r25949: Make error messages clearer and more correct.
authorAndrew Bartlett <abartlet@samba.org>
Wed, 14 Nov 2007 02:52:39 +0000 (03:52 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 21 Dec 2007 04:45:13 +0000 (05:45 +0100)
Andrew Bartlett
(This used to be commit f0a0d73f768434cb474b311d7c366d1f2a06c8f4)

source4/dsdb/samdb/ldb_modules/samldb.c
source4/dsdb/samdb/samdb.c

index e2e914ee8255bf88e1bcbe4e06081f2d652b1193..b1366fd99439c69d82f8b53191784f36cb25d07a 100644 (file)
@@ -475,7 +475,7 @@ static int samldb_fill_user_or_computer_object(struct ldb_module *module, const
        /* build the new msg */
        msg2 = ldb_msg_copy(mem_ctx, msg);
        if (!msg2) {
-               ldb_debug(module->ldb, LDB_DEBUG_FATAL, "samldb_fill_group_object: ldb_msg_copy failed!\n");
+               ldb_debug(module->ldb, LDB_DEBUG_FATAL, "samldb_fill_user_or_computer_object: ldb_msg_copy failed!\n");
                talloc_free(mem_ctx);
                return LDB_ERR_OPERATIONS_ERROR;
        }
@@ -523,7 +523,7 @@ static int samldb_fill_user_or_computer_object(struct ldb_module *module, const
        ret = samdb_search_for_parent_domain(module->ldb, mem_ctx, msg2->dn, &dom_dn, &errstr);
        if (ret != LDB_SUCCESS) {
                ldb_asprintf_errstring(module->ldb,
-                                      "samldb_fill_group_object: %s", errstr);
+                                      "samldb_fill_user_or_computer_object: %s", errstr);
                return ret;
        }
 
index 96e526d319801474b4ef6243aef00f5906f5de07..8b1c00dc90e9fc08a8fb6f600195020f2de44a50 100644 (file)
@@ -1521,15 +1521,16 @@ int samdb_search_for_parent_domain(struct ldb_context *ldb, TALLOC_CTX *mem_ctx,
        }
 
        if (ret != LDB_SUCCESS) {
-               *errstring = talloc_asprintf(mem_ctx, "Error searching for parent domain of %s: %s",
-                                             ldb_dn_get_linearized(sdn),
-                                             ldb_errstring(ldb));
+               *errstring = talloc_asprintf(mem_ctx, "Error searching for parent domain of %s, failed searching for %s: %s",
+                                            ldb_dn_get_linearized(dn),
+                                            ldb_dn_get_linearized(sdn),
+                                            ldb_errstring(ldb));
                talloc_free(local_ctx);
                return ret;
        }
        if (res->count != 1) {
                *errstring = talloc_asprintf(mem_ctx, "Invalid dn (%s), not child of a domain object",
-                                            ldb_dn_get_linearized(sdn));
+                                            ldb_dn_get_linearized(dn));
                talloc_free(local_ctx);
                return LDB_ERR_CONSTRAINT_VIOLATION;
        }