summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Unterwurzacher2018-11-04 22:35:17 +0100
committerJakob Unterwurzacher2019-01-01 16:24:25 +0100
commitabbdaa8ea4ca28b50304170986f0b6a271cda341 (patch)
treefb550417533bcbd9b8480ce9de1a0ce00be96adc
parentd4b7f42c3bb734aec207d10f4addf56e0b59fee2 (diff)
fusefrontend: fix compile failure on Darwin
Failure was: + GOOS=darwin + GOARCH=amd64 + go build -tags without_openssl # github.com/rfjakob/gocryptfs/internal/fusefrontend internal/fusefrontend/fs_dir.go:159:60: cannot use origMode | 448 (type uint16) as type uint32 in argument to syscallcompat.Fchmodat internal/fusefrontend/fs_dir.go:170:33: cannot use origMode (type uint16) as type uint32 in argument to syscallcompat.Fchmodat
-rw-r--r--internal/fusefrontend/fs_dir.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/internal/fusefrontend/fs_dir.go b/internal/fusefrontend/fs_dir.go
index d4117fb..181ccb5 100644
--- a/internal/fusefrontend/fs_dir.go
+++ b/internal/fusefrontend/fs_dir.go
@@ -158,7 +158,8 @@ func (fs *FS) Rmdir(relPath string, context *fuse.Context) (code fuse.Status) {
tlog.Debug.Printf("Rmdir: Stat: %v", err)
return fuse.ToStatus(err)
}
- origMode := st.Mode & 0777
+ // This cast is needed on Darwin, where st.Mode is uint16.
+ origMode := uint32(st.Mode & 0777)
err = syscallcompat.Fchmodat(parentDirFd, cName, origMode|0700, unix.AT_SYMLINK_NOFOLLOW)
if err != nil {
tlog.Debug.Printf("Rmdir: Fchmodat failed: %v", err)