s3: shortcut gid_to_sid when "ldapsam:trusted = yes"
authorStefan Metzmacher <metze@samba.org>
Sat, 30 Jan 2010 21:28:19 +0000 (22:28 +0100)
committerKarolin Seeger <kseeger@samba.org>
Thu, 11 Feb 2010 11:02:46 +0000 (12:02 +0100)
commit479087716f50e8a1961163750b1d651dcd23dfc2
tree3419223d5207723fafc153e1a3c464948ee0d47b
parentc48405ed0ab0e3c3a0c1472e3bf874a4a64c0261
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
(similar to commit 0fb99386d41241f62312d4bb535976344e5d6492)
source3/passdb/pdb_ldap.c