]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/shared/acl-util.h
Merge pull request #2495 from heftig/master
[thirdparty/systemd.git] / src / shared / acl-util.h
CommitLineData
c2f1db8f 1#pragma once
f4b47811
LP
2
3/***
4 This file is part of systemd.
5
6 Copyright 2011 Lennart Poettering
7
8 systemd is free software; you can redistribute it and/or modify it
5430f7f2
LP
9 under the terms of the GNU Lesser General Public License as published by
10 the Free Software Foundation; either version 2.1 of the License, or
f4b47811
LP
11 (at your option) any later version.
12
13 systemd is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5430f7f2 16 Lesser General Public License for more details.
f4b47811 17
5430f7f2 18 You should have received a copy of the GNU Lesser General Public License
f4b47811
LP
19 along with systemd; If not, see <http://www.gnu.org/licenses/>.
20***/
21
f8eeeaf9
ZJS
22#ifdef HAVE_ACL
23
71d35b6b 24#include <acl/libacl.h>
478c8269 25#include <stdbool.h>
f8eeeaf9 26#include <sys/acl.h>
f8eeeaf9
ZJS
27
28#include "macro.h"
478c8269 29
f4b47811 30int acl_find_uid(acl_t acl, uid_t uid, acl_entry_t *entry);
23ad4dd8 31int calc_acl_mask_if_needed(acl_t *acl_p);
dd4105b0 32int add_base_acls_if_needed(acl_t *acl_p, const char *path);
e346512c 33int acl_search_groups(const char* path, char ***ret_groups);
e738c945 34int parse_acl(const char *text, acl_t *acl_access, acl_t *acl_default, bool want_mask);
50d9e46d 35int acls_for_file(const char *path, acl_type_t type, acl_t new, acl_t *acl);
5c3bde3f 36int add_acls_for_user(int fd, uid_t uid);
34c10968 37
f8eeeaf9
ZJS
38/* acl_free takes multiple argument types.
39 * Multiple cleanup functions are necessary. */
40DEFINE_TRIVIAL_CLEANUP_FUNC(acl_t, acl_free);
41#define acl_free_charp acl_free
42DEFINE_TRIVIAL_CLEANUP_FUNC(char*, acl_free_charp);
1c73f3bc
ZJS
43#define acl_free_uid_tp acl_free
44DEFINE_TRIVIAL_CLEANUP_FUNC(uid_t*, acl_free_uid_tp);
45#define acl_free_gid_tp acl_free
46DEFINE_TRIVIAL_CLEANUP_FUNC(gid_t*, acl_free_gid_tp);
34c10968 47
f8eeeaf9 48#endif