chiark / gitweb /
tree-wide: remove Lennart's copyright lines
[elogind.git] / src / shared / acl-util.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 #pragma once
3
4 #if HAVE_ACL
5
6 #include <acl/libacl.h>
7 #include <stdbool.h>
8 #include <sys/acl.h>
9
10 #include "macro.h"
11
12 int acl_find_uid(acl_t acl, uid_t uid, acl_entry_t *entry);
13 #if 0 /// UNNEEDED by elogind
14 int calc_acl_mask_if_needed(acl_t *acl_p);
15 int add_base_acls_if_needed(acl_t *acl_p, const char *path);
16 int acl_search_groups(const char* path, char ***ret_groups);
17 int parse_acl(const char *text, acl_t *acl_access, acl_t *acl_default, bool want_mask);
18 int acls_for_file(const char *path, acl_type_t type, acl_t new, acl_t *acl);
19 int add_acls_for_user(int fd, uid_t uid);
20 #endif // 0
21
22 /* acl_free takes multiple argument types.
23  * Multiple cleanup functions are necessary. */
24 DEFINE_TRIVIAL_CLEANUP_FUNC(acl_t, acl_free);
25 #define acl_free_charp acl_free
26 DEFINE_TRIVIAL_CLEANUP_FUNC(char*, acl_free_charp);
27 #define acl_free_uid_tp acl_free
28 DEFINE_TRIVIAL_CLEANUP_FUNC(uid_t*, acl_free_uid_tp);
29 #define acl_free_gid_tp acl_free
30 DEFINE_TRIVIAL_CLEANUP_FUNC(gid_t*, acl_free_gid_tp);
31
32 #endif