'getent group' only returns a few groups - Solaris 8

Travis Freeland travis at deakin.edu.au
Tue May 14 10:11:02 GMT 2002


Gerald Carter wrote:

>On Tue, 14 May 2002, Torbjorn Olofsson wrote:
>
>  
>
>>>On Sat, 11 May 2002, Travis Freeland wrote:
>>>
>>>      
>>>
>>>>In order to get samba 2.2.4 working correctly under solaris (where we
>>>>rely heavily on NIS unix groups) I had to make a couple of changes to
>>>>username.c (basically take it back to the 2.0 style unix group checking
>>>>code .. and take out the winbind group check which was failing because
>>>>we dont run winbind).
>>>>        
>>>>
>
>Travis,  Can you send me the diff?  I would like to take a look at it.
>  
>
Sure.. here tis..

travis at rana:03:07:01:/tmp/samba-2.2.4/source/lib
$ diff username.c ~/samba-2.2.4/source/lib/username.c
385,416c385,407
<       struct passwd *pass = Get_Pwnam(user,False);
<       struct sys_userlist *user_list;
<       struct sys_userlist *member;
<
<       DEBUG(10,("user_in_unix_group_list: checking user %s in group 
%s\n", use
r, gname));
<
<       /*
<        * We need to check the users primary group as this
<        * group is implicit and often not listed in the group database.
<        */
<
<       if (pass) {
<               if (strequal(gname, gidtoname(pass->pw_gid))) {
<                       DEBUG(10,("user_in_unix_group_list: group %s is 
primary
group.\n", gname ));
<                       return True;
<               }
<       }
<
<       user_list = get_users_in_group(gname);
<       if (user_list == NULL) {
<               DEBUG(10,("user_in_unix_group_list: no such group %s\n", 
gname )
);
<               return False;
<       }
<
<       for (member = user_list; member; member = member->next) {
<               DEBUG(10,("user_in_unix_group_list: checking user %s 
against mem
ber %s\n",
<                       user, member->unix_name ));
<               if (strequal(member->unix_name,user)) {
<                       free_userlist(user_list);
<                       return(True);
<               }
<       }
---
 >         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);
 >         }
 >
 >         setgrent();
 >         while ((gptr = (struct group *)getgrent())) {
 >                 if (!strequal(gptr->gr_name,gname))
 >                         continue;
 >                 member = gptr->gr_mem;
 >                 while (member && *member) {
 >                         if (strequal(*member,user)) {
 >                                 endgrent();
 >                                 return(True);
 >                         }
 >                         member++;
 >                 }
 >         }
418,419c409,410
<       free_userlist(user_list);
<       return False;
---
 >         endgrent();
 >         return False;
431,433c422
<       ret = user_in_winbind_group_list(user, gname, &winbind_answered);
<       if (!winbind_answered)
<               ret = user_in_unix_group_list(user, gname);
---
 >       ret = user_in_unix_group_list(user, gname);

Travis

>
>
>
>cheers, jerry
> ---------------------------------------------------------------------
> Hewlett-Packard                                     http://www.hp.com
> SAMBA Team                                       http://www.samba.org
> --                                            http://www.plainjoe.org
> "Sam's Teach Yourself Samba in 24 Hours" 2ed.      ISBN 0-672-32269-2
> --"I never saved anything for the swim back." Ethan Hawk in Gattaca--
>
>
>  
>


-------------- next part --------------
HTML attachment scrubbed and removed


More information about the samba-technical mailing list