]>
Commit | Line | Data |
---|---|---|
1d13e637 AF |
1 | From df1da96d7f9a11ee1029c1bb55a40255ea63267c Mon Sep 17 00:00:00 2001 |
2 | From: Michael Adam <obnox@samba.org> | |
3 | Date: Wed, 6 Jan 2016 11:04:16 +0100 | |
4 | Subject: [PATCH] PATCHSET35 net: add option --no-dns-updates for net ads join | |
5 | ||
6 | If called with this option, 'net ads join' will not attempt | |
7 | to perform dns updates. | |
8 | ||
9 | Backported for Samba 3.6 from master patches: | |
10 | ||
11 | ae81a40b1193ef93add61666ace6fff1a1e0676a | |
12 | d7a617f2f00c4a2b5294523fa651915c85de0d8b | |
13 | ||
14 | Signed-off-by: Michael Adam <obnox@samba.org> | |
15 | --- | |
16 | docs-xml/manpages-3/net.8.xml | 9 ++++++++- | |
17 | source3/utils/net.c | 2 ++ | |
18 | source3/utils/net.h | 2 ++ | |
19 | source3/utils/net_ads.c | 6 +++++- | |
20 | 4 files changed, 17 insertions(+), 2 deletions(-) | |
21 | ||
22 | diff --git a/docs-xml/manpages-3/net.8.xml b/docs-xml/manpages-3/net.8.xml | |
23 | index 65f1272..cff3594 100644 | |
24 | --- a/docs-xml/manpages-3/net.8.xml | |
25 | +++ b/docs-xml/manpages-3/net.8.xml | |
26 | @@ -135,6 +135,13 @@ | |
27 | </para></listitem> | |
28 | </varlistentry> | |
29 | ||
30 | + <varlistentry> | |
31 | + <term>--no-dns-updates</term> | |
32 | + <listitem><para>Do not perform DNS updates as part of | |
33 | + "net ads join". | |
34 | + </para></listitem> | |
35 | + </varlistentry> | |
36 | + | |
37 | &stdarg.server.debug; | |
38 | </variablelist> | |
39 | </refsect1> | |
40 | @@ -194,7 +201,7 @@ the remote server using <command>/bin/date</command>. </para> | |
41 | </refsect2> | |
42 | ||
43 | <refsect2> | |
44 | -<title>[RPC|ADS] JOIN [TYPE] [-U username[%password]] [createupn=UPN] [createcomputer=OU] [options]</title> | |
45 | +<title>[RPC|ADS] JOIN [TYPE] [--no-dns-updates] [-U username[%password]] [createupn=UPN] [createcomputer=OU] [options]</title> | |
46 | ||
47 | <para> | |
48 | Join a domain. If the account already exists on the server, and | |
49 | diff --git a/source3/utils/net.c b/source3/utils/net.c | |
50 | index c53b285..3a95f7e 100644 | |
51 | --- a/source3/utils/net.c | |
52 | +++ b/source3/utils/net.c | |
53 | @@ -820,6 +820,8 @@ static struct functable net_func[] = { | |
54 | {"lock", 0, POPT_ARG_NONE, &c->opt_lock}, | |
55 | {"auto", 'a', POPT_ARG_NONE, &c->opt_auto}, | |
56 | {"repair", 0, POPT_ARG_NONE, &c->opt_repair}, | |
57 | + /* Options for 'net ads join' */ | |
58 | + {"no-dns-updates", 0, POPT_ARG_NONE, &c->opt_no_dns_updates}, | |
59 | POPT_COMMON_SAMBA | |
60 | { 0, 0, 0, 0} | |
61 | }; | |
62 | diff --git a/source3/utils/net.h b/source3/utils/net.h | |
63 | index 1d1559f..adddf34 100644 | |
64 | --- a/source3/utils/net.h | |
65 | +++ b/source3/utils/net.h | |
66 | @@ -81,6 +81,8 @@ struct net_context { | |
67 | int opt_auto; | |
68 | int opt_repair; | |
69 | ||
70 | + int opt_no_dns_updates; | |
71 | + | |
72 | int opt_have_ip; | |
73 | struct sockaddr_storage opt_dest_ip; | |
74 | bool smb_encrypt; | |
75 | diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c | |
76 | index 816349d..5c541f3 100644 | |
77 | --- a/source3/utils/net_ads.c | |
78 | +++ b/source3/utils/net_ads.c | |
79 | @@ -1296,7 +1296,7 @@ static NTSTATUS net_update_dns(struct net_context *c, TALLOC_CTX *mem_ctx, ADS_S | |
80 | ||
81 | static int net_ads_join_usage(struct net_context *c, int argc, const char **argv) | |
82 | { | |
83 | - d_printf(_("net ads join [options]\n" | |
84 | + d_printf(_("net ads join [--no-dns-updates] [options]\n" | |
85 | "Valid options:\n")); | |
86 | d_printf(_(" createupn[=UPN] Set the userPrincipalName attribute during the join.\n" | |
87 | " The deault UPN is in the form host/netbiosname@REALM.\n")); | |
88 | @@ -1455,6 +1455,10 @@ int net_ads_join(struct net_context *c, int argc, const char **argv) | |
89 | } | |
90 | ||
91 | #if defined(WITH_DNS_UPDATES) | |
92 | + if (c->opt_no_dns_updates) { | |
93 | + goto done; | |
94 | + } | |
95 | + | |
96 | /* | |
97 | * In a clustered environment, don't do dynamic dns updates: | |
98 | * Registering the set of ip addresses that are assigned to | |
99 | -- | |
100 | 2.5.0 | |
101 |