summaryrefslogtreecommitdiff
path: root/testprogs
diff options
context:
space:
mode:
authorTim Beale <timbeale@catalyst.net.nz>2018-09-18 14:54:51 +1200
committerAndrew Bartlett <abartlet@samba.org>2018-09-26 07:49:17 +0200
commitce57a800c9bed7e6876cdc0baf3a2d5fdc879ecf (patch)
treeeb9b9ecb3d71a46b474b0117da90041e1127ff67 /testprogs
parentad69aaf7e13435111fc990954ff0bc81ed5325c5 (diff)
downloadsamba-ce57a800c9bed7e6876cdc0baf3a2d5fdc879ecf.tar.gz
netcmd: Re-create default site for backup-restore (if missing)
Normally when a new DC joins a domain, samba-tool works out the new DC's site automatically. However, it does this by querying the existing DC using CLDAP. In the restore case, there is no DC running. We could still query the DB on disk and work out the correct site based on the new DC's IP, however: - comparing between the CN=Subnet DNs and an IP-address string seems like it'd be non-trivial to write, and - in the lab-domain rename case, chances are the user will want a completely different subnet to what's already in the DB. The restore command now has a --site option so the user can specify an appropriate site for the restored DC. This patch makes the restore command work by default (i.e. without a --site option) even if the default Default-First-Site-Name doesn't exist. Basically the solution is to just check Default-First-Site-Name exists and create it if it doesn't. As the recommended workflow is to use the restored DC as a temporary seed that you'll later throw away, this approach seems acceptable. Subsequent DCs will then be joined to the running restored DC, so an appropriate site will be determined using CLDAP. The only side-effect is potentially an extra Site object. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13621 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'testprogs')
0 files changed, 0 insertions, 0 deletions