2011-08-02 13:53:47 +02:00
|
|
|
commit 95f7c57ff4090a5dee062044d2c7b99879077808
|
|
|
|
Author: Kamil Dudka <kdudka@redhat.com>
|
|
|
|
Date: Fri Jul 22 14:48:42 2011 +0200
|
|
|
|
|
|
|
|
file-has-acl: use acl_extended_file_nofollow if available
|
|
|
|
|
|
|
|
* lib/acl-internal.h (HAVE_ACL_EXTENDED_FILE): New macro.
|
|
|
|
(acl_extended_file): New macro.
|
|
|
|
* lib/file-has-acl.c (file_has_acl): Use acl_extended_file_nofollow.
|
|
|
|
* m4/acl.m4 (gl_FUNC_ACL): Check for acl_extended_file_nofollow.
|
|
|
|
This addresses http://bugzilla.redhat.com/692823.
|
|
|
|
|
2011-10-16 12:42:20 +02:00
|
|
|
Index: lib/acl-internal.h
|
2011-08-02 13:53:47 +02:00
|
|
|
===================================================================
|
2013-01-22 15:08:43 +01:00
|
|
|
--- lib/acl-internal.h.orig
|
|
|
|
+++ lib/acl-internal.h
|
2012-04-23 09:12:18 +02:00
|
|
|
@@ -142,6 +142,12 @@ rpl_acl_set_fd (int fd, acl_t acl)
|
2011-08-02 13:53:47 +02:00
|
|
|
# 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
|
|
|
|
# define acl_from_mode(mode) (NULL)
|
2011-10-16 12:42:20 +02:00
|
|
|
Index: lib/file-has-acl.c
|
2011-08-02 13:53:47 +02:00
|
|
|
===================================================================
|
2013-01-22 15:08:43 +01:00
|
|
|
--- lib/file-has-acl.c.orig
|
|
|
|
+++ lib/file-has-acl.c
|
2012-04-23 09:12:18 +02:00
|
|
|
@@ -492,12 +492,20 @@ file_has_acl (char const *name, struct s
|
2011-08-02 13:53:47 +02:00
|
|
|
/* Linux, FreeBSD, MacOS X, IRIX, Tru64 */
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
- if (HAVE_ACL_EXTENDED_FILE) /* Linux */
|
|
|
|
+ if (HAVE_ACL_EXTENDED_FILE || HAVE_ACL_EXTENDED_FILE_NOFOLLOW) /* Linux */
|
|
|
|
{
|
|
|
|
+# if HAVE_ACL_EXTENDED_FILE_NOFOLLOW
|
|
|
|
+ /* acl_extended_file_nofollow() uses lgetxattr() in order to prevent
|
|
|
|
+ unnecessary mounts, but it returns the same result as we already
|
|
|
|
+ know that NAME is not a symbolic link at this point (modulo the
|
|
|
|
+ TOCTTOU race condition). */
|
|
|
|
+ ret = acl_extended_file_nofollow (name);
|
|
|
|
+# else
|
|
|
|
/* 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 (name);
|
|
|
|
+# endif
|
|
|
|
}
|
|
|
|
else /* FreeBSD, MacOS X, IRIX, Tru64 */
|
|
|
|
{
|
2011-10-16 12:42:20 +02:00
|
|
|
Index: m4/acl.m4
|
2011-08-02 13:53:47 +02:00
|
|
|
===================================================================
|
2013-01-22 15:08:43 +01:00
|
|
|
--- m4/acl.m4.orig
|
|
|
|
+++ m4/acl.m4
|
2011-08-02 13:53:47 +02:00
|
|
|
@@ -33,7 +33,7 @@ AC_DEFUN([gl_FUNC_ACL],
|
|
|
|
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_delete_def_file acl_extended_file acl_extended_file_nofollow \
|
|
|
|
acl_delete_fd_np acl_delete_file_np \
|
|
|
|
acl_copy_ext_native acl_create_entry_np \
|
|
|
|
acl_to_short_text acl_free_text])
|
2011-10-16 12:42:20 +02:00
|
|
|
Index: ChangeLog
|
2011-08-02 13:53:47 +02:00
|
|
|
===================================================================
|
2013-01-22 15:08:43 +01:00
|
|
|
--- ChangeLog.orig
|
|
|
|
+++ ChangeLog
|
|
|
|
@@ -3272,6 +3272,14 @@
|
2011-10-16 12:42:20 +02:00
|
|
|
MacOS X 10.7 has an fdatasync that is not declared, and is rumored to
|
|
|
|
be ineffective. (Bug#9141)
|
|
|
|
|
2011-08-02 13:53:47 +02:00
|
|
|
+2011-07-22 Kamil Dudka <kdudka@redhat.com>
|
|
|
|
+
|
|
|
|
+ file-has-acl: use acl_extended_file_nofollow if available
|
|
|
|
+ * lib/acl-internal.h (HAVE_ACL_EXTENDED_FILE): New macro.
|
|
|
|
+ (acl_extended_file): New macro.
|
|
|
|
+ * lib/file-has-acl.c (file_has_acl): Use acl_extended_file_nofollow.
|
|
|
|
+ * m4/acl.m4 (gl_FUNC_ACL): Check for acl_extended_file_nofollow.
|
|
|
|
+
|
2011-10-16 12:42:20 +02:00
|
|
|
2011-07-20 Mike Frysinger <vapier@gentoo.org>
|
2011-08-02 13:53:47 +02:00
|
|
|
|
2011-10-16 12:42:20 +02:00
|
|
|
dircolors: add screen.Eterm terminal type
|