From: Günther Deschner Date: Mon, 3 Aug 2009 14:28:59 +0000 (+0200) Subject: s3-pdb_ldap: Make ldapsam_alias_memberships behave like the tdbsam equivalent. X-Git-Tag: tevent-0.9.8~506 X-Git-Url: http://git.samba.org/samba.git/?p=ira%2Fwip.git;a=commitdiff_plain;h=20225d83dd1d09274bd913d1713c56268a069628 s3-pdb_ldap: Make ldapsam_alias_memberships behave like the tdbsam equivalent. This lets samr_GetAliasMembership return with NT_STATUS_OK when called with 0 sids (just what w2k3 does). Guenther --- diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c index 1b1e22f2c87..fc736c2e3eb 100644 --- a/source3/passdb/pdb_ldap.c +++ b/source3/passdb/pdb_ldap.c @@ -3710,6 +3710,9 @@ static NTSTATUS ldapsam_alias_memberships(struct pdb_methods *methods, char *filter; enum lsa_SidType type = SID_NAME_USE_NONE; + *pp_alias_rids = NULL; + *p_num_alias_rids = 0; + if (sid_check_is_builtin(domain_sid)) { type = SID_NAME_ALIAS; } @@ -3724,6 +3727,10 @@ static NTSTATUS ldapsam_alias_memberships(struct pdb_methods *methods, return NT_STATUS_UNSUCCESSFUL; } + if (num_members == 0) { + return NT_STATUS_OK; + } + filter = talloc_asprintf(mem_ctx, "(&(|(objectclass=%s)(sambaGroupType=%d))(|", LDAP_OBJ_GROUPMAP, type);