netcmd: Add sanity-check for invalid domain rename args
authorTim Beale <timbeale@catalyst.net.nz>
Sun, 8 Jul 2018 21:44:30 +0000 (09:44 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 10 Jul 2018 02:42:10 +0000 (04:42 +0200)
commitc8f0b88571e6573bea7f20ade2f62c60525ca800
treedb664f173ed38ce74d3a37311cfe672a3b43ad09
parent7b70637e9ffab2a99e7d0d4df95409b1f411b93b
netcmd: Add sanity-check for invalid domain rename args

We are suggesting to users that it's safe to run a renamed domain in
parallel with the old backed-up domain. However, this would not be the
case if the user (foolishly) "renames" their domain using the exact same
NetBIOS name or DNS realm.

Using the same DNS realm fails later on (updating the dnsRoot values),
but using the same NetBIOS name actually succeeds. While we can't make
samba tools completely idiot-proof, we can protect users from the most
basic of (potentially unintended) errors with some simple sanity-checks.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/netcmd/domain_backup.py
python/samba/tests/domain_backup.py