diff --git a/src/basic/xattr-util.c b/src/basic/xattr-util.c index 1bde725d1a..cf53418ceb 100644 --- a/src/basic/xattr-util.c +++ b/src/basic/xattr-util.c @@ -477,3 +477,14 @@ int fd_setcrtime(int fd, usec_t usec) { "user.crtime_usec", (const char*) &le, sizeof(le), /* xattr_flags = */ 0); } + +bool xattr_is_acl(const char *name) { + return STR_IN_SET( + ASSERT_PTR(name), + "system.posix_acl_access", + "system.posix_acl_default"); +} + +bool xattr_is_selinux(const char *name) { + return streq(ASSERT_PTR(name), "security.selinux"); +} diff --git a/src/basic/xattr-util.h b/src/basic/xattr-util.h index cf68933bfe..f38ecf491d 100644 --- a/src/basic/xattr-util.h +++ b/src/basic/xattr-util.h @@ -54,3 +54,6 @@ int getcrtime_at(int fd, const char *path, int at_flags, usec_t *ret); static inline int fd_getcrtime(int fd, usec_t *ret) { return getcrtime_at(fd, NULL, 0, ret); } + +bool xattr_is_acl(const char *name); +bool xattr_is_selinux(const char *name);