summaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorSebastian Lackner2019-01-03 18:11:07 +0100
committerrfjakob2019-01-03 18:24:05 +0100
commita1ba4b6576695a3e680364813425ffd9c9c7c148 (patch)
treea48631b16f47d006178f97770816569948e01319 /internal
parent0414ef2572c3c07aa2a1b6dbb18a276a876c985a (diff)
Omit syscall.O_RDONLY flag when passing O_PATH.
When O_PATH is specified in flags, flag bits other than O_CLOEXEC, O_DIRECTORY, and O_NOFOLLOW are ignored.
Diffstat (limited to 'internal')
-rw-r--r--internal/fusefrontend/openbackingdir.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/fusefrontend/openbackingdir.go b/internal/fusefrontend/openbackingdir.go
index d56848f..1cca81b 100644
--- a/internal/fusefrontend/openbackingdir.go
+++ b/internal/fusefrontend/openbackingdir.go
@@ -42,7 +42,7 @@ func (fs *FS) openBackingDir(relPath string) (dirfd int, cName string, err error
return dirfd, cName, nil
}
// Open cipherdir (following symlinks)
- dirfd, err = syscall.Open(fs.args.Cipherdir, syscall.O_RDONLY|syscall.O_DIRECTORY|syscallcompat.O_PATH, 0)
+ dirfd, err = syscall.Open(fs.args.Cipherdir, syscall.O_DIRECTORY|syscallcompat.O_PATH, 0)
if err != nil {
return -1, "", err
}
@@ -65,7 +65,7 @@ func (fs *FS) openBackingDir(relPath string) (dirfd int, cName string, err error
break
}
// Not the last part? Descend into next directory.
- dirfd2, err := syscallcompat.Openat(dirfd, cName, syscall.O_RDONLY|syscall.O_NOFOLLOW|syscall.O_DIRECTORY|syscallcompat.O_PATH, 0)
+ dirfd2, err := syscallcompat.Openat(dirfd, cName, syscall.O_NOFOLLOW|syscall.O_DIRECTORY|syscallcompat.O_PATH, 0)
syscall.Close(dirfd)
if err != nil {
return -1, "", err