Lines Matching defs:acl
23 #include "acl-util.h"
30 int acl_find_uid(acl_t acl, uid_t uid, acl_entry_t *entry) {
34 assert(acl);
37 for (r = acl_get_entry(acl, ACL_FIRST_ENTRY, &i);
39 r = acl_get_entry(acl, ACL_NEXT_ENTRY, &i)) {
165 _cleanup_(acl_free) acl_t acl = NULL;
172 acl = acl_get_file(path, ACL_TYPE_DEFAULT);
173 if (!acl)
176 r = acl_get_entry(acl, ACL_FIRST_ENTRY, &entry);
216 r = acl_get_entry(acl, ACL_NEXT_ENTRY, &entry);
342 assert_not_reached("Unknown acl tag type");
346 static int find_acl_entry(acl_t acl, acl_entry_t entry, acl_entry_t *out) {
350 for (r = acl_get_entry(acl, ACL_FIRST_ENTRY, &i);
352 r = acl_get_entry(acl, ACL_NEXT_ENTRY, &i)) {
367 int acls_for_file(const char *path, acl_type_t type, acl_t new, acl_t *acl) {
395 *acl = old;
401 _cleanup_(acl_freep) acl_t acl = NULL;
406 acl = acl_get_fd(fd);
407 if (!acl)
410 r = acl_find_uid(acl, uid, &entry);
412 if (acl_create_entry(&acl, &entry) < 0 ||
424 r = calc_acl_mask_if_needed(&acl);
428 return acl_set_fd(fd, acl);