samba_dnsupdate: set KRB5_CONFIG for nsupdate command
authorBjörn Baumbach <bb@sernet.de>
Thu, 20 Dec 2012 14:57:43 +0000 (15:57 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 9 Jan 2013 08:11:20 +0000 (09:11 +0100)
Let nslookup use krb5.conf, which is set in our KRB5_CONFIG.

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/scripting/bin/samba_dnsupdate

index a700118da0e6cf13a90b144f0d5e7f7edd36864a..a5cece1333659b680e731a979153bf6fdb45cfac 100755 (executable)
@@ -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: