s3: shortcut uid_to_sid when "ldapsam:trusted = yes"
commit17ef5e9d21eb0873e9b4ac8c05429efc1f0bf957
authorMichael Adam <obnox@samba.org>
Mon, 16 Nov 2009 10:37:18 +0000 (16 11:37 +0100)
committerKarolin Seeger <kseeger@samba.org>
Mon, 15 Feb 2010 13:46:54 +0000 (15 14:46 +0100)
tree3072f71f12190bca36ef5f16fcbc7ab1121bb546
parentba734d27448cebf7b3d1b9168d858ae034c39d54
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)

Signed-off-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 91e40dfde99b08158b809590c44c22b503403157)
source3/passdb/pdb_ldap.c