From da97e2a534a945ad550fab0626657648b235a6aa Mon Sep 17 00:00:00 2001 From: Andreas Gruenbacher Date: Tue, 30 Jun 2015 21:09:28 +0200 Subject: 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. --- lib/acl-internal.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/acl-internal.h') 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 */ -- cgit v1.2.1