From 63a2ed92b417b002c98c766505dcf6b89b43dafb Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 22 Apr 2025 11:28:44 +0100 Subject: [PATCH] fuse: Ignore extra options parameter on macOS macOS macfuse has an extra options parameter for the setxattr and getxattr FUSE callbacks. The possible options are documented below. However the underlying libguestfs APIs don't allow us to act on these flags, so we ignore them for now. (from https://manp.gs/mac/2/setxattr) XATTR_NOFOLLOW do not follow symbolic links. setxattr() normally sets attributes on the target of path if it is a symbolic link. With this option, setxattr() will act on the link itself. XATTR_NOFOLLOW_ANY do not follow any symbolic links encountered during pathname resolution. An error is returned if a symlink is encountered before the last component of path. XATTR_CREATE fail if the named attribute already exists. XATTR_REPLACE fail if the named attribute does not exist. Failure to specify XATTR_REPLACE or XATTR_CREATE allows creation and replacement. Reported-by: Mohamed Akram Fixes: https://github.com/libguestfs/libguestfs/issues/180 Related: https://github.com/macfuse/macfuse/issues/1065 --- lib/fuse.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/fuse.c b/lib/fuse.c index aaf740a96..dfab23c4c 100644 --- a/lib/fuse.c +++ b/lib/fuse.c @@ -753,7 +753,11 @@ mount_local_fsync (const char *path, int isdatasync, static int mount_local_setxattr (const char *path, const char *name, const char *value, - size_t size, int flags) + size_t size, int flags +#ifdef __APPLE__ + , uint32_t extra_apple_options_ignored +#endif + ) { int r; DECL_G (); @@ -777,7 +781,11 @@ mount_local_setxattr (const char *path, const char *name, const char *value, */ static int mount_local_getxattr (const char *path, const char *name, char *value, - size_t size) + size_t size +#ifdef __APPLE__ + , uint32_t extra_apple_options_ignored +#endif + ) { const struct guestfs_xattr_list *xattrs; int free_attrs = 0;