s3: shortcut gid_to_sid when "ldapsam:trusted = yes"
commitc0505ad627f4abd6796b1414dbbb0aebfe1edf6c
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 10:08:41 +0000 (10 11:08 +0100)
treec74fd8f4dd70dc6c04e6ccdac68a3d1a55830ea5
parent976b7c4c1140e51ba53dbc218fa1c4a35f3c489a
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)
(cherry picked from commit 0fb99386d41241f62312d4bb535976344e5d6492)
source3/passdb/pdb_ldap.c