diff options
Diffstat (limited to 'internal/fusefrontend/file.go')
-rw-r--r-- | internal/fusefrontend/file.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/internal/fusefrontend/file.go b/internal/fusefrontend/file.go index 780a792..546526b 100644 --- a/internal/fusefrontend/file.go +++ b/internal/fusefrontend/file.go @@ -459,7 +459,10 @@ func (f *file) Chmod(mode uint32) fuse.Status { f.fdLock.RLock() defer f.fdLock.RUnlock() - return fuse.ToStatus(f.fd.Chmod(os.FileMode(mode))) + // os.File.Chmod goes through the "syscallMode" translation function that messes + // up the suid and sgid bits. So use syscall.Fchmod directly. + err := syscall.Fchmod(f.intFd(), mode) + return fuse.ToStatus(err) } func (f *file) Chown(uid uint32, gid uint32) fuse.Status { |