]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
toolchain: Fix patches for updated tar.
authorSchantl Stefan <Stevee@ipfire.org>
Fri, 19 Mar 2010 18:36:57 +0000 (19:36 +0100)
committerSchantl Stefan <Stevee@ipfire.org>
Fri, 19 Mar 2010 18:36:57 +0000 (19:36 +0100)
pkgs/toolchain/tar/patches/tar-1.22-xattrs-conf-1.patch [deleted file]
pkgs/toolchain/tar/patches/tar-1.23-xattrs.patch [moved from pkgs/toolchain/tar/patches/tar-1.22-xattrs-1.patch with 72% similarity]

diff --git a/pkgs/toolchain/tar/patches/tar-1.22-xattrs-conf-1.patch b/pkgs/toolchain/tar/patches/tar-1.22-xattrs-conf-1.patch
deleted file mode 100644 (file)
index ada7917..0000000
+++ /dev/null
@@ -1,799 +0,0 @@
-diff -urNp tar-1.22-orig/config.hin tar-1.22/config.hin
---- tar-1.22-orig/config.hin   2009-03-05 08:08:07.000000000 +0100
-+++ tar-1.22/config.hin        2009-03-05 09:57:06.000000000 +0100
-@@ -131,6 +131,9 @@
-    */
- #undef HAVE_ALLOCA_H
-+/* Define to 1 if you have the <attr/xattr.h> header file. */
-+#undef HAVE_ATTR_XATTR_H
-+
- /* Define to 1 if you have the `btowc' function. */
- #undef HAVE_BTOWC
-@@ -372,12 +375,21 @@
- /* Define to 1 if you have the <features.h> header file. */
- #undef HAVE_FEATURES_H
-+/* Define to 1 if you have the `fgetxattr' function. */
-+#undef HAVE_FGETXATTR
-+
-+/* Define to 1 if you have the `flistxattr' function. */
-+#undef HAVE_FLISTXATTR
-+
- /* Define to 1 if you have the <float.h> header file. */
- #undef HAVE_FLOAT_H
- /* Define to 1 if you have the `flockfile' function. */
- #undef HAVE_FLOCKFILE
-+/* Define to 1 if you have the `fsetxattr' function. */
-+#undef HAVE_FSETXATTR
-+
- /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
- #undef HAVE_FSEEKO
-@@ -423,6 +435,9 @@
- /* Define to 1 if you have the `gettimeofday' function. */
- #undef HAVE_GETTIMEOFDAY
-+/* Define to 1 if you have the `getxattr' function. */
-+#undef HAVE_GETXATTR
-+
- /* Define to 1 if you have the <grp.h> header file. */
- #undef HAVE_GRP_H
-@@ -468,15 +483,30 @@
- /* Define to 1 if you have the `lchown' function. */
- #undef HAVE_LCHOWN
-+/* Define to 1 if you have the `lgetxattr' function. */
-+#undef HAVE_LGETXATTR
-+
-+/* Define to 1 if you have the `acl' library (-lacl). */
-+#undef HAVE_LIBACL
-+
- /* Define to 1 if you have the <libintl.h> header file. */
- #undef HAVE_LIBINTL_H
-+/* Define to 1 if you have the `selinux' library (-lselinux). */
-+#undef HAVE_LIBSELINUX
-+
- /* Define to 1 if you have the <linewrap.h> header file. */
- #undef HAVE_LINEWRAP_H
- /* Define to 1 if you have the <linux/fd.h> header file. */
- #undef HAVE_LINUX_FD_H
-+/* Define to 1 if you have the `listxattr' function. */
-+#undef HAVE_LISTXATTR
-+
-+/* Define to 1 if you have the `llistxattr' function. */
-+#undef HAVE_LLISTXATTR
-+
- /* Define to 1 if you have the <locale.h> header file. */
- #undef HAVE_LOCALE_H
-@@ -486,6 +516,9 @@
- /* Define to 1 if the system has the type `long long int'. */
- #undef HAVE_LONG_LONG_INT
-+/* Define to 1 if you have the `lsetxattr' function. */
-+#undef HAVE_LSETXATTR
-+
- /* Define to 1 if you have the `lstat' function. */
- #undef HAVE_LSTAT
-@@ -589,12 +622,18 @@
- /* Define to 1 if you have the <search.h> header file. */
- #undef HAVE_SEARCH_H
-+/* Define to 1 if you have the <selinux/selinux.h> header file. */
-+#undef HAVE_SELINUX_SELINUX_H
-+
- /* Define to 1 if you have the `setenv' function. */
- #undef HAVE_SETENV
- /* Define to 1 if you have the `setlocale' function. */
- #undef HAVE_SETLOCALE
-+/* Define to 1 if you have the `setxattr' function. */
-+#undef HAVE_SETXATTR
-+
- /* Define to 1 if you have the <sgtty.h> header file. */
- #undef HAVE_SGTTY_H
-@@ -734,6 +773,9 @@
- /* Define to 1 if you have the <sysexits.h> header file. */
- #undef HAVE_SYSEXITS_H
-+/* Define to 1 if you have the <sys/acl.h> header file. */
-+#undef HAVE_SYS_ACL_H
-+
- /* Define to 1 if you have the <sys/bitypes.h> header file. */
- #undef HAVE_SYS_BITYPES_H
-@@ -891,6 +933,9 @@
- /* Define if utimes works properly. */
- #undef HAVE_WORKING_UTIMES
-+/* Define if we have a working extended attributes */
-+#undef HAVE_XATTRS
-+
- /* Define to 1 if the system has the type `_Bool'. */
- #undef HAVE__BOOL
-diff -urNp tar-1.22-orig/configure tar-1.22/configure
---- tar-1.22-orig/configure    2009-03-05 08:05:20.000000000 +0100
-+++ tar-1.22/configure 2009-03-05 09:57:06.000000000 +0100
-@@ -2127,6 +2127,9 @@ ac_header_list="$ac_header_list sys/tpri
- ac_header_list="$ac_header_list sys/tape.h"
- ac_header_list="$ac_header_list unistd.h"
- ac_header_list="$ac_header_list locale.h"
-+ac_header_list="$ac_header_list selinux/selinux.h"
-+ac_header_list="$ac_header_list attr/xattr.h"
-+ac_header_list="$ac_header_list sys/acl.h"
- ac_func_list="$ac_func_list flockfile"
- ac_func_list="$ac_func_list funlockfile"
- ac_header_list="$ac_header_list features.h"
-@@ -6022,7 +6025,14 @@ return strerror ();
-   return 0;
- }
- _ACEOF
--rm -f conftest.$ac_objext conftest$ac_exeext
-+for ac_lib in '' cposix; do
-+  if test -z "$ac_lib"; then
-+    ac_res="none required"
-+  else
-+    ac_res=-l$ac_lib
-+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
-+  fi
-+  rm -f conftest.$ac_objext conftest$ac_exeext
- if { (ac_try="$ac_link"
- case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-@@ -6040,25 +6050,35 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec
-        test ! -s conftest.err
-        } && test -s conftest$ac_exeext &&
-        $as_test_x conftest$ac_exeext; then
--  ac_cv_lib_cposix_strerror=yes
-+  ac_cv_search_strerror=$ac_res
- else
-   echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
--      ac_cv_lib_cposix_strerror=no
-+
- fi
- rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
--      conftest$ac_exeext conftest.$ac_ext
--LIBS=$ac_check_lib_save_LIBS
-+      conftest$ac_exeext
-+  if test "${ac_cv_search_strerror+set}" = set; then
-+  break
- fi
--{ echo "$as_me:$LINENO: result: $ac_cv_lib_cposix_strerror" >&5
--echo "${ECHO_T}$ac_cv_lib_cposix_strerror" >&6; }
--if test $ac_cv_lib_cposix_strerror = yes; then
--  LIBS="$LIBS -lcposix"
-+done
-+if test "${ac_cv_search_strerror+set}" = set; then
-+  :
-+else
-+  ac_cv_search_strerror=no
- fi
-+rm conftest.$ac_ext
-+LIBS=$ac_func_search_save_LIBS
-+fi
-+{ echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5
-+echo "${ECHO_T}$ac_cv_search_strerror" >&6; }
-+ac_res=$ac_cv_search_strerror
-+if test "$ac_res" != no; then
-+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
--
-+fi
- { echo "$as_me:$LINENO: checking for inline" >&5
- echo $ECHO_N "checking for inline... $ECHO_C" >&6; }
-@@ -38773,6 +38793,257 @@ _ACEOF
- fi
- done
-+
-+
-+
-+
-+
-+
-+
-+
-+
-+for ac_func in getxattr  fgetxattr  lgetxattr \
-+               setxattr  fsetxattr  lsetxattr \
-+               listxattr flistxattr llistxattr
-+do
-+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+  cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-+#define $ac_func innocuous_$ac_func
-+
-+/* System header to define __stub macros and hopefully few prototypes,
-+    which can conflict with char $ac_func (); below.
-+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-+    <limits.h> exists even on freestanding compilers.  */
-+
-+#ifdef __STDC__
-+# include <limits.h>
-+#else
-+# include <assert.h>
-+#endif
-+
-+#undef $ac_func
-+
-+/* Override any GCC internal prototype to avoid an error.
-+   Use char because int might match the return type of a GCC
-+   builtin and then its argument prototype would still apply.  */
-+#ifdef __cplusplus
-+extern "C"
-+#endif
-+char $ac_func ();
-+/* The GNU C library defines this for functions which it implements
-+    to always fail with ENOSYS.  Some functions are actually named
-+    something starting with __ and the normal name is an alias.  */
-+#if defined __stub_$ac_func || defined __stub___$ac_func
-+choke me
-+#endif
-+
-+int
-+main ()
-+{
-+return $ac_func ();
-+  ;
-+  return 0;
-+}
-+_ACEOF
-+rm -f conftest.$ac_objext conftest$ac_exeext
-+if { (ac_try="$ac_link"
-+case "(($ac_try" in
-+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-+  *) ac_try_echo=$ac_try;;
-+esac
-+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+  (eval "$ac_link") 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } && {
-+       test -z "$ac_c_werror_flag" ||
-+       test ! -s conftest.err
-+       } && test -s conftest$ac_exeext &&
-+       $as_test_x conftest$ac_exeext; then
-+  eval "$as_ac_var=yes"
-+else
-+  echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+      eval "$as_ac_var=no"
-+fi
-+
-+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-+      conftest$ac_exeext conftest.$ac_ext
-+fi
-+ac_res=`eval echo '${'$as_ac_var'}'`
-+             { echo "$as_me:$LINENO: result: $ac_res" >&5
-+echo "${ECHO_T}$ac_res" >&6; }
-+if test `eval echo '${'$as_ac_var'}'` = yes; then
-+  cat >>confdefs.h <<_ACEOF
-+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-+_ACEOF
-+
-+cat >>confdefs.h <<\_ACEOF
-+#define HAVE_XATTRS
-+_ACEOF
-+
-+fi
-+done
-+
-+
-+{ echo "$as_me:$LINENO: checking for getfilecon in -lselinux" >&5
-+echo $ECHO_N "checking for getfilecon in -lselinux... $ECHO_C" >&6; }
-+if test "${ac_cv_lib_selinux_getfilecon+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+  ac_check_lib_save_LIBS=$LIBS
-+LIBS="-lselinux  $LIBS"
-+cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+
-+/* Override any GCC internal prototype to avoid an error.
-+   Use char because int might match the return type of a GCC
-+   builtin and then its argument prototype would still apply.  */
-+#ifdef __cplusplus
-+extern "C"
-+#endif
-+char getfilecon ();
-+int
-+main ()
-+{
-+return getfilecon ();
-+  ;
-+  return 0;
-+}
-+_ACEOF
-+rm -f conftest.$ac_objext conftest$ac_exeext
-+if { (ac_try="$ac_link"
-+case "(($ac_try" in
-+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-+  *) ac_try_echo=$ac_try;;
-+esac
-+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+  (eval "$ac_link") 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } && {
-+       test -z "$ac_c_werror_flag" ||
-+       test ! -s conftest.err
-+       } && test -s conftest$ac_exeext &&
-+       $as_test_x conftest$ac_exeext; then
-+  ac_cv_lib_selinux_getfilecon=yes
-+else
-+  echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+      ac_cv_lib_selinux_getfilecon=no
-+fi
-+
-+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-+      conftest$ac_exeext conftest.$ac_ext
-+LIBS=$ac_check_lib_save_LIBS
-+fi
-+{ echo "$as_me:$LINENO: result: $ac_cv_lib_selinux_getfilecon" >&5
-+echo "${ECHO_T}$ac_cv_lib_selinux_getfilecon" >&6; }
-+if test $ac_cv_lib_selinux_getfilecon = yes; then
-+  cat >>confdefs.h <<_ACEOF
-+#define HAVE_LIBSELINUX 1
-+_ACEOF
-+
-+  LIBS="-lselinux $LIBS"
-+
-+fi
-+
-+
-+{ echo "$as_me:$LINENO: checking for acl_get_fd in -lacl" >&5
-+echo $ECHO_N "checking for acl_get_fd in -lacl... $ECHO_C" >&6; }
-+if test "${ac_cv_lib_acl_acl_get_fd+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+  ac_check_lib_save_LIBS=$LIBS
-+LIBS="-lacl  $LIBS"
-+cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+
-+/* Override any GCC internal prototype to avoid an error.
-+   Use char because int might match the return type of a GCC
-+   builtin and then its argument prototype would still apply.  */
-+#ifdef __cplusplus
-+extern "C"
-+#endif
-+char acl_get_fd ();
-+int
-+main ()
-+{
-+return acl_get_fd ();
-+  ;
-+  return 0;
-+}
-+_ACEOF
-+rm -f conftest.$ac_objext conftest$ac_exeext
-+if { (ac_try="$ac_link"
-+case "(($ac_try" in
-+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-+  *) ac_try_echo=$ac_try;;
-+esac
-+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+  (eval "$ac_link") 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } && {
-+       test -z "$ac_c_werror_flag" ||
-+       test ! -s conftest.err
-+       } && test -s conftest$ac_exeext &&
-+       $as_test_x conftest$ac_exeext; then
-+  ac_cv_lib_acl_acl_get_fd=yes
-+else
-+  echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+      ac_cv_lib_acl_acl_get_fd=no
-+fi
-+
-+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-+      conftest$ac_exeext conftest.$ac_ext
-+LIBS=$ac_check_lib_save_LIBS
-+fi
-+{ echo "$as_me:$LINENO: result: $ac_cv_lib_acl_acl_get_fd" >&5
-+echo "${ECHO_T}$ac_cv_lib_acl_acl_get_fd" >&6; }
-+if test $ac_cv_lib_acl_acl_get_fd = yes; then
-+  cat >>confdefs.h <<_ACEOF
-+#define HAVE_LIBACL 1
-+_ACEOF
-+
-+  LIBS="-lacl $LIBS"
-+
-+fi
-+
-+
- { echo "$as_me:$LINENO: checking whether getgrgid is declared" >&5
- echo $ECHO_N "checking whether getgrgid is declared... $ECHO_C" >&6; }
- if test "${ac_cv_have_decl_getgrgid+set}" = set; then
-@@ -40571,6 +40842,296 @@ fi
- done
-+
-+for ac_header in selinux/selinux.h
-+do
-+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
-+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
-+fi
-+ac_res=`eval echo '${'$as_ac_Header'}'`
-+             { echo "$as_me:$LINENO: result: $ac_res" >&5
-+echo "${ECHO_T}$ac_res" >&6; }
-+else
-+  # Is the header compilable?
-+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-+cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+$ac_includes_default
-+#include <$ac_header>
-+_ACEOF
-+rm -f conftest.$ac_objext
-+if { (ac_try="$ac_compile"
-+case "(($ac_try" in
-+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-+  *) ac_try_echo=$ac_try;;
-+esac
-+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+  (eval "$ac_compile") 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } && {
-+       test -z "$ac_c_werror_flag" ||
-+       test ! -s conftest.err
-+       } && test -s conftest.$ac_objext; then
-+  ac_header_compiler=yes
-+else
-+  echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+      ac_header_compiler=no
-+fi
-+
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-+echo "${ECHO_T}$ac_header_compiler" >&6; }
-+
-+# Is the header present?
-+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-+cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+#include <$ac_header>
-+_ACEOF
-+if { (ac_try="$ac_cpp conftest.$ac_ext"
-+case "(($ac_try" in
-+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-+  *) ac_try_echo=$ac_try;;
-+esac
-+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } >/dev/null && {
-+       test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-+       test ! -s conftest.err
-+       }; then
-+  ac_header_preproc=yes
-+else
-+  echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+  ac_header_preproc=no
-+fi
-+
-+rm -f conftest.err conftest.$ac_ext
-+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-+echo "${ECHO_T}$ac_header_preproc" >&6; }
-+
-+# So?  What about this header?
-+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-+  yes:no: )
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-+    ac_header_preproc=yes
-+    ;;
-+  no:yes:* )
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-+    ( cat <<\_ASBOX
-+## ------------------------------ ##
-+## Report this to bug-tar@gnu.org ##
-+## ------------------------------ ##
-+_ASBOX
-+     ) | sed "s/^/$as_me: WARNING:     /" >&2
-+    ;;
-+esac
-+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+  eval "$as_ac_Header=\$ac_header_preproc"
-+fi
-+ac_res=`eval echo '${'$as_ac_Header'}'`
-+             { echo "$as_me:$LINENO: result: $ac_res" >&5
-+echo "${ECHO_T}$ac_res" >&6; }
-+
-+fi
-+if test `eval echo '${'$as_ac_Header'}'` = yes; then
-+  cat >>confdefs.h <<_ACEOF
-+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-+_ACEOF
-+
-+fi
-+
-+done
-+
-+
-+for ac_header in attr/xattr.h
-+do
-+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
-+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
-+fi
-+ac_res=`eval echo '${'$as_ac_Header'}'`
-+             { echo "$as_me:$LINENO: result: $ac_res" >&5
-+echo "${ECHO_T}$ac_res" >&6; }
-+else
-+  # Is the header compilable?
-+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-+cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+$ac_includes_default
-+#include <$ac_header>
-+_ACEOF
-+rm -f conftest.$ac_objext
-+if { (ac_try="$ac_compile"
-+case "(($ac_try" in
-+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-+  *) ac_try_echo=$ac_try;;
-+esac
-+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+  (eval "$ac_compile") 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } && {
-+       test -z "$ac_c_werror_flag" ||
-+       test ! -s conftest.err
-+       } && test -s conftest.$ac_objext; then
-+  ac_header_compiler=yes
-+else
-+  echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+      ac_header_compiler=no
-+fi
-+
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-+echo "${ECHO_T}$ac_header_compiler" >&6; }
-+
-+# Is the header present?
-+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-+cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h.  */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h.  */
-+#include <$ac_header>
-+_ACEOF
-+if { (ac_try="$ac_cpp conftest.$ac_ext"
-+case "(($ac_try" in
-+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-+  *) ac_try_echo=$ac_try;;
-+esac
-+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-+  ac_status=$?
-+  grep -v '^ *+' conftest.er1 >conftest.err
-+  rm -f conftest.er1
-+  cat conftest.err >&5
-+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+  (exit $ac_status); } >/dev/null && {
-+       test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-+       test ! -s conftest.err
-+       }; then
-+  ac_header_preproc=yes
-+else
-+  echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+  ac_header_preproc=no
-+fi
-+
-+rm -f conftest.err conftest.$ac_ext
-+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-+echo "${ECHO_T}$ac_header_preproc" >&6; }
-+
-+# So?  What about this header?
-+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-+  yes:no: )
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-+    ac_header_preproc=yes
-+    ;;
-+  no:yes:* )
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-+    ( cat <<\_ASBOX
-+## ------------------------------ ##
-+## Report this to bug-tar@gnu.org ##
-+## ------------------------------ ##
-+_ASBOX
-+     ) | sed "s/^/$as_me: WARNING:     /" >&2
-+    ;;
-+esac
-+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+  eval "$as_ac_Header=\$ac_header_preproc"
-+fi
-+ac_res=`eval echo '${'$as_ac_Header'}'`
-+             { echo "$as_me:$LINENO: result: $ac_res" >&5
-+echo "${ECHO_T}$ac_res" >&6; }
-+
-+fi
-+if test `eval echo '${'$as_ac_Header'}'` = yes; then
-+  cat >>confdefs.h <<_ACEOF
-+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-+_ACEOF
-+
-+fi
-+
-+done
-+
- { echo "$as_me:$LINENO: checking for iconv_t" >&5
- echo $ECHO_N "checking for iconv_t... $ECHO_C" >&6; }
- if test "${ac_cv_type_iconv_t+set}" = set; then
-diff -urNp tar-1.22-orig/src/Makefile.in tar-1.22/src/Makefile.in
---- tar-1.22-orig/src/Makefile.in      2009-03-05 08:05:26.000000000 +0100
-+++ tar-1.22/src/Makefile.in   2009-03-05 09:57:06.000000000 +0100
-@@ -143,7 +143,8 @@ am_tar_OBJECTS = buffer.$(OBJEXT) checkp
-       extract.$(OBJEXT) xheader.$(OBJEXT) incremen.$(OBJEXT) \
-       list.$(OBJEXT) misc.$(OBJEXT) names.$(OBJEXT) sparse.$(OBJEXT) \
-       suffix.$(OBJEXT) system.$(OBJEXT) tar.$(OBJEXT) \
--      transform.$(OBJEXT) update.$(OBJEXT) utf8.$(OBJEXT)
-+      transform.$(OBJEXT) update.$(OBJEXT) utf8.$(OBJEXT) \
-+      xattrs.$(OBJEXT)
- tar_OBJECTS = $(am_tar_OBJECTS)
- am__DEPENDENCIES_1 =
- am__DEPENDENCIES_2 = ../lib/libtar.a $(am__DEPENDENCIES_1) \
-@@ -653,7 +654,7 @@ sysconfdir = @sysconfdir@
- target_alias = @target_alias@
- top_builddir = @top_builddir@
- top_srcdir = @top_srcdir@
--noinst_HEADERS = arith.h common.h tar.h
-+noinst_HEADERS = arith.h common.h tar.h xattrs.h
- tar_SOURCES = \
-  buffer.c\
-  checkpoint.c\
-@@ -672,11 +673,12 @@ tar_SOURCES = \
-  tar.c\
-  transform.c\
-  update.c\
-- utf8.c
-+ utf8.c\
-+ xattrs.c
- INCLUDES = -I$(top_srcdir)/lib -I../ -I../lib
- LDADD = ../lib/libtar.a $(LIBINTL) $(LIBICONV)
--tar_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME)
-+tar_LDADD = $(LIBS) $(LDADD) $(LIB_CLOCK_GETTIME)
- all: all-am
- .SUFFIXES:
-@@ -776,6 +778,7 @@ distclean-compile:
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/transform.Po@am__quote@
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/update.Po@am__quote@
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utf8.Po@am__quote@
-+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xattrs.Po@am__quote@
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xheader.Po@am__quote@
- .c.o:
similarity index 72%
rename from pkgs/toolchain/tar/patches/tar-1.22-xattrs-1.patch
rename to pkgs/toolchain/tar/patches/tar-1.23-xattrs.patch
index 49ba87e88a66d5909530c57042d403e7385858c7..b8296524566943c861cb26bcd92bdd80a2777b0f 100644 (file)
@@ -1,16 +1,16 @@
-diff -urp tar-1.22-orig/configure.ac tar-1.22/configure.ac
---- tar-1.22-orig/configure.ac 2009-03-05 08:01:58.000000000 +0100
-+++ tar-1.22/configure.ac      2009-03-05 09:45:42.000000000 +0100
-@@ -40,7 +40,7 @@ AC_CHECK_HEADERS_ONCE(fcntl.h linux/fd.h
+diff -urNp tar-1.23-orig/configure.ac tar-1.23/configure.ac
+--- tar-1.23-orig/configure.ac 2010-03-10 11:47:54.000000000 +0100
++++ tar-1.23/configure.ac      2010-03-12 13:48:43.000000000 +0100
+@@ -44,7 +44,7 @@ AC_CHECK_HEADERS_ONCE(fcntl.h linux/fd.h
    sys/param.h sys/device.h sys/filio.h sys/gentape.h \
    sys/inet.h sys/io/trioctl.h \
    sys/mtio.h sys/time.h sys/tprintf.h sys/tape.h \
 -  unistd.h locale.h)
-+  unistd.h locale.h selinux/selinux.h attr/xattr.h sys/acl.h)
++  unistd.h locale.h attr/xattr.h sys/acl.h)
  
  AC_CHECK_HEADERS([sys/buf.h], [], [],
  [#if HAVE_SYS_PARAM_H
-@@ -88,6 +88,13 @@ gl_INIT
+@@ -91,6 +91,12 @@ gl_INIT
  tar_PAXUTILS
  
  AC_CHECK_FUNCS(fsync getdtablesize lstat mkfifo readlink symlink setlocale utimes)
@@ -18,25 +18,41 @@ diff -urp tar-1.22-orig/configure.ac tar-1.22/configure.ac
 +               setxattr  fsetxattr  lsetxattr \
 +               listxattr flistxattr llistxattr,
 +               AC_DEFINE(HAVE_XATTRS,,[Define if we have a working extended attributes]),)
-+AC_CHECK_LIB(selinux, getfilecon)
 +AC_CHECK_LIB(acl, acl_get_fd)
 +
  AC_CHECK_DECLS([getgrgid],,, [#include <grp.h>])
  AC_CHECK_DECLS([getpwuid],,, [#include <pwd.h>])
  AC_CHECK_DECLS([time],,, [#include <time.h>])
-@@ -203,6 +210,8 @@ AC_DEFINE_UNQUOTED(DEFAULT_QUOTING_STYLE
+@@ -214,6 +220,7 @@ AC_DEFINE_UNQUOTED(DEFAULT_QUOTING_STYLE
  # Iconv
  AM_ICONV
  AC_CHECK_HEADERS(iconv.h)
-+AC_CHECK_HEADERS(selinux/selinux.h)
 +AC_CHECK_HEADERS(attr/xattr.h)
  AC_CHECK_TYPE(iconv_t,:,
                AC_DEFINE(iconv_t, int,
                          [Conversion descriptor type]),
-diff -urp tar-1.22-orig/doc/tar.texi tar-1.22/doc/tar.texi
---- tar-1.22-orig/doc/tar.texi 2009-03-05 08:04:13.000000000 +0100
-+++ tar-1.22/doc/tar.texi      2009-03-05 09:45:42.000000000 +0100
-@@ -2345,6 +2345,10 @@ Normally when creating an archive, @comm
+@@ -223,6 +230,17 @@ AC_CHECK_TYPE(iconv_t,:,
+ #endif
+ ])
++AC_ARG_ENABLE(selinux,
++  AC_HELP_STRING([--enable-selinux],
++    [enable SELinux support (disabled by default)]),
++  [selinux_enabled=$enableval],
++  [selinux_enabled=no])
++
++if test "x$selinux_enabled" = xyes; then
++  AC_CHECK_LIB(selinux, getfilecon)
++  AC_CHECK_HEADERS(selinux/selinux.h)
++fi
++
+ # Gettext.
+ AM_GNU_GETTEXT([external], [need-formatstring-macros])
+ AM_GNU_GETTEXT_VERSION([0.16])
+diff -urNp tar-1.23-orig/doc/tar.texi tar-1.23/doc/tar.texi
+--- tar-1.23-orig/doc/tar.texi 2010-03-09 15:24:24.000000000 +0100
++++ tar-1.23/doc/tar.texi      2010-03-12 13:48:43.000000000 +0100
+@@ -2364,6 +2364,10 @@ Normally when creating an archive, @comm
  @samp{/} from member names.  This option disables that behavior.
  @xref{absolute}.
  
@@ -47,7 +63,7 @@ diff -urp tar-1.22-orig/doc/tar.texi tar-1.22/doc/tar.texi
  @opsummary{after-date}
  @item --after-date
  
-@@ -2844,6 +2848,10 @@ contents have changed (as opposed to jus
+@@ -2885,6 +2889,10 @@ contents have changed (as opposed to jus
  also back up files for which any status information has
  changed).  @xref{after}.
  
@@ -58,9 +74,9 @@ diff -urp tar-1.22-orig/doc/tar.texi tar-1.22/doc/tar.texi
  @opsummary{no-anchored}
  @item --no-anchored
  An exclude pattern can match any subsequence of the name's components.
-@@ -2919,11 +2927,21 @@ When extracting an archive, subtract the
- the permissions specified in the archive.  This is the default behavior
for ordinary users.
+@@ -2968,11 +2976,21 @@ locations.  Usually @command{tar} determ
+ the archive can be seeked or not.  Use this option to disable this
mechanism.
  
 +@opsummary{no-selinux}
 +@item --no-selinux
@@ -80,9 +96,9 @@ diff -urp tar-1.22-orig/doc/tar.texi tar-1.22/doc/tar.texi
  @opsummary{no-wildcards}
  @item --no-wildcards
  Do not use wildcards.
-@@ -3151,6 +3169,11 @@ locations.  Usually @command{tar} determ
- the archive can be seeked or not.  This option is intended for use
in cases when such recognition fails.
+@@ -3202,6 +3220,11 @@ in cases when such recognition fails.  I
+ archive is open for reading (e.g. with @option{--list} or
@option{--extract} options).
  
 +@opsummary{selinux}
 +@item --selinux
@@ -92,9 +108,9 @@ diff -urp tar-1.22-orig/doc/tar.texi tar-1.22/doc/tar.texi
  @opsummary{show-defaults}
  @item --show-defaults
  
-@@ -3349,6 +3372,11 @@ Used in conjunction with @option{--multi
- keep track of which volume of a multi-volume archive it is working in
- @var{file}.  @xref{volno-file}.
+@@ -3411,6 +3434,11 @@ Enable or disable warning messages ident
+ messages are suppressed if @var{keyword} is prefixed with @samp{no-}.
+ @xref{warnings}.
  
 +@opsummary{xattrs}
 +@item --xattrs
@@ -104,7 +120,7 @@ diff -urp tar-1.22-orig/doc/tar.texi tar-1.22/doc/tar.texi
  @opsummary{wildcards}
  @item --wildcards
  Use wildcards when matching member names with patterns.
-@@ -8350,6 +8378,8 @@ implementation able to read @samp{ustar}
+@@ -8599,6 +8627,8 @@ implementation able to read @samp{ustar}
  most @samp{posix} archives as well, with the only exception that any
  additional information (such as long file names etc.) will in such
  case be extracted as plain text files along with the files it refers to.
@@ -113,7 +129,7 @@ diff -urp tar-1.22-orig/doc/tar.texi tar-1.22/doc/tar.texi
  
  This archive format will be the default format for future versions
  of @GNUTAR{}.
-@@ -8902,6 +8932,51 @@ Same as both @option{--same-permissions}
+@@ -9160,6 +9190,51 @@ Same as both @option{--same-permissions}
  
  This option is deprecated, and will be removed in @GNUTAR{} version 1.23.
  
@@ -165,10 +181,10 @@ diff -urp tar-1.22-orig/doc/tar.texi tar-1.22/doc/tar.texi
  @end table
  
  @node Portability
-diff -urp tar-1.22-orig/src/common.h tar-1.22/src/common.h
---- tar-1.22-orig/src/common.h 2008-11-30 13:30:29.000000000 +0100
-+++ tar-1.22/src/common.h      2009-03-05 09:45:42.000000000 +0100
-@@ -248,6 +248,15 @@ GLOBAL int same_owner_option;
+diff -urNp tar-1.23-orig/src/common.h tar-1.23/src/common.h
+--- tar-1.23-orig/src/common.h 2010-01-26 13:21:18.000000000 +0100
++++ tar-1.23/src/common.h      2010-03-12 13:48:43.000000000 +0100
+@@ -251,6 +251,15 @@ GLOBAL int same_owner_option;
  /* If positive, preserve permissions when extracting.  */
  GLOBAL int same_permissions_option;
  
@@ -184,7 +200,7 @@ diff -urp tar-1.22-orig/src/common.h tar-1.22/src/common.h
  /* When set, strip the given number of file name components from the file name
     before extracting */
  GLOBAL size_t strip_name_components;
-@@ -673,6 +682,9 @@ extern char *output_start;
+@@ -732,6 +741,9 @@ extern char *output_start;
  
  void update_archive (void);
  
@@ -194,7 +210,7 @@ diff -urp tar-1.22-orig/src/common.h tar-1.22/src/common.h
  /* Module xheader.c.  */
  
  void xheader_init (struct xheader *xhdr);
-@@ -694,6 +706,12 @@ bool xheader_string_end (struct xheader 
+@@ -753,6 +765,12 @@ bool xheader_string_end (struct xheader 
  bool xheader_keyword_deleted_p (const char *kw);
  char *xheader_format_name (struct tar_stat_info *st, const char *fmt,
                           size_t n);
@@ -207,9 +223,9 @@ diff -urp tar-1.22-orig/src/common.h tar-1.22/src/common.h
  
  /* Module system.c */
  
-diff -urp tar-1.22-orig/src/create.c tar-1.22/src/create.c
---- tar-1.22-orig/src/create.c 2008-10-30 11:58:04.000000000 +0100
-+++ tar-1.22/src/create.c      2009-03-05 09:45:42.000000000 +0100
+diff -urNp tar-1.23-orig/src/create.c tar-1.23/src/create.c
+--- tar-1.23-orig/src/create.c 2010-03-09 13:52:41.000000000 +0100
++++ tar-1.23/src/create.c      2010-03-12 13:48:43.000000000 +0100
 @@ -24,6 +24,7 @@
  #include <quotearg.h>
  
@@ -218,7 +234,7 @@ diff -urp tar-1.22-orig/src/create.c tar-1.22/src/create.c
  #include <hash.h>
  
  struct link
-@@ -944,6 +945,30 @@ start_header (struct tar_stat_info *st)
+@@ -947,6 +948,30 @@ start_header (struct tar_stat_info *st)
        GNAME_TO_CHARS (st->gname, header->header.gname);
      }
  
@@ -237,7 +253,7 @@ diff -urp tar-1.22-orig/src/create.c tar-1.22/src/create.c
 +        {
 +          size_t scan_xattr = 0;
 +          struct xattr_array *xattr_map = st->xattr_map;
-+          
++
 +          while (scan_xattr < st->xattr_map_size)
 +            {
 +              xheader_store (xattr_map[scan_xattr].xkey, st, &scan_xattr);
@@ -249,7 +265,7 @@ diff -urp tar-1.22-orig/src/create.c tar-1.22/src/create.c
    return header;
  }
  
-@@ -1578,6 +1603,10 @@ dump_file0 (struct tar_stat_info *st, co
+@@ -1580,6 +1605,10 @@ dump_file0 (struct tar_stat_info *st, co
            }
        }
  
@@ -260,10 +276,20 @@ diff -urp tar-1.22-orig/src/create.c tar-1.22/src/create.c
        if (is_dir)
        {
          const char *tag_file_name;
-diff -urp tar-1.22-orig/src/extract.c tar-1.22/src/extract.c
---- tar-1.22-orig/src/extract.c        2008-10-30 15:10:28.000000000 +0100
-+++ tar-1.22/src/extract.c     2009-03-05 09:45:42.000000000 +0100
-@@ -69,6 +69,13 @@ struct delayed_set_stat
+@@ -1702,6 +1731,9 @@ dump_file0 (struct tar_stat_info *st, co
+       if (NAME_FIELD_SIZE - (archive_format == OLDGNU_FORMAT) < size)
+       write_long_link (st);
++      xattrs_selinux_get(st, p, -1);
++      xattrs_xattrs_get(st, p, -1);
++
+       block_ordinal = current_block_ordinal ();
+       st->stat.st_size = 0;   /* force 0 size on symlink */
+       header = start_header (st);
+diff -urNp tar-1.23-orig/src/extract.c tar-1.23/src/extract.c
+--- tar-1.23-orig/src/extract.c        2010-01-26 12:28:09.000000000 +0100
++++ tar-1.23/src/extract.c     2010-03-12 13:48:43.000000000 +0100
+@@ -70,6 +70,13 @@ struct delayed_set_stat
      mode_t invert_permissions;
      enum permstatus permstatus;
      bool after_links;
@@ -277,26 +303,26 @@ diff -urp tar-1.22-orig/src/extract.c tar-1.22/src/extract.c
      char file_name[1];
    };
  
-@@ -96,6 +103,18 @@ struct delayed_link
+@@ -97,6 +104,18 @@ struct delayed_link
         hard-linked together.  */
      struct string_list *sources;
  
 +    /* SELinux context */
 +    char *cntx_name;
-+   
++
 +    /* ACLs */
 +    char *acls_a_ptr;
 +    size_t acls_a_len;
 +    char *acls_d_ptr;
 +    size_t acls_d_len;
-+   
++
 +    size_t xattr_map_size;   /* Size of the xattr map */
 +    struct xattr_array *xattr_map;
-+   
++
      /* The desired target of the desired link.  */
      char target[1];
    };
-@@ -276,6 +295,10 @@ set_stat (char const *file_name,
+@@ -290,6 +309,10 @@ set_stat (char const *file_name,
         give files away.  */
      }
  
@@ -307,7 +333,7 @@ diff -urp tar-1.22-orig/src/extract.c tar-1.22/src/extract.c
    if (0 < same_owner_option && permstatus != INTERDIR_PERMSTATUS)
      {
        /* When lchown exists, it should be used to change the attributes of
-@@ -352,6 +375,29 @@ delay_set_stat (char const *file_name, s
+@@ -366,6 +389,29 @@ delay_set_stat (char const *file_name, s
    data->invert_permissions = invert_permissions;
    data->permstatus = permstatus;
    data->after_links = 0;
@@ -337,7 +363,39 @@ diff -urp tar-1.22-orig/src/extract.c tar-1.22/src/extract.c
    strcpy (data->file_name, file_name);
    delayed_set_stat_head = data;
  }
-@@ -599,11 +645,22 @@ apply_nonancestor_delayed_set_stat (char
+@@ -571,6 +617,31 @@ maybe_recoverable (char *file_name, int 
+     }
+ }
++/* Restore stat extended attributes (xattr) for FILE_NAME, using information
++   given in *ST.  Restore before extraction because they may affect layout.
++   If not restoring permissions, invert the
++   INVERT_PERMISSIONS bits from the file's current permissions.
++   TYPEFLAG specifies the type of the file.
++   FILE_CREATED indicates set_xattr has created the file */
++static int
++set_xattr (char const *file_name, struct tar_stat_info const *st,
++         mode_t invert_permissions, char typeflag, int *file_created)
++{
++  int status = 0;
++  int interdir_made = 0;
++
++  if ((xattrs_option >= 0) && st->xattr_map_size) {
++    mode_t mode = current_stat_info.stat.st_mode & MODE_RWX & ~ current_umask;
++
++    do
++      status = mknod (file_name, mode ^ invert_permissions, 0);
++    while (status && maybe_recoverable ((char *)file_name, &interdir_made));
++    xattrs_xattrs_set(st, file_name, typeflag);
++    *file_created = 1;
++  }
++  return(status);
++}
++
+ /* Fix the statuses of all directories whose statuses need fixing, and
+    which are not ancestors of FILE_NAME.  If AFTER_LINKS is
+    nonzero, do this for all such directories; otherwise, stop at the
+@@ -624,11 +695,22 @@ apply_nonancestor_delayed_set_stat (char
          sb.stat.st_gid = data->gid;
          sb.atime = data->atime;
          sb.mtime = data->mtime;
@@ -360,21 +418,61 @@ diff -urp tar-1.22-orig/src/extract.c tar-1.22/src/extract.c
        free (data);
      }
  }
-@@ -882,6 +939,13 @@ create_placeholder_file (char *file_name
+@@ -730,7 +812,7 @@ extract_dir (char *file_name, int typefl
+ static int
+-open_output_file (char *file_name, int typeflag, mode_t mode)
++open_output_file (char *file_name, int typeflag, mode_t mode, int file_created)
+ {
+   int fd;
+   int openflag = (O_WRONLY | O_BINARY | O_CREAT
+@@ -738,6 +820,10 @@ open_output_file (char *file_name, int t
+                    ? O_TRUNC
+                    : O_EXCL));
++  /* File might be created in set_xattr. So clear O_EXCL to avoid open() failure */
++  if (file_created)
++    openflag = openflag & ~O_EXCL;
++
+ #if O_CTG
+   /* Contiguous files (on the Masscomp) have to specify the size in
+      the open call that creates them.  */
+@@ -796,8 +882,18 @@ extract_file (char *file_name, int typef
+   else
+     {
+       int recover = RECOVER_NO;
++      int file_created = 0;
++      if (set_xattr (file_name, &current_stat_info, invert_permissions,
++                   typeflag, &file_created))
++        {
++          skip_member ();
++          open_error (file_name);
++          return 1;
++        }
++
+       do
+-      fd = open_output_file (file_name, typeflag, mode ^ invert_permissions);
++      fd = open_output_file (file_name, typeflag, mode ^ invert_permissions,
++                             file_created);
+       while (fd < 0
+            && (recover = maybe_recoverable (file_name, &interdir_made))
+                == RECOVER_OK);
+@@ -922,6 +1018,13 @@ create_placeholder_file (char *file_name
                            + strlen (file_name) + 1);
        p->sources->next = 0;
        strcpy (p->sources->string, file_name);
 +      p->cntx_name = NULL;
++      assign_string (&p->cntx_name, current_stat_info.cntx_name);
 +      p->acls_a_ptr = NULL;
 +      p->acls_a_len = 0;
 +      p->acls_d_ptr = NULL;
 +      p->acls_d_len = 0;
-+      p->xattr_map = NULL;
-+      p->xattr_map_size = 0;
++      xheader_xattr_copy (&current_stat_info, &p->xattr_map, &p->xattr_map_size);
        strcpy (p->target, current_stat_info.link_name);
  
        h = delayed_set_stat_head;
-@@ -1288,6 +1352,13 @@ apply_delayed_links (void)
+@@ -1335,6 +1438,13 @@ apply_delayed_links (void)
                  struct tar_stat_info st1;
                  st1.stat.st_uid = ds->uid;
                  st1.stat.st_gid = ds->gid;
@@ -388,10 +486,20 @@ diff -urp tar-1.22-orig/src/extract.c tar-1.22/src/extract.c
                  set_stat (source, &st1, NULL, 0, 0, SYMTYPE);
                  valid_source = source;
                }
-diff -urp tar-1.22-orig/src/list.c tar-1.22/src/list.c
---- tar-1.22-orig/src/list.c   2009-03-05 09:45:15.000000000 +0100
-+++ tar-1.22/src/list.c        2009-03-05 09:45:42.000000000 +0100
-@@ -567,6 +567,13 @@ decode_header (union block *header, stru
+@@ -1348,6 +1458,9 @@ apply_delayed_links (void)
+         sources = next;
+       }
++   xheader_xattr_free (ds->xattr_map, ds->xattr_map_size);
++   free (ds->cntx_name);
++
+       {
+       struct delayed_link *next = ds->next;
+       free (ds);
+diff -urNp tar-1.23-orig/src/list.c tar-1.23/src/list.c
+--- tar-1.23-orig/src/list.c   2010-03-12 13:40:53.000000000 +0100
++++ tar-1.23/src/list.c        2010-03-12 13:48:43.000000000 +0100
+@@ -585,6 +585,13 @@ decode_header (union block *header, stru
    assign_string (&stat_info->gname,
                 header->header.gname[0] ? header->header.gname : NULL);
  
@@ -401,13 +509,13 @@ diff -urp tar-1.22-orig/src/list.c tar-1.22/src/list.c
 +  stat_info->acls_d_len = 0;
 +  stat_info->cntx_name = NULL;
 +  xheader_xattr_init(stat_info);
-+  
++
    if (format == OLDGNU_FORMAT && incremental_option)
      {
        stat_info->atime.tv_sec = TIME_FROM_HEADER (header->oldgnu_header.atime);
-diff -urp tar-1.22-orig/src/Makefile.am tar-1.22/src/Makefile.am
---- tar-1.22-orig/src/Makefile.am      2007-10-29 18:53:06.000000000 +0100
-+++ tar-1.22/src/Makefile.am   2009-03-05 09:45:42.000000000 +0100
+diff -urNp tar-1.23-orig/src/Makefile.am tar-1.23/src/Makefile.am
+--- tar-1.23-orig/src/Makefile.am      2010-01-26 12:30:20.000000000 +0100
++++ tar-1.23/src/Makefile.am   2010-03-12 13:48:43.000000000 +0100
 @@ -20,7 +20,7 @@
  
  bin_PROGRAMS = tar
@@ -417,24 +525,24 @@ diff -urp tar-1.22-orig/src/Makefile.am tar-1.22/src/Makefile.am
  tar_SOURCES = \
   buffer.c\
   checkpoint.c\
-@@ -39,10 +39,11 @@ tar_SOURCES = \
-  tar.c\
-  transform.c\
+@@ -42,10 +42,11 @@ tar_SOURCES = \
+  unlink.c\
   update.c\
-- utf8.c
-+ utf8.c\
+  utf8.c\
+- warning.c
++ warning.c\
 + xattrs.c
  
- INCLUDES = -I$(top_srcdir)/lib -I../ -I../lib
+ INCLUDES = -I$(top_srcdir)/gnu -I../ -I../gnu -I$(top_srcdir)/lib -I../lib
  
- LDADD = ../lib/libtar.a $(LIBINTL) $(LIBICONV)
+ LDADD = ../lib/libtar.a ../gnu/libgnu.a $(LIBINTL) $(LIBICONV)
  
 -tar_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME)
 +tar_LDADD = $(LIBS) $(LDADD) $(LIB_CLOCK_GETTIME)
-diff -urp tar-1.22-orig/src/tar.c tar-1.22/src/tar.c
---- tar-1.22-orig/src/tar.c    2009-03-05 08:04:13.000000000 +0100
-+++ tar-1.22/src/tar.c 2009-03-05 09:45:42.000000000 +0100
-@@ -246,7 +246,8 @@ tar_set_quoting_style (char *arg)
+diff -urNp tar-1.23-orig/src/tar.c tar-1.23/src/tar.c
+--- tar-1.23-orig/src/tar.c    2010-03-09 13:52:41.000000000 +0100
++++ tar-1.23/src/tar.c 2010-03-12 13:48:43.000000000 +0100
+@@ -255,7 +255,8 @@ tar_set_quoting_style (char *arg)
  
  enum
  {
@@ -444,7 +552,7 @@ diff -urp tar-1.22-orig/src/tar.c tar-1.22/src/tar.c
    ATIME_PRESERVE_OPTION,
    BACKUP_OPTION,
    CHECK_DEVICE_OPTION,
-@@ -276,6 +277,7 @@ enum
+@@ -287,6 +288,7 @@ enum
    MODE_OPTION,
    MTIME_OPTION,
    NEWER_MTIME_OPTION,
@@ -452,10 +560,10 @@ diff -urp tar-1.22-orig/src/tar.c tar-1.22/src/tar.c
    NO_ANCHORED_OPTION,
    NO_AUTO_COMPRESS_OPTION,
    NO_CHECK_DEVICE_OPTION,
-@@ -288,9 +290,11 @@ enum
-   NO_RECURSION_OPTION,
+@@ -300,9 +302,11 @@ enum
    NO_SAME_OWNER_OPTION,
    NO_SAME_PERMISSIONS_OPTION,
+   NO_SEEK_OPTION,
 +  NO_SELINUX_CONTEXT_OPTION,
    NO_UNQUOTE_OPTION,
    NO_WILDCARDS_MATCH_SLASH_OPTION,
@@ -464,7 +572,7 @@ diff -urp tar-1.22-orig/src/tar.c tar-1.22/src/tar.c
    NULL_OPTION,
    NUMERIC_OWNER_OPTION,
    OCCURRENCE_OPTION,
-@@ -312,6 +316,7 @@ enum
+@@ -324,6 +328,7 @@ enum
    RMT_COMMAND_OPTION,
    RSH_COMMAND_OPTION,
    SAME_OWNER_OPTION,
@@ -472,9 +580,9 @@ diff -urp tar-1.22-orig/src/tar.c tar-1.22/src/tar.c
    SHOW_DEFAULTS_OPTION,
    SHOW_OMITTED_DIRS_OPTION,
    SHOW_TRANSFORMED_NAMES_OPTION,
-@@ -328,7 +333,8 @@ enum
-   VERSION_OPTION,
+@@ -339,7 +344,8 @@ enum
    VOLNO_FILE_OPTION,
+   WARNING_OPTION, 
    WILDCARDS_MATCH_SLASH_OPTION,
 -  WILDCARDS_OPTION
 +  WILDCARDS_OPTION,
@@ -482,33 +590,33 @@ diff -urp tar-1.22-orig/src/tar.c tar-1.22/src/tar.c
  };
  
  const char *argp_program_version = "tar (" PACKAGE_NAME ") " VERSION;
-@@ -465,6 +471,10 @@ static struct argp_option options[] = {
+@@ -485,6 +491,10 @@ static struct argp_option options[] = {
    {NULL, 0, NULL, 0,
     N_("Handling of file attributes:"), GRID },
  
-+  {"acls", ACLS_OPTION, 0, 0, 
++  {"acls", ACLS_OPTION, 0, 0,
 +   N_("Save the ACLs to the archive"), GRID+1 },
-+  {"no-acls", NO_ACLS_OPTION, 0, 0, 
++  {"no-acls", NO_ACLS_OPTION, 0, 0,
 +   N_("Don't extract the ACLs from the archive"), GRID+1 },
    {"owner", OWNER_OPTION, N_("NAME"), 0,
     N_("force NAME as owner for added files"), GRID+1 },
    {"group", GROUP_OPTION, N_("NAME"), 0,
-@@ -495,6 +505,14 @@ static struct argp_option options[] = {
+@@ -515,6 +525,14 @@ static struct argp_option options[] = {
    {"preserve-order", 's', 0, 0,
     N_("sort names to extract to match archive"), GRID+1 },
    {"same-order", 0, 0, OPTION_ALIAS, NULL, GRID+1 },
-+  {"selinux", SELINUX_CONTEXT_OPTION, 0, 0, 
++  {"selinux", SELINUX_CONTEXT_OPTION, 0, 0,
 +   N_("Save the SELinux context to the archive"), GRID+1 },
-+  {"no-selinux", NO_SELINUX_CONTEXT_OPTION, 0, 0, 
++  {"no-selinux", NO_SELINUX_CONTEXT_OPTION, 0, 0,
 +   N_("Don't extract the SELinux context from the archive"), GRID+1 },
-+  {"xattrs", XATTR_OPTION, 0, 0, 
++  {"xattrs", XATTR_OPTION, 0, 0,
 +   N_("Save the user/root xattrs to the archive"), GRID+1 },
-+  {"no-xattrs", NO_XATTR_OPTION, 0, 0, 
++  {"no-xattrs", NO_XATTR_OPTION, 0, 0,
 +   N_("Don't extract the user/root xattrs from the archive"), GRID+1 },
    {"preserve", PRESERVE_OPTION, 0, 0,
     N_("same as both -p and -s"), GRID+1 },
    {"delay-directory-restore", DELAY_DIRECTORY_RESTORE_OPTION, 0, 0,
-@@ -1932,6 +1950,37 @@ parse_opt (int key, char *arg, struct ar
+@@ -2060,6 +2078,37 @@ parse_opt (int key, char *arg, struct ar
        same_permissions_option = -1;
        break;
  
@@ -546,7 +654,7 @@ diff -urp tar-1.22-orig/src/tar.c tar-1.22/src/tar.c
      case RECURSION_OPTION:
        recursion_option = FNM_LEADING_DIR;
        break;
-@@ -2330,6 +2379,29 @@ decode_options (int argc, char **argv)
+@@ -2442,6 +2491,29 @@ decode_options (int argc, char **argv)
          || subcommand_option != LIST_SUBCOMMAND))
      USAGE_ERROR ((0, 0, _("--pax-option can be used only on POSIX archives")));
  
@@ -576,7 +684,7 @@ diff -urp tar-1.22-orig/src/tar.c tar-1.22/src/tar.c
    /* If ready to unlink hierarchies, so we are for simpler files.  */
    if (recursive_unlink_option)
      old_files_option = UNLINK_FIRST_OLD_FILES;
-@@ -2544,11 +2616,15 @@ tar_stat_init (struct tar_stat_info *st)
+@@ -2662,11 +2734,15 @@ tar_stat_init (struct tar_stat_info *st)
  void
  tar_stat_destroy (struct tar_stat_info *st)
  {
@@ -592,9 +700,9 @@ diff -urp tar-1.22-orig/src/tar.c tar-1.22/src/tar.c
    free (st->sparse_map);
    free (st->dumpdir);
    xheader_destroy (&st->xhdr);
-diff -urp tar-1.22-orig/src/tar.h tar-1.22/src/tar.h
---- tar-1.22-orig/src/tar.h    2007-06-27 15:30:32.000000000 +0200
-+++ tar-1.22/src/tar.h 2009-03-05 09:45:42.000000000 +0100
+diff -urNp tar-1.23-orig/src/tar.h tar-1.23/src/tar.h
+--- tar-1.23-orig/src/tar.h    2010-01-26 12:30:20.000000000 +0100
++++ tar-1.23/src/tar.h 2010-03-12 13:48:43.000000000 +0100
 @@ -276,6 +276,14 @@ struct xheader
    uintmax_t string_length;
  };
@@ -619,7 +727,7 @@ diff -urp tar-1.22-orig/src/tar.h tar-1.22/src/tar.h
 +
 +  char *acls_a_ptr;         /* Access ACLs for the current archive entry. */
 +  size_t acls_a_len;        /* Access ACLs for the current archive entry. */
-+ 
++
 +  char *acls_d_ptr;         /* Default ACLs for the current archive entry. */
 +  size_t acls_d_len;        /* Default ACLs for the current archive entry. */
 +
@@ -636,312 +744,10 @@ diff -urp tar-1.22-orig/src/tar.h tar-1.22/src/tar.h
    /* Extended headers */
    struct xheader xhdr;
    
-diff -urp tar-1.22-orig/src/xheader.c tar-1.22/src/xheader.c
---- tar-1.22-orig/src/xheader.c        2008-11-30 13:30:54.000000000 +0100
-+++ tar-1.22/src/xheader.c     2009-03-05 09:45:42.000000000 +0100
-@@ -417,6 +417,74 @@ xheader_write_global (struct xheader *xh
-   free (name);
- }
-+void xheader_xattr_init(struct tar_stat_info *st)
-+{
-+  st->xattr_map = NULL;
-+  st->xattr_map_size = 0;
-+}
-+
-+void xheader_xattr_free(struct xattr_array *xattr_map, size_t xattr_map_size)
-+{
-+  size_t scan = 0;
-+
-+  while (scan < xattr_map_size)
-+    {
-+      free (xattr_map[scan].xkey);
-+      free (xattr_map[scan].xval_ptr);
-+
-+      ++scan;
-+    }
-+  free (xattr_map);
-+}
-+
-+static void xheader_xattr__add(struct xattr_array **xattr_map,
-+                               size_t *xattr_map_size,
-+                               const char *key, const char *val, size_t len)
-+{
-+  size_t pos = (*xattr_map_size)++;
-+  
-+  *xattr_map = xrealloc (*xattr_map,
-+                         *xattr_map_size * sizeof(struct xattr_array));
-+  (*xattr_map)[pos].xkey = xstrdup (key);
-+  (*xattr_map)[pos].xval_ptr = xmemdup (val, len + 1);
-+  (*xattr_map)[pos].xval_len = len;
-+}
-+
-+void xheader_xattr_add(struct tar_stat_info *st,
-+                       const char *key, const char *val, size_t len)
-+{
-+  size_t klen = strlen (key);
-+  char *xkey = xmalloc (strlen("SCHILY.xattr.") + klen + 1);
-+  char *tmp = xkey;
-+
-+  tmp = stpcpy (tmp, "SCHILY.xattr.");
-+  tmp = stpcpy (tmp, key);
-+  
-+  xheader_xattr__add (&st->xattr_map, &st->xattr_map_size, xkey, val, len);
-+
-+  free (xkey);
-+}
-+
-+void xheader_xattr_copy(const struct tar_stat_info *st,
-+                        struct xattr_array **xattr_map, size_t *xattr_map_size)
-+{
-+  size_t scan = 0;
-+
-+  *xattr_map = NULL;
-+  *xattr_map_size = 0;
-+  
-+  while (scan < st->xattr_map_size)
-+    {
-+      char  *key = st->xattr_map[scan].xkey;
-+      char  *val = st->xattr_map[scan].xval_ptr;
-+      size_t len = st->xattr_map[scan].xval_len;
-+      
-+      xheader_xattr__add(xattr_map, xattr_map_size, key, val, len);
-+
-+      ++scan;
-+    }
-+}
-+
\f
- /* General Interface */
-@@ -427,6 +495,7 @@ struct xhdr_tab
-                struct xheader *, void const *data);
-   void (*decoder) (struct tar_stat_info *, char const *, char const *, size_t);
-   bool protect;
-+  bool prefix;
- };
- /* This declaration must be extern, because ISO C99 section 6.9.2
-@@ -443,8 +512,17 @@ locate_handler (char const *keyword)
-   struct xhdr_tab const *p;
-   for (p = xhdr_tab; p->keyword; p++)
--    if (strcmp (p->keyword, keyword) == 0)
--      return p;
-+    if (p->prefix)
-+      {
-+        if (strncmp (p->keyword, keyword, strlen(p->keyword)) == 0)
-+          return p;
-+      }
-+  else
-+      {
-+        if (strcmp (p->keyword, keyword) == 0)
-+          return p;
-+      }
-+  
-   return NULL;
- }
-@@ -454,7 +532,7 @@ xheader_protected_pattern_p (const char 
-   struct xhdr_tab const *p;
-   for (p = xhdr_tab; p->keyword; p++)
--    if (p->protect && fnmatch (pattern, p->keyword, 0) == 0)
-+    if (!p->prefix && p->protect && fnmatch (pattern, p->keyword, 0) == 0)
-       return true;
-   return false;
- }
-@@ -465,7 +543,7 @@ xheader_protected_keyword_p (const char 
-   struct xhdr_tab const *p;
-   for (p = xhdr_tab; p->keyword; p++)
--    if (p->protect && strcmp (p->keyword, keyword) == 0)
-+    if (!p->prefix && p->protect && strcmp (p->keyword, keyword) == 0)
-       return true;
-   return false;
- }
-@@ -1417,6 +1495,71 @@ volume_filename_decoder (struct tar_stat
- }
- static void
-+xattr_selinux_coder (struct tar_stat_info const *st, char const *keyword,
-+                     struct xheader *xhdr, void const *data)
-+{
-+  code_string (st->cntx_name, keyword, xhdr);
-+}
-+
-+static void
-+xattr_selinux_decoder (struct tar_stat_info *st,
-+                       char const *keyword, char const *arg, size_t size)
-+{
-+  decode_string (&st->cntx_name, arg);
-+}
-+
-+static void
-+xattr_acls_a_coder (struct tar_stat_info const *st , char const *keyword,
-+                    struct xheader *xhdr, void const *data)
-+{
-+  xheader_print_n (xhdr, keyword, st->acls_a_ptr, st->acls_a_len);
-+}
-+
-+static void
-+xattr_acls_a_decoder (struct tar_stat_info *st,
-+                      char const *keyword, char const *arg, size_t size)
-+{
-+  st->acls_a_ptr = xmemdup (arg, size + 1);
-+  st->acls_a_len = size;
-+}
-+
-+static void
-+xattr_acls_d_coder (struct tar_stat_info const *st , char const *keyword,
-+                    struct xheader *xhdr, void const *data)
-+{
-+  xheader_print_n (xhdr, keyword, st->acls_d_ptr, st->acls_d_len);
-+}
-+
-+static void
-+xattr_acls_d_decoder (struct tar_stat_info *st,
-+                      char const *keyword, char const *arg, size_t size)
-+{
-+  st->acls_d_ptr = xmemdup (arg, size + 1);
-+  st->acls_d_len = size;
-+}
-+
-+static void
-+xattr_coder (struct tar_stat_info const *st , char const *keyword,
-+             struct xheader *xhdr, void const *data)
-+{
-+  struct xattr_array *xattr_map = st->xattr_map;
-+  const size_t *off = data;
-+  xheader_print_n (xhdr, keyword,
-+                   xattr_map[*off].xval_ptr, xattr_map[*off].xval_len);
-+}
-+
-+static void
-+xattr_decoder (struct tar_stat_info *st,
-+               char const *keyword, char const *arg, size_t size)
-+{
-+  char *xstr = NULL;
-+
-+  xstr = xmemdup(arg, size + 1);
-+  xheader_xattr_add(st, keyword + strlen("SCHILY.xattr."), xstr, size);
-+  free(xstr);
-+}
-+
-+static void
- sparse_major_coder (struct tar_stat_info const *st, char const *keyword,
-                   struct xheader *xhdr, void const *data)
- {
-@@ -1453,18 +1596,18 @@ sparse_minor_decoder (struct tar_stat_in
- }
- struct xhdr_tab const xhdr_tab[] = {
--  { "atime",  atime_coder,    atime_decoder,    false },
--  { "comment",        dummy_coder,    dummy_decoder,    false },
--  { "charset",        dummy_coder,    dummy_decoder,    false },
--  { "ctime",  ctime_coder,    ctime_decoder,    false },
--  { "gid",    gid_coder,      gid_decoder,      false },
--  { "gname",  gname_coder,    gname_decoder,    false },
--  { "linkpath", linkpath_coder, linkpath_decoder, false },
--  { "mtime",  mtime_coder,    mtime_decoder,    false },
--  { "path",   path_coder,     path_decoder,     false },
--  { "size",   size_coder,     size_decoder,     false },
--  { "uid",    uid_coder,      uid_decoder,      false },
--  { "uname",  uname_coder,    uname_decoder,    false },
-+  { "atime",   atime_coder,    atime_decoder,    false, false },
-+  { "comment", dummy_coder,    dummy_decoder,    false, false },
-+  { "charset", dummy_coder,    dummy_decoder,    false, false },
-+  { "ctime",   ctime_coder,    ctime_decoder,    false, false },
-+  { "gid",     gid_coder,      gid_decoder,      false, false },
-+  { "gname",   gname_coder,    gname_decoder,    false, false },
-+  { "linkpath", linkpath_coder, linkpath_decoder, false, false },
-+  { "mtime",   mtime_coder,    mtime_decoder,    false, false },
-+  { "path",    path_coder,     path_decoder,     false, false },
-+  { "size",    size_coder,     size_decoder,     false, false },
-+  { "uid",     uid_coder,      uid_decoder,      false, false },
-+  { "uname",   uname_coder,    uname_decoder,    false, false },
-   /* Sparse file handling */
-   { "GNU.sparse.name",       path_coder, path_decoder,
-@@ -1479,25 +1622,25 @@ struct xhdr_tab const xhdr_tab[] = {
-     true },
-   /* tar 1.14 - 1.15.90 keywords. */
--  { "GNU.sparse.size",       sparse_size_coder, sparse_size_decoder, true },
-+  { "GNU.sparse.size",       sparse_size_coder, sparse_size_decoder, true, false },
-   /* tar 1.14 - 1.15.1 keywords. Multiple instances of these appeared in 'x'
-      headers, and each of them was meaningful. It confilcted with POSIX specs,
-      which requires that "when extended header records conflict, the last one
-      given in the header shall take precedence." */
-   { "GNU.sparse.offset",     sparse_offset_coder, sparse_offset_decoder,
--    true },
-+    true, false },
-   { "GNU.sparse.numbytes",   sparse_numbytes_coder, sparse_numbytes_decoder,
--    true },
-+    true, false },
-   /* tar 1.15.90 keyword, introduced to remove the above-mentioned conflict. */
-   { "GNU.sparse.map",        NULL /* Unused, see pax_dump_header() */,
--    sparse_map_decoder, false },
-+    sparse_map_decoder, false, false },
-   { "GNU.dumpdir",           dumpdir_coder, dumpdir_decoder,
--    true },
-+    true, false },
-   /* Keeps the tape/volume label. May be present only in the global headers.
-      Equivalent to GNUTYPE_VOLHDR.  */
--  { "GNU.volume.label", volume_label_coder, volume_label_decoder, true },
-+  { "GNU.volume.label", volume_label_coder, volume_label_decoder, true, false },
-   /* These may be present in a first global header of the archive.
-      They provide the same functionality as GNUTYPE_MULTIVOL header.
-@@ -1506,9 +1649,38 @@ struct xhdr_tab const xhdr_tab[] = {
-      GNU.volume.offset keeps the offset of the start of this volume,
-      otherwise kept in oldgnu_header.offset.  */
-   { "GNU.volume.filename", volume_label_coder, volume_filename_decoder,
--    true },
--  { "GNU.volume.size", volume_size_coder, volume_size_decoder, true },
--  { "GNU.volume.offset", volume_offset_coder, volume_offset_decoder, true },
--
-+    true, false },
-+  { "GNU.volume.size", volume_size_coder, volume_size_decoder, true, false },
-+  { "GNU.volume.offset", volume_offset_coder, volume_offset_decoder,
-+    true, false },
-+
-+  /* We get the SELinux value from filecon, so add a namespace for SELinux
-+     instead of storing it in SCHILY.xattr.* (which would be RAW). */
-+  { "RHT.security.selinux",
-+    xattr_selinux_coder, xattr_selinux_decoder, false, false },
-+
-+  /* ACLs, use the star format... */
-+  { "SCHILY.acl.access",
-+    xattr_acls_a_coder, xattr_acls_a_decoder, false, false },
-+
-+  { "SCHILY.acl.default",
-+    xattr_acls_d_coder, xattr_acls_d_decoder, false, false },
-+
-+  /* FIXME: These are compat. for FC-6 ... we shipped a tar using the generic
-+     header names by accident. */
-+  { "SCHILY.xattr.security.selinux",
-+    xattr_selinux_coder, xattr_selinux_decoder, false, false },
-+  { "SCHILY.xattr.system.posix_acl_access",
-+    xattr_acls_a_coder, xattr_acls_a_decoder, false, false },
-+  { "SCHILY.xattr.system.posix_acl_default",
-+    xattr_acls_d_coder, xattr_acls_d_decoder, false, false },
-+
-+  /* xattr's, use the star format note we only save the user/trusted varients... */
-+  { "SCHILY.xattr.user",    xattr_coder, xattr_decoder, false, true },
-+  { "SCHILY.xattr.trusted", xattr_coder, xattr_decoder, false, true },
-+
-+  /* ignore everything else in the xattr namespaces... */
-+  { "SCHILY.xattr",         dummy_coder, dummy_decoder, false, true },
-+  
-   { NULL, NULL, NULL, false }
- };
-diff -up /dev/null tar-1.17/src/xattrs.c
---- /dev/null  2007-12-10 11:30:31.504001819 +0100
-+++ tar-1.17/src/xattrs.c      2007-12-10 15:31:54.000000000 +0100
-@@ -0,0 +1,491 @@
+diff -urNp tar-1.23-orig/src/xattrs.c tar-1.23/src/xattrs.c
+--- tar-1.23-orig/src/xattrs.c 1970-01-01 01:00:00.000000000 +0100
++++ tar-1.23/src/xattrs.c      2010-03-12 13:48:43.000000000 +0100
+@@ -0,0 +1,488 @@
 +/* Create a tar archive.
 +
 +   Copyright (C) 2006 Free Software Foundation, Inc.
@@ -1003,16 +809,16 @@ diff -up /dev/null tar-1.17/src/xattrs.c
 +  static ssize_t asz = 1024;
 +  ssize_t ret = 0;
 +  static char *val = NULL;
-+  
++
 +  if (!val) val = xmalloc (asz);
-+  
++
 +  while (((ret = fgetxattr (fd, attr, val, asz)) == -1) &&
 +         (errno == ERANGE))
 +    {
 +      asz <<= 1;
 +      val = xrealloc (val, asz);
 +    }
-+  
++
 +  if (ret != -1)
 +    {
 +      *ret_ptr = xmemdup (val, ret + 1);
@@ -1048,20 +854,20 @@ diff -up /dev/null tar-1.17/src/xattrs.c
 +      call_arg_warn ("acl_get_file", file_name);
 +    return;
 +  }
-+  
-+  
++
++
 +  val = acl_to_text(acl, &len);
 +  acl_free (acl);
-+  
++
 +  if (val == NULL)
 +  {
 +    call_arg_warn ("acl_to_text", file_name);
 +    return;
 +  }
-+  
++
 +  *ret_ptr = xstrdup (val);
 +  *ret_len = len;
-+  
++
 +  acl_free (val);
 +#endif
 +}
@@ -1074,26 +880,26 @@ diff -up /dev/null tar-1.17/src/xattrs.c
 +  char *val = NULL;
 +  ssize_t len;
 +  acl_t acl;
-+  
++
 +  if ((acl = acl_get_file (file_name, ACL_TYPE_DEFAULT)) == (acl_t)NULL)
 +  {
 +    if (errno != ENOTSUP)
 +      call_arg_warn ("acl_get_file", file_name);
 +    return;
 +  }
-+  
++
 +  val = acl_to_text(acl, &len);
 +  acl_free (acl);
-+  
++
 +  if (val == NULL)
 +  {
 +    call_arg_warn ("acl_to_text", file_name);
 +    return;
 +  }
-+  
++
 +  *ret_ptr = xstrdup (val);
 +  *ret_len = len;
-+  
++
 +  acl_free (val);
 +#endif
 +}
@@ -1157,9 +963,9 @@ diff -up /dev/null tar-1.17/src/xattrs.c
 +#else
 +
 +      if (!xatrs) xatrs = xmalloc (xsz);
-+              
-+      while (((fd == -1) ? 
-+              ((xret = listxattr (file_name, xatrs, xsz)) == -1) :
++
++      while (((fd == -1) ?
++              ((xret = llistxattr (file_name, xatrs, xsz)) == -1) :
 +              ((xret = flistxattr (fd, xatrs, xsz)) == -1)) &&
 +             (errno == ERANGE))
 +        {
@@ -1168,39 +974,36 @@ diff -up /dev/null tar-1.17/src/xattrs.c
 +        }
 +
 +      if (xret == -1)
-+        call_arg_warn ((fd == -1) ? "listxattrs" : "flistxattrs", file_name);
++        call_arg_warn ((fd == -1) ? "llistxattrs" : "flistxattrs", file_name);
 +      else
 +        {
 +          const char *attr = xatrs;
 +          static ssize_t asz = 1024;
 +          static char *val = NULL;
-+          
++
 +          if (!val) val = xmalloc (asz);
-+          
++
 +          while (xret > 0)
 +            {
 +              size_t len = strlen (attr);
 +              ssize_t aret = 0;
-+              
-+              if (strncmp (attr, "user.", strlen("user.")) &&
-+                  strncmp (attr, "trusted.", strlen("trusted.")))
-+                goto next_attr; /* only store normal xattrs */
-+              
-+              while (((fd == -1) ? 
-+                      ((aret = getxattr (file_name, attr, val, asz)) == -1) :
++
++              /* Archive all xattrs during creation, decide at extraction time
++               * which ones are of interest/use for the target filesystem. */
++              while (((fd == -1) ?
++                      ((aret = lgetxattr (file_name, attr, val, asz)) == -1) :
 +                      ((aret = fgetxattr (fd, attr, val, asz)) == -1)) &&
 +                     (errno == ERANGE))
 +                {
 +                  asz <<= 1;
 +                  val = xrealloc (val, asz);
 +                }
-+              
++
 +              if (aret != -1)
 +                xheader_xattr_add (st, attr, val, aret);
 +              else if (errno != ENOATTR)
-+                call_arg_warn ("fgetxattr", file_name);
-+              
-+             next_attr:
++                call_arg_warn ((fd==-1) ? "lgetxattr" : "fgetxattr", file_name);
++
 +              attr += len + 1;
 +              xret -= len + 1;
 +            }
@@ -1256,7 +1059,7 @@ diff -up /dev/null tar-1.17/src/xattrs.c
 +  if (perms & 0004) val[28] = 'r';
 +  if (perms & 0002) val[29] = 'w';
 +  if (perms & 0001) val[30] = 'x';
-+  
++
 +  return (acl_from_text (val));
 +}
 +#endif
@@ -1268,13 +1071,13 @@ diff -up /dev/null tar-1.17/src/xattrs.c
 +  if (*ptr != ':')
 +    return (ptr); /* error? no user/group field */
 +  ++ptr;
-+  
++
 +  ptr += strcspn(ptr, ":,\n"); /* skip user/group name */
 +
 +  if (*ptr != ':')
 +    return (ptr); /* error? no perms field */
 +  ++ptr;
-+  
++
 +  ptr += strcspn(ptr, ":,\n"); /* skip perms */
 +
 +  if (*ptr != ':')
@@ -1303,13 +1106,13 @@ diff -up /dev/null tar-1.17/src/xattrs.c
 +
 +    if (*src == ':') /* We have extra fields, skip them all */
 +      src += strcspn(src, "\n,");
-+    
++
 +    if ((*src == '\n') || (*src == ','))
 +      *dst++ = *src++; /* also done when dst == src, but that's ok */
 +  }
 +  if (src != dst)
 +    *dst = 0;
-+  
++
 +  return ptr;
 +}
 +
@@ -1324,7 +1127,7 @@ diff -up /dev/null tar-1.17/src/xattrs.c
 +    {
 +      /* assert (strlen (ptr) == len); */
 +      ptr = fixup_extra_acl_fields(ptr);
-+      
++
 +      acl = acl_from_text (ptr);
 +      acls_option = 1;
 +    }
@@ -1333,13 +1136,13 @@ diff -up /dev/null tar-1.17/src/xattrs.c
 +  else
 +    return; /* don't call acl functions unless we first hit an ACL, or
 +               --acls was passed explicitly */
-+  
++
 +  if (acl == (acl_t)NULL)
 +    {
 +      call_arg_warn ("acl_from_text", file_name);
 +      return;
 +    }
-+  
++
 +  if (acl_set_file (file_name, type, acl) == -1)
 +    {
 +      if (errno != ENOTSUP)
@@ -1362,7 +1165,7 @@ diff -up /dev/null tar-1.17/src/xattrs.c
 +#else
 +      xattrs__acls_set (st, file_name, ACL_TYPE_ACCESS,
 +                        st->acls_a_ptr, st->acls_a_len);
-+      if (S_ISDIR (st->stat.st_mode))
++      if ((typeflag == DIRTYPE) || (typeflag == GNUTYPE_DUMPDIR))
 +        xattrs__acls_set (st, file_name, ACL_TYPE_DEFAULT,
 +                          st->acls_d_ptr, st->acls_d_len);
 +#endif
@@ -1420,23 +1223,22 @@ diff -up /dev/null tar-1.17/src/xattrs.c
 +          keyword += strlen("SCHILY.xattr.");
 +
 +          if (strncmp (keyword, "user.", strlen("user.")) &&
++              strncmp (keyword, "lustre.", strlen("lustre.")) &&
 +              strncmp (keyword, "trusted.", strlen("trusted.")))
 +            continue; /* don't try and set anything but normal xattrs */
-+            
-+          /* should we ignore trusted.* EPERM errors when not root ? */
++
 +          xattrs__fd_set (st, file_name, typeflag, keyword,
 +                          st->xattr_map[scan].xval_ptr,
 +                          st->xattr_map[scan].xval_len);
-+      
++
 +          ++scan;
 +        }
 +#endif
 +    }
 +}
-+
-diff -up /dev/null tar-1.17/src/xattrs.h
---- /dev/null  2007-12-10 11:30:31.504001819 +0100
-+++ tar-1.17/src/xattrs.h      2007-12-10 15:31:54.000000000 +0100
+diff -urNp tar-1.23-orig/src/xattrs.h tar-1.23/src/xattrs.h
+--- tar-1.23-orig/src/xattrs.h 1970-01-01 01:00:00.000000000 +0100
++++ tar-1.23/src/xattrs.h      2010-03-12 13:48:43.000000000 +0100
 @@ -0,0 +1,14 @@
 +
 +extern void xattrs_acls_get(struct tar_stat_info *st,
@@ -1452,3 +1254,321 @@ diff -up /dev/null tar-1.17/src/xattrs.h
 +                               char const *file_name, char typeflag);
 +extern void xattrs_xattrs_set(struct tar_stat_info const *st,
 +                              char const *file_name, char typeflag);
+diff -urNp tar-1.23-orig/src/xheader.c tar-1.23/src/xheader.c
+--- tar-1.23-orig/src/xheader.c        2010-02-12 11:03:09.000000000 +0100
++++ tar-1.23/src/xheader.c     2010-03-12 13:50:44.000000000 +0100
+@@ -459,6 +459,74 @@ xheader_write_global (struct xheader *xh
+     }
+ }
++void xheader_xattr_init(struct tar_stat_info *st)
++{
++  st->xattr_map = NULL;
++  st->xattr_map_size = 0;
++}
++
++void xheader_xattr_free(struct xattr_array *xattr_map, size_t xattr_map_size)
++{
++  size_t scan = 0;
++
++  while (scan < xattr_map_size)
++    {
++      free (xattr_map[scan].xkey);
++      free (xattr_map[scan].xval_ptr);
++
++      ++scan;
++    }
++  free (xattr_map);
++}
++
++static void xheader_xattr__add(struct xattr_array **xattr_map,
++                               size_t *xattr_map_size,
++                               const char *key, const char *val, size_t len)
++{
++  size_t pos = (*xattr_map_size)++;
++
++  *xattr_map = xrealloc (*xattr_map,
++                         *xattr_map_size * sizeof(struct xattr_array));
++  (*xattr_map)[pos].xkey = xstrdup (key);
++  (*xattr_map)[pos].xval_ptr = xmemdup (val, len + 1);
++  (*xattr_map)[pos].xval_len = len;
++}
++
++void xheader_xattr_add(struct tar_stat_info *st,
++                       const char *key, const char *val, size_t len)
++{
++  size_t klen = strlen (key);
++  char *xkey = xmalloc (strlen("SCHILY.xattr.") + klen + 1);
++  char *tmp = xkey;
++
++  tmp = stpcpy (tmp, "SCHILY.xattr.");
++  tmp = stpcpy (tmp, key);
++
++  xheader_xattr__add (&st->xattr_map, &st->xattr_map_size, xkey, val, len);
++
++  free (xkey);
++}
++
++void xheader_xattr_copy(const struct tar_stat_info *st,
++                        struct xattr_array **xattr_map, size_t *xattr_map_size)
++{
++  size_t scan = 0;
++
++  *xattr_map = NULL;
++  *xattr_map_size = 0;
++
++  while (scan < st->xattr_map_size)
++    {
++      char  *key = st->xattr_map[scan].xkey;
++      char  *val = st->xattr_map[scan].xval_ptr;
++      size_t len = st->xattr_map[scan].xval_len;
++
++      xheader_xattr__add(xattr_map, xattr_map_size, key, val, len);
++
++      ++scan;
++    }
++}
++
\f
+ /* General Interface */
+@@ -472,6 +540,7 @@ struct xhdr_tab
+                struct xheader *, void const *data);
+   void (*decoder) (struct tar_stat_info *, char const *, char const *, size_t);
+   int flags;
++  bool prefix;
+ };
+ /* This declaration must be extern, because ISO C99 section 6.9.2
+@@ -488,8 +557,17 @@ locate_handler (char const *keyword)
+   struct xhdr_tab const *p;
+   for (p = xhdr_tab; p->keyword; p++)
+-    if (strcmp (p->keyword, keyword) == 0)
+-      return p;
++    if (p->prefix)
++      {
++        if (strncmp (p->keyword, keyword, strlen(p->keyword)) == 0)
++          return p;
++      }
++  else
++      {
++        if (strcmp (p->keyword, keyword) == 0)
++          return p;
++      }
++
+   return NULL;
+ }
+@@ -499,7 +577,7 @@ xheader_protected_pattern_p (const char 
+   struct xhdr_tab const *p;
+   for (p = xhdr_tab; p->keyword; p++)
+-    if ((p->flags & XHDR_PROTECTED) && fnmatch (pattern, p->keyword, 0) == 0)
++    if (!p->prefix && (p->flags & XHDR_PROTECTED) && fnmatch (pattern, p->keyword, 0) == 0)
+       return true;
+   return false;
+ }
+@@ -510,7 +588,7 @@ xheader_protected_keyword_p (const char 
+   struct xhdr_tab const *p;
+   for (p = xhdr_tab; p->keyword; p++)
+-    if ((p->flags & XHDR_PROTECTED) && strcmp (p->keyword, keyword) == 0)
++    if (!p->prefix && (p->flags & XHDR_PROTECTED) && strcmp (p->keyword, keyword) == 0)
+       return true;
+   return false;
+ }
+@@ -1469,6 +1547,71 @@ volume_filename_decoder (struct tar_stat
+ }
+ static void
++xattr_selinux_coder (struct tar_stat_info const *st, char const *keyword,
++                     struct xheader *xhdr, void const *data)
++{
++  code_string (st->cntx_name, keyword, xhdr);
++}
++
++static void
++xattr_selinux_decoder (struct tar_stat_info *st,
++                       char const *keyword, char const *arg, size_t size)
++{
++  decode_string (&st->cntx_name, arg);
++}
++
++static void
++xattr_acls_a_coder (struct tar_stat_info const *st , char const *keyword,
++                    struct xheader *xhdr, void const *data)
++{
++  xheader_print_n (xhdr, keyword, st->acls_a_ptr, st->acls_a_len);
++}
++
++static void
++xattr_acls_a_decoder (struct tar_stat_info *st,
++                      char const *keyword, char const *arg, size_t size)
++{
++  st->acls_a_ptr = xmemdup (arg, size + 1);
++  st->acls_a_len = size;
++}
++
++static void
++xattr_acls_d_coder (struct tar_stat_info const *st , char const *keyword,
++                    struct xheader *xhdr, void const *data)
++{
++  xheader_print_n (xhdr, keyword, st->acls_d_ptr, st->acls_d_len);
++}
++
++static void
++xattr_acls_d_decoder (struct tar_stat_info *st,
++                      char const *keyword, char const *arg, size_t size)
++{
++  st->acls_d_ptr = xmemdup (arg, size + 1);
++  st->acls_d_len = size;
++}
++
++static void
++xattr_coder (struct tar_stat_info const *st , char const *keyword,
++             struct xheader *xhdr, void const *data)
++{
++  struct xattr_array *xattr_map = st->xattr_map;
++  const size_t *off = data;
++  xheader_print_n (xhdr, keyword,
++                   xattr_map[*off].xval_ptr, xattr_map[*off].xval_len);
++}
++
++static void
++xattr_decoder (struct tar_stat_info *st,
++               char const *keyword, char const *arg, size_t size)
++{
++  char *xstr = NULL;
++
++  xstr = xmemdup(arg, size + 1);
++  xheader_xattr_add(st, keyword + strlen("SCHILY.xattr."), xstr, size);
++  free(xstr);
++}
++
++static void
+ sparse_major_coder (struct tar_stat_info const *st, char const *keyword,
+                   struct xheader *xhdr, void const *data)
+ {
+@@ -1505,53 +1648,53 @@ sparse_minor_decoder (struct tar_stat_in
+ }
+ struct xhdr_tab const xhdr_tab[] = {
+-  { "atime",  atime_coder,    atime_decoder,    0 },
+-  { "comment",        dummy_coder,    dummy_decoder,    0 },
+-  { "charset",        dummy_coder,    dummy_decoder,    0 },
+-  { "ctime",  ctime_coder,    ctime_decoder,    0 },
+-  { "gid",    gid_coder,      gid_decoder,      0 },
+-  { "gname",  gname_coder,    gname_decoder,    0 },
+-  { "linkpath", linkpath_coder, linkpath_decoder, 0 },
+-  { "mtime",  mtime_coder,    mtime_decoder,    0 },
+-  { "path",   path_coder,     path_decoder,     0 },
+-  { "size",   size_coder,     size_decoder,     0 },
+-  { "uid",    uid_coder,      uid_decoder,      0 },
+-  { "uname",  uname_coder,    uname_decoder,    0 },
++  { "atime",   atime_coder,    atime_decoder,    0, false },
++  { "comment", dummy_coder,    dummy_decoder,    0, false },
++  { "charset", dummy_coder,    dummy_decoder,    0, false },
++  { "ctime",   ctime_coder,    ctime_decoder,    0, false },
++  { "gid",     gid_coder,      gid_decoder,      0, false },
++  { "gname",   gname_coder,    gname_decoder,    0, false },
++  { "linkpath", linkpath_coder, linkpath_decoder, 0, false },
++  { "mtime",   mtime_coder,    mtime_decoder,    0, false },
++  { "path",    path_coder,     path_decoder,     0, false },
++  { "size",    size_coder,     size_decoder,     0, false },
++  { "uid",     uid_coder,      uid_decoder,      0, false },
++  { "uname",   uname_coder,    uname_decoder,    0, false },
+   /* Sparse file handling */
+   { "GNU.sparse.name",       path_coder, path_decoder,
+-    XHDR_PROTECTED },
++    XHDR_PROTECTED, false },
+   { "GNU.sparse.major",      sparse_major_coder, sparse_major_decoder,
+-    XHDR_PROTECTED },
++    XHDR_PROTECTED, false },
+   { "GNU.sparse.minor",      sparse_minor_coder, sparse_minor_decoder,
+-    XHDR_PROTECTED },
++    XHDR_PROTECTED, false },
+   { "GNU.sparse.realsize",   sparse_size_coder, sparse_size_decoder,
+-    XHDR_PROTECTED },
++    XHDR_PROTECTED, false },
+   { "GNU.sparse.numblocks",  sparse_numblocks_coder, sparse_numblocks_decoder,
+-    XHDR_PROTECTED },
++    XHDR_PROTECTED, false },
+   /* tar 1.14 - 1.15.90 keywords. */
+   { "GNU.sparse.size",       sparse_size_coder, sparse_size_decoder,
+-    XHDR_PROTECTED },
++    XHDR_PROTECTED, false },
+   /* tar 1.14 - 1.15.1 keywords. Multiple instances of these appeared in 'x'
+      headers, and each of them was meaningful. It confilcted with POSIX specs,
+      which requires that "when extended header records conflict, the last one
+      given in the header shall take precedence." */
+   { "GNU.sparse.offset",     sparse_offset_coder, sparse_offset_decoder,
+-    XHDR_PROTECTED },
++    XHDR_PROTECTED, false },
+   { "GNU.sparse.numbytes",   sparse_numbytes_coder, sparse_numbytes_decoder,
+-    XHDR_PROTECTED },
++    XHDR_PROTECTED, false },
+   /* tar 1.15.90 keyword, introduced to remove the above-mentioned conflict. */
+   { "GNU.sparse.map",        NULL /* Unused, see pax_dump_header() */,
+-    sparse_map_decoder, 0 },
++    sparse_map_decoder, 0, false },
+   { "GNU.dumpdir",           dumpdir_coder, dumpdir_decoder,
+-    XHDR_PROTECTED },
++    XHDR_PROTECTED, false },
+   /* Keeps the tape/volume label. May be present only in the global headers.
+      Equivalent to GNUTYPE_VOLHDR.  */
+   { "GNU.volume.label", volume_label_coder, volume_label_decoder,
+-    XHDR_PROTECTED | XHDR_GLOBAL },
++    XHDR_PROTECTED | XHDR_GLOBAL, false },
+   /* These may be present in a first global header of the archive.
+      They provide the same functionality as GNUTYPE_MULTIVOL header.
+@@ -1560,11 +1703,40 @@ struct xhdr_tab const xhdr_tab[] = {
+      GNU.volume.offset keeps the offset of the start of this volume,
+      otherwise kept in oldgnu_header.offset.  */
+   { "GNU.volume.filename", volume_label_coder, volume_filename_decoder,
+-    XHDR_PROTECTED | XHDR_GLOBAL },
++    XHDR_PROTECTED | XHDR_GLOBAL, false },
+   { "GNU.volume.size", volume_size_coder, volume_size_decoder,
+-    XHDR_PROTECTED | XHDR_GLOBAL },
++    XHDR_PROTECTED | XHDR_GLOBAL, false },
+   { "GNU.volume.offset", volume_offset_coder, volume_offset_decoder,
+-    XHDR_PROTECTED | XHDR_GLOBAL },
++    XHDR_PROTECTED | XHDR_GLOBAL, false },
++
++  /* We get the SELinux value from filecon, so add a namespace for SELinux
++     instead of storing it in SCHILY.xattr.* (which would be RAW). */
++  { "RHT.security.selinux",
++    xattr_selinux_coder, xattr_selinux_decoder, 0, false },
++
++  /* ACLs, use the star format... */
++  { "SCHILY.acl.access",
++    xattr_acls_a_coder, xattr_acls_a_decoder, 0, false },
++
++  { "SCHILY.acl.default",
++    xattr_acls_d_coder, xattr_acls_d_decoder, 0, false },
++
++  /* FIXME: These are compat. for FC-6 ... we shipped a tar using the generic
++     header names by accident. */
++  { "SCHILY.xattr.security.selinux",
++    xattr_selinux_coder, xattr_selinux_decoder, 0, false },
++  { "SCHILY.xattr.system.posix_acl_access",
++    xattr_acls_a_coder, xattr_acls_a_decoder, 0, false },
++  { "SCHILY.xattr.system.posix_acl_default",
++    xattr_acls_d_coder, xattr_acls_d_decoder, 0, false },
++
++  /* xattrs use the star format.  note we only save some variants... */
++  { "SCHILY.xattr.user",    xattr_coder, xattr_decoder, 0, true },
++  { "SCHILY.xattr.trusted", xattr_coder, xattr_decoder, 0, true },
++  { "SCHILY.xattr.lustre",  xattr_coder, xattr_decoder, 0, true },
++
++  /* ignore everything else in the xattr namespaces... */
++  { "SCHILY.xattr",         dummy_coder, dummy_decoder, 0, true },
+-  { NULL, NULL, NULL, 0 }
++  { NULL, NULL, NULL, 0, false }
+ };