summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2012-01-30 14:15:14 +0100
committerMichael Adam <obnox@samba.org>2012-01-31 17:00:30 +0100
commit8f9b43281d7ad425a4e6681503eb6e872d9040d7 (patch)
tree9825dd4dddc4eee89445840eec58a75c857ddfa3 /source3/utils
parent9cd7b8f04d6e51a0be4e18e8842ff1062134afae (diff)
downloadsamba-8f9b43281d7ad425a4e6681503eb6e872d9040d7.tar.gz
samba-8f9b43281d7ad425a4e6681503eb6e872d9040d7.tar.bz2
samba-8f9b43281d7ad425a4e6681503eb6e872d9040d7.zip
s3:net ads join: improve status evaluation for call to net_update_dns()
untangle assignment from check and log error code in message if failed.
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net_ads.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c
index ecb04ceea6..15f2b54ee9 100644
--- a/source3/utils/net_ads.c
+++ b/source3/utils/net_ads.c
@@ -1466,6 +1466,7 @@ int net_ads_join(struct net_context *c, int argc, const char **argv)
/* We enter this block with user creds */
ADS_STRUCT *ads_dns = NULL;
int ret;
+ NTSTATUS status;
ads_dns = ads_init(lp_realm(), NULL, r->in.dc_name);
@@ -1507,8 +1508,10 @@ int net_ads_join(struct net_context *c, int argc, const char **argv)
goto dns_done;
}
- if (!NT_STATUS_IS_OK(net_update_dns( ctx, ads_dns, NULL))) {
- d_fprintf( stderr, _("DNS update failed!\n"));
+ status = net_update_dns(ctx, ads_dns, NULL);
+ if (!NT_STATUS_IS_OK(status)) {
+ d_fprintf( stderr, _("DNS update failed: %s\n"),
+ nt_errstr(status));
}
/* exit from this block using machine creds */