CVS update: samba/source/passdb

Gerald Carter gcarter at
Mon Nov 27 05:01:37 GMT 2000

Tim Potter wrote:
> Eeek!  This is not the correct way to look up names as it isn't
> portable across non-English NT machines - just ask Mr JF
> Administrateur about it.  (-:
> The correct way (which also indirectly solves this lookup
> problem) is to construct a sid using global_sam_sid and append a
> well known RID value from rpc_misc.h:
> DOMAIN_USER_RID_ADMIN for the administrator user
> DOMAIN_GROUP_RID_ADMINS for the Administrators group
> and so on.
> For actual named accounts like root you will probably have to do
> a lookup.

Tim,  You're my hero :-)

> > This code (indirectly using local_lookup_name()) was making
> > it impossible to print.  I had a LDAP server providing about
> > 6,000 accounts.  Simply trying to look at the printer
> > properties was impossible because of the getpwnam() calls.
> > local_lookup_name() need to use sys_getpwnam().  We should
> > deal with machine accounts, but using Get_Pwnam() in
> > local_lookup_name() has some fairly large implications.
> Hmm...  So why is this so slow?  Looking up individual users by
> name shouldn't take that long.  My experience has been that the
> only killer is when an application does a set/get/endpwent()
> call.

Because you have one for just about every 
GetPrinterData() call :-(  I can send you a copy 
of the logs which shows a lot of getpwnam() calls 
that fail.  The above code caused 18 failed getpwnam() 
calls using Get_Pwnam() for each GetPrinterData().

Cheers, jerry
   /\  Gerald (Jerry) Carter                     Professional Services
 \/  VA Linux Systems   gcarter at       SAMBA Team          jerry at                     jerry at

       "...a hundred billion castaways looking for a home."
                                - Sting "Message in a Bottle" ( 1979 )

More information about the samba-technical mailing list