From 550d438c444b256b943c30e5070238191afe8b22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?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. --- lib/acl-internal.h | 6 ++---- lib/set-permissions.c | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/acl-internal.h b/lib/acl-internal.h index d592a75..4f042ad 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 3bcfd31..8569a20 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.4.1