file_manager: fix permission reporting

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2022-11-06 06:29:02 -05:00
parent 36536535bc
commit d490796da9
No known key found for this signature in database
GPG Key ID: 5A1EB336DFB4C71B
1 changed files with 6 additions and 2 deletions

View File

@ -549,8 +549,12 @@ class FileManager:
(path.is_symlink() and path.is_file()) (path.is_symlink() and path.is_file())
): ):
permissions = "r" permissions = "r"
if self.check_reserved_path(real_path, permissions == "rw", False): for name, (res_path, can_read) in self.reserved_paths.items():
permissions = "" if (res_path == real_path or res_path in real_path.parents):
if not can_read:
permissions = ""
break
permissions = "r"
return { return {
'modified': fstat.st_mtime, 'modified': fstat.st_mtime,
'size': fstat.st_size, 'size': fstat.st_size,