From 716083c1a8ea4580e09d35f96b67f8bd875c0fe3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?P=C3=A1draig=20Brady?=
Date: Tue, 30 Jun 2015 20:35:26 +0100 Subject: [PATCH] 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. --- ChangeLog | 12 ++++++++++++ lib/acl-internal.h | 6 ++---- lib/set-permissions.c | 3 +-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index ed3a306b70..cc0077da2a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2015-07-01 Pádraig Brady
+ + 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
readutmp: port to FreeBSD >= 9 diff --git a/lib/acl-internal.h b/lib/acl-internal.h index d592a7559f..4f042adc96 100644 --- a/lib/acl-internal.h +++ b/lib/acl-internal.h @@ -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. */ diff --git a/lib/set-permissions.c b/lib/set-permissions.c index 3bcfd31530..8569a20a17 100644 --- a/lib/set-permissions.c +++ b/lib/set-permissions.c @@ -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; -- 2.39.5