summaryrefslogtreecommitdiffstats
path: root/install
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2012-02-22 16:40:29 -0500
committerMartin Kosek <mkosek@redhat.com>2012-02-27 14:49:02 +0100
commit1d4aa207b1bb8f00258f4b5c787375c58f04ddcd (patch)
tree0871bddc94c308115810ccf6e831ba4de8424919 /install
parent31bd87ad90b6218486d90a81b099d93ee4edd18d (diff)
downloadfreeipa.git-1d4aa207b1bb8f00258f4b5c787375c58f04ddcd.tar.gz
freeipa.git-1d4aa207b1bb8f00258f4b5c787375c58f04ddcd.tar.xz
freeipa.git-1d4aa207b1bb8f00258f4b5c787375c58f04ddcd.zip
Remove unused kpasswd.keytab and ldappwd files if they exist.
These were used by ipa_kpasswd and krb5-server-ldap respectivily. https://fedorahosted.org/freeipa/ticket/2397
Diffstat (limited to 'install')
-rw-r--r--install/tools/ipa-upgradeconfig14
1 files changed, 14 insertions, 0 deletions
diff --git a/install/tools/ipa-upgradeconfig b/install/tools/ipa-upgradeconfig
index 725a9d10..535628a7 100644
--- a/install/tools/ipa-upgradeconfig
+++ b/install/tools/ipa-upgradeconfig
@@ -220,6 +220,19 @@ def update_dbmodules(realm, filename="/etc/krb5.conf"):
fd.write("".join(newfile))
fd.close()
+def cleanup_kdc():
+ """
+ Clean up old KDC files if they exist. We need to remove the actual
+ file and any references in the uninstall configuration.
+ """
+ fstore = sysrestore.FileStore('/var/lib/ipa/sysrestore')
+
+ for file in ['kpasswd.keytab', 'ldappwd']:
+ filename = '/var/kerberos/krb5kdc/%s' % file
+ installutils.remove_file(filename)
+ if fstore.has_file(filename):
+ fstore.untrack_file(filename)
+
def main():
"""
Get some basics about the system. If getting those basics fail then
@@ -266,6 +279,7 @@ def main():
except (ldap.ALREADY_EXISTS, ipalib.errors.DuplicateEntry):
pass
+ cleanup_kdc()
try:
if __name__ == "__main__":
sys.exit(main())