aboutsummaryrefslogtreecommitdiff
path: root/bin/setfacl
diff options
context:
space:
mode:
authorChris D. Faulhaber <jedgar@FreeBSD.org>2002-02-03 02:37:43 +0000
committerChris D. Faulhaber <jedgar@FreeBSD.org>2002-02-03 02:37:43 +0000
commit42dcd8695a9e7b26d5bb9445a47f3311854b573a (patch)
tree61cb23f289f0e68fc9206706788cefa7d04c0684 /bin/setfacl
parentf353db9f9a182a2489738def1684984e5da577ed (diff)
Notes
Diffstat (limited to 'bin/setfacl')
-rw-r--r--bin/setfacl/mask.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/bin/setfacl/mask.c b/bin/setfacl/mask.c
index 0851be1bff23..d81cfb686085 100644
--- a/bin/setfacl/mask.c
+++ b/bin/setfacl/mask.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001 Chris D. Faulhaber
+ * Copyright (c) 2001-2002 Chris D. Faulhaber
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,7 @@
int
set_acl_mask(acl_t *prev_acl)
{
- acl_entry_t entry;
+ acl_entry_t entry, entry_new;
acl_t acl;
acl_tag_t tag;
int entry_id;
@@ -104,7 +104,20 @@ set_acl_mask(acl_t *prev_acl)
return (0);
}
- **prev_acl = *acl;
+ acl_free(*prev_acl);
+ *prev_acl = acl_init(ACL_MAX_ENTRIES);
+ if (*prev_acl == NULL)
+ err(1, "acl_init() failed");
+
+ entry_id = ACL_FIRST_ENTRY;
+ while (acl_get_entry(acl, entry_id, &entry) == 1) {
+ entry_id = ACL_NEXT_ENTRY;
+ if (acl_create_entry(prev_acl, &entry_new) == -1)
+ err(1, "acl_create_entry() failed");
+ if (acl_copy_entry(entry_new, entry) == -1)
+ err(1, "acl_copy_entry() failed");
+ }
+
acl_free(acl);
return (0);