]> Savannah Git Hosting - gnulib.git/commitdiff
acl: fix definition of acl_from_mode on FreeBSD
authorPádraig Brady <P@draigBrady.com>
Tue, 30 Jun 2015 19:35:26 +0000 (20:35 +0100)
committerPádraig Brady <P@draigBrady.com>
Tue, 30 Jun 2015 23:50:07 +0000 (00:50 +0100)
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.

ChangeLog
lib/acl-internal.h
lib/set-permissions.c

index ed3a306b70f13a4a3d0d8ecf0ef1625bec708b0e..cc0077da2a2ceac41b807097870de7a80cb7bab5 100644 (file)
--- 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
index d592a7559f01b888199df626136ce040c290dcdd..4f042adc96be5b0e0586a58a6c7918cb87f3e33c 100644 (file)
@@ -127,10 +127,8 @@ rpl_acl_set_fd (int fd, acl_t acl)
 #   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.  */
index 3bcfd31530e54a6681b3dc824a8a056b29a668fa..8569a20a17e6e64f208475e411b983414aff0dcd 100644 (file)
@@ -801,10 +801,9 @@ set_permissions (struct permission_context *ctx, const char *name, int desc)
       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;