| |
@@ -0,0 +1,31 @@
|
| |
+ diff --git diskcache/core.py diskcache/core.py
|
| |
+ index 7a3d23b..6901d96 100644
|
| |
+ --- diskcache/core.py
|
| |
+ +++ diskcache/core.py
|
| |
+ @@ -232,7 +232,7 @@ class Disk:
|
| |
+
|
| |
+ for count in range(1, 11):
|
| |
+ with cl.suppress(OSError):
|
| |
+ - os.makedirs(full_dir)
|
| |
+ + os.makedirs(full_dir, 0o700)
|
| |
+
|
| |
+ try:
|
| |
+ # Another cache may have deleted the directory before
|
| |
+ @@ -417,7 +417,7 @@ def args_to_key(base, args, kwargs, typed, ignore):
|
| |
+ class Cache:
|
| |
+ """Disk and file backed cache."""
|
| |
+
|
| |
+ - def __init__(self, directory=None, timeout=60, disk=Disk, **settings):
|
| |
+ + def __init__(self, directory=None, timeout=60, disk=JSONDisk, **settings):
|
| |
+ """Initialize cache instance.
|
| |
+
|
| |
+ :param str directory: cache directory
|
| |
+ @@ -444,7 +444,7 @@ class Cache:
|
| |
+
|
| |
+ if not op.isdir(directory):
|
| |
+ try:
|
| |
+ - os.makedirs(directory, 0o755)
|
| |
+ + os.makedirs(directory, 0o700)
|
| |
+ except OSError as error:
|
| |
+ if error.errno != errno.EEXIST:
|
| |
+ raise EnvironmentError(
|
| |
This is a slightly modified version of the upstream patch #359. The additional change in this patch sets the default disk to JSONDisk which is safer because it does not use pickle for storing cached values.
The upstream project is very dormant and I do not expect the patch to be merged any time soon. Patching in Fedora addresses the vulnerability for Fedora users.