]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
misc: define XATTR_{CREATE,REMOVE} if necessary
authorTheodore Ts'o <tytso@mit.edu>
Wed, 4 Jun 2025 20:29:49 +0000 (20:29 +0000)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 4 Jun 2025 20:29:49 +0000 (20:29 +0000)
This fixes a FreeBSD portability issue in fuse2fs.

Fixes: 5c7fec6121e6 ("fuse2fs: support XATTR_CREATE/REPLACE in setxattr")
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
misc/fuse2fs.c

index 19d43af37459ca954ec79a043dddf369d84ca033..ad4795ae4ed907fd1ebd033a5d3668e91f2c78bc 100644 (file)
 #define XATTR_SECURITY_PREFIX_LEN (sizeof (XATTR_SECURITY_PREFIX) - 1)
 #endif
 
+/*
+ * Linux and MacOS implement the setxattr(2) interface, which defines
+ * XATTR_CREATE and XATTR_REPLACE.  However, FreeBSD uses
+ * extattr_set_file(2), which does not have a flags or options
+ * parameter, and does not define XATTR_CREATE and XATTR_REPLACE.
+ */
+#ifndef XATTR_CREATE
+#define XATTR_CREATE 0
+#endif
+
+#ifndef XATTR_REPLACE
+#define XATTR_REPLACE 0
+#endif
+
 #if !defined(EUCLEAN)
 #if !defined(EBADMSG)
 #define EUCLEAN EBADMSG