summaryrefslogtreecommitdiff
path: root/internal/syscallcompat/open_nofollow.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2018-09-08 18:06:33 +0200
committerJakob Unterwurzacher2018-09-08 18:06:33 +0200
commit930c37e03d5ff80e7cdc9f0ca2cd35d80a06d5c0 (patch)
tree7294ff75cc9ebbc78c5d6fe57c20ca7e69d515d5 /internal/syscallcompat/open_nofollow.go
parent9ec9d0c49cfbdc9ceba10d7534b77e527c0a3cdc (diff)
syscallcompat: use O_PATH in OpenDirNofollow
This fixes the "0100 directory" problem in reverse mode, and should be slightly faster.
Diffstat (limited to 'internal/syscallcompat/open_nofollow.go')
-rw-r--r--internal/syscallcompat/open_nofollow.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/syscallcompat/open_nofollow.go b/internal/syscallcompat/open_nofollow.go
index d440fc3..3953a27 100644
--- a/internal/syscallcompat/open_nofollow.go
+++ b/internal/syscallcompat/open_nofollow.go
@@ -36,7 +36,7 @@ func OpenDirNofollow(baseDir string, relPath string) (fd int, err error) {
// Walk the directory tree
var dirfd2 int
for _, name := range parts {
- dirfd2, err = Openat(dirfd, name, syscall.O_RDONLY|syscall.O_NOFOLLOW|syscall.O_DIRECTORY, 0)
+ dirfd2, err = Openat(dirfd, name, syscall.O_RDONLY|syscall.O_NOFOLLOW|syscall.O_DIRECTORY|O_PATH, 0)
syscall.Close(dirfd)
if err != nil {
return -1, err