aboutsummaryrefslogtreecommitdiff
path: root/internal/fusefrontend
diff options
context:
space:
mode:
authorJakob Unterwurzacher2019-01-20 13:10:59 +0100
committerJakob Unterwurzacher2019-01-20 13:10:59 +0100
commit3d6b2685fb926b40b4eb528a8cbdc3871444d492 (patch)
tree8617e715beb8695248ccaac14b76cd6eb5ca756d /internal/fusefrontend
parent0805a63df1b5f915b228727f6074c2506922d0ad (diff)
Revert "syscallcompat: drop Faccessat AT_SYMLINK_NOFOLLOW helper"
Breaks mounting on MacOS: unix.Faccessat on Darwin does NOT (yet) support AT_SYMLINK_NOFOLLOW. See d44fe89ba4f3252c5bd00c4f7730197732f2a26a . This reverts commit 0805a63df1b5f915b228727f6074c2506922d0ad.
Diffstat (limited to 'internal/fusefrontend')
-rw-r--r--internal/fusefrontend/fs.go2
-rw-r--r--internal/fusefrontend/openbackingdir_test.go19
2 files changed, 11 insertions, 10 deletions
diff --git a/internal/fusefrontend/fs.go b/internal/fusefrontend/fs.go
index decd13f..096e663 100644
--- a/internal/fusefrontend/fs.go
+++ b/internal/fusefrontend/fs.go
@@ -626,7 +626,7 @@ func (fs *FS) Access(relPath string, mode uint32, context *fuse.Context) (code f
if err != nil {
return fuse.ToStatus(err)
}
- err = unix.Faccessat(dirfd, cName, mode, unix.AT_SYMLINK_NOFOLLOW)
+ err = syscallcompat.Faccessat(dirfd, cName, mode)
syscall.Close(dirfd)
return fuse.ToStatus(err)
}
diff --git a/internal/fusefrontend/openbackingdir_test.go b/internal/fusefrontend/openbackingdir_test.go
index 9c2358e..82cc74d 100644
--- a/internal/fusefrontend/openbackingdir_test.go
+++ b/internal/fusefrontend/openbackingdir_test.go
@@ -7,6 +7,7 @@ import (
"golang.org/x/sys/unix"
+ "github.com/rfjakob/gocryptfs/internal/syscallcompat"
"github.com/rfjakob/gocryptfs/tests/test_helpers"
)
@@ -45,11 +46,11 @@ func TestOpenBackingDir(t *testing.T) {
t.Fatal("cName should be .")
}
- err = unix.Faccessat(dirfd, cName, unix.R_OK, unix.AT_SYMLINK_NOFOLLOW)
+ err = syscallcompat.Faccessat(dirfd, cName, unix.R_OK)
if err != nil {
t.Error(err)
}
- err = unix.Faccessat(dirfd, ".", unix.R_OK, unix.AT_SYMLINK_NOFOLLOW)
+ err = syscallcompat.Faccessat(dirfd, ".", unix.R_OK)
if err != nil {
t.Error(err)
}
@@ -62,7 +63,7 @@ func TestOpenBackingDir(t *testing.T) {
if cName == "" {
t.Fatal("cName should not be empty")
}
- err = unix.Faccessat(dirfd, cName, unix.R_OK, unix.AT_SYMLINK_NOFOLLOW)
+ err = syscallcompat.Faccessat(dirfd, cName, unix.R_OK)
if err != nil {
t.Error(err)
}
@@ -75,7 +76,7 @@ func TestOpenBackingDir(t *testing.T) {
if cName == "" {
t.Fatal("cName should not be empty")
}
- err = unix.Faccessat(dirfd, cName, unix.R_OK, unix.AT_SYMLINK_NOFOLLOW)
+ err = syscallcompat.Faccessat(dirfd, cName, unix.R_OK)
if err != nil {
t.Error(err)
}
@@ -94,7 +95,7 @@ func TestOpenBackingDir(t *testing.T) {
if len(cName) >= 255 {
t.Fatalf("cName is too long: %q", cName)
}
- err = unix.Faccessat(dirfd, cName, unix.R_OK, unix.AT_SYMLINK_NOFOLLOW)
+ err = syscallcompat.Faccessat(dirfd, cName, unix.R_OK)
if err != nil {
t.Error(err)
}
@@ -125,11 +126,11 @@ func TestOpenBackingDirPlaintextNames(t *testing.T) {
if cName != "." {
t.Fatal("cName should be .")
}
- err = unix.Faccessat(dirfd, cName, unix.R_OK, unix.AT_SYMLINK_NOFOLLOW)
+ err = syscallcompat.Faccessat(dirfd, cName, unix.R_OK)
if err != nil {
t.Error(err)
}
- err = unix.Faccessat(dirfd, ".", unix.R_OK, unix.AT_SYMLINK_NOFOLLOW)
+ err = syscallcompat.Faccessat(dirfd, ".", unix.R_OK)
if err != nil {
t.Error(err)
}
@@ -142,7 +143,7 @@ func TestOpenBackingDirPlaintextNames(t *testing.T) {
if cName != "dir1" {
t.Fatalf("wrong cName: %q", cName)
}
- err = unix.Faccessat(dirfd, cName, unix.R_OK, unix.AT_SYMLINK_NOFOLLOW)
+ err = syscallcompat.Faccessat(dirfd, cName, unix.R_OK)
if err != nil {
t.Error(err)
}
@@ -155,7 +156,7 @@ func TestOpenBackingDirPlaintextNames(t *testing.T) {
if cName != "dir2" {
t.Fatalf("wrong cName: %q", cName)
}
- err = unix.Faccessat(dirfd, cName, unix.R_OK, unix.AT_SYMLINK_NOFOLLOW)
+ err = syscallcompat.Faccessat(dirfd, cName, unix.R_OK)
if err != nil {
t.Error(err)
}