GNU bug report logs - #20667
[GNULIB v2 1/2] file-has-acl: Split feature tests again

Previous Next

Package: coreutils;

Reported by: Andreas Gruenbacher <andreas.gruenbacher <at> gmail.com>

Date: Tue, 26 May 2015 20:55:07 UTC

Severity: normal

Merged with 20310, 20311, 20312, 20666, 20696

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 20667 in the body.
You can then email your comments to 20667 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#20667; Package coreutils. (Tue, 26 May 2015 20:55:07 GMT) Full text and rfc822 format available.

Acknowledgement sent to Andreas Gruenbacher <andreas.gruenbacher <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Tue, 26 May 2015 20:55:08 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Andreas Gruenbacher <andreas.gruenbacher <at> gmail.com>
To: bug-gnulib <at> gnu.org,
	bug-coreutils <at> gnu.org
Subject: [GNULIB v2 1/2] file-has-acl: Split feature tests again
Date: Tue, 26 May 2015 22:53:56 +0200
* lib/file-has-acl.c: Instead of testing for
XATTR_NAME_POSIX_ACL_ACCESS and XATTR_NAME_POSIX_ACL_DEFAULT,
define them when needed.
* m4/acl.m4 (gl_FILE_HAS_ACL): With that, Paul's
GETXATTR_WITH_POSIX_ACLS change shouldn't be needed anymore.
---
 ChangeLog          |  9 +++++++++
 lib/file-has-acl.c | 15 +++++++++++++--
 m4/acl.m4          | 24 +++++-------------------
 3 files changed, 27 insertions(+), 21 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 960eec3..c5100ab 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2015-04-28  Andreas Gruenbacher  <agruenba <at> redhat.com>
+
+	file-has-acl: Split feature tests again
+	* lib/file-has-acl.c: Instead of testing for
+	XATTR_NAME_POSIX_ACL_ACCESS and XATTR_NAME_POSIX_ACL_DEFAULT,
+	define them when needed.
+	* m4/acl.m4 (gl_FILE_HAS_ACL): With that, Paul's
+	GETXATTR_WITH_POSIX_ACLS change shouldn't be needed anymore.
+
 2015-05-07  Glenn Morris  <rgm <at> gnu.org>
 
 	gitlog-to-changelog: parse "Tiny-change"
diff --git a/lib/file-has-acl.c b/lib/file-has-acl.c
index 7e26c53..e187117 100644
--- a/lib/file-has-acl.c
+++ b/lib/file-has-acl.c
@@ -29,8 +29,11 @@
 
 #include "acl-internal.h"
 
-#if GETXATTR_WITH_POSIX_ACLS
+#if HAVE_SYS_XATTR_H
 # include <sys/xattr.h>
+#endif
+
+#if HAVE_LINUX_XATTR_H
 # include <linux/xattr.h>
 #endif
 
@@ -48,7 +51,15 @@ file_has_acl (char const *name, struct stat const *sb)
   if (! S_ISLNK (sb->st_mode))
     {
 
-# if GETXATTR_WITH_POSIX_ACLS
+# if HAVE_GETXATTR
+
+#  ifndef XATTR_NAME_POSIX_ACL_ACCESS
+#   define XATTR_NAME_POSIX_ACL_ACCESS "system.posix_acl_access"
+#  endif
+
+#  ifndef XATTR_NAME_POSIX_ACL_DEFAULT
+#   define XATTR_NAME_POSIX_ACL_DEFAULT "system.posix_acl_default"
+#  endif
 
       ssize_t ret;
 
diff --git a/m4/acl.m4 b/m4/acl.m4
index b8f4660..bf2e30b 100644
--- a/m4/acl.m4
+++ b/m4/acl.m4
@@ -1,5 +1,5 @@
 # acl.m4 - check for access control list (ACL) primitives
-# serial 19
+# serial 20
 
 # Copyright (C) 2002, 2004-2015 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
@@ -181,26 +181,12 @@ AC_DEFUN([gl_FILE_HAS_ACL],
 [
   AC_REQUIRE([gl_FUNC_ACL_ARG])
   if test "$enable_acl" != no; then
-    AC_CACHE_CHECK([for getxattr with XATTR_NAME_POSIX_ACL macros],
-      [gl_cv_getxattr_with_posix_acls],
-      [gl_cv_getxattr_with_posix_acls=no
-       AC_LINK_IFELSE(
-         [AC_LANG_PROGRAM(
-            [[#include <sys/types.h>
-              #include <sys/xattr.h>
-              #include <linux/xattr.h>
-            ]],
-            [[ssize_t a = getxattr (".", XATTR_NAME_POSIX_ACL_ACCESS, 0, 0);
-              ssize_t b = getxattr (".", XATTR_NAME_POSIX_ACL_DEFAULT, 0, 0);
-              return a < 0 || b < 0;
-            ]])],
-         [gl_cv_getxattr_with_posix_acls=yes])])
+    AC_CHECK_HEADERS([linux/xattr.h])
+    AC_CHECK_HEADERS([sys/xattr.h],
+      [AC_CHECK_FUNCS_ONCE([getxattr])])
   fi
-  if test "$gl_cv_getxattr_with_posix_acls" = yes; then
+  if test "$ac_cv_header_sys_xattr_h,$ac_cv_func_getxattr" = yes,yes; then
     LIB_HAS_ACL=
-    AC_DEFINE([GETXATTR_WITH_POSIX_ACLS], 1,
-      [Define to 1 if getxattr works with XATTR_NAME_POSIX_ACL_ACCESS
-       and XATTR_NAME_POSIX_ACL_DEFAULT.])
   else
     dnl Set gl_need_lib_has_acl to a nonempty value, so that any
     dnl later gl_FUNC_ACL call will set LIB_HAS_ACL=$LIB_ACL.
-- 
2.4.0





Merged 20666 20667. Request was from Eric Blake <eblake <at> redhat.com> to control <at> debbugs.gnu.org. (Tue, 26 May 2015 21:06:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-coreutils <at> gnu.org:
bug#20667; Package coreutils. (Wed, 27 May 2015 18:16:02 GMT) Full text and rfc822 format available.

Message #10 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Andreas Gruenbacher <andreas.gruenbacher <at> gmail.com>, 
 bug-gnulib <at> gnu.org, bug-coreutils <at> gnu.org
Subject: Re: [GNULIB v2 1/2] file-has-acl: Split feature tests again
Date: Wed, 27 May 2015 11:14:58 -0700
I found one nit:

> +    AC_CHECK_HEADERS([linux/xattr.h])
> +    AC_CHECK_HEADERS([sys/xattr.h],
> +      [AC_CHECK_FUNCS_ONCE([getxattr])])

This is missing _ONCE and non-ONCE calls, which doesn't work as 
expected.  Simplest fix is to replace AC_CHECK_FUNCS_ONCE with 
AC_CHECK_FUNCS.





Forcibly Merged 20310 20311 20312 20666 20667 20696. Request was from Pádraig Brady <P <at> draigBrady.com> to control <at> debbugs.gnu.org. (Sun, 31 May 2015 00:31:03 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 20310 <at> debbugs.gnu.org and Pádraig Brady <P <at> draigBrady.com> Request was from Pádraig Brady <P <at> draigBrady.com> to control <at> debbugs.gnu.org. (Sun, 31 May 2015 00:31:06 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 28 Jun 2015 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 52 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.