Ticket #1080: acl-2.2.52-sys_xattr-1.patch

File acl-2.2.52-sys_xattr-1.patch, 12.5 KB (added by William Harrington, 9 years ago)

Allows acl to use xattr from libc

  • configure

    diff -Naur acl-2.2.52.orig/configure acl-2.2.52/configure
    old new  
    1241612416    fi
    1241712417
    1241812418
    12419  for ac_header in attr/xattr.h
     12419 for ac_header in sys/xattr.h
    1242012420do :
    12421   ac_fn_c_check_header_mongrel "$LINENO" "attr/xattr.h" "ac_cv_header_attr_xattr_h" "$ac_includes_default"
     12421  ac_fn_c_check_header_mongrel "$LINENO" "sys/xattr.h" "ac_cv_header_attr_xattr_h" "$ac_includes_default"
    1242212422if test "x$ac_cv_header_attr_xattr_h" = xyes; then :
    1242312423  cat >>confdefs.h <<_ACEOF
    1242412424#define HAVE_ATTR_XATTR_H 1
     
    1243012430
    1243112431    if test "$ac_cv_header_attr_xattr_h" != "yes"; then
    1243212432        echo
    12433         echo 'FATAL ERROR: attr/xattr.h does not exist.'
     12433        echo 'FATAL ERROR: sys/xattr.h does not exist.'
    1243412434        echo 'Install the extended attributes (attr) development package.'
    1243512435        echo 'Alternatively, run "make install-dev" from the attr source.'
    1243612436        exit 1
    1243712437    fi
    1243812438
    12439  for ac_header in attr/error_context.h
    12440 do :
    12441   ac_fn_c_check_header_mongrel "$LINENO" "attr/error_context.h" "ac_cv_header_attr_error_context_h" "$ac_includes_default"
    12442 if test "x$ac_cv_header_attr_error_context_h" = xyes; then :
    12443   cat >>confdefs.h <<_ACEOF
    12444 #define HAVE_ATTR_ERROR_CONTEXT_H 1
    12445 _ACEOF
    12446 
    12447 fi
    12448 
    12449 done
    12450 
    12451     if test "$ac_cv_header_attr_error_context_h" != "yes"; then
    12452         echo
    12453         echo 'FATAL ERROR: attr/error_context.h does not exist.'
    12454         echo 'Install the extended attributes (attr) development package.'
    12455         echo 'Alternatively, run "make install-dev" from the attr source.'
    12456         exit 1
    12457     fi
    12458 
    12459 
    1246012439                  enable_lib64="$enable_lib64"
    1246112440  libdirsuffix=""
    1246212441  searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
     
    1247712456  fi
    1247812457
    1247912458
    12480  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getxattr in -lattr" >&5
    12481 $as_echo_n "checking for getxattr in -lattr... " >&6; }
    12482 if ${ac_cv_lib_attr_getxattr+:} false; then :
    12483   $as_echo_n "(cached) " >&6
    12484 else
    12485   ac_check_lib_save_LIBS=$LIBS
    12486 LIBS="-lattr  $LIBS"
    12487 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    12488 /* end confdefs.h.  */
    12489 
    12490 /* Override any GCC internal prototype to avoid an error.
    12491    Use char because int might match the return type of a GCC
    12492    builtin and then its argument prototype would still apply.  */
    12493 #ifdef __cplusplus
    12494 extern "C"
    12495 #endif
    12496 char getxattr ();
    12497 int
    12498 main ()
    12499 {
    12500 return getxattr ();
    12501   ;
    12502   return 0;
    12503 }
    12504 _ACEOF
    12505 if ac_fn_c_try_link "$LINENO"; then :
    12506   ac_cv_lib_attr_getxattr=yes
    12507 else
    12508   ac_cv_lib_attr_getxattr=no
    12509 fi
    12510 rm -f core conftest.err conftest.$ac_objext \
    12511     conftest$ac_exeext conftest.$ac_ext
    12512 LIBS=$ac_check_lib_save_LIBS
    12513 fi
    12514 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_attr_getxattr" >&5
    12515 $as_echo "$ac_cv_lib_attr_getxattr" >&6; }
    12516 if test "x$ac_cv_lib_attr_getxattr" = xyes; then :
    12517   cat >>confdefs.h <<_ACEOF
    12518 #define HAVE_LIBATTR 1
    12519 _ACEOF
    12520 
    12521   LIBS="-lattr $LIBS"
    12522 
    12523 else
    12524 
    12525         echo
    12526         echo 'FATAL ERROR: could not find a valid Extended Attributes library.'
    12527         echo 'Install the extended attributes (attr) development package.'
    12528         echo 'Alternatively, run "make install-lib" from the attr source.'
    12529         exit 1
    12530 
    12531 fi
    12532 
    12533     libattr="-lattr"
    12534     test -f `pwd`/../attr/libattr/libattr.la && \
    12535         libattr="`pwd`/../attr/libattr/libattr.la"
    12536 
    12537 
    1253812459 have_zipped_manpages=false
    1253912460    for d in ${prefix}/share/man ${prefix}/man ; do
    1254012461        if test -f $d/man1/man.1.gz
  • libacl/Makefile

    diff -Naur acl-2.2.52.orig/libacl/Makefile acl-2.2.52/libacl/Makefile
    old new  
    2222include $(TOPDIR)/include/builddefs
    2323
    2424LTLIBRARY = libacl.la
    25 LTLIBS = -lattr $(LIBMISC)
     25LTLIBS = $(LIBMISC)
    2626LTDEPENDENCIES = $(LIBMISC)
    2727LT_CURRENT = 2
    2828LT_REVISION = 0
  • libacl/__acl_extended_file.c

    diff -Naur acl-2.2.52.orig/libacl/__acl_extended_file.c acl-2.2.52/libacl/__acl_extended_file.c
    old new  
    1919  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    2020*/
    2121
     22
     23#ifdef HAVE_CONFIG_H
     24#include "config.h"
     25#endif
     26
    2227#include <unistd.h>
    23 #include <attr/xattr.h>
     28#include <sys/xattr.h>
    2429#include "libacl.h"
    2530
    2631#include "byteorder.h"
  • libacl/acl_delete_def_file.c

    diff -Naur acl-2.2.52.orig/libacl/acl_delete_def_file.c acl-2.2.52/libacl/acl_delete_def_file.c
    old new  
    1919  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    2020*/
    2121
     22#ifdef HAVE_CONFIG_H
     23#include "config.h"
     24#endif
     25
    2226#include <sys/types.h>
    23 #include <attr/xattr.h>
     27#include <sys/xattr.h>
    2428#include "byteorder.h"
    2529#include "acl_ea.h"
    26 #include "config.h"
    27 
     30#include "libobj.h"
    2831
    2932/* 23.4.8 */
    3033int
  • libacl/acl_extended_fd.c

    diff -Naur acl-2.2.52.orig/libacl/acl_extended_fd.c acl-2.2.52/libacl/acl_extended_fd.c
    old new  
    1919  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    2020*/
    2121
     22#ifdef HAVE_CONFIG_H
     23#include "config.h"
     24#endif
     25
    2226#include <unistd.h>
    23 #include <attr/xattr.h>
     27#include <sys/xattr.h>
    2428#include "libacl.h"
    2529
    2630#include "byteorder.h"
  • libacl/acl_extended_file.c

    diff -Naur acl-2.2.52.orig/libacl/acl_extended_file.c acl-2.2.52/libacl/acl_extended_file.c
    old new  
    1919  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    2020*/
    2121
     22#ifdef HAVE_CONFIG_H
     23#include "config.h"
     24#endif
     25
    2226#include <unistd.h>
    23 #include <attr/xattr.h>
     27#include <sys/xattr.h>
    2428#include "libacl.h"
    2529
    2630#include "__acl_extended_file.h"
  • libacl/acl_extended_file_nofollow.c

    diff -Naur acl-2.2.52.orig/libacl/acl_extended_file_nofollow.c acl-2.2.52/libacl/acl_extended_file_nofollow.c
    old new  
    1919  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    2020*/
    2121
     22#ifdef HAVE_CONFIG_H
     23#include "config.h"
     24#endif
     25
    2226#include <unistd.h>
    23 #include <attr/xattr.h>
     27#include <sys/xattr.h>
    2428#include "libacl.h"
    2529
    2630#include "__acl_extended_file.h"
  • libacl/acl_get_fd.c

    diff -Naur acl-2.2.52.orig/libacl/acl_get_fd.c acl-2.2.52/libacl/acl_get_fd.c
    old new  
    1919  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    2020*/
    2121
     22#ifdef HAVE_CONFIG_H
     23#include "config.h"
     24#endif
     25
    2226#include <sys/types.h>
    2327#include <sys/stat.h>
    2428#include <unistd.h>
    2529#include <stdio.h>
    26 #include <attr/xattr.h>
     30#include <sys/xattr.h>
    2731#include <acl/libacl.h>
    2832#include "libacl.h"
    2933#include "__acl_from_xattr.h"
  • libacl/acl_get_file.c

    diff -Naur acl-2.2.52.orig/libacl/acl_get_file.c acl-2.2.52/libacl/acl_get_file.c
    old new  
    1919  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    2020*/
    2121
     22#ifdef HAVE_CONFIG_H
     23#include "config.h"
     24#endif
     25
    2226#include <sys/types.h>
    2327#include <sys/stat.h>
    2428#include <unistd.h>
    2529#include <stdio.h>
    26 #include <attr/xattr.h>
     30#include <sys/xattr.h>
    2731#include <acl/libacl.h>
    2832#include "libacl.h"
    2933#include "__acl_from_xattr.h"
  • libacl/acl_set_fd.c

    diff -Naur acl-2.2.52.orig/libacl/acl_set_fd.c acl-2.2.52/libacl/acl_set_fd.c
    old new  
    1919  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    2020*/
    2121
     22#ifdef HAVE_CONFIG_H
     23#include "config.h"
     24#endif
     25
    2226#include <unistd.h>
    23 #include <attr/xattr.h>
     27#include <sys/xattr.h>
    2428#include "libacl.h"
    2529#include "__acl_to_xattr.h"
    2630
  • libacl/acl_set_file.c

    diff -Naur acl-2.2.52.orig/libacl/acl_set_file.c acl-2.2.52/libacl/acl_set_file.c
    old new  
    1919  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    2020*/
    2121
     22#ifdef HAVE_CONFIG_H
     23#include "config.h"
     24#endif
     25
    2226#include <sys/types.h>
    2327#include <sys/stat.h>
    2428#include <unistd.h>
    25 #include <attr/xattr.h>
     29#include <sys/xattr.h>
    2630#include "libacl.h"
    2731#include "__acl_to_xattr.h"
    2832
  • libacl/error_context.h

    diff -Naur acl-2.2.52.orig/libacl/error_context.h acl-2.2.52/libacl/error_context.h
    old new  
     1/*
     2  Copyright (C) 2009  Andreas Gruenbacher <address@hidden>
     3
     4  This program is free software: you can redistribute it and/or modify it
     5  under the terms of the GNU Lesser General Public License as published by
     6  the Free Software Foundation, either version 2.1 of the License, or
     7  (at your option) any later version.
     8
     9  This program is distributed in the hope that it will be useful,
     10  but WITHOUT ANY WARRANTY; without even the implied warranty of
     11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     12  GNU Lesser General Public License for more details.
     13
     14  You should have received a copy of the GNU Lesser General Public License
     15  along with this program.  If not, see <http://www.gnu.org/licenses/>.
     16 */
     17
     18#ifndef __ERROR_CONTEXT_T
     19#define __ERROR_CONTEXT_T
     20
     21#ifdef __cplusplus
     22extern "C" {
     23#endif
     24
     25struct error_context {
     26       /* Process an error message */
     27       void (*error) (struct error_context *, const char *, ...);
     28
     29       /* Quote a file name for including in an error message */
     30       const char *(*quote) (struct error_context *, const char *);
     31
     32       /* Free a quoted name */
     33       void (*quote_free) (struct error_context *, const char *);
     34};
     35
     36#ifdef ERROR_CONTEXT_MACROS
     37# define error(ctx, args...) do { \
     38       if ((ctx) && (ctx)->error) \
     39               (ctx)->error((ctx), args); \
     40       } while(0)
     41# define quote(ctx, name) \
     42       ( ((ctx) && (ctx)->quote) ? (ctx)->quote((ctx), (name)) : (name) )
     43# define quote_free(ctx, name) do { \
     44       if ((ctx) && (ctx)->quote_free) \
     45               (ctx)->quote_free((ctx), (name)); \
     46       } while(0)
     47#endif
     48
     49#ifdef __cplusplus
     50}
     51#endif
     52
     53#endif  /* __ERROR_CONTEXT_T */
  • libacl/libobj.h

    diff -Naur acl-2.2.52.orig/libacl/libobj.h acl-2.2.52/libacl/libobj.h
    old new  
    1919#define __LIBOBJ_H
    2020
    2121#include <stdlib.h>
     22#include <errno.h>
    2223
    23 #include "config.h"
     24#ifndef ENOATTR
     25# define ENOATTR ENODATA        /* No such attribute */
     26#endif
    2427
    2528/* Mark library internal functions as hidden */
    2629#if defined(HAVE_VISIBILITY_ATTRIBUTE)
  • libacl/perm_copy_fd.c

    diff -Naur acl-2.2.52.orig/libacl/perm_copy_fd.c acl-2.2.52/libacl/perm_copy_fd.c
    old new  
    1717  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    1818*/
    1919
    20 #if defined (HAVE_CONFIG_H)
     20#ifdef HAVE_CONFIG_H
    2121#include "config.h"
    2222#endif
     23
    2324#if defined(HAVE_LIBACL_LIBACL_H)
    2425# include "libacl.h"
    2526#endif
     
    3940#endif
    4041
    4142#define ERROR_CONTEXT_MACROS
    42 #ifdef HAVE_ATTR_ERROR_CONTEXT_H
    43 #include <attr/error_context.h>
    44 #else
    4543#include "error_context.h"
    46 #endif
    4744
    4845#if !defined(ENOTSUP)
    4946# define ENOTSUP (-1)
  • libacl/perm_copy_file.c

    diff -Naur acl-2.2.52.orig/libacl/perm_copy_file.c acl-2.2.52/libacl/perm_copy_file.c
    old new  
    1717  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    1818*/
    1919
    20 #if defined (HAVE_CONFIG_H)
     20#ifdef HAVE_CONFIG_H
    2121#include "config.h"
    2222#endif
     23
    2324#if defined(HAVE_LIBACL_LIBACL_H)
    2425# include "libacl.h"
    2526#endif
     
    3940#endif
    4041
    4142#define ERROR_CONTEXT_MACROS
    42 #ifdef HAVE_ATTR_ERROR_CONTEXT_H
    43 #include <attr/error_context.h>
    44 #else
    4543#include "error_context.h"
    46 #endif
    4744
    4845#if !defined(ENOTSUP)
    4946# define ENOTSUP (-1)