+2024-11-11 Bruno Haible <bruno@clisp.org>
+
+ file-has-acl: Fix compilation errors on macOS et al. (regr. 2024-11-09).
+ * m4/acl.m4 (gl_FUNC_ACL): Test whether acl_get_link_np exists.
+ * lib/file-has-acl.c (file_has_aclinfo): Use ACL_SYMLINK_FOLLOW, not
+ AC_SYMLINK_FOLLOW. Don't use acl_get_link_np if this function does not
+ exist.
+
2024-11-10 Bruno Haible <bruno@clisp.org>
relocatable-prog-wrapper: Fix compilation error on NetBSD 7.
{
/* POSIX 1003.1e (draft 17 -- abandoned) specific version. */
- /* Linux, FreeBSD, Mac OS X, IRIX, Tru64, Cygwin >= 2.5 */
+ /* Linux, FreeBSD, NetBSD >= 10, Mac OS X, IRIX, Tru64, Cygwin >= 2.5 */
int ret;
# if HAVE_ACL_EXTENDED_FILE /* Linux */
always return NULL / EINVAL. There is no point in making
these two useless calls. The real ACL is retrieved through
acl_get_file (name, ACL_TYPE_EXTENDED). */
- acl_t acl = ((flags & AC_SYMLINK_FOLLOW
+ acl_t acl = ((flags & ACL_SYMLINK_FOLLOW
? acl_get_file
: acl_get_link_np)
(name, ACL_TYPE_EXTENDED));
}
else
ret = -1;
-# else /* FreeBSD, IRIX, Tru64, Cygwin >= 2.5 */
- acl_t acl = ((flags & AC_SYMLINK_FOLLOW
- ? acl_get_file
- : acl_get_link_np)
- (name, ACL_TYPE_ACCESS));
+# else /* FreeBSD, NetBSD >= 10, IRIX, Tru64, Cygwin >= 2.5 */
+ acl_t acl;
+# if HAVE_ACL_GET_LINK_NP /* FreeBSD, NetBSD >= 10 */
+ if (!(flags & ACL_SYMLINK_FOLLOW))
+ acl = acl_get_link_np (name, ACL_TYPE_ACCESS);
+ else
+# endif
+ acl = acl_get_file (name, ACL_TYPE_ACCESS);
if (acl)
{
ret = acl_access_nontrivial (acl);
/* On OSF/1, acl_get_file (name, ACL_TYPE_DEFAULT) always
returns NULL with errno not set. There is no point in
making this call. */
-# else /* FreeBSD, IRIX, Cygwin >= 2.5 */
- /* On Linux, FreeBSD, IRIX, acl_get_file (name, ACL_TYPE_ACCESS)
+# else /* FreeBSD, NetBSD >= 10, IRIX, Cygwin >= 2.5 */
+ /* On Linux, FreeBSD, NetBSD, IRIX,
+ acl_get_file (name, ACL_TYPE_ACCESS)
and acl_get_file (name, ACL_TYPE_DEFAULT) on a directory
either both succeed or both fail; it depends on the
file system. Therefore there is no point in making the second
# acl.m4
-# serial 33
+# serial 34
dnl Copyright (C) 2002, 2004-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
if test $ac_cv_header_sys_acl_h = yes; then
gl_saved_LIBS=$LIBS
- dnl Test for POSIX-draft-like API (GNU/Linux, FreeBSD, Mac OS X,
- dnl IRIX, Tru64, Cygwin >= 2.5).
+ dnl Test for POSIX-draft-like API (GNU/Linux, FreeBSD, NetBSD >= 10,
+ dnl Mac OS X, IRIX, Tru64, Cygwin >= 2.5).
dnl -lacl is needed on GNU/Linux, -lpacl on OSF/1.
if test $use_acl = 0; then
AC_SEARCH_LIBS([acl_get_file], [acl pacl],
fi
AC_CHECK_FUNCS(
[acl_get_file acl_get_fd acl_set_file acl_set_fd \
+ acl_get_link_np \
acl_free acl_from_mode acl_from_text \
acl_delete_def_file acl_extended_file \
acl_delete_fd_np acl_delete_file_np \