+2011-10-05 Jim Meyering <meyering@redhat.com>
+
+ file-has-acl: revert both recent changes, 80af92af and 95f7c57f
+ * lib/file-has-acl.c: While the 2011-10-03 change does fix the
+ ls -lL regression introduced in coreutils-8.12, it does so at the
+ cost of an additional stat call in the common case. Besides, now
+ that the kernel change that prompted commit 95f7c57f has been reverted
+ (see https://bugzilla.redhat.com/show_bug.cgi?id=720325#c24)
+ we have no use for commit 95f7c57f, "file-has-acl: use
+ acl_extended_file_nofollow if available".
+
2011-10-03 Kamil Dudka <kdudka@redhat.com>
file-has-acl: revert unintended change in behavior of ls -L
# define acl_extended_file(name) (-1)
# endif
-/* Linux-specific */
-# ifndef HAVE_ACL_EXTENDED_FILE_NOFOLLOW
-# define HAVE_ACL_EXTENDED_FILE_NOFOLLOW false
-# define acl_extended_file_nofollow(name) (-1)
-# endif
-
/* Linux-specific */
# ifndef HAVE_ACL_FROM_MODE
# define HAVE_ACL_FROM_MODE false
#endif
-/* acl_extended_file() tests whether a file has an ACL. But it can trigger
- unnecessary autofs mounts. In newer versions of libacl, a function
- acl_extended_file_nofollow() is available that uses lgetxattr() and
- therefore does not have this problem. It is equivalent to
- acl_extended_file(), except on symbolic links. */
-
-static int
-acl_extended_file_wrap (char const *name)
-{
- if ( ! HAVE_ACL_EXTENDED_FILE)
- return -1;
-
- if (HAVE_ACL_EXTENDED_FILE_NOFOLLOW)
- {
- struct stat sb;
- if (! lstat (name, &sb) && ! S_ISLNK (sb.st_mode))
- /* acl_extended_file_nofollow() uses lgetxattr() in order to
- prevent unnecessary mounts. It returns the same result as
- acl_extended_file() since we already know that NAME is not a
- symbolic link at this point (modulo the TOCTTOU race condition). */
- return acl_extended_file_nofollow (name);
- }
-
- /* fallback for symlinks and old versions of libacl */
- return acl_extended_file (name);
-}
-
-
/* Return 1 if NAME has a nontrivial access control list, 0 if NAME
only has no or a base access control list, and -1 (setting errno)
on error. SB must be set to the stat buffer of NAME, obtained
/* On Linux, acl_extended_file is an optimized function: It only
makes two calls to getxattr(), one for ACL_TYPE_ACCESS, one for
ACL_TYPE_DEFAULT. */
- ret = acl_extended_file_wrap (name);
+ ret = acl_extended_file (name);
}
else /* FreeBSD, MacOS X, IRIX, Tru64 */
{
AC_CHECK_FUNCS(
[acl_get_file acl_get_fd acl_set_file acl_set_fd \
acl_free acl_from_mode acl_from_text \
- acl_delete_def_file acl_extended_file acl_extended_file_nofollow \
+ acl_delete_def_file acl_extended_file \
acl_delete_fd_np acl_delete_file_np \
acl_copy_ext_native acl_create_entry_np \
acl_to_short_text acl_free_text])