summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2000-05-10 14:48:33 +0000
committerAndrew Tridgell <tridge@samba.org>2000-05-10 14:48:33 +0000
commit43a3faab0831a866559ca56e70c81be582047d0b (patch)
tree260d1729096068494759dce1743d44da61499671 /source3/lib
parent1c0cfff309be9360fa55ca2c72f6efd093f5a062 (diff)
downloadsamba-43a3faab0831a866559ca56e70c81be582047d0b.tar.gz
samba-43a3faab0831a866559ca56e70c81be582047d0b.tar.bz2
samba-43a3faab0831a866559ca56e70c81be582047d0b.zip
- changed smb_getpwnam() to use winbind style usernames
- finished ntdom -> winbind rename in head (This used to be commit ada483cb56453afc6df4ec4be18bfe5e943c7150)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/username.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/source3/lib/username.c b/source3/lib/username.c
index 2839ddab3d..2620d74eba 100644
--- a/source3/lib/username.c
+++ b/source3/lib/username.c
@@ -429,19 +429,18 @@ static struct passwd * uname_string_combinations(char *s,struct passwd * (*fn)(c
these wrappers allow appliance mode to work. In appliance mode the username
takes the form DOMAIN/user
****************************************************************************/
-struct passwd *smb_getpwnam(char *user, char *domain, BOOL allow_change)
+struct passwd *smb_getpwnam(char *user, BOOL allow_change)
{
struct passwd *pw;
- fstring userdom;
+ char *p;
pw = Get_Pwnam(user, allow_change);
- if (pw || !domain || !*domain) return pw;
-
- slprintf(userdom, sizeof(userdom), "%s/%s", domain, user);
+ if (pw) return pw;
- DEBUG(4,("smb_getpwnam trying userdom %s\n", userdom));
+ p = strchr(user,'/');
+ if (p) return Get_Pwnam(p+1, allow_change);
- return Get_Pwnam(userdom, allow_change);
+ return NULL;
}
int smb_initgroups(char *user, char *domain, gid_t group)