aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Lackner2019-01-03 17:53:22 +0100
committerrfjakob2019-01-03 18:24:05 +0100
commit078a431493aab05120790073290cacae4c17ca20 (patch)
tree5337d8dfd7d360aed747a424340e4886cd69fa8e
parent885a341df65f9a1f312e3b08576528583b649eee (diff)
fusefrontend: Open directory with syscall.O_DIRECTORY in Rmdir.
-rw-r--r--internal/fusefrontend/fs_dir.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/fusefrontend/fs_dir.go b/internal/fusefrontend/fs_dir.go
index 320e49f..71f86fa 100644
--- a/internal/fusefrontend/fs_dir.go
+++ b/internal/fusefrontend/fs_dir.go
@@ -153,7 +153,7 @@ func (fs *FS) Rmdir(relPath string, context *fuse.Context) (code fuse.Status) {
return fuse.ToStatus(err)
}
dirfd, err := syscallcompat.Openat(parentDirFd, cName,
- syscall.O_RDONLY|syscall.O_NOFOLLOW, 0)
+ syscall.O_RDONLY|syscall.O_DIRECTORY|syscall.O_NOFOLLOW, 0)
if err == syscall.EACCES {
// We need permission to read and modify the directory
tlog.Debug.Printf("Rmdir: handling EACCESS")
@@ -172,7 +172,7 @@ func (fs *FS) Rmdir(relPath string, context *fuse.Context) (code fuse.Status) {
}
// Retry open
dirfd, err = syscallcompat.Openat(parentDirFd, cName,
- syscall.O_RDONLY|syscall.O_NOFOLLOW, 0)
+ syscall.O_RDONLY|syscall.O_DIRECTORY|syscall.O_NOFOLLOW, 0)
// Undo the chmod if removing the directory failed
defer func() {
if code != fuse.OK {