file_manager: disallow drilling down protected folders

Signed-off-by:  Kurt Haenen <kurt.haenen@gmail.com>
This commit is contained in:
Misterke 2022-11-05 14:53:52 +01:00 committed by Eric Callahan
parent 6f43940270
commit 130c2a48f0
1 changed files with 1 additions and 0 deletions

View File

@ -491,6 +491,7 @@ class FileManager:
if not os.path.isdir(path):
raise self.server.error(
f"Directory does not exist ({path})")
self.check_reserved_path(path, False)
flist: Dict[str, Any] = {'dirs': [], 'files': []}
for fname in os.listdir(path):
full_path = os.path.join(path, fname)