summaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorJakob Unterwurzacher2018-05-15 23:00:47 +0200
committerJakob Unterwurzacher2018-05-15 23:00:47 +0200
commit7b0068180772b9dd7e0b00ca9e1b0f3ce39c9c23 (patch)
tree61d774de8b89e2183dacc78bf3f7e258714dcd9a /internal
parentf7a6f4d46858dcd049bcf671509bdf42e5d26d09 (diff)
xattr: return EOPNOTSUPP for unsupported attributes
mv is unhappy when we return EPERM when it tries to set system.posix_acl_access: mv: preserving permissions for ‘b/x’: Operation not permitted Now we return EOPNOTSUPP like tmpfs does and mv seems happy.
Diffstat (limited to 'internal')
-rw-r--r--internal/fusefrontend/xattr.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/internal/fusefrontend/xattr.go b/internal/fusefrontend/xattr.go
index ac4b15f..813f286 100644
--- a/internal/fusefrontend/xattr.go
+++ b/internal/fusefrontend/xattr.go
@@ -48,13 +48,15 @@ func (fs *FS) GetXAttr(path string, attr string, context *fuse.Context) ([]byte,
return data, fuse.OK
}
+const _EOPNOTSUPP = fuse.Status(syscall.EOPNOTSUPP)
+
// SetXAttr implements pathfs.Filesystem.
func (fs *FS) SetXAttr(path string, attr string, data []byte, flags int, context *fuse.Context) fuse.Status {
if fs.isFiltered(path) {
return fuse.EPERM
}
if disallowedXAttrName(attr) {
- return fuse.EPERM
+ return _EOPNOTSUPP
}
flags = filterXattrSetFlags(flags)
@@ -74,7 +76,7 @@ func (fs *FS) RemoveXAttr(path string, attr string, context *fuse.Context) fuse.
return fuse.EPERM
}
if disallowedXAttrName(attr) {
- return fuse.EPERM
+ return _EOPNOTSUPP
}
cPath, err := fs.getBackingPath(path)
if err != nil {