summaryrefslogtreecommitdiff
path: root/internal/fusefrontend/node_xattr.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/fusefrontend/node_xattr.go')
-rw-r--r--internal/fusefrontend/node_xattr.go16
1 files changed, 12 insertions, 4 deletions
diff --git a/internal/fusefrontend/node_xattr.go b/internal/fusefrontend/node_xattr.go
index 3855b55..925dcbf 100644
--- a/internal/fusefrontend/node_xattr.go
+++ b/internal/fusefrontend/node_xattr.go
@@ -56,12 +56,14 @@ func (n *Node) Getxattr(ctx context.Context, attr string, dest []byte) (uint32,
}
} else {
// encrypted user xattr
- cAttr := rn.encryptXattrName(attr)
+ cAttr, err := rn.encryptXattrName(attr)
+ if err != nil {
+ return minus1, syscall.EIO
+ }
cData, errno := n.getXAttr(cAttr)
if errno != 0 {
return 0, errno
}
- var err error
data, err = rn.decryptXattrValue(cData)
if err != nil {
tlog.Warn.Printf("GetXAttr: %v", err)
@@ -91,7 +93,10 @@ func (n *Node) Setxattr(ctx context.Context, attr string, data []byte, flags uin
return n.setXAttr(attr, data, flags)
}
- cAttr := rn.encryptXattrName(attr)
+ cAttr, err := rn.encryptXattrName(attr)
+ if err != nil {
+ return syscall.EINVAL
+ }
cData := rn.encryptXattrValue(data)
return n.setXAttr(cAttr, cData, flags)
}
@@ -107,7 +112,10 @@ func (n *Node) Removexattr(ctx context.Context, attr string) syscall.Errno {
return n.removeXAttr(attr)
}
- cAttr := rn.encryptXattrName(attr)
+ cAttr, err := rn.encryptXattrName(attr)
+ if err != nil {
+ return syscall.EINVAL
+ }
return n.removeXAttr(cAttr)
}