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)
committerStefan Metzmacher <metze@samba.org>
Mon, 8 Feb 2010 10:10:16 +0000 (11:10 +0100)
commit17c520aa72bbd9a529082d5320290717509fef02
tree911126437f504b0418185978b298f8a0b903fe36
parent4a4b2a5eafe89e87798d231522c756750d14ce60
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
source3/passdb/pdb_ldap.c