s4:dsdb Add error string in 'no such object' because of 0 replies case
authorAndrew Bartlett <abartlet@samba.org>
Fri, 23 Oct 2009 01:34:41 +0000 (12:34 +1100)
committerAndrew Tridgell <tridge@samba.org>
Fri, 23 Oct 2009 04:42:33 +0000 (15:42 +1100)
source4/dsdb/samdb/ldb_modules/util.c

index 476eb08ed0ee27882183b8a441a4324f94765a71..372cad62e21202567d50e0eeace406a83b0fa102 100644 (file)
@@ -70,6 +70,9 @@ int dsdb_module_search_dn(struct ldb_module *module,
        if (res->count != 1) {
                /* we may be reading a DB that does not have the 'check base on search' option... */
                ret = LDB_ERR_NO_SUCH_OBJECT;
+               ldb_asprintf_errstring(ldb_module_get_ctx(module), 
+                                      "dsdb_module_search_dn: did not find base dn %s (%d results)", 
+                                      ldb_dn_get_linearized(basedn), res->count);
        } else {
                *_res = talloc_steal(mem_ctx, res);
        }