| author | |
| committer | |
| log | fe6fd0d5412bdef86cf200d664b37e05a3050966 |
| tree | 7b42068b5a5ff8d93e949cca2dbfc535cefbe4ee |
| parent | 433709a78864cf65e1686d3178a05605e4c61c66 |
Can occur when trying to open a directory for iteration but the 'List folder contents' permission of the directory is set to 'Deny'.
This was found because it was being triggered during PATH searching in ChildProcess.spawnWindows if a PATH entry did not have 'List folder contents' permission, so this fixes that as well (note: the behavior on hitting this during PATH searching is to treat it as the directory not existing and therefore will fail to find any executables in a directory in the PATH without 'List folder contents' permission; this matches Windows behavior which also fails to find commands in directories that do not have 'List folder contents' permission).1 files changed, 3 insertions(+), 0 deletions(-)
lib/std/fs.zig+3| ... | ... | @@ -1822,6 +1822,9 @@ pub const Dir = struct { |
| 1822 | 1822 | .OBJECT_NAME_NOT_FOUND => return error.FileNotFound, |
| 1823 | 1823 | .OBJECT_PATH_NOT_FOUND => return error.FileNotFound, |
| 1824 | 1824 | .NOT_A_DIRECTORY => return error.NotDir, |
| 1825 | // This can happen if the directory has 'List folder contents' permission set to 'Deny' | |
| 1826 | // and the directory is trying to be opened for iteration. | |
| 1827 | .ACCESS_DENIED => return error.AccessDenied, | |
| 1825 | 1828 | .INVALID_PARAMETER => unreachable, |
| 1826 | 1829 | else => return w.unexpectedStatus(rc), |
| 1827 | 1830 | } |