diff options
author | Kamen Mazdrashki <kamenim@samba.org> | 2010-08-29 19:47:40 +0300 |
---|---|---|
committer | Kamen Mazdrashki <kamenim@samba.org> | 2010-08-30 09:55:30 +0300 |
commit | 5c5e5ff6077d544fc6a75f423ff6f14715fb4256 (patch) | |
tree | 1ff105cb939fd9d35d52b7f146f3549c5a6fd902 /source4/utils/net/drs | |
parent | 0007203978eaf3b570d00862a95fecd1193e3f85 (diff) | |
download | samba-5c5e5ff6077d544fc6a75f423ff6f14715fb4256.tar.gz samba-5c5e5ff6077d544fc6a75f423ff6f14715fb4256.tar.bz2 samba-5c5e5ff6077d544fc6a75f423ff6f14715fb4256.zip |
s4-util: Print more informative error messages in 'net drs replicate'
Diffstat (limited to 'source4/utils/net/drs')
-rw-r--r-- | source4/utils/net/drs/net_drs_replicate.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/source4/utils/net/drs/net_drs_replicate.c b/source4/utils/net/drs/net_drs_replicate.c index 1e28c73db5..a661d2b70e 100644 --- a/source4/utils/net/drs/net_drs_replicate.c +++ b/source4/utils/net/drs/net_drs_replicate.c @@ -35,6 +35,7 @@ net_drs_server_dn_from_dc_name(struct net_drs_context *drs_ctx, const char *dc_name) { int ldb_err; + char *filter; struct ldb_dn *dn; struct ldb_dn *server_dn = NULL; struct ldb_result *ldb_res; @@ -57,17 +58,25 @@ net_drs_server_dn_from_dc_name(struct net_drs_context *drs_ctx, } /* search for Server in Sites container */ + filter = talloc_asprintf(mem_ctx, + "(&(objectCategory=server)(|(name=%1$s)(dNSHostName=%1$s)))", + dc_name); ldb_err = ldb_search(drs_ctx->ldap.ldb, mem_ctx, &ldb_res, dn, LDB_SCOPE_SUBTREE, attrs, - "(&(objectCategory=server)(|(name=%1$s)(dNSHostName=%1$s)))", - dc_name); + "%s", + filter); if (ldb_err != LDB_SUCCESS) { - d_printf("ldb_seach() failed with err: %d (%s).\n", + d_printf("ldb_seach(base=%s, filter=%s) failed: %d (%s).\n", + ldb_dn_get_linearized(dn), + filter, ldb_err, ldb_errstring(drs_ctx->ldap.ldb)); goto failed; } if (ldb_res->count != 1) { - d_printf("ldb_search() should return exactly one record!\n"); + d_printf("ldb_search(base=%s, filter=%s) returned %d records, expected 1!\n", + ldb_dn_get_linearized(dn), + filter, + ldb_res->count); goto failed; } |