1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-31 20:22:15 +03:00

netcmd: Extend 'backup restore' command to handle renamed domains

When restoring a renamed domain backup, we need to register the new
realm's DNS zone. We do this in the restore step because we don't know
the new server's IP/hostname in the backup step.

Because we may have removed the old realm's DNS entries in the rename
step, the remove_dc() code may fail to find the expected DNS entries for
the DC's domain (the DCs' dnsHostname still maps to the old DNS realm).
We just needed to adjust remove_dns_references() as it was getting a
slightly different error code.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Tim Beale
2018-06-11 11:18:09 +12:00
committed by Douglas Bagnall
parent ab65647a8b
commit 6681f904aa
3 changed files with 61 additions and 8 deletions

View File

@ -102,7 +102,8 @@ def remove_dns_references(samdb, logger, dnsHostName, ignore_no_name=False):
(dn, primary_recs) = samdb.dns_lookup(dnsHostName)
except RuntimeError as e4:
(enum, estr) = e4.args
if enum == werror.WERR_DNS_ERROR_NAME_DOES_NOT_EXIST:
if (enum == werror.WERR_DNS_ERROR_NAME_DOES_NOT_EXIST or
enum == werror.WERR_DNS_ERROR_RCODE_NAME_ERROR):
if ignore_no_name:
remove_hanging_dns_references(samdb, logger,
dnsHostNameUpper,