summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Sutton <josephsutton@catalyst.net.nz>2021-05-26 13:44:15 +1200
committerAndrew Bartlett <abartlet@samba.org>2021-06-11 07:41:38 +0000
commitf5c26f7231e9c5558e40ef70529693a35a8442f2 (patch)
tree308387075620f3f04fae9010aa4de9e087dfa515
parentc6b2846c9d6d235cd833c5425723260368cef101 (diff)
downloadsamba-f5c26f7231e9c5558e40ef70529693a35a8442f2.tar.gz
samba_upgradedns: Create binddns_dir if it doesn't already exist
Without doing this, the upgrade process can fail if the directory is not present, e.g. after restoring from an offline backup (which specifically ignores this directory). Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
-rwxr-xr-xsource4/scripting/bin/samba_upgradedns4
1 files changed, 4 insertions, 0 deletions
diff --git a/source4/scripting/bin/samba_upgradedns b/source4/scripting/bin/samba_upgradedns
index fc995648226..a3d515c0df3 100755
--- a/source4/scripting/bin/samba_upgradedns
+++ b/source4/scripting/bin/samba_upgradedns
@@ -492,6 +492,10 @@ if __name__ == '__main__':
else:
logger.info("dns-%s account already exists" % hostname)
+ if not os.path.exists(paths.binddns_dir):
+ # This directory won't exist if we're restoring from an offline backup.
+ os.mkdir(paths.binddns_dir, 0o770)
+
private_dns_keytab_path = os.path.join(paths.private_dir, paths.dns_keytab)
bind_dns_keytab_path = os.path.join(paths.binddns_dir, paths.dns_keytab)