changeset 2166:1b3fbb76984b

core (memory/cache): escape profile when creating cache dir
author Goffi <goffi@goffi.org>
date Sun, 26 Feb 2017 18:20:27 +0100
parents a0fbb2b11fd0
children 4b78b4c7f805
files src/memory/cache.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/memory/cache.py	Thu Feb 23 07:33:30 2017 +0100
+++ b/src/memory/cache.py	Sun Feb 26 18:20:27 2017 +0100
@@ -19,6 +19,7 @@
 
 from sat.core.log import getLogger
 log = getLogger(__name__)
+from sat.tools.common import regex
 from sat.core import exceptions
 from sat.core.constants import Const as C
 import cPickle as pickle
@@ -36,7 +37,7 @@
         self.cache_dir = os.path.join(
             host.memory.getConfig('', 'local_dir'),
             C.CACHE_DIR,
-            profile or '')
+            regex.pathEscape(profile or ''))
         if not os.path.exists(self.cache_dir):
             os.makedirs(self.cache_dir)