core (memory/cache): escape profile when creating cache dir

This commit is contained in:
Goffi 2017-02-26 18:20:27 +01:00
commit 27f5dd80bf

View file

@ -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 @@ class Cache(object):
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)