summaryrefslogtreecommitdiffstats
path: root/python/samba/provision/sambadns.py
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2014-08-14 14:47:38 +1200
committerAndrew Bartlett <abartlet@samba.org>2014-09-01 00:36:42 +0200
commit36085a222cb4b837568f00192828594d26692c0e (patch)
tree5654dc4b14ecbdf7adfac3edf18d1a7db25cf5ab /python/samba/provision/sambadns.py
parentb50d7a0f34867072195777915858e2396d452092 (diff)
downloadsamba-36085a222cb4b837568f00192828594d26692c0e.tar.gz
samba-36085a222cb4b837568f00192828594d26692c0e.tar.xz
samba-36085a222cb4b837568f00192828594d26692c0e.zip
provision: Only create hard links for ForestDnsZones if it exists on this DC
We might be a subdomain, and not host this partition. Andrew Bartlett Change-Id: I9aa32c5692cd9fd0a6bced8bea37cd8593b31906 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Diffstat (limited to 'python/samba/provision/sambadns.py')
-rw-r--r--python/samba/provision/sambadns.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/python/samba/provision/sambadns.py b/python/samba/provision/sambadns.py
index aca9116eec..9dbea4ef2a 100644
--- a/python/samba/provision/sambadns.py
+++ b/python/samba/provision/sambadns.py
@@ -806,22 +806,26 @@ def create_samdb_copy(samdb, logger, paths, names, domainsid, domainguid):
# Link dns partitions and metadata
domainzonedn = "DC=DOMAINDNSZONES,%s" % names.domaindn.upper()
forestzonedn = "DC=FORESTDNSZONES,%s" % names.rootdn.upper()
+
domainzone_file = partfile[domainzonedn]
- forestzone_file = partfile[forestzonedn]
+ forestzone_file = partfile.get(forestzonedn)
+
metadata_file = "metadata.tdb"
try:
os.link(os.path.join(samldb_dir, metadata_file),
os.path.join(dns_samldb_dir, metadata_file))
os.link(os.path.join(private_dir, domainzone_file),
os.path.join(dns_dir, domainzone_file))
- os.link(os.path.join(private_dir, forestzone_file),
- os.path.join(dns_dir, forestzone_file))
+ if forestzone_file:
+ os.link(os.path.join(private_dir, forestzone_file),
+ os.path.join(dns_dir, forestzone_file))
except OSError:
logger.error(
"Failed to setup database for BIND, AD based DNS cannot be used")
raise
del partfile[domainzonedn]
- del partfile[forestzonedn]
+ if forestzone_file:
+ del partfile[forestzonedn]
# Copy root, config, schema partitions (and any other if any)
# Since samdb is open in the current process, copy them in a child process