Commit 0bd47914 authored by Gary Lockyer's avatar Gary Lockyer Committed by Andrew Bartlett
Browse files

upgradedns: ensure lmdb lock files linked

Ensure that the '-lock' files for the dns partitions as well as the data
files are linked when running
  samba_dnsupgrade --dns-backend=BIND9_DLZ
failure to create these links can cause corruption of the corresponding
data file.


Signed-off-by: default avatarGary Lockyer <>
Reviewed-by: Andrew Bartlett's avatarAndrew Bartlett <>
parent f0cebbe4
......@@ -850,9 +850,19 @@ def create_samdb_copy(samdb, logger, paths, names, domainsid, domainguid):
os.path.join(dns_samldb_dir, metadata_file)), domainzone_file),
os.path.join(dns_dir, domainzone_file))
if backend_store == "mdb":
# If the file is an lmdb data file need to link the
# lock file as well, domainzone_file + "-lock"),
os.path.join(dns_dir, domainzone_file + "-lock"))
if forestzone_file:, forestzone_file),
os.path.join(dns_dir, forestzone_file))
if backend_store == "mdb":
# If the database file is an lmdb data file need to link the
# lock file as well, forestzone_file + "-lock"),
os.path.join(dns_dir, forestzone_file + "-lock"))
except OSError:
"Failed to setup database for BIND, AD based DNS cannot be used")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment