fusefrontend: xattr: return ENOSYS on unsupported flags

We previously returned EPERM to prevent the kernel from
blacklisting our xattr support once we get an unsupported
flag, but this causes lots of trouble on MacOS:
Cannot save files from GUI apps, see
https://github.com/rfjakob/gocryptfs/issues/229

Returning ENOSYS triggers the dotfiles fallback on MacOS
and fixes the issue.
This commit is contained in:
Jakob Unterwurzacher 2018-05-01 23:30:53 +02:00
parent 996d2f141b
commit fe3890688a

View File

@ -55,7 +55,8 @@ func (fs *FS) SetXAttr(path string, attr string, data []byte, flags int, context
return fuse.EPERM
}
if flags != 0 {
return fuse.EPERM
// Drop this once https://github.com/pkg/xattr/pull/26 is merged
return fuse.ENOSYS
}
if disallowedXAttrName(attr) {
return fuse.EPERM