s3: shortcut uid_to_sid when "ldapsam:trusted = yes"
authorMichael Adam <obnox@samba.org>
Mon, 16 Nov 2009 10:37:18 +0000 (11:37 +0100)
committerMichael Adam <obnox@samba.org>
Thu, 19 Nov 2009 16:55:47 +0000 (17:55 +0100)
commit457055871af86567acc122fb0309c2db9517879a
tree564303da8b953a41c6cf18a18b8876711f7370ee
parentfc9f199f2619635f73e8ee7f3b5359521d63f325
s3: shortcut uid_to_sid when "ldapsam:trusted = yes"

The normal uid_to_sid behaviour is to call sys_getpwuid()
to get the name for the given uid and then call the
getsampwnam passdb method for the resulting name.

In the ldapsam:trusted case we can reduce the uid_to_sid
operation to one simple search for the uidNumber attribute
and only get the sambaSID attribute from the correspoinding
LDAP object. This reduces the number of ldap roundtrips
for this operation.

Michael
source3/passdb/pdb_ldap.c