mirror of
https://github.com/samba-team/samba.git
synced 2025-03-03 12: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:
parent
9cd7b8f04d
commit
8f9b43281d
@ -1466,6 +1466,7 @@ int net_ads_join(struct net_context *c, int argc, const char **argv)
|
|||||||
/* We enter this block with user creds */
|
/* We enter this block with user creds */
|
||||||
ADS_STRUCT *ads_dns = NULL;
|
ADS_STRUCT *ads_dns = NULL;
|
||||||
int ret;
|
int ret;
|
||||||
|
NTSTATUS status;
|
||||||
|
|
||||||
ads_dns = ads_init(lp_realm(), NULL, r->in.dc_name);
|
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;
|
goto dns_done;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!NT_STATUS_IS_OK(net_update_dns( ctx, ads_dns, NULL))) {
|
status = net_update_dns(ctx, ads_dns, NULL);
|
||||||
d_fprintf( stderr, _("DNS update failed!\n"));
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
|
d_fprintf( stderr, _("DNS update failed: %s\n"),
|
||||||
|
nt_errstr(status));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* exit from this block using machine creds */
|
/* exit from this block using machine creds */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user