summaryrefslogtreecommitdiffstats
path: root/ipaserver/install/ipa_restore.py
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2014-07-29 12:41:25 +0200
committerPetr Viktorin <pviktori@redhat.com>2014-09-23 12:29:37 +0200
commit06566cb62b00c10b9ef2fd210bb9b36c16649de5 (patch)
treeb32e3e1cc989eeaadf153c8c06a5c00cf4192e83 /ipaserver/install/ipa_restore.py
parent5fef2ecb399129b7d4e96eb47ec1d03f586a2b52 (diff)
downloadfreeipa-06566cb62b00c10b9ef2fd210bb9b36c16649de5.tar.gz
freeipa-06566cb62b00c10b9ef2fd210bb9b36c16649de5.tar.xz
freeipa-06566cb62b00c10b9ef2fd210bb9b36c16649de5.zip
backup,restore: Don't overwrite /etc/{passwd,group}
The /etc/passwd and /etc/group files are not saved and restored. The DS user is always created on restore, and the PKI user is created if a CA is being restored. https://fedorahosted.org/freeipa/ticket/3866 Reviewed-By: Tomas Babej <tbabej@redhat.com>
Diffstat (limited to 'ipaserver/install/ipa_restore.py')
-rw-r--r--ipaserver/install/ipa_restore.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/ipaserver/install/ipa_restore.py b/ipaserver/install/ipa_restore.py
index 439f68304..e230f0aa3 100644
--- a/ipaserver/install/ipa_restore.py
+++ b/ipaserver/install/ipa_restore.py
@@ -32,7 +32,7 @@ from ipapython import admintool
from ipapython.dn import DN
from ipaserver.install.dsinstance import (realm_to_serverid,
create_ds_user, DS_USER)
-from ipaserver.install.cainstance import PKI_USER
+from ipaserver.install.cainstance import PKI_USER, create_ca_user
from ipaserver.install.replication import (wait_for_task, ReplicationManager,
get_cs_replication_manager)
from ipaserver.install import installutils
@@ -265,6 +265,8 @@ class Restore(admintool.AdminTool):
# We do either a full file restore or we restore data.
if self.backup_type == 'FULL' and not options.data_only:
+ if 'CA' in self.backup_services:
+ create_ca_user()
if options.online:
raise admintool.ScriptError('File restoration cannot be done online.')
self.file_restore(options.no_logs)