]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
dnsupdate: Pass smb.conf through to samba-tool commands
authorTim Beale <timbeale@catalyst.net.nz>
Tue, 30 Oct 2018 00:06:20 +0000 (13:06 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 1 Nov 2018 08:41:19 +0000 (09:41 +0100)
If you call samba_dnsupdate with a --configfile option, this wasn't
passed through to the samba-tool commands the script tries to run.
Normally, samba_dnsupdate would only be run on the DC itself, so it
shouldn't be a big deal, however, this may be a problem if you install
the samba database into a non-default location (i.e. not
/usr/local/samba).

This patch passes through the smb.conf file, if one was specified.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/scripting/bin/samba_dnsupdate

index ae355e9ec4e904b394baea7ff3ab5eb58dcc2301..18b61977dff1c82b14b3a68a045988ada349b22c 100755 (executable)
@@ -122,6 +122,7 @@ for i in IPs:
     else:
         IP4s.append(i)
 
+smb_conf = sambaopts.get_loadparm_path()
 
 if opts.verbose:
     print("IPs: %s" % IPs)
@@ -620,6 +621,9 @@ def call_samba_tool(d, op="add", zone=None):
     if d.type == "NS":
         args = [rpc_server_ip, zone, short_name, "NS", d.dest]
 
+    if smb_conf and args:
+        args += ["--configfile=" + smb_conf]
+
     global error_count
     try:
         cmd = cmd_dns()