]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
acl-util: add new acl_set_perm() helper
authorLennart Poettering <lennart@poettering.net>
Fri, 22 Aug 2025 09:04:56 +0000 (11:04 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 4 Nov 2025 13:12:39 +0000 (14:12 +0100)
src/shared/acl-util.h

index a15790b94d288ffb2b94c113f74018c8ad1856ab..ea4aca7bdbe74f8ace6094bbb7872c495f667177 100644 (file)
@@ -62,6 +62,10 @@ DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(char*, sym_acl_free, acl_free_charpp, NU
 DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(uid_t*, sym_acl_free, acl_free_uid_tpp, NULL);
 DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(gid_t*, sym_acl_free, acl_free_gid_tpp, NULL);
 
+static inline int acl_set_perm(acl_permset_t ps, acl_perm_t p, bool b) {
+        return (b ? sym_acl_add_perm : sym_acl_delete_perm)(ps, p);
+}
+
 #else
 
 #define ACL_READ    0x04