summaryrefslogtreecommitdiff
path: root/source4/ldap_server/ldap_simple_ldb.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2005-07-08 05:04:57 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:19:21 -0500
commita1a3b967315eee71da4d5d09d4fa9dd948502772 (patch)
tree5a0ea5ffb8218ce78098805d4d36a2bf5bb1ae1c /source4/ldap_server/ldap_simple_ldb.c
parentc11204339ae86604a6edd6491f5ee03bf5e3c950 (diff)
downloadsamba-a1a3b967315eee71da4d5d09d4fa9dd948502772.tar.gz
samba-a1a3b967315eee71da4d5d09d4fa9dd948502772.tar.bz2
samba-a1a3b967315eee71da4d5d09d4fa9dd948502772.zip
r8222: 0 entries are no error, unless it's a base search
metze (This used to be commit 0297943ff201b06cc7a3c4aba5d81481a4cc5966)
Diffstat (limited to 'source4/ldap_server/ldap_simple_ldb.c')
-rw-r--r--source4/ldap_server/ldap_simple_ldb.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source4/ldap_server/ldap_simple_ldb.c b/source4/ldap_server/ldap_simple_ldb.c
index e8c66e80a2..4403ec8ea2 100644
--- a/source4/ldap_server/ldap_simple_ldb.c
+++ b/source4/ldap_server/ldap_simple_ldb.c
@@ -47,6 +47,7 @@ static NTSTATUS sldb_Search(struct ldapsrv_partition *partition, struct ldapsrv_
struct ldb_context *samdb;
struct ldb_message **res = NULL;
int i, j, y, count = 0;
+ int success_limit = 1;
enum ldb_scope scope = LDB_SCOPE_DEFAULT;
const char **attrs = NULL;
const char *errstr = NULL;
@@ -67,14 +68,17 @@ static NTSTATUS sldb_Search(struct ldapsrv_partition *partition, struct ldapsrv_
case LDAP_SEARCH_SCOPE_BASE:
DEBUG(10,("sldb_Search: scope: [BASE]\n"));
scope = LDB_SCOPE_BASE;
+ success_limit = 1;
break;
case LDAP_SEARCH_SCOPE_SINGLE:
DEBUG(10,("sldb_Search: scope: [ONE]\n"));
scope = LDB_SCOPE_ONELEVEL;
+ success_limit = 0;
break;
case LDAP_SEARCH_SCOPE_SUB:
DEBUG(10,("sldb_Search: scope: [SUB]\n"));
scope = LDB_SCOPE_SUBTREE;
+ success_limit = 0;
break;
}
@@ -135,7 +139,7 @@ reply:
NT_STATUS_HAVE_NO_MEMORY(done_r);
if (result == LDAP_SUCCESS) {
- if (count > 0) {
+ if (count >= success_limit) {
DEBUG(10,("sldb_Search: results: [%d]\n",count));
result = LDAP_SUCCESS;
errstr = NULL;