mirror of
https://github.com/restic/restic.git
synced 2025-12-12 03:11:56 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user