aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/acl/libacl-helper.c
diff options
context:
space:
mode:
Diffstat (limited to 'internal/acl/libacl-helper.c')
-rw-r--r--internal/acl/libacl-helper.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/internal/acl/libacl-helper.c b/internal/acl/libacl-helper.c
index 065c1928..5fa35c18 100644
--- a/internal/acl/libacl-helper.c
+++ b/internal/acl/libacl-helper.c
@@ -1,11 +1,14 @@
+#define _GNU_SOURCE /* Definition of AT_* constants */
+
#include "libacl-helper.h"
#include <acl/libacl.h>
#include <stdbool.h>
#include <stdlib.h>
+#include <fcntl.h>
#include <sys/acl.h>
enum hakurei_acl_status hakurei_update_acl(
- const char *path_p,
+ int fd,
uid_t uid,
acl_perm_t perms) {
enum hakurei_acl_status ret;
@@ -20,7 +23,7 @@ enum hakurei_acl_status hakurei_update_acl(
acl_perm_t has_perms;
ret = HAKUREI_ACL_GET_FILE;
- acl = acl_get_file(path_p, ACL_TYPE_ACCESS);
+ acl = acl_get_file_at(fd, "", AT_EMPTY_PATH, ACL_TYPE_ACCESS);
if (acl == NULL)
goto out;
@@ -120,11 +123,10 @@ set:
goto out;
ret = HAKUREI_ACL_SET_FILE;
- if (acl_set_file(path_p, ACL_TYPE_ACCESS, acl) == 0)
+ if (acl_set_file_at(fd, "", AT_EMPTY_PATH, ACL_TYPE_ACCESS, acl) == 0)
ret = HAKUREI_ACL_OK;
out:
- free((void *)path_p);
if (acl != NULL)
acl_free((void *)acl);
if (acl_d != NULL)