mirror of
https://github.com/restic/restic.git
synced 2026-11-21 21:12:42 +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:
1 parent
f8031561f2
commit
b402e8a6fc
4 files changed
+33
-2
No files matched your search
@@ -7,3 +7,6 @@ import "syscall"
|
||||
|
||||
// O_NOFOLLOW instructs the kernel to not follow symlinks when opening a file.
|
||||
const O_NOFOLLOW int = syscall.O_NOFOLLOW
|
||||
|
||||
// O_DIRECTORY instructs the kernel to only open directories.
|
||||
const O_DIRECTORY int = syscall.O_DIRECTORY
|
||||
Reference in new issue
Block a user