s3: shortcut gid_to_sid when "ldapsam:trusted = yes"
commit0fb99386d41241f62312d4bb535976344e5d6492
authorStefan Metzmacher <metze@samba.org>
Sat, 30 Jan 2010 21:28:19 +0000 (30 22:28 +0100)
committerKarolin Seeger <kseeger@samba.org>
Wed, 10 Feb 2010 08:52:52 +0000 (10 09:52 +0100)
treee0ea03641eba14399a8765b4af88fb846ddbe7a1
parent60fed68259f430cbd67cd1f347cc3218e3c0ea35
s3: shortcut gid_to_sid when "ldapsam:trusted = yes"

The normal gid_to_sid behaviour is to call sys_getgrgid()
to get the name for the given gid and then call the
getsamgrnam passdb method for the resulting name.

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

metze
(cherry picked from commit 779821df8ecfe3ed2392582b500d26332f0b80fc)
source3/passdb/pdb_ldap.c