mirror of
https://github.com/samba-team/samba.git
synced 2025-03-09 08:58:35 +03:00
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. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14199 Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
parent
f0cebbe4dd
commit
0bd479140c
@ -850,9 +850,19 @@ def create_samdb_copy(samdb, logger, paths, names, domainsid, domainguid):
|
||||
os.path.join(dns_samldb_dir, metadata_file))
|
||||
os.link(os.path.join(private_dir, 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
|
||||
os.link(os.path.join(private_dir, domainzone_file + "-lock"),
|
||||
os.path.join(dns_dir, domainzone_file + "-lock"))
|
||||
if forestzone_file:
|
||||
os.link(os.path.join(private_dir, 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
|
||||
os.link(os.path.join(private_dir, forestzone_file + "-lock"),
|
||||
os.path.join(dns_dir, forestzone_file + "-lock"))
|
||||
except OSError:
|
||||
logger.error(
|
||||
"Failed to setup database for BIND, AD based DNS cannot be used")
|
||||
|
@ -1 +0,0 @@
|
||||
^samba.tests.samba_upgradedns_lmdb.samba.tests.samba_upgradedns_lmdb.
|
Loading…
x
Reference in New Issue
Block a user