Skip to content

setxattr callback receives empty EA name parameter #1134

@rdmark

Description

@rdmark

I'm working on making the afpfs-ng FUSE client to work nicely with the latest macFUSE, but am running into some challenges with setxattr:

The setxattr operation in FUSE filesystem implementations receives an empty string for the name parameter when called via macOS's xattr command or cp with extended attributes.

Is this a known limitation with macFUSE, or is it something that ought to work?

Env

macOS 26.1
macFUSE 5.1.2

Reproduction

Implement a FUSE filesystem with setxattr callback using standard FUSE 3.x API:

#ifdef __APPLE__
static int fuse_setxattr(const char *path, const char *name,
                         const char *value, size_t size, int flags,
                         uint32_t position)
#else
static int fuse_setxattr(const char *path, const char *name,
                         const char *value, size_t size, int flags)
#endif

Register the callback in fuse_operations:

static struct fuse_operations ops = {
    .setxattr = fuse_setxattr,
    // ... other ops
};

Then mount the filesystem and attempt to set an extended attribute:

xattr -w testattr testvalue /path/to/mounted/file

Expected Behavior: The name parameter should contain the EA name (e.g., "testattr"), and value should point to the EA value (e.g., "testvalue").

Actual Behavior:

  • name parameter is an empty string (strlen(name) == 0)
  • name pointer is valid but points to a null-terminated empty string
  • value pointer is positioned exactly 1 byte after the name pointer (e.g., if name=0x63b403fe0, then value=0x63b403fe1)
  • The EA name appears to be completely missing from the call

From afpfs-ng debug logs

*** fuse_setxattr called: path=0x7aac14000 name=0xc7a003fe0 value=0xc7a003fe1 size=7 flags=0x0
*** fuse_setxattr name='' (len=0)
*** fuse_setxattr value first bytes: 00 00 00 00 00 00 00

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions