mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 08:25:20 +09:00
xattr: add helper that detect special purpose xattrs
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user