changeset 18034:dce9e4637294

acl: fix definition of acl_from_mode on FreeBSD This was causing basic coreutils copy operations to fail with ENOTSUP or ENOENT error messages. * lib/acl-internal.h (acl_from_mode): Only define when ! defined HAVE_ACL_FROM_TEXT. That allows the version of acl_from_mode() defined in lib/set-permissions.c to be used on FreeBSD at least. * lib/set-permissions.c: Fix up comment spelling, and a redundant variable assignment; noticed in passing.
author Pádraig Brady <P@draigBrady.com>
date Tue, 30 Jun 2015 20:35:26 +0100
parents f282834ddccc
children 674bd7704497
files ChangeLog lib/acl-internal.h lib/set-permissions.c
diffstat 3 files changed, 15 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2015-07-01  Pádraig Brady  <P@draigBrady.com>
+
+	acl: fix definition of acl_from_mode on FreeBSD
+	This was causing basic coreutils copy operations to fail
+	with ENOTSUP or ENOENT error messages.
+	* lib/acl-internal.h (acl_from_mode): Only define when
+	! defined HAVE_ACL_FROM_TEXT.  That allows the version
+	of acl_from_mode() defined in lib/set-permissions.c to
+	be used on FreeBSD at least.
+	* lib/set-permissions.c: Fix up comment spelling,
+	and a redundant variable assignment; noticed in passing.
+
 2015-06-30  Pádraig Brady  <P@draigBrady.com>
 
 	readutmp: port to FreeBSD >= 9
--- a/lib/acl-internal.h
+++ b/lib/acl-internal.h
@@ -127,10 +127,8 @@
 #   define acl_extended_file(name) (-1)
 #  endif
 
-/* Linux-specific */
-#  ifndef HAVE_ACL_FROM_MODE
-#   define HAVE_ACL_FROM_MODE false
-#   define acl_from_mode(mode) (NULL)
+#  if ! defined HAVE_ACL_FROM_MODE && ! defined HAVE_ACL_FROM_TEXT
+#   define acl_from_mode (NULL)
 #  endif
 
 /* Set to 0 if a file's mode is stored independently from the ACL.  */
--- a/lib/set-permissions.c
+++ b/lib/set-permissions.c
@@ -801,10 +801,9 @@
       int saved_errno = ret ? errno : 0;
 
       /* If we can't set an acl which we expect to be able to set, try setting
-	 the permissions to ctx->mode. Doe to possible inherited permissions,
+	 the permissions to ctx->mode. Due to possible inherited permissions,
 	 we cannot simply chmod.  */
 
-      acls_set = false;
       ret = set_acls (ctx, name, desc, true, &must_chmod, &acls_set);
       if (! acls_set)
 	must_chmod = true;