]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
dnsupdate: Skip kerberos step if use-file specified
authorTim Beale <timbeale@catalyst.net.nz>
Tue, 30 Oct 2018 01:11:46 +0000 (14:11 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 1 Nov 2018 08:41:20 +0000 (09:41 +0100)
If there's a problem in get_credentials() (getting the machine account
Kerberos credentials), then we fallback to use_samba_tool (essentially
ignoring use-file). However, there's no need to do this, as use-file
shouldn't require Kerberos credentials.

This was making bootstrapping issues starting a testenv harder to debug.
Obviously, Kerberos is dependent on DNS functioning correctly, but
running dnsupdate was also dependent on having a working Kerberos KDC.
In my case, the testenv had a bad krb5.conf file, but the problem
appeared as resolv-wrapper errors (due to a missing RESOLV_WRAPPER_HOSTS
file, which should've been generated by dnsupdate).

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Pair-Programmed-With: Garming Sam <garming@catalyst.net.nz>

source4/scripting/bin/samba_dnsupdate

index 18b61977dff1c82b14b3a68a045988ada349b22c..37c8c684b24509126785b6ce86fc8efac92f86bc 100755 (executable)
@@ -196,11 +196,11 @@ def get_credentials(lp):
     creds.set_krb_forwardable(credentials.NO_KRB_FORWARDABLE)
     (tmp_fd, ccachename) = tempfile.mkstemp()
     try:
-        creds.get_named_ccache(lp, ccachename)
-
         if opts.use_file is not None:
             return
 
+        creds.get_named_ccache(lp, ccachename)
+
         # Now confirm we can get a ticket to the DNS server
         get_krb5_rw_dns_server(creds, sub_vars['DNSDOMAIN'] + '.')
         return creds