From: Günther Deschner Date: Sun, 7 Jun 2009 00:02:26 +0000 (+0200) Subject: s3-samr: fix return code of _samr_LookupRids when run with pdb_ldap. X-Git-Tag: tdb-1.1.5~223 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fbb1e990ab3915956217c2747a983e9ae0469fd3;p=thirdparty%2Fsamba.git s3-samr: fix return code of _samr_LookupRids when run with pdb_ldap. 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 --- diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c index 0bebcc7c2ca..2272aedf134 100644 --- a/source3/passdb/pdb_ldap.c +++ b/source3/passdb/pdb_ldap.c @@ -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