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