s3: shortcut uid_to_sid when "ldapsam:trusted = yes"
commit91e40dfde99b08158b809590c44c22b503403157
authorMichael Adam <obnox@samba.org>
Mon, 16 Nov 2009 10:37:18 +0000 (16 11:37 +0100)
committerKarolin Seeger <kseeger@samba.org>
Thu, 11 Feb 2010 11:02:46 +0000 (11 12:02 +0100)
treeb9df2472fe9f446b64b5f3221f80b23b2a793648
parent05f23a8dd6824bb6af3f60304096e621e534f4d4
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>
source3/passdb/pdb_ldap.c