summaryrefslogtreecommitdiff
path: root/internal/fusefrontend/xattr_darwin.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/fusefrontend/xattr_darwin.go')
-rw-r--r--internal/fusefrontend/xattr_darwin.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/internal/fusefrontend/xattr_darwin.go b/internal/fusefrontend/xattr_darwin.go
index f0b755f..ad81320 100644
--- a/internal/fusefrontend/xattr_darwin.go
+++ b/internal/fusefrontend/xattr_darwin.go
@@ -53,3 +53,17 @@ func (fs *FS) removeXAttr(relPath string, cAttr string, context *fuse.Context) f
err = xattr.LRemove(cPath, cAttr)
return unpackXattrErr(err)
}
+
+// This function is NOT symlink-safe because Darwin lacks
+// both flistxattr() and /proc/self/fd.
+func (fs *FS) listXAttr(relPath string, context *fuse.Context) ([]string, fuse.Status) {
+ cPath, err := fs.getBackingPath(relPath)
+ if err != nil {
+ return nil, fuse.ToStatus(err)
+ }
+ cNames, err := xattr.LList(cPath)
+ if err != nil {
+ return nil, unpackXattrErr(err)
+ }
+ return cNames, fuse.OK
+}