2017-11-18 17:09:20 +01:00
|
|
|
/* SPDX-License-Identifier: LGPL-2.1+ */
|
2012-07-18 19:07:51 +02:00
|
|
|
#pragma once
|
2011-10-07 23:03:07 +02:00
|
|
|
|
2017-10-03 10:41:51 +02:00
|
|
|
#if HAVE_ACL
|
2015-01-18 05:27:39 +01:00
|
|
|
|
2015-11-18 22:46:33 +01:00
|
|
|
#include <acl/libacl.h>
|
2013-03-22 15:35:26 +01:00
|
|
|
#include <stdbool.h>
|
2015-01-18 05:27:39 +01:00
|
|
|
#include <sys/acl.h>
|
|
|
|
|
|
|
|
#include "macro.h"
|
2013-03-22 15:35:26 +01:00
|
|
|
|
2011-10-07 23:03:07 +02:00
|
|
|
int acl_find_uid(acl_t acl, uid_t uid, acl_entry_t *entry);
|
2013-05-28 20:45:34 +02:00
|
|
|
int calc_acl_mask_if_needed(acl_t *acl_p);
|
2015-01-19 00:22:27 +01:00
|
|
|
int add_base_acls_if_needed(acl_t *acl_p, const char *path);
|
2015-04-22 22:54:23 +02:00
|
|
|
int acl_search_groups(const char* path, char ***ret_groups);
|
2015-06-17 22:08:21 +02:00
|
|
|
int parse_acl(const char *text, acl_t *acl_access, acl_t *acl_default, bool want_mask);
|
2015-01-18 11:02:47 +01:00
|
|
|
int acls_for_file(const char *path, acl_type_t type, acl_t new, acl_t *acl);
|
2015-11-28 04:24:33 +01:00
|
|
|
int add_acls_for_user(int fd, uid_t uid);
|
2014-06-18 22:02:18 +02:00
|
|
|
|
2015-01-18 05:27:39 +01:00
|
|
|
/* acl_free takes multiple argument types.
|
|
|
|
* Multiple cleanup functions are necessary. */
|
|
|
|
DEFINE_TRIVIAL_CLEANUP_FUNC(acl_t, acl_free);
|
|
|
|
#define acl_free_charp acl_free
|
|
|
|
DEFINE_TRIVIAL_CLEANUP_FUNC(char*, acl_free_charp);
|
2015-02-24 05:19:54 +01:00
|
|
|
#define acl_free_uid_tp acl_free
|
|
|
|
DEFINE_TRIVIAL_CLEANUP_FUNC(uid_t*, acl_free_uid_tp);
|
|
|
|
#define acl_free_gid_tp acl_free
|
|
|
|
DEFINE_TRIVIAL_CLEANUP_FUNC(gid_t*, acl_free_gid_tp);
|
2014-06-18 22:02:18 +02:00
|
|
|
|
2015-01-18 05:27:39 +01:00
|
|
|
#endif
|