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 committed 2024-11-16 12:56:23 +01:00
1 parent f8031561f2
commit b402e8a6fc
4 files changed
+33 -2

No files matched your search

+5
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