mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
ipautil: use file in a temporary dir as ccache in private_ccache
python-gssapi chokes on empty ccache files, so instead of creating an empty temporary ccache file in private_ccache, create a temporary directory and use a non-existent file in that directory as the ccache. https://fedorahosted.org/freeipa/ticket/5401 Reviewed-By: Martin Basti <mbasti@redhat.com> Reviewed-By: Simo Sorce <ssorce@redhat.com>
This commit is contained in:
@@ -1345,8 +1345,10 @@ def posixify(string):
|
||||
def private_ccache(path=None):
|
||||
|
||||
if path is None:
|
||||
(desc, path) = tempfile.mkstemp(prefix='krbcc')
|
||||
os.close(desc)
|
||||
dir_path = tempfile.mkdtemp(prefix='krbcc')
|
||||
path = os.path.join(dir_path, 'ccache')
|
||||
else:
|
||||
dir_path = None
|
||||
|
||||
original_value = os.environ.get('KRB5CCNAME', None)
|
||||
|
||||
@@ -1362,6 +1364,11 @@ def private_ccache(path=None):
|
||||
|
||||
if os.path.exists(path):
|
||||
os.remove(path)
|
||||
if dir_path is not None:
|
||||
try:
|
||||
os.rmdir(dir_path)
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
|
||||
if six.PY2:
|
||||
|
||||
Reference in New Issue
Block a user