1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-01 04:58:35 +03:00

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.
This commit is contained in:
Michael Adam 2012-01-30 14:15:14 +01:00
parent 9cd7b8f04d
commit 8f9b43281d

View File

@ -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 */