From: Gary Lockyer Date: Thu, 19 Dec 2019 03:31:46 +0000 (+1300) Subject: upgradedns: ensure lmdb lock files linked X-Git-Tag: samba-4.10.13~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe015ece4ee1b61efb97319156bfa85f299e8ffb;p=thirdparty%2Fsamba.git 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 Reviewed-by: Andrew Bartlett (cherry picked from commit 0bd479140c18ab79479ced4f25f366744c3afe18) --- diff --git a/python/samba/provision/sambadns.py b/python/samba/provision/sambadns.py index 9b245608c63..239c99ff0b9 100644 --- a/python/samba/provision/sambadns.py +++ b/python/samba/provision/sambadns.py @@ -858,9 +858,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") diff --git a/selftest/knownfail.d/bug-14199 b/selftest/knownfail.d/bug-14199 deleted file mode 100644 index f9508910b79..00000000000 --- a/selftest/knownfail.d/bug-14199 +++ /dev/null @@ -1 +0,0 @@ -^samba.tests.samba_upgradedns_lmdb.samba.tests.samba_upgradedns_lmdb.