s3-samr: fix return code of _samr_LookupRids when run with pdb_ldap.
[ira/wip.git] / 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;