file_manager: disallow drilling down protected folders
Signed-off-by: Kurt Haenen <kurt.haenen@gmail.com>
This commit is contained in:
parent
6f43940270
commit
130c2a48f0
@ -491,6 +491,7 @@ class FileManager:
|
|||||||
if not os.path.isdir(path):
|
if not os.path.isdir(path):
|
||||||
raise self.server.error(
|
raise self.server.error(
|
||||||
f"Directory does not exist ({path})")
|
f"Directory does not exist ({path})")
|
||||||
|
self.check_reserved_path(path, False)
|
||||||
flist: Dict[str, Any] = {'dirs': [], 'files': []}
|
flist: Dict[str, Any] = {'dirs': [], 'files': []}
|
||||||
for fname in os.listdir(path):
|
for fname in os.listdir(path):
|
||||||
full_path = os.path.join(path, fname)
|
full_path = os.path.join(path, fname)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user