get_domain_user_groups() improvement.

John P Janosik jpjanosi at us.ibm.com
Thu Sep 30 19:40:06 GMT 2004







samba-technical-bounces+jpjanosi=us.ibm.com at lists.samba.org wrote on
09/30/2004 02:02:19 PM:

> > those problems.
>
> Thanks!
>
> And by 'calls to pdb' you mean both pdb_enum_group_prmembers() and
> pdb_getsampwnam() calls, right? :o)
>
> Acctually, for pdb_getsampwnam() it will be better to have
> become_root()/unbecome_root() outside of the for loop it is used in.
> ..and then it will call for rewrite of the 'if' returning False to be
> just a fall out of the loop... That what you get for not thinking it
> through.
>
> BTW, does it really improve performance? :o)
>
> Igor
>

You are correct, I put the calls before both pdb_ calls and outside the
loop as you describe.  I would have just posted the patch in the first
place to be more clear but I am not "approved" to do that:(.

I hope your patch is accepted.  Without it winbindd on my domain member
file servers is unusable because it would timeout on every group membership
lookup.  I still have the problem that the lookup of "Domain Users" takes
longer than the 10 second timeout but I think I will create a new smb.conf
parameter for myself that adjusts the client timeout just for the RPCs in
winbindd_rpc.c I know take too long.

Of course even with your patch winbindd is unusable for me without
modification because the RPC that winbindd uses to get the domain sequence
number also enumerates the users and groups in the domain and so times out
when trying to build any cache entry.  Since a Samba PDC just returns the
current time for the sequence number anyway I have added an smb.conf
parameter to disable the lookup of the sequence number as well.

John Janosik



More information about the samba-technical mailing list