mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
net: add option --no-dns-updates for net ads join
If called with this option, 'net ads join' will not attempt to perform dns updates. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
This commit is contained in:
parent
a44a0c47cb
commit
ae81a40b11
@ -839,6 +839,8 @@ static struct functable net_func[] = {
|
||||
{"wipe", 0, POPT_ARG_NONE, &c->opt_wipe},
|
||||
/* Options for 'net registry import' */
|
||||
{"precheck", 0, POPT_ARG_STRING, &c->opt_precheck},
|
||||
/* Options for 'net ads join' */
|
||||
{"no-dns-updates", 0, POPT_ARG_NONE, &c->opt_no_dns_updates},
|
||||
POPT_COMMON_SAMBA
|
||||
{ 0, 0, 0, 0}
|
||||
};
|
||||
|
@ -84,6 +84,7 @@ struct net_context {
|
||||
const char *opt_output;
|
||||
int opt_wipe;
|
||||
const char *opt_precheck;
|
||||
int opt_no_dns_updates;
|
||||
|
||||
int opt_have_ip;
|
||||
struct sockaddr_storage opt_dest_ip;
|
||||
|
@ -1318,7 +1318,7 @@ static NTSTATUS net_update_dns(struct net_context *c, TALLOC_CTX *mem_ctx, ADS_S
|
||||
|
||||
static int net_ads_join_usage(struct net_context *c, int argc, const char **argv)
|
||||
{
|
||||
d_printf(_("net ads join [options]\n"
|
||||
d_printf(_("net ads join [--no-dns-updates] [options]\n"
|
||||
"Valid options:\n"));
|
||||
d_printf(_(" createupn[=UPN] Set the userPrincipalName attribute during the join.\n"
|
||||
" The deault UPN is in the form host/netbiosname@REALM.\n"));
|
||||
@ -1594,11 +1594,14 @@ int net_ads_join(struct net_context *c, int argc, const char **argv)
|
||||
}
|
||||
|
||||
/*
|
||||
* We try doing the dns update (if it was compiled in).
|
||||
* We try doing the dns update (if it was compiled in
|
||||
* and if it was not disabled on the command line).
|
||||
* If the dns update fails, we still consider the join
|
||||
* operation as succeeded if we came this far.
|
||||
*/
|
||||
_net_ads_join_dns_updates(c, ctx, r);
|
||||
if (!c->opt_no_dns_updates) {
|
||||
_net_ads_join_dns_updates(c, ctx, r);
|
||||
}
|
||||
|
||||
TALLOC_FREE(r);
|
||||
TALLOC_FREE( ctx );
|
||||
|
Loading…
Reference in New Issue
Block a user