From: Lennart Poettering Date: Fri, 22 Aug 2025 09:04:56 +0000 (+0200) Subject: acl-util: add new acl_set_perm() helper X-Git-Tag: v259-rc1~174^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f89c9149684fec4a52268bddff48ea4e37bab049;p=thirdparty%2Fsystemd.git acl-util: add new acl_set_perm() helper --- diff --git a/src/shared/acl-util.h b/src/shared/acl-util.h index a15790b94d2..ea4aca7bdbe 100644 --- a/src/shared/acl-util.h +++ b/src/shared/acl-util.h @@ -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