Allow .. in data_dir path
This commit is contained in:
parent
9fd30b8853
commit
4e96ddfb9e
1 changed files with 5 additions and 6 deletions
|
@ -278,11 +278,10 @@ class SiteStorage(object):
|
||||||
if not inner_path:
|
if not inner_path:
|
||||||
return self.directory
|
return self.directory
|
||||||
|
|
||||||
file_path = u"%s/%s" % (self.directory, inner_path)
|
if ".." in inner_path:
|
||||||
|
raise Exception(u"File not allowed: %s" % inner_path)
|
||||||
|
|
||||||
if ".." in file_path:
|
return u"%s/%s" % (self.directory, inner_path)
|
||||||
raise Exception(u"File not allowed: %s" % file_path)
|
|
||||||
return file_path
|
|
||||||
|
|
||||||
# Get site dir relative path
|
# Get site dir relative path
|
||||||
def getInnerPath(self, path):
|
def getInnerPath(self, path):
|
||||||
|
@ -418,8 +417,8 @@ class SiteStorage(object):
|
||||||
os.unlink(path)
|
os.unlink(path)
|
||||||
break
|
break
|
||||||
except Exception, err:
|
except Exception, err:
|
||||||
self.log.error("Error removing %s: %s, try #%s" % (path, err, retry))
|
self.log.error("Error removing %s: %s, try #%s" % (path, err, retry))
|
||||||
time.sleep(float(retry)/10)
|
time.sleep(float(retry) / 10)
|
||||||
self.onUpdated(inner_path, False)
|
self.onUpdated(inner_path, False)
|
||||||
|
|
||||||
self.log.debug("Deleting empty dirs...")
|
self.log.debug("Deleting empty dirs...")
|
||||||
|
|
Loading…
Reference in a new issue