aboutsummaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorJakob Unterwurzacher2026-02-10 21:02:03 +0100
committerJakob Unterwurzacher2026-02-10 21:02:03 +0100
commitab4c0446d3db0665fc2e9a05c0319541d21811eb (patch)
treef886270d8b03b02ae36f0d79c2b6f8514f7354f4 /internal
parent8936a544a062d8ba56e050d45f30fc2d3b9d9d09 (diff)
reverse: return ENOTTR when xattr name is not decryptable
Diffstat (limited to 'internal')
-rw-r--r--internal/fusefrontend_reverse/node_xattr.go2
-rw-r--r--internal/syscallcompat/sys_common.go2
2 files changed, 3 insertions, 1 deletions
diff --git a/internal/fusefrontend_reverse/node_xattr.go b/internal/fusefrontend_reverse/node_xattr.go
index f22764a..b940339 100644
--- a/internal/fusefrontend_reverse/node_xattr.go
+++ b/internal/fusefrontend_reverse/node_xattr.go
@@ -40,7 +40,7 @@ func (n *Node) Getxattr(ctx context.Context, attr string, dest []byte) (uint32,
} else {
pAttr, err := rn.decryptXattrName(attr)
if err != nil {
- return 0, syscall.EINVAL
+ return 0, noSuchAttributeError
}
pData, errno := n.getXAttr(pAttr)
if errno != 0 {
diff --git a/internal/syscallcompat/sys_common.go b/internal/syscallcompat/sys_common.go
index 3cb9ffa..dfe5f22 100644
--- a/internal/syscallcompat/sys_common.go
+++ b/internal/syscallcompat/sys_common.go
@@ -2,6 +2,7 @@ package syscallcompat
import (
"bytes"
+ "fmt"
"syscall"
"golang.org/x/sys/unix"
@@ -128,6 +129,7 @@ func Fgetxattr(fd int, attr string) (val []byte, err error) {
// Lgetxattr is a wrapper around unix.Lgetxattr that handles the buffer sizing.
func Lgetxattr(path string, attr string) (val []byte, err error) {
fn := func(buf []byte) (int, error) {
+ fmt.Printf("Lgetxattr(%q, %q, buf %d)\n", path, attr, len(buf))
return unix.Lgetxattr(path, attr, buf)
}
return getxattrSmartBuf(fn)