summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2006-01-13 04:36:58 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:50:59 -0500
commit17402db4dfeeded476076773d858e7382e15baaf (patch)
tree597c9e84af2f2f0366ffba7d08eac7a91bb1408a
parent1460719b6afe9382e4cfcd063cda2187fd0bee85 (diff)
downloadsamba-17402db4dfeeded476076773d858e7382e15baaf.tar.gz
samba-17402db4dfeeded476076773d858e7382e15baaf.tar.bz2
samba-17402db4dfeeded476076773d858e7382e15baaf.zip
r12894: Add more detail to error messages.
Andrew Bartlett (This used to be commit 31fd39f356c9bc40827b22c0cdb622044d896a85)
-rw-r--r--source4/libnet/libnet_samsync_ldb.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/source4/libnet/libnet_samsync_ldb.c b/source4/libnet/libnet_samsync_ldb.c
index e707d69cb8..5587f208ef 100644
--- a/source4/libnet/libnet_samsync_ldb.c
+++ b/source4/libnet/libnet_samsync_ldb.c
@@ -228,6 +228,12 @@ static NTSTATUS samsync_ldb_handle_user(TALLOC_CTX *mem_ctx,
ldap_encode_ndr_dom_sid(mem_ctx, dom_sid_add_rid(mem_ctx, state->dom_sid[database], rid)));
if (ret == -1) {
+ *error_string = talloc_asprintf(mem_ctx, "gendb_search for user %s failed: %s",
+ dom_sid_string(mem_ctx,
+ dom_sid_add_rid(mem_ctx,
+ state->dom_sid[database],
+ rid)),
+ ldb_errstring(state->sam_ldb));
return NT_STATUS_INTERNAL_DB_CORRUPTION;
} else if (ret == 0) {
add = True;
@@ -346,15 +352,17 @@ static NTSTATUS samsync_ldb_handle_user(TALLOC_CTX *mem_ctx,
ret = samdb_add(state->sam_ldb, mem_ctx, msg);
if (ret != 0) {
- *error_string = talloc_asprintf(mem_ctx, "Failed to create user record %s",
- ldb_dn_linearize(mem_ctx, msg->dn));
+ *error_string = talloc_asprintf(mem_ctx, "Failed to create user record %s: %s",
+ ldb_dn_linearize(mem_ctx, msg->dn),
+ ldb_errstring(state->sam_ldb));
return NT_STATUS_INTERNAL_DB_CORRUPTION;
}
} else {
ret = samdb_replace(state->sam_ldb, mem_ctx, msg);
if (ret != 0) {
- *error_string = talloc_asprintf(mem_ctx, "Failed to modify user record %s",
- ldb_dn_linearize(mem_ctx, msg->dn));
+ *error_string = talloc_asprintf(mem_ctx, "Failed to modify user record %s: %s",
+ ldb_dn_linearize(mem_ctx, msg->dn),
+ ldb_errstring(state->sam_ldb));
return NT_STATUS_INTERNAL_DB_CORRUPTION;
}
}