summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2007-09-10 01:39:20 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:05:49 -0500
commit37de963f67a1331b6402f901d2bda79b7119a155 (patch)
treefa078786f0a277cf3b7eda478b3dee2f2e18ef97 /source4
parent7e297ecfa4db2c7ab720a63c7764bc0e20f8058c (diff)
downloadsamba-37de963f67a1331b6402f901d2bda79b7119a155.tar.gz
samba-37de963f67a1331b6402f901d2bda79b7119a155.tar.bz2
samba-37de963f67a1331b6402f901d2bda79b7119a155.zip
r25048: From the archives (patch found in one of my old working trees):
Try two different DNs, when performing a samsync from an AD server. Andrew Bartlett (This used to be commit 8204e261b5c554866a8433362477b532d1123e5d)
Diffstat (limited to 'source4')
-rw-r--r--source4/libnet/libnet_samsync_ldb.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/source4/libnet/libnet_samsync_ldb.c b/source4/libnet/libnet_samsync_ldb.c
index 2c30128b16..1fa4aece19 100644
--- a/source4/libnet/libnet_samsync_ldb.c
+++ b/source4/libnet/libnet_samsync_ldb.c
@@ -432,14 +432,21 @@ static NTSTATUS samsync_ldb_handle_user(TALLOC_CTX *mem_ctx,
if (ret != 0) {
struct ldb_dn *first_try_dn = msg->dn;
/* Try again with the default DN */
- msg->dn = talloc_steal(msg, msgs[0]->dn);
- ret = samdb_add(state->sam_ldb, mem_ctx, msg);
- if (ret != 0) {
- *error_string = talloc_asprintf(mem_ctx, "Failed to create user record. Tried both %s and %s: %s",
+ if (!remote_msgs) {
+ *error_string = talloc_asprintf(mem_ctx, "Failed to create user record. Tried %s: %s",
ldb_dn_get_linearized(first_try_dn),
- ldb_dn_get_linearized(msg->dn),
ldb_errstring(state->sam_ldb));
return NT_STATUS_INTERNAL_DB_CORRUPTION;
+ } else {
+ msg->dn = talloc_steal(msg, remote_msgs[0]->dn);
+ ret = samdb_add(state->sam_ldb, mem_ctx, msg);
+ if (ret != 0) {
+ *error_string = talloc_asprintf(mem_ctx, "Failed to create user record. Tried both %s and %s: %s",
+ ldb_dn_get_linearized(first_try_dn),
+ ldb_dn_get_linearized(msg->dn),
+ ldb_errstring(state->sam_ldb));
+ return NT_STATUS_INTERNAL_DB_CORRUPTION;
+ }
}
}
} else {