diff options
author | Jeremy Allison <jra@samba.org> | 2000-10-11 22:38:38 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2000-10-11 22:38:38 +0000 |
commit | d81a598230a4f4eba8f3dabcfa927a91a3fa7dfb (patch) | |
tree | 16bbbcf92791d246368ddbcee38f2bd3ea82974a /source3/lib | |
parent | 93932079c65929f7770ca57d978f8be3eea7c57a (diff) | |
download | samba-d81a598230a4f4eba8f3dabcfa927a91a3fa7dfb.tar.gz samba-d81a598230a4f4eba8f3dabcfa927a91a3fa7dfb.tar.bz2 samba-d81a598230a4f4eba8f3dabcfa927a91a3fa7dfb.zip |
Turns out we do need the pwnam check as on many systems the users
primary group is not listed in the groups file...
Jeremy.
(This used to be commit b1cb7bec51963ac2ddc62dd1abbf8f8fa4351f9b)
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/username.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source3/lib/username.c b/source3/lib/username.c index 7baf3618b9..ad44c0c544 100644 --- a/source3/lib/username.c +++ b/source3/lib/username.c @@ -267,6 +267,13 @@ static BOOL user_in_group_list(char *user,char *gname) { struct group *gptr; char **member; + struct passwd *pass = Get_Pwnam(user,False); + + if (pass) { + gptr = getgrgid(pass->pw_gid); + if (gptr && strequal(gptr->gr_name,gname)) + return True; + } if ((gptr = (struct group *)getgrnam(gname)) == NULL) return False; |