summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-08-14 22:53:35 +1000
committerAndrew Bartlett <abartlet@samba.org>2012-08-14 15:37:22 +0200
commitfd0394d85d6da511eed96fe3dda72dfe92b83481 (patch)
treed85ce248a09cfd1fa5eb0c609ed5953c551a6504 /source4
parentc47d73f6c495d1585fa369c75da1173e78002da0 (diff)
downloadsamba-fd0394d85d6da511eed96fe3dda72dfe92b83481.tar.gz
samba-fd0394d85d6da511eed96fe3dda72dfe92b83481.tar.bz2
samba-fd0394d85d6da511eed96fe3dda72dfe92b83481.zip
s4-libnet: Improve debugging of libnet_BecomeDC LDAP errors
Diffstat (limited to 'source4')
-rw-r--r--source4/dsdb/common/util.c2
-rw-r--r--source4/libnet/libnet_become_dc.c12
2 files changed, 14 insertions, 0 deletions
diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c
index 251e17759b..fd54e4adb9 100644
--- a/source4/dsdb/common/util.c
+++ b/source4/dsdb/common/util.c
@@ -1590,6 +1590,8 @@ int samdb_reference_dn(struct ldb_context *ldb, TALLOC_CTX *mem_ctx, struct ldb_
ret = dsdb_search(ldb, mem_ctx, &res, base, LDB_SCOPE_BASE, attrs, DSDB_SEARCH_ONE_ONLY, NULL);
if (ret != LDB_SUCCESS) {
+ ldb_asprintf_errstring(ldb, "Cannot find DN %s to get attribute %s for reference dn: %s",
+ ldb_dn_get_linearized(base), attribute, ldb_errstring(ldb));
return ret;
}
diff --git a/source4/libnet/libnet_become_dc.c b/source4/libnet/libnet_become_dc.c
index 28bb5a1e0e..306671b33c 100644
--- a/source4/libnet/libnet_become_dc.c
+++ b/source4/libnet/libnet_become_dc.c
@@ -1047,11 +1047,17 @@ static NTSTATUS becomeDC_ldap1_infrastructure_fsmo(struct libnet_BecomeDC_state
DS_GUID_INFRASTRUCTURE_CONTAINER,
&basedn);
if (ret != LDB_SUCCESS) {
+ DEBUG(0,("Failed to get well known DN for DS_GUID_INFRASTRUCTURE_CONTAINER on %s: %s\n",
+ ldb_dn_get_linearized(ldb_get_default_basedn(s->ldap1.ldb)),
+ ldb_errstring(s->ldap1.ldb)));
return NT_STATUS_LDAP(ret);
}
ret = samdb_reference_dn(s->ldap1.ldb, s, basedn, "fSMORoleOwner", &ntds_dn);
if (ret != LDB_SUCCESS) {
+ DEBUG(0,("Failed to get reference DN from fsmoRoleOwner on %s: %s\n",
+ ldb_dn_get_linearized(basedn),
+ ldb_errstring(s->ldap1.ldb)));
talloc_free(basedn);
return NT_STATUS_LDAP(ret);
}
@@ -1068,6 +1074,9 @@ static NTSTATUS becomeDC_ldap1_infrastructure_fsmo(struct libnet_BecomeDC_state
ret = ldb_search(s->ldap1.ldb, s, &r, server_dn, LDB_SCOPE_BASE,
dns_attrs, "(objectClass=*)");
if (ret != LDB_SUCCESS) {
+ DEBUG(0,("Failed to get server DN %s: %s\n",
+ ldb_dn_get_linearized(server_dn),
+ ldb_errstring(s->ldap1.ldb)));
return NT_STATUS_LDAP(ret);
} else if (r->count != 1) {
talloc_free(r);
@@ -1083,6 +1092,9 @@ static NTSTATUS becomeDC_ldap1_infrastructure_fsmo(struct libnet_BecomeDC_state
ret = ldb_search(s->ldap1.ldb, s, &r, ntds_dn, LDB_SCOPE_BASE,
guid_attrs, "(objectClass=*)");
if (ret != LDB_SUCCESS) {
+ DEBUG(0,("Failed to get NTDS Settings DN %s: %s\n",
+ ldb_dn_get_linearized(ntds_dn),
+ ldb_errstring(s->ldap1.ldb)));
return NT_STATUS_LDAP(ret);
} else if (r->count != 1) {
talloc_free(r);