summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbaconseed <baconseed>2012-09-29 17:01:28 +0100
committerCalum Lind <calumlind+deluge@gmail.com>2012-09-29 17:02:16 +0100
commitbb7b529c294bb8f74ed955286be0f59aca62ed51 (patch)
treeb8afe993ca036474de3e507a8826a5a7ba9860b3
parent43390b850a19cfc9feb0c4bd825137d8f6a285e5 (diff)
downloaddeluge-bb7b529c294bb8f74ed955286be0f59aca62ed51.zip
deluge-bb7b529c294bb8f74ed955286be0f59aca62ed51.tar.gz
deluge-bb7b529c294bb8f74ed955286be0f59aca62ed51.tar.bz2
Fix #2112 : World readable tmp directory in json_api
-rw-r--r--deluge/ui/web/json_api.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/deluge/ui/web/json_api.py b/deluge/ui/web/json_api.py
index 533b6c2..23fb318 100644
--- a/deluge/ui/web/json_api.py
+++ b/deluge/ui/web/json_api.py
@@ -664,7 +664,8 @@ class WebApi(JSONComponent):
log.error("Reason: %s", result.getErrorMessage())
return result
- tmp_file = os.path.join(tempfile.gettempdir(), url.split("/")[-1])
+ tempdir = tempfile.mkdtemp(prefix="delugeweb-")
+ tmp_file = os.path.join(tempdir, url.split("/")[-1])
log.debug("filename: %s", tmp_file)
headers = {}
if cookie: