summaryrefslogtreecommitdiff
path: root/lib/acl-internal.h
diff options
context:
space:
mode:
authorAndreas Gruenbacher <andreas.gruenbacher@gmail.com>2015-06-30 21:09:28 +0200
committerAndreas Gruenbacher <andreas.gruenbacher@gmail.com>2015-07-05 22:45:52 +0200
commitda97e2a534a945ad550fab0626657648b235a6aa (patch)
treee33682e92f1ac7a2ec10c11bfdfc7264dbc22d84 /lib/acl-internal.h
parent999724c0010ab3fb3a40fe11587df797021ed875 (diff)
downloadgnulib-da97e2a534a945ad550fab0626657648b235a6aa.tar.gz
acl-permissions: Fix on FreeBSD
When a directory doesn't have an ACL_TYPE_DEFAULT acl, acl_get_file will return an empty acl, but when trying to set that acl, FreeBSD's acl_set_file will fail with errno == EINVAL. Instead, FreeBSD expects acl_delete_def_file to be used. * lib/acl-internal.c (acl_default_nontrivial): Recognize empty default acls. * lib/set-permissions.c (set_acls): Avoid calling acl_set_file for empty ACL_TYPE_DEFAULT acls.
Diffstat (limited to 'lib/acl-internal.h')
-rw-r--r--lib/acl-internal.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/acl-internal.h b/lib/acl-internal.h
index 4f042adc96..38a4ab2eb3 100644
--- a/lib/acl-internal.h
+++ b/lib/acl-internal.h
@@ -155,6 +155,12 @@ extern int acl_extended_nontrivial (acl_t);
Return 0 if it is trivial, i.e. equivalent to a simple stat() mode.
Return -1 and set errno upon failure to determine it. */
extern int acl_access_nontrivial (acl_t);
+
+/* ACL is an ACL, from a file, stored as type ACL_TYPE_DEFAULT.
+ Return 1 if the given ACL is non-trivial.
+ Return 0 if it is trivial, i.e. equivalent to a simple stat() mode.
+ Return -1 and set errno upon failure to determine it. */
+extern int acl_default_nontrivial (acl_t);
# endif
# elif HAVE_FACL && defined GETACL /* Solaris, Cygwin, not HP-UX */