summaryrefslogtreecommitdiff
path: root/internal/fusefrontend/fs.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2018-09-22 21:10:54 +0200
committerJakob Unterwurzacher2018-09-23 12:17:59 +0200
commite4f1a32a9a109805107fc0655006f2eedf75c52c (patch)
tree982203b2a29f961334e10d245c099dfc8fce8366 /internal/fusefrontend/fs.go
parenta1fb4566186ec38ec2b21b936f29df669efbfe4f (diff)
fusefrontend: Fix uint16 build failure on Darwin
Error was: # github.com/rfjakob/gocryptfs/internal/fusefrontend internal/fusefrontend/fs.go:179: cannot use perms | 256 (type uint16) as type uint32 in argument to syscall.Fchmod internal/fusefrontend/fs.go:185: cannot use perms (type uint16) as type uint32 in argument to syscall.Fchmod
Diffstat (limited to 'internal/fusefrontend/fs.go')
-rw-r--r--internal/fusefrontend/fs.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/internal/fusefrontend/fs.go b/internal/fusefrontend/fs.go
index 557393b..1b6941e 100644
--- a/internal/fusefrontend/fs.go
+++ b/internal/fusefrontend/fs.go
@@ -162,7 +162,8 @@ func (fs *FS) openWriteOnlyFile(dirfd int, cName string, newFlags int) (fuseFile
if err != nil {
return nil, fuse.ToStatus(err)
}
- perms := st.Mode & 0777
+ // The cast to uint32 fixes a build failure on Darwin, where st.Mode is uint16.
+ perms := uint32(st.Mode & 0777)
// Verify that we don't have read permissions
if perms&0400 != 0 {
tlog.Warn.Printf("openWriteOnlyFile: unexpected permissions %#o, returning EPERM", perms)