mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Use tempfile.mkdtemp() rather than hardcoded tmpdir
httpinstance.py currently uses a hardcoded /tmp/ipa temporary directory. Make it use tempfile.mkdtemp() instead. Signed-off-by: Mark McLoughlin <markmc@redhat.com>
This commit is contained in:
parent
ae099fe006
commit
8b3024080b
@ -131,15 +131,10 @@ class HTTPInstance(service.Service):
|
||||
shutil.copy(ds_ca.cacert_fname, "/usr/share/ipa/html/ca.crt")
|
||||
os.chmod("/usr/share/ipa/html/ca.crt", 0444)
|
||||
|
||||
try:
|
||||
shutil.rmtree("/tmp/ipa")
|
||||
except:
|
||||
pass
|
||||
os.mkdir("/tmp/ipa")
|
||||
shutil.copy("/usr/share/ipa/html/preferences.html", "/tmp/ipa")
|
||||
|
||||
tmpdir = tempfile.mkdtemp(prefix = "tmp-")
|
||||
shutil.copy("/usr/share/ipa/html/preferences.html", tmpdir)
|
||||
ca.run_signtool(["-k", "Signing-Cert",
|
||||
"-Z", "/usr/share/ipa/html/configure.jar",
|
||||
"-e", ".html",
|
||||
"/tmp/ipa"])
|
||||
shutil.rmtree("/tmp/ipa")
|
||||
tmpdir])
|
||||
shutil.rmtree(tmpdir)
|
||||
|
Loading…
Reference in New Issue
Block a user