Turns out we do need the pwnam check as on many systems the users
authorJeremy Allison <jra@samba.org>
Wed, 11 Oct 2000 22:38:38 +0000 (22:38 +0000)
committerJeremy Allison <jra@samba.org>
Wed, 11 Oct 2000 22:38:38 +0000 (22:38 +0000)
primary group is not listed in the groups file...
Jeremy.
(This used to be commit b1cb7bec51963ac2ddc62dd1abbf8f8fa4351f9b)

source3/lib/username.c

index 7baf3618b931dd0dd3b69696aee8af0c479a282d..ad44c0c5444f4dc164b9b24c725a343e7f04f832 100644 (file)
@@ -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;