Give a more useful error when the templates.ldb can't be found.
authorAndrew Bartlett <abartlet@samba.org>
Sat, 9 Feb 2008 03:02:14 +0000 (14:02 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Sat, 9 Feb 2008 03:02:14 +0000 (14:02 +1100)
Andrew Bartlett
(This used to be commit 26108eb66b4b5d4b339dfc845e8a018190068e81)

source4/dsdb/samdb/samdb.c

index c11eea1757c99a0649c6f79251d6aba413eeb010..a01e4425878a4e134c75b6b6f55f6d9fb5fb8eb7 100644 (file)
@@ -103,8 +103,8 @@ int samdb_copy_template(struct ldb_context *ldb,
 
        if (!templates_ldb) {
                templates_ldb_path = samdb_relative_path(ldb, 
-                                                       msg, 
-                                                       "templates.ldb");
+                                                        msg, 
+                                                        "templates.ldb");
                if (!templates_ldb_path) {
                        *errstring = talloc_asprintf(msg, "samdb_copy_template: ERROR: Failed to contruct path for template db");
                        return LDB_ERR_OPERATIONS_ERROR;
@@ -115,6 +115,8 @@ int samdb_copy_template(struct ldb_context *ldb,
                                                NULL, 0, NULL);
                talloc_free(templates_ldb_path);
                if (!templates_ldb) {
+                       *errstring = talloc_asprintf(msg, "samdb_copy_template: ERROR: Failed to connect to templates db at: %s",
+                                            templates_ldb_path);
                        return LDB_ERR_OPERATIONS_ERROR;
                }