r25958: Callers of gendb_search_dn() don't expect to get
authorAndrew Bartlett <abartlet@samba.org>
Thu, 15 Nov 2007 00:13:24 +0000 (01:13 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 21 Dec 2007 04:45:18 +0000 (05:45 +0100)
LDB_ERR_NO_SUCH_OBJECT for base searches.  Return 0 in this case.

Andrew Bartlett
(This used to be commit eb180f6a6af0caf185e0f9782173c232dab9c5fb)

source4/lib/gendb.c

index 003384b1ee9b4738e120ab3e36b93a82ad8a065c..35b55a1fd75e911f228e845bd200064fd9bfa0d4 100644 (file)
@@ -64,6 +64,9 @@ int gendb_search_v(struct ldb_context *ldb,
                ret = res->count;
                *msgs = res->msgs;
                talloc_free(res);
+       } else if (scope == LDB_SCOPE_BASE && ret == LDB_ERR_NO_SUCH_OBJECT) {
+               ret = 0;
+               *msgs = NULL;
        } else {
                DEBUG(4,("gendb_search_v: search failed: %s", ldb_errstring(ldb)));
                ret = -1;