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")
|
shutil.copy(ds_ca.cacert_fname, "/usr/share/ipa/html/ca.crt")
|
||||||
os.chmod("/usr/share/ipa/html/ca.crt", 0444)
|
os.chmod("/usr/share/ipa/html/ca.crt", 0444)
|
||||||
|
|
||||||
try:
|
tmpdir = tempfile.mkdtemp(prefix = "tmp-")
|
||||||
shutil.rmtree("/tmp/ipa")
|
shutil.copy("/usr/share/ipa/html/preferences.html", tmpdir)
|
||||||
except:
|
|
||||||
pass
|
|
||||||
os.mkdir("/tmp/ipa")
|
|
||||||
shutil.copy("/usr/share/ipa/html/preferences.html", "/tmp/ipa")
|
|
||||||
|
|
||||||
ca.run_signtool(["-k", "Signing-Cert",
|
ca.run_signtool(["-k", "Signing-Cert",
|
||||||
"-Z", "/usr/share/ipa/html/configure.jar",
|
"-Z", "/usr/share/ipa/html/configure.jar",
|
||||||
"-e", ".html",
|
"-e", ".html",
|
||||||
"/tmp/ipa"])
|
tmpdir])
|
||||||
shutil.rmtree("/tmp/ipa")
|
shutil.rmtree(tmpdir)
|
||||||
|
Loading…
Reference in New Issue
Block a user