summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Babej <tbabej@redhat.com>2013-10-09 12:23:18 +0200
committerMartin Kosek <mkosek@redhat.com>2013-10-14 11:12:43 +0200
commit2c4928f91a2c29f14676c7b1333034384a7b9669 (patch)
tree4e23a9dececdc6f8ad8571f1d7b77e0fbb1fc4b6
parentb15effdddf701bdd96115edef0fa4a109c2135d9 (diff)
downloadfreeipa.git-2c4928f91a2c29f14676c7b1333034384a7b9669.tar.gz
freeipa.git-2c4928f91a2c29f14676c7b1333034384a7b9669.tar.xz
freeipa.git-2c4928f91a2c29f14676c7b1333034384a7b9669.zip
ipa-upgradeconfig: Remove backed up smb.conf
Since we are not able to properly restore the Samba server to the working state after running ipa-adtrust-install, we should not keep the smb.conf in the fstore. This patch makes sure that any backed up smb.conf is removed from the backup and that this file is not backed up anymore. Part of: https://fedorahosted.org/freeipa/ticket/3479
-rw-r--r--install/tools/ipa-upgradeconfig14
-rw-r--r--ipaserver/install/adtrustinstance.py15
2 files changed, 20 insertions, 9 deletions
diff --git a/install/tools/ipa-upgradeconfig b/install/tools/ipa-upgradeconfig
index 1edc4c7b..2ee59832 100644
--- a/install/tools/ipa-upgradeconfig
+++ b/install/tools/ipa-upgradeconfig
@@ -291,6 +291,19 @@ def cleanup_kdc(fstore):
fstore.untrack_file(filename)
root_logger.debug('Uninstalling %s', filename)
+def cleanup_adtrust(fstore):
+ """
+ Clean up any old Samba backup files that were deprecated.
+ """
+
+ root_logger.info('[Checking for deprecated backups of Samba '
+ 'configuration files]')
+
+ for backed_up_file in ['/etc/samba/smb.conf']:
+ if fstore.has_file(backed_up_file):
+ fstore.untrack_file(backed_up_file)
+ root_logger.debug('Removing %s from backup', backed_up_file)
+
def setup_firefox_extension(fstore):
"""Set up the Firefox configuration extension, if it's not set up yet
@@ -1061,6 +1074,7 @@ def main():
pass
cleanup_kdc(fstore)
+ cleanup_adtrust(fstore)
setup_firefox_extension(fstore)
add_ca_dns_records()
diff --git a/ipaserver/install/adtrustinstance.py b/ipaserver/install/adtrustinstance.py
index b3046386..140c8d76 100644
--- a/ipaserver/install/adtrustinstance.py
+++ b/ipaserver/install/adtrustinstance.py
@@ -365,8 +365,6 @@ class ADTRUSTInstance(service.Service):
self.admin_conn.add_entry(entry)
def __write_smb_conf(self):
- self.fstore.backup_file(self.smb_conf)
-
conf_fd = open(self.smb_conf, "w")
conf_fd.write('### Added by IPA Installer ###\n')
conf_fd.write('[global]\n')
@@ -863,18 +861,17 @@ class ADTRUSTInstance(service.Service):
except:
pass
- for r_file in [self.smb_conf]:
- try:
- self.fstore.restore_file(r_file)
- except ValueError, error:
- root_logger.debug(error)
- pass
+ # Since we do not guarantee restoring back to working samba state,
+ # we should not restore smb.conf
+
+ # Restore the state of affected selinux booleans
for var in self.selinux_booleans:
sebool_state = self.restore_state(var)
if not sebool_state is None:
try:
- ipautil.run(["/usr/sbin/setsebool", "-P", var, sebool_state])
+ ipautil.run(["/usr/sbin/setsebool",
+ "-P", var, sebool_state])
except:
self.print_msg(SELINUX_WARNING % dict(var=var))