mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Abort backup restoration on not matching host.
When restoring backup on master other than it was created there is high risk of unexpected and hard-to-debug behavior. Refuse such restore. https://fedorahosted.org/freeipa/ticket/4823 Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
parent
b0f412177f
commit
b6c58ff238
@ -248,11 +248,9 @@ class Restore(admintool.AdminTool):
|
||||
(options.instance or options.backend)):
|
||||
raise admintool.ScriptError('Restore must be in data-only mode when restoring a specific instance or backend.')
|
||||
if self.backup_host != api.env.host:
|
||||
self.log.warning('Host name %s does not match backup name %s' %
|
||||
raise admintool.ScriptError(
|
||||
'Host name %s does not match backup name %s' %
|
||||
(api.env.host, self.backup_host))
|
||||
if (not options.unattended and
|
||||
not user_input("Continue to restore?", False)):
|
||||
raise admintool.ScriptError("Aborted")
|
||||
if self.backup_ipa_version != str(version.VERSION):
|
||||
self.log.warning(
|
||||
"Restoring data from a different release of IPA.\n"
|
||||
|
Loading…
Reference in New Issue
Block a user