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
Problem Description:
The current implementation of the TsWrite/TsRead case in the code does not correctly determine if a directory is writable/readable.
Specifically, the following snippet:
will fail when x refers to a directory because opening a directory with the os.O_WRONLY flag is not a valid operation. Consequently, the function will always return false for directories, even if they are writable.
The text was updated successfully, but these errors were encountered:
ic-it
changed the title
Incorrect way to handle directory Read/Write access check
Incorrect way to handle directory Read/Write access check in test command
Dec 30, 2024
ic-it
changed the title
Incorrect way to handle directory Read/Write access check in test command
Incorrect way to handle directory read/write access checks in the test command
Dec 30, 2024
We already have some OS-dependent logic via os_unix.go and os_notunix.go. It would be perfectly fine to extend this to perform better on unix as you suggest; we would just need tests to cover the edge case above.
Problem Description:
The current implementation of the
TsWrite
/TsRead
case in the code does not correctly determine if a directory is writable/readable.Specifically, the following snippet:
sh/interp/test.go
Lines 158 to 163 in 86363cf
will fail when
x
refers to a directory because opening a directory with theos.O_WRONLY
flag is not a valid operation. Consequently, the function will always return false for directories, even if they are writable.The text was updated successfully, but these errors were encountered: