diff options
author | Sebastian Lackner | 2019-01-14 02:45:21 +0100 |
---|---|---|
committer | rfjakob | 2019-01-14 21:27:28 +0100 |
commit | 0345cc08307c01da635ea5546952a584480c9a93 (patch) | |
tree | f5f6071c1d303e8eb1506c74f5f318768f5f9430 /internal/syscallcompat/sys_darwin.go | |
parent | 229a9da74bc0839e2cd481f701c877708b080ede (diff) |
syscallcompat: Drop Fchmodat emulation on macOS.
On macOS the function has a flags argument, so we don't need the
/proc/self/fd trick used on Linux.
Diffstat (limited to 'internal/syscallcompat/sys_darwin.go')
-rw-r--r-- | internal/syscallcompat/sys_darwin.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/internal/syscallcompat/sys_darwin.go b/internal/syscallcompat/sys_darwin.go index 92639cf..89d93e7 100644 --- a/internal/syscallcompat/sys_darwin.go +++ b/internal/syscallcompat/sys_darwin.go @@ -8,6 +8,8 @@ import ( "golang.org/x/sys/unix" "github.com/hanwen/go-fuse/fuse" + + "github.com/rfjakob/gocryptfs/internal/tlog" ) const ( @@ -92,7 +94,12 @@ func MknodatUser(dirfd int, path string, mode uint32, dev int, context *fuse.Con } func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { - return emulateFchmodat(dirfd, path, mode, flags) + // Why would we ever want to call this without AT_SYMLINK_NOFOLLOW? + if flags&unix.AT_SYMLINK_NOFOLLOW == 0 { + tlog.Warn.Printf("Fchmodat: adding missing AT_SYMLINK_NOFOLLOW flag") + flags |= unix.AT_SYMLINK_NOFOLLOW + } + return unix.Fchmodat(dirfd, path, mode, flags) } func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { |