diff options
author | Martin Basti <mbasti@redhat.com> | 2015-06-01 13:13:17 +0200 |
---|---|---|
committer | Jan Cholasta <jcholast@redhat.com> | 2015-06-02 10:35:22 +0000 |
commit | af8f44c86ab37d83b952c0f021c6509c48be7da8 (patch) | |
tree | bd113515681ccdf42e417275d9b5ec933bcfa030 /ipaserver/install | |
parent | e2c2d5967d4dfd219cd6ab5fc6f3bc8094ba28a7 (diff) | |
download | freeipa-af8f44c86ab37d83b952c0f021c6509c48be7da8.tar.gz freeipa-af8f44c86ab37d83b952c0f021c6509c48be7da8.tar.xz freeipa-af8f44c86ab37d83b952c0f021c6509c48be7da8.zip |
Installers fix: remove temporal ccache
Environ variable may be changed outside, so store path into global
variable.
https://fedorahosted.org/freeipa/ticket/5042
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Diffstat (limited to 'ipaserver/install')
-rw-r--r-- | ipaserver/install/server/install.py | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/ipaserver/install/server/install.py b/ipaserver/install/server/install.py index 61137d2e9..aea1f9915 100644 --- a/ipaserver/install/server/install.py +++ b/ipaserver/install/server/install.py @@ -41,6 +41,7 @@ SYSRESTORE_DIR_PATH = paths.SYSRESTORE installation_cleanup = True original_ccache = None +temp_ccache = None def validate_dm_password(password): @@ -248,24 +249,28 @@ def set_subject_in_config(realm_name, dm_password, suffix, subject_base): def init_private_ccache(): - (desc, path) = tempfile.mkstemp(prefix='krbcc') + global original_ccache + global temp_ccache + + (desc, temp_ccache) = tempfile.mkstemp(prefix='krbcc') os.close(desc) - original_ccache = os.environ.get('KRB5CCNAME', None) + original_ccache = os.environ.get('KRB5CCNAME') - os.environ['KRB5CCNAME'] = path + os.environ['KRB5CCNAME'] = temp_ccache def destroy_private_ccache(): - path = os.environ.get('KRB5CCNAME') + global original_ccache + global temp_ccache if original_ccache is not None: os.environ['KRB5CCNAME'] = original_ccache else: os.environ.pop('KRB5CCNAME', None) - if os.path.exists(path): - os.remove(path) + if os.path.exists(temp_ccache): + os.remove(temp_ccache) def common_cleanup(func): |