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)
committerKarolin Seeger <kseeger@samba.org>
Thu, 26 Nov 2009 10:41:02 +0000 (11:41 +0100)
commit16f60167292a2bddf79055c0a9ddbfc70cdf3d61
tree388eb39da18428b1b5a9a5bc0c7ad01a6491ee0a
parentba9c0564b156ac4f9bbb5985fa1ff6b0f1f1a44e
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
(cherry picked from commit 37dcc8a400ea41fb0a0559c9922cc41ac28ad045)
source3/passdb/pdb_ldap.c