From d81a598230a4f4eba8f3dabcfa927a91a3fa7dfb Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 11 Oct 2000 22:38:38 +0000 Subject: 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) --- source3/lib/username.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source3/lib/username.c') 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; -- cgit