fs: stricter enforcement to only call readdir on a directory

Use O_DIRECTORY to prevent opening any other than a directory in
readdirnames.
This commit is contained in:
Michael Eischer
2024-11-02 17:44:55 +01:00
parent f8031561f2
commit b402e8a6fc
4 changed files with 33 additions and 2 deletions

View File

@@ -3,5 +3,10 @@
package fs
// TODO honor flags when opening files
// O_NOFOLLOW is a noop on Windows.
const O_NOFOLLOW int = 0
// O_DIRECTORY is a noop on Windows.
const O_DIRECTORY int = 0