s3-samr: fix return code of _samr_LookupRids when run with pdb_ldap.
authorGünther Deschner <gd@samba.org>
Sun, 7 Jun 2009 00:02:26 +0000 (02:02 +0200)
committerGünther Deschner <gd@samba.org>
Sun, 7 Jun 2009 00:24:21 +0000 (02:24 +0200)
when _samr_LookupRids is called with no rids, it needs to return
NT_STATUS_NONE_MAPPED (not NT_STATUS_NO_MEMORY).

Found by RPC-SAMR torture test.

Guenther

source3/passdb/pdb_ldap.c

index 0bebcc7c2ca7556c9a9e709fb13cf3273bbe109b..2272aedf134d4334e812e8fdda0186b57113a69d 100644 (file)
@@ -3977,6 +3977,11 @@ static NTSTATUS ldapsam_lookup_rids(struct pdb_methods *methods,
                goto done;
        }
 
+       if (num_rids == 0) {
+               result = NT_STATUS_NONE_MAPPED;
+               goto done;
+       }
+
        for (i=0; i<num_rids; i++)
                attrs[i] = SID_NAME_UNKNOWN;