r26284: Rather than just debug, push the error back up the stack as the error
authorAndrew Bartlett <abartlet@samba.org>
Tue, 4 Dec 2007 04:32:23 +0000 (05:32 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 21 Dec 2007 04:48:08 +0000 (05:48 +0100)
string, if we fail to load the schema.

Andrew Bartlett
(This used to be commit 1dc771f903dd613a4d6494f7fd45d35c4d282a33)

source4/dsdb/samdb/ldb_modules/schema_fsmo.c

index b10e3ac203ce9759d667a36ae0b1be775daaf2f2..28853f3e34b7396309830604b9fd08a7b8e08c3b 100644 (file)
@@ -54,7 +54,7 @@ static int schema_fsmo_init(struct ldb_module *module)
        };
 
        if (dsdb_get_schema(module->ldb)) {
-         return ldb_next_init(module);
+               return ldb_next_init(module);
        }
 
        schema_dn = samdb_schema_dn(module->ldb);
@@ -96,9 +96,9 @@ static int schema_fsmo_init(struct ldb_module *module)
                talloc_free(mem_ctx);
                return ldb_next_init(module);
        } else if (ret != LDB_SUCCESS) {
-               ldb_debug_set(module->ldb, LDB_DEBUG_FATAL,
-                             "schema_fsmo_init: failed to search the schema head: %d:%s",
-                             ret, ldb_strerror(ret));
+               ldb_asprintf_errstring(module->ldb, 
+                                      "schema_fsmo_init: failed to search the schema head: %s",
+                                      ldb_errstring(module->ldb));
                talloc_free(mem_ctx);
                return ret;
        }
@@ -151,9 +151,9 @@ static int schema_fsmo_init(struct ldb_module *module)
                         "(objectClass=attributeSchema)", NULL,
                         &a_res);
        if (ret != LDB_SUCCESS) {
-               ldb_debug_set(module->ldb, LDB_DEBUG_FATAL,
-                             "schema_fsmo_init: failed to search attributeSchema objects: %d:%s",
-                             ret, ldb_strerror(ret));
+               ldb_asprintf_errstring(module->ldb, 
+                                      "schema_fsmo_init: failed to search attributeSchema objects: %s",
+                                      ldb_errstring(module->ldb));
                talloc_free(mem_ctx);
                return ret;
        }
@@ -190,9 +190,9 @@ static int schema_fsmo_init(struct ldb_module *module)
                         "(objectClass=classSchema)", NULL,
                         &c_res);
        if (ret != LDB_SUCCESS) {
-               ldb_debug_set(module->ldb, LDB_DEBUG_FATAL,
-                             "schema_fsmo_init: failed to search classSchema objects: %d:%s",
-                             ret, ldb_strerror(ret));
+               ldb_asprintf_errstring(module->ldb, 
+                                      "schema_fsmo_init: failed to search classSchema objects: %s",
+                                      ldb_errstring(module->ldb));
                talloc_free(mem_ctx);
                return ret;
        }