Ensure expected errors do not leak up to the application.
authorAndrew Bartlett <abartlet@samba.org>
Fri, 8 Feb 2008 01:45:51 +0000 (12:45 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 8 Feb 2008 01:45:51 +0000 (12:45 +1100)
(reset the error string to be sure).

Andrew Bartlett

source/dsdb/samdb/ldb_modules/schema_fsmo.c

index 559c91bd2d863b5049d49851860da58a9ea58738..f9dd131fd4f8327ab323aa0f2c57fb22913a0c12 100644 (file)
@@ -59,6 +59,7 @@ static int schema_fsmo_init(struct ldb_module *module)
 
        schema_dn = samdb_schema_dn(module->ldb);
        if (!schema_dn) {
+               ldb_reset_err_string(module->ldb);
                ldb_debug(module->ldb, LDB_DEBUG_WARNING,
                          "schema_fsmo_init: no schema dn present: (skip schema loading)\n");
                return ldb_next_init(module);
@@ -91,6 +92,7 @@ static int schema_fsmo_init(struct ldb_module *module)
                         NULL, schema_attrs,
                         &schema_res);
        if (ret == LDB_ERR_NO_SUCH_OBJECT) {
+               ldb_reset_err_string(module->ldb);
                ldb_debug(module->ldb, LDB_DEBUG_WARNING,
                          "schema_fsmo_init: no schema head present: (skip schema loading)\n");
                talloc_free(mem_ctx);