From: Tim Beale Date: Tue, 30 Oct 2018 00:06:20 +0000 (+1300) Subject: dnsupdate: Pass smb.conf through to samba-tool commands X-Git-Tag: tdb-1.3.17~992 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c35fb3a88b5c92c343d09f1a707806ea6e46db60;p=thirdparty%2Fsamba.git dnsupdate: Pass smb.conf through to samba-tool commands 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 Reviewed-by: Andrew Bartlett --- diff --git a/source4/scripting/bin/samba_dnsupdate b/source4/scripting/bin/samba_dnsupdate index ae355e9ec4e..18b61977dff 100755 --- a/source4/scripting/bin/samba_dnsupdate +++ b/source4/scripting/bin/samba_dnsupdate @@ -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()