From 4d1fd0b7daa089bd8863f0efcaf258bf30192c29 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bj=C3=B6rn=20Baumbach?= Date: Thu, 20 Dec 2012 15:57:43 +0100 Subject: [PATCH] samba_dnsupdate: set KRB5_CONFIG for nsupdate command MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Let nslookup use krb5.conf, which is set in our KRB5_CONFIG. Signed-off-by: Björn Baumbach Reviewed-by: Stefan Metzmacher Reviewed-by: Andrew Bartlett --- source4/scripting/bin/samba_dnsupdate | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/source4/scripting/bin/samba_dnsupdate b/source4/scripting/bin/samba_dnsupdate index a700118da0e..a5cece13336 100755 --- a/source4/scripting/bin/samba_dnsupdate +++ b/source4/scripting/bin/samba_dnsupdate @@ -278,7 +278,7 @@ def get_subst_vars(samdb): def call_nsupdate(d): """call nsupdate for an entry.""" - global ccachename, nsupdate_cmd + global ccachename, nsupdate_cmd, krb5conf if opts.verbose: print "Calling nsupdate for %s" % d @@ -333,10 +333,11 @@ def call_nsupdate(d): try: cmd = nsupdate_cmd[:] cmd.append(tmpfile) + env = {} + if krb5conf: + env["KRB5_CONFIG"] = krb5conf if ccachename: - env = {"KRB5CCNAME": ccachename} - else: - env = {} + env["KRB5CCNAME"] = ccachename ret = subprocess.call(cmd, shell=False, env=env) if ret != 0: if opts.fail_immediately: -- 2.34.1