diff options
author | Andrew Bartlett <abartlet@samba.org> | 2017-09-14 15:02:36 +1200 |
---|---|---|
committer | Douglas Bagnall <dbagnall@samba.org> | 2017-09-20 02:25:30 +0200 |
commit | c1e41d489d8b199ad1f7f1546ae50461cda0fbce (patch) | |
tree | ec7631263ad46fff0d7ba2bcf24882f862b49d81 /source4/torture/dns | |
parent | 6c28abc249f83a1083a71b2d526098d42c4f5c14 (diff) | |
download | samba-c1e41d489d8b199ad1f7f1546ae50461cda0fbce.tar.gz |
samdb: Rework samdb_connect_url() to return LDB error code and an error string
This allows debugging of why the LDB failed to start up.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Diffstat (limited to 'source4/torture/dns')
-rw-r--r-- | source4/torture/dns/dlz_bind9.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/source4/torture/dns/dlz_bind9.c b/source4/torture/dns/dlz_bind9.c index 893158fa730..2234e7a23f6 100644 --- a/source4/torture/dns/dlz_bind9.c +++ b/source4/torture/dns/dlz_bind9.c @@ -86,16 +86,18 @@ static isc_result_t dlz_bind9_writeable_zone_hook(dns_view_t *view, const char *zone_name) { struct torture_context *tctx = talloc_get_type((void *)view, struct torture_context); - struct ldb_context *samdb = samdb_connect_url(tctx, NULL, tctx->lp_ctx, - system_session(tctx->lp_ctx), - 0, - test_dlz_bind9_binddns_dir(tctx, "dns/sam.ldb")); + struct ldb_context *samdb = NULL; + char *errstring = NULL; + int ret = samdb_connect_url(tctx, NULL, tctx->lp_ctx, + system_session(tctx->lp_ctx), + 0, + test_dlz_bind9_binddns_dir(tctx, "dns/sam.ldb"), + &samdb, &errstring); struct ldb_message *msg; - int ret; const char *attrs[] = { NULL }; - if (!samdb) { + if (ret != LDB_SUCCESS) { torture_fail(tctx, "Failed to connect to samdb"); return ISC_R_FAILURE; } |