From 8bb96d322bd08fc0890602494b8a1c417200b20b Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Thu, 19 Mar 2020 01:54:41 +0100 Subject: Fix xattr scanning on Mac OS X Mac OS X does not have llistxattr or lgetxattr. Instead, the listxattr and getxattr functions have additional an flag parameter that can be set to not follow symlinks. This commit adds a pre-processor define on OS X as a work around. Signed-off-by: David Oberhollenzer --- mkfs/mkfs.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mkfs/mkfs.h b/mkfs/mkfs.h index 21e1715..1b767aa 100644 --- a/mkfs/mkfs.h +++ b/mkfs/mkfs.h @@ -14,6 +14,14 @@ #ifdef HAVE_SYS_XATTR_H #include + +#if defined(__APPLE__) && defined(__MACH__) +#define llistxattr(path, list, size) \ + listxattr(path, list, size, XATTR_NOFOLLOW) + +#define lgetxattr(path, name, value, size) \ + getxattr(path, name, value, size, 0, XATTR_NOFOLLOW) +#endif #endif #ifdef WITH_SELINUX -- cgit v1.2.3