2024-11-11 Paul Eggert <eggert@cs.ucla.edu>
+ file-has-acl: minor refactor of acl_get_link_np fix
+ * lib/file-has-acl.c (file_has_aclinfo): Redo to avoid ‘else #endif’.
+
file-has-acl: scontext even if --disable-acl
Be able to get the security context even if configured with
--disable-acl, as security contexts are not ACLs, and the
else
ret = -1;
# 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
+# if !HAVE_ACL_GET_LINK_NP /* IRIX, Tru64, Cygwin >= 2.5 */
+# define acl_get_link_np acl_get_file
# endif
- acl = acl_get_file (name, ACL_TYPE_ACCESS);
+ acl_t acl = ((flags & AC_SYMLINK_FOLLOW
+ ? acl_get_file
+ : acl_get_link_np)
+ (name, ACL_TYPE_ACCESS));
if (acl)
{
ret = acl_access_nontrivial (acl);