s3-pdb_ldap: Make ldapsam_alias_memberships behave like the tdbsam equivalent.
authorGünther Deschner <gd@samba.org>
Mon, 3 Aug 2009 14:28:59 +0000 (16:28 +0200)
committerGünther Deschner <gd@samba.org>
Mon, 3 Aug 2009 14:32:15 +0000 (16:32 +0200)
This lets samr_GetAliasMembership return with NT_STATUS_OK when called with 0
sids (just what w2k3 does).

Guenther

source3/passdb/pdb_ldap.c

index 1b1e22f2c87304c4492fa28e4c8347caf19d96e4..fc736c2e3eb41ba50e581d311d99f5a08ccac923 100644 (file)
@@ -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);