You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that in is_file_hidden_posix() an exception is raised if it comes across a symlink where the target path is not accesssible to the user (PermissionError). This has the effect of stopping the file contents manager from displaying the contents of a directory containing such links in JupyterLab 3.
Right now if os.stat() raises errno.ENOENT then the function returns False. I find that if I allow the function to similarly return False if os.stat() raises errno.EACCES, then the file listing works.
Is this an actual bug (and fix) and if so maybe does it need to be applied in the non-posix function as well?
The text was updated successfully, but these errors were encountered:
Hi @rcthomas. I think the intention relative to EACCES is that files in which the active user is denied access should not show up in any listing, irrespective of the allow_hidden trait, as that can be considered a security issue. As a result, I'm inclined to say the calling application should handle raised exceptions (and be responsible for not hinting that a file may be protected).
I suppose one could view denied files as "hidden", but given the trait's existence, I think that would still be considered a security issue. (I also think the directory listing logic in server could use some refactoring since it could still expose these kinds of files in listings and/or warning messages - as well as the fact that EACCES terminates the listing.)
It seems that in
is_file_hidden_posix()
an exception is raised if it comes across a symlink where the target path is not accesssible to the user (PermissionError). This has the effect of stopping the file contents manager from displaying the contents of a directory containing such links in JupyterLab 3.Right now if
os.stat()
raiseserrno.ENOENT
then the function returnsFalse
. I find that if I allow the function to similarly returnFalse
ifos.stat()
raiseserrno.EACCES
, then the file listing works.Is this an actual bug (and fix) and if so maybe does it need to be applied in the non-posix function as well?
The text was updated successfully, but these errors were encountered: