diff -rup tar-1.15.1-orig/aclocal.m4 tar-1.15.1/aclocal.m4 --- tar-1.15.1-orig/aclocal.m4 2004-12-21 08:29:44.000000000 -0500 +++ tar-1.15.1/aclocal.m4 2006-09-25 11:01:16.000000000 -0400 @@ -1,7 +1,7 @@ -# generated automatically by aclocal 1.9.3 -*- Autoconf -*- +# generated automatically by aclocal 1.9.6 -*- Autoconf -*- -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 -# Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -11,23 +11,11 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. -# -*- Autoconf -*- -# Copyright (C) 2002, 2003 Free Software Foundation, Inc. -# Generated from amversion.in; do not edit by hand. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- @@ -40,26 +28,15 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api # Call AM_AUTOMAKE_VERSION so it can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], - [AM_AUTOMAKE_VERSION([1.9.3])]) - -# AM_AUX_DIR_EXPAND - -# Copyright (C) 2001, 2003 Free Software Foundation, Inc. + [AM_AUTOMAKE_VERSION([1.9.6])]) -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. +# AM_AUX_DIR_EXPAND -*- Autoconf -*- -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to @@ -106,26 +83,16 @@ AC_PREREQ([2.50])dnl am_aux_dir=`cd $ac_aux_dir && pwd` ]) -# AM_CONDITIONAL -*- Autoconf -*- - -# Copyright (C) 1997, 2000, 2001, 2003, 2004 Free Software Foundation, Inc. +# AM_CONDITIONAL -*- Autoconf -*- -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# serial 6 +# serial 7 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- @@ -149,26 +116,15 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# serial 7 -*- Autoconf -*- -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - +# serial 8 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, @@ -177,7 +133,6 @@ fi])]) # CC etc. in the Makefile, will ask for an AC_PROG_CC use... - # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. @@ -317,27 +272,16 @@ AM_CONDITIONAL([AMDEP], [test "x$enable_ AC_SUBST([AMDEPBACKSLASH]) ]) -# Generate code to set up dependency tracking. -*- Autoconf -*- +# Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 -# Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -#serial 2 +#serial 3 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ @@ -396,30 +340,19 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS] [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) -# Do all the work for Automake. -*- Autoconf -*- +# Do all the work for Automake. -*- Autoconf -*- -# This macro actually does too much some checks are only needed if -# your package does certain things. But this isn't really a big deal. - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# serial 12 -# serial 11 +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) @@ -521,51 +454,27 @@ for _am_header in $config_headers :; do done echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. - -# Copyright (C) 2001, 2003 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"$am_aux_dir/install-sh"} AC_SUBST(install_sh)]) -# -*- Autoconf -*- -# Copyright (C) 2003 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# serial 1 +# serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. @@ -580,26 +489,15 @@ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) -# Check to see how 'make' treats includes. -*- Autoconf -*- - -# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. +# Check to see how 'make' treats includes. -*- Autoconf -*- -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# serial 2 +# serial 3 # AM_MAKE_INCLUDE() # ----------------- @@ -643,27 +541,16 @@ AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) -# -*- Autoconf -*- - - -# Copyright (C) 1997, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# serial 3 +# serial 4 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ @@ -689,27 +576,16 @@ else fi ]) +# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + # AM_PROG_MKDIR_P # --------------- # Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. - -# Copyright (C) 2003, 2004 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - +# # Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories # created by `make install' are always world readable, even if the # installer happens to have an overly restrictive umask (e.g. 077). @@ -763,26 +639,15 @@ else fi AC_SUBST([mkdir_p])]) -# Helper functions for option handling. -*- Autoconf -*- - -# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. +# Helper functions for option handling. -*- Autoconf -*- -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# serial 2 +# serial 3 # _AM_MANGLE_OPTION(NAME) # ----------------------- @@ -807,28 +672,16 @@ AC_DEFUN([_AM_SET_OPTIONS], AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# -# Check to make sure that the build environment is sane. -# +# Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996, 1997, 2000, 2001, 2003 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# serial 3 +# serial 4 # AM_SANITY_CHECK # --------------- @@ -871,25 +724,14 @@ Check your system clock]) fi AC_MSG_RESULT(yes)]) -# AM_PROG_INSTALL_STRIP - -# Copyright (C) 2001, 2003 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. +# AM_PROG_INSTALL_STRIP +# --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip @@ -912,25 +754,13 @@ AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# serial 1 +# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. +# serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- diff -rup tar-1.15.1-orig/config/config.guess tar-1.15.1/config/config.guess --- tar-1.15.1-orig/config/config.guess 2004-12-15 03:55:00.000000000 -0500 +++ tar-1.15.1/config/config.guess 2006-09-25 11:01:16.000000000 -0400 @@ -1,9 +1,9 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. -timestamp='2004-10-25' +timestamp='2003-06-17' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -53,7 +53,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO @@ -136,6 +136,13 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` | UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown +## for Red Hat Linux +if test -f /etc/redhat-release ; then + VENDOR=redhat ; +else + VENDOR= ; +fi + # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in @@ -197,21 +204,15 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit 0 ;; - amd64:OpenBSD:*:*) - echo x86_64-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; - cats:OpenBSD:*:*) - echo arm-unknown-openbsd${UNAME_RELEASE} + arc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; - luna88k:OpenBSD:*:*) - echo m88k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; @@ -227,33 +228,25 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$ mvmeppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; + pmax:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; sgi:OpenBSD:*:*) - echo mips64-unknown-openbsd${UNAME_RELEASE} + echo mipseb-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sun3:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; + wgrisc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} exit 0 ;; - *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} - exit 0 ;; - macppc:MirBSD:*:*) - echo powerppc-unknown-mirbsd${UNAME_RELEASE} - exit 0 ;; - *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} - exit 0 ;; alpha:OSF1:*:*) - case $UNAME_RELEASE in - *4.0) + if test $UNAME_RELEASE = "V4.0"; then UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - ;; - *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` - ;; - esac + fi # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU @@ -291,12 +284,14 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$ "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac - # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit 0 ;; + Alpha*:OpenVMS:*:*) + echo alpha-hp-vms exit 0 ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? @@ -319,9 +314,6 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$ *:OS/390:*:*) echo i370-ibm-openedition exit 0 ;; - *:OS400:*:*) - echo powerpc-ibm-os400 - exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; @@ -342,7 +334,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$ DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit 0 ;; - DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + DRS?6000:UNIX_SV:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7 && exit 0 ;; esac ;; @@ -414,9 +406,6 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$ *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; - m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} - exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; @@ -752,7 +741,7 @@ EOF echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` @@ -760,11 +749,6 @@ EOF FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; - 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit 0 ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; @@ -774,8 +758,19 @@ EOF *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; - *:FreeBSD:*:*) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + *:FreeBSD:*:*|*:GNU/FreeBSD:*:*) + # Determine whether the default compiler uses glibc. + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #if __GLIBC__ >= 2 + LIBC=gnu + #else + LIBC= + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin @@ -808,13 +803,8 @@ EOF echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) - # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; - *:GNU/*:*:*) - # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu - exit 0 ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit 0 ;; @@ -824,17 +814,8 @@ EOF cris:Linux:*:*) echo cris-axis-linux-gnu exit 0 ;; - crisv32:Linux:*:*) - echo crisv32-axis-linux-gnu - exit 0 ;; - frv:Linux:*:*) - echo frv-unknown-linux-gnu - exit 0 ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-${VENDOR:-unknown}-linux-gnu exit 0 ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu @@ -878,10 +859,10 @@ EOF test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu + echo powerpc-${VENDOR:-unknown}-linux-gnu exit 0 ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu + echo powerpc64-${VENDOR:-unknown}-linux-gnu exit 0 ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in @@ -909,7 +890,7 @@ EOF echo hppa64-unknown-linux-gnu exit 0 ;; s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux + echo ${UNAME_MACHINE}-${VENDOR:-ibm}-linux-gnu exit 0 ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu @@ -921,7 +902,7 @@ EOF echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; x86_64:Linux:*:*) - echo x86_64-unknown-linux-gnu + echo x86_64-${VENDOR:-unknown}-linux-gnu exit 0 ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so @@ -971,12 +952,9 @@ EOF LIBC=gnuaout #endif #endif - #ifdef __dietlibc__ - LIBC=dietlibc - #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` - test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 + test x"${LIBC}" != x && echo "${UNAME_MACHINE}-${VENDOR:-pc}-linux-${LIBC}" && exit 0 test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; i*86:DYNIX/ptx:4*:*) @@ -1004,9 +982,6 @@ EOF i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit 0 ;; - i*86:syllable:*:*) - echo ${UNAME_MACHINE}-pc-syllable - exit 0 ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; @@ -1076,9 +1051,9 @@ EOF M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit 0 ;; - M68*:*:R3V[5678]*:*) + M68*:*:R3V[567]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; - 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` @@ -1176,10 +1151,9 @@ EOF echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - case $UNAME_PROCESSOR in + case `uname -p` in *86) UNAME_PROCESSOR=i686 ;; - unknown) UNAME_PROCESSOR=powerpc ;; + powerpc) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit 0 ;; @@ -1194,7 +1168,7 @@ EOF *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; - NSR-?:NONSTOP_KERNEL:*:*) + NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; *:NonStop-UX:*:*) @@ -1238,19 +1212,6 @@ EOF SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit 0 ;; - *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit 0 ;; - *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "${UNAME_MACHINE}" in - A*) echo alpha-dec-vms && exit 0 ;; - I*) echo ia64-dec-vms && exit 0 ;; - V*) echo vax-dec-vms && exit 0 ;; - esac ;; - *:XENIX:*:SysV) - echo i386-pc-xenix - exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 diff -rup tar-1.15.1-orig/config/config.sub tar-1.15.1/config/config.sub --- tar-1.15.1-orig/config/config.sub 2004-12-15 03:55:00.000000000 -0500 +++ tar-1.15.1/config/config.sub 2006-09-25 11:01:16.000000000 -0400 @@ -1,9 +1,9 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. -timestamp='2004-08-29' +timestamp='2003-06-18' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -70,7 +70,7 @@ Report bugs and patches to &5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; 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 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 { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_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 eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&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 eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; 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 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 { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_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 eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&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 sys/acl.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; 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 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 { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_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 eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&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 sys/buf.h do @@ -11470,20 +11920,20 @@ fi # dnl Persuade glibc to declare these functions. - # Solaris 2.5.1 needs -lposix4 to get the clock_gettyme function. + # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function. # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4. # Save and restore LIBS so e.g., -lrt, isn't added to it. Otherwise, *all* # programs in the package would end up linked with that potentially-shared # library, inducing unnecessary run-time overhead. fetish_saved_libs=$LIBS - echo "$as_me:$LINENO: checking for library containing clock_gettyme" >&5 -echo $ECHO_N "checking for library containing clock_gettyme... $ECHO_C" >&6 -if test "${ac_cv_search_clock_gettyme+set}" = set; then + echo "$as_me:$LINENO: checking for library containing clock_gettime" >&5 +echo $ECHO_N "checking for library containing clock_gettime... $ECHO_C" >&6 +if test "${ac_cv_search_clock_gettime+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS -ac_cv_search_clock_gettyme=no +ac_cv_search_clock_gettime=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -11497,11 +11947,11 @@ extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char clock_gettyme (); +char clock_gettime (); int main () { -clock_gettyme (); +clock_gettime (); ; return 0; } @@ -11528,7 +11978,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_search_clock_gettyme="none required" + ac_cv_search_clock_gettime="none required" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -11536,7 +11986,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -if test "$ac_cv_search_clock_gettyme" = no; then +if test "$ac_cv_search_clock_gettime" = no; then for ac_lib in rt posix4; do LIBS="-l$ac_lib $ac_func_search_save_LIBS" cat >conftest.$ac_ext <<_ACEOF @@ -11552,11 +12002,11 @@ extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char clock_gettyme (); +char clock_gettime (); int main () { -clock_gettyme (); +clock_gettime (); ; return 0; } @@ -11583,7 +12033,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_search_clock_gettyme="-l$ac_lib" + ac_cv_search_clock_gettime="-l$ac_lib" break else echo "$as_me: failed program was:" >&5 @@ -11596,18 +12046,18 @@ rm -f conftest.err conftest.$ac_objext \ fi LIBS=$ac_func_search_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_search_clock_gettyme" >&5 -echo "${ECHO_T}$ac_cv_search_clock_gettyme" >&6 -if test "$ac_cv_search_clock_gettyme" != no; then - test "$ac_cv_search_clock_gettyme" = "none required" || LIBS="$ac_cv_search_clock_gettyme $LIBS" - test "$ac_cv_search_clock_gettyme" = "none required" || - LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettyme +echo "$as_me:$LINENO: result: $ac_cv_search_clock_gettime" >&5 +echo "${ECHO_T}$ac_cv_search_clock_gettime" >&6 +if test "$ac_cv_search_clock_gettime" != no; then + test "$ac_cv_search_clock_gettime" = "none required" || LIBS="$ac_cv_search_clock_gettime $LIBS" + test "$ac_cv_search_clock_gettime" = "none required" || + LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime fi -for ac_func in clock_gettyme clock_settime +for ac_func in clock_gettime clock_settime do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -20541,17 +20991,17 @@ fi # programs in the package would end up linked with that potentially-shared # library, inducing unnecessary run-time overhead. -# Solaris 2.5.1 needs -lposix4 to get the clock_gettyme function. +# Solaris 2.5.1 needs -lposix4 to get the clock_gettime function. # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4. tar_save_LIBS=$LIBS LIB_CLOCK_GETTIME= - echo "$as_me:$LINENO: checking for library containing clock_gettyme" >&5 -echo $ECHO_N "checking for library containing clock_gettyme... $ECHO_C" >&6 -if test "${ac_cv_search_clock_gettyme+set}" = set; then + echo "$as_me:$LINENO: checking for library containing clock_gettime" >&5 +echo $ECHO_N "checking for library containing clock_gettime... $ECHO_C" >&6 +if test "${ac_cv_search_clock_gettime+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS -ac_cv_search_clock_gettyme=no +ac_cv_search_clock_gettime=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20565,11 +21015,11 @@ extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char clock_gettyme (); +char clock_gettime (); int main () { -clock_gettyme (); +clock_gettime (); ; return 0; } @@ -20596,7 +21046,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_search_clock_gettyme="none required" + ac_cv_search_clock_gettime="none required" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -20604,7 +21054,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -if test "$ac_cv_search_clock_gettyme" = no; then +if test "$ac_cv_search_clock_gettime" = no; then for ac_lib in rt posix4; do LIBS="-l$ac_lib $ac_func_search_save_LIBS" cat >conftest.$ac_ext <<_ACEOF @@ -20620,11 +21070,11 @@ extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char clock_gettyme (); +char clock_gettime (); int main () { -clock_gettyme (); +clock_gettime (); ; return 0; } @@ -20651,7 +21101,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_search_clock_gettyme="-l$ac_lib" + ac_cv_search_clock_gettime="-l$ac_lib" break else echo "$as_me: failed program was:" >&5 @@ -20664,19 +21114,19 @@ rm -f conftest.err conftest.$ac_objext \ fi LIBS=$ac_func_search_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_search_clock_gettyme" >&5 -echo "${ECHO_T}$ac_cv_search_clock_gettyme" >&6 -if test "$ac_cv_search_clock_gettyme" != no; then - test "$ac_cv_search_clock_gettyme" = "none required" || LIBS="$ac_cv_search_clock_gettyme $LIBS" +echo "$as_me:$LINENO: result: $ac_cv_search_clock_gettime" >&5 +echo "${ECHO_T}$ac_cv_search_clock_gettime" >&6 +if test "$ac_cv_search_clock_gettime" != no; then + test "$ac_cv_search_clock_gettime" = "none required" || LIBS="$ac_cv_search_clock_gettime $LIBS" fi - case "$ac_cv_search_clock_gettyme" in - -l*) LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettyme;; + case "$ac_cv_search_clock_gettime" in + -l*) LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime;; esac -for ac_func in clock_gettyme +for ac_func in clock_gettime do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -20888,6 +21338,270 @@ _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 eval "test \"\${$as_ac_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 declares $ac_func. + For example, HP-UX 11i 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 to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +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 +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&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 gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char getfilecon (); +int +main () +{ +getfilecon (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \ + 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 gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char acl_get_fd (); +int +main () +{ +acl_get_fd (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; 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 conftest.err conftest.$ac_objext \ + 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 diff -rup tar-1.15.1-orig/configure.ac tar-1.15.1/configure.ac --- tar-1.15.1-orig/configure.ac 2004-12-21 08:29:02.000000000 -0500 +++ tar-1.15.1/configure.ac 2006-09-25 11:01:16.000000000 -0400 @@ -40,6 +40,9 @@ AC_CHECK_HEADERS(fcntl.h linux/fd.h memo sys/inet.h sys/io/trioctl.h \ sys/mtio.h sys/time.h sys/tprintf.h sys/tape.h \ unistd.h locale.h) +AC_CHECK_HEADERS(selinux/selinux.h) +AC_CHECK_HEADERS(attr/xattr.h) +AC_CHECK_HEADERS(sys/acl.h) AC_CHECK_HEADERS([sys/buf.h], [], [], [#if HAVE_SYS_PARAM_H @@ -110,6 +113,12 @@ tar_save_LIBS=$LIBS LIBS=$tar_save_LIBS AC_CHECK_FUNCS(fsync lstat mkfifo readlink strerror symlink setlocale utimes) +AC_CHECK_FUNCS(getxattr fgetxattr lgetxattr \ + 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 ]) AC_CHECK_DECLS([getpwuid],,, [#include ]) AC_CHECK_DECLS([time],,, [#include ]) diff -rup tar-1.15.1-orig/doc/header.texi tar-1.15.1/doc/header.texi --- tar-1.15.1-orig/doc/header.texi 2004-04-04 05:53:48.000000000 -0400 +++ tar-1.15.1/doc/header.texi 2006-09-25 11:01:16.000000000 -0400 @@ -265,6 +265,14 @@ struct sp_array size_t numbytes; @}; +/* Information about xattrs for a file. */ +struct xattr_array + @{ + char *xkey; + char *xval_ptr; + size_t xval_len; + @}; + struct tar_stat_info @{ char *orig_file_name; /* name of file read from the archive header */ @@ -278,6 +286,15 @@ struct tar_stat_info unsigned int devmajor; /* device major number */ char *uname; /* user name of owner */ char *gname; /* group name of owner */ + + char *cntx_name; /* SELinux context for the current archive entry. */ + + 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. */ + struct stat stat; /* regular filesystem stat */ /* Nanosecond parts of file timestamps (if available) */ @@ -294,7 +311,10 @@ struct tar_stat_info sparse_map array. Zero if the file is not sparse */ size_t sparse_map_size; /* Size of the sparse map */ - struct sp_array *sparse_map; + struct sp_array *sparse_map; + + size_t xattr_map_size; /* Size of the xattr map */ + struct xattr_array *xattr_map; @}; union block diff -rup tar-1.15.1-orig/doc/Makefile.in tar-1.15.1/doc/Makefile.in --- tar-1.15.1-orig/doc/Makefile.in 2004-12-21 08:30:58.000000000 -0500 +++ tar-1.15.1/doc/Makefile.in 2006-09-25 11:01:16.000000000 -0400 @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.3 from Makefile.am. +# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004 Free Software Foundation, Inc. +# 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -300,9 +300,11 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps) restore=: && backupdir="$(am__leading_dot)am$$$$" && \ am__cwd=`pwd` && cd $(srcdir) && \ rm -rf $$backupdir && mkdir $$backupdir && \ - for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ - if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \ - done; \ + if ($(MAKEINFO) --version) >/dev/null 2>&1; then \ + for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ + if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \ + done; \ + else :; fi && \ cd "$$am__cwd"; \ if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ -o $@ $<; \ @@ -361,10 +363,11 @@ mostlyclean-vti: maintainer-clean-vti: -rm -f $(srcdir)/stamp-vti $(srcdir)/version.texi .dvi.ps: + TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ $(DVIPS) -o $@ $< uninstall-info-am: - $(PRE_UNINSTALL) + @$(PRE_UNINSTALL) @if (install-info --version && \ install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \ list='$(INFO_DEPS)'; \ @@ -380,7 +383,7 @@ uninstall-info-am: relfile=`echo "$$file" | sed 's|^.*/||'`; \ relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \ (if cd "$(DESTDIR)$(infodir)"; then \ - echo " rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9])"; \ + echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]"; \ rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \ else :; fi); \ done diff -rup tar-1.15.1-orig/doc/stamp-vti tar-1.15.1/doc/stamp-vti --- tar-1.15.1-orig/doc/stamp-vti 2004-12-21 08:33:12.000000000 -0500 +++ tar-1.15.1/doc/stamp-vti 2006-09-25 11:01:16.000000000 -0400 @@ -1,4 +1,4 @@ -@set UPDATED 18 December 2004 -@set UPDATED-MONTH December 2004 +@set UPDATED 23 September 2006 +@set UPDATED-MONTH September 2006 @set EDITION 1.15.1 @set VERSION 1.15.1 diff -rup tar-1.15.1-orig/doc/tar.info tar-1.15.1/doc/tar.info --- tar-1.15.1-orig/doc/tar.info 2004-12-21 08:03:19.000000000 -0500 +++ tar-1.15.1/doc/tar.info 2006-09-25 11:01:16.000000000 -0400 @@ -1,6 +1,6 @@ -This is tar.info, produced by makeinfo version 4.7 from tar.texi. +This is tar.info, produced by makeinfo version 4.8 from tar.texi. - This manual is for GNU `tar' (version 1.15.1, 18 December 2004), + This manual is for GNU `tar' (version 1.15.1, 23 September 2006), which creates and extracts files from archives. Copyright (C) 1992, 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2003, @@ -35,7 +35,7 @@ File: tar.info, Node: Top, Next: Intro GNU tar: an archiver tool ************************* -This manual is for GNU `tar' (version 1.15.1, 18 December 2004), which +This manual is for GNU `tar' (version 1.15.1, 23 September 2006), which creates and extracts files from archives. Copyright (C) 1992, 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2003, @@ -6354,7 +6354,8 @@ conforming to POSIX.1-2001 standard. A POSIX conformant archive will be created if `tar' was given `--format=posix' option. Notice, that currently GNU extensions are not allowed with this format. Following is the list of options that cannot -be used with `--format=posix': +be used with `--format=posix': This is the only format that can store +ACLs, SELinux context and extended attributes. * `--label=ARCHIVE-LABEL' (`-V ARCHIVE-LABEL'), when used with `--create' (`-c'). @@ -6797,6 +6798,46 @@ they were before they were read, use the is equivalent to `--same-permissions' (`--preserve-permissions', `-p') plus `--same-order' (`--preserve-order', `-s'). +`--acls' + This option causes `tar' to store each file's ACLs in the archive. + + The `--acls' option has no equivalent short option name. + +`--selinux' + This option causes `tar' to store each file's SELinux security + context information in the archive. + + The `--selinux' option has no equivalent short option name. + +`--xattrs' + This option causes `tar' to store each file's extended attributes + in the archive. This option also enables `--acls' and `--selinux' + if+they haven't been set already, due to the fact that the data + for those are stored in special xattrs. + + The `--xattrs' option has no equivalent short option name. + +`--no-acls' + This option causes `tar' not to store each file's ACLs in the + archive and not to extract any ACL information in an archive. + + The `--acls' option has no equivalent short option name. + +`--no-selinux' + This option causes `tar' not to store each file's SELinux security + context information in the archive and not to extract any SELinux + information in an archive. + + The `--selinux' option has no equivalent short option name. + +`--no-xattrs' + This option causes `tar' not to store each file's extended + attributes in the archive and not to extract any extended + attributes in an archive. This option also enables `--acls' and + `--selinux' if they haven't been set already. + + The `--xattrs' option has no equivalent short option name. +  File: tar.info, Node: Standard, Next: Extensions, Prev: Attributes, Up: Formats @@ -7123,6 +7164,14 @@ distribution, this is part of file `src/ size_t numbytes; }; + /* Information about xattrs for a file. */ + struct xattr_array + { + char *xkey; + char *xval_ptr; + size_t xval_len; + }; + struct tar_stat_info { char *orig_file_name; /* name of file read from the archive header */ @@ -7136,6 +7185,15 @@ distribution, this is part of file `src/ unsigned int devmajor; /* device major number */ char *uname; /* user name of owner */ char *gname; /* group name of owner */ + + char *cntx_name; /* SELinux context for the current archive entry. */ + + 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. */ + struct stat stat; /* regular filesystem stat */ /* Nanosecond parts of file timestamps (if available) */ @@ -7153,6 +7211,9 @@ distribution, this is part of file `src/ not sparse */ size_t sparse_map_size; /* Size of the sparse map */ struct sp_array *sparse_map; + + size_t xattr_map_size; /* Size of the xattr map */ + struct xattr_array *xattr_map; }; union block @@ -9271,6 +9332,7 @@ Appendix C Index * -suffix: backup. (line 68) * abbreviations for months: Calendar date items. (line 38) * absolute file names: Remote Tape Server. (line 17) +* acls: Attributes. (line 118) * Adding archives to an archive: concatenate. (line 6) * Adding files to an Archive: appending files. (line 8) * ADMINISTRATOR: General-Purpose Variables. @@ -9446,6 +9508,9 @@ Appendix C Index (line 6) * next DAY: Day of week items. (line 15) * next in date strings: General date syntax. (line 26) +* no-acls: Attributes. (line 137) +* no-selinux: Attributes. (line 143) +* no-xattrs: Attributes. (line 150) * noon in date strings: Time of day items. (line 21) * now in date strings: Relative items in date strings. (line 33) @@ -9494,6 +9559,7 @@ Appendix C Index * Running out of space: Reading. (line 6) * Running out of space during extraction: Scarce. (line 6) * Salz, Rich: Authors of get_date. (line 6) +* selinux: Attributes. (line 123) * simple backup method: backup. (line 64) * SIMPLE_BACKUP_SUFFIX: backup. (line 68) * SLEEP_MESSAGE: General-Purpose Variables. @@ -9555,6 +9621,7 @@ Appendix C Index * Working directory, specifying: directory. (line 6) * Writing extracted files to standard output: Writing. (line 6) * Writing new archives: file. (line 36) +* xattrs: Attributes. (line 129) * XLIST: General-Purpose Variables. (line 80) * year in date strings: Relative items in date strings. @@ -9565,172 +9632,172 @@ Appendix C Index  Tag Table: -Node: Top1264 -Node: Introduction9089 -Node: Book Contents9948 -Node: Definitions12120 -Node: What tar Does13921 -Node: Naming tar Archives16686 -Node: Current status17413 -Node: Authors19471 -Node: Reports21176 -Node: Tutorial21535 -Node: assumptions22348 -Node: stylistic conventions24827 -Node: basic tar options25270 -Node: frequent operations28909 -Node: Two Frequent Options29561 -Node: file tutorial30192 -Node: verbose tutorial31275 -Node: help tutorial33009 -Node: create33363 -Node: prepare for examples34864 -Node: Creating the archive36578 -Node: create verbose39377 -Node: short create40198 -Node: create dir43095 -Node: list45701 -Node: list dir48222 -Node: extract49211 -Node: extracting archives50413 -Node: extracting files50903 -Node: extract dir53003 -Node: extracting untrusted archives55386 -Node: failing commands56265 -Node: going further57350 -Node: tar invocation57500 -Node: Synopsis58997 -Node: using tar options63416 -Node: Styles66021 -Node: Mnemonic Options67830 -Node: Short Options70030 -Ref: Short Options-Footnote-171838 -Node: Old Options72055 -Ref: Old Options-Footnote-175007 -Node: Mixing75177 -Ref: Mixing-Footnote-177543 -Node: All Options77667 -Node: Operation Summary78272 -Node: Option Summary79533 -Ref: Option Summary-Footnote-1101314 -Node: Short Option Summary101377 -Node: help103153 -Ref: help-Footnote-1106597 -Node: verbose106806 -Node: interactive111072 -Node: operations113151 -Node: Basic tar113410 -Ref: Basic tar-Footnote-1116723 -Node: Advanced tar116867 -Node: Operations117712 -Node: append119670 -Ref: append-Footnote-1122850 -Node: appending files123016 -Node: multiple124794 -Node: update127495 -Node: how to update128503 -Node: concatenate130286 -Node: delete133562 -Node: compare135552 -Node: create options137206 -Node: Ignore Failed Read137608 -Node: extract options137811 -Node: Reading138722 -Node: read full records140309 -Node: Ignore Zeros140645 -Node: Writing141656 -Node: Dealing with Old Files142124 -Node: Overwrite Old Files144550 -Node: Keep Old Files146007 -Node: Keep Newer Files146525 -Node: Unlink First146814 -Node: Recursive Unlink147218 -Node: Modification Times147766 -Node: Setting Access Permissions148544 -Node: Writing to Standard Output149168 -Node: remove files150600 -Node: Scarce150789 -Node: Starting File151037 -Node: Same Order151867 -Node: backup152703 -Node: Applications156385 -Node: looking ahead157647 -Node: Backups158472 -Node: Full Dumps161478 -Node: Inc Dumps166991 -Node: incremental and listed-incremental168276 -Node: Backup Levels172728 -Node: Backup Parameters175085 -Node: General-Purpose Variables176262 -Node: Magnetic Tape Control180941 -Node: User Hooks182273 -Node: backup-specs example183584 -Node: Scripted Backups184727 -Ref: Scripted Backups-Footnote-1187468 -Node: Scripted Restoration187850 -Node: Choosing190347 -Node: file191289 -Node: Selecting Archive Members194938 -Node: files196281 -Node: nul197885 -Node: exclude199267 -Node: controlling pattern-patching with exclude201156 -Node: problems with exclude203204 -Node: Wildcards205415 -Node: after207948 -Node: recurse211056 -Node: one213679 -Node: directory215315 -Node: absolute218390 -Node: Date input formats221535 -Node: General date syntax223851 -Node: Calendar date items226556 -Node: Time of day items228553 -Node: Time zone items230605 -Node: Day of week items231839 -Node: Relative items in date strings232828 -Node: Pure numbers in date strings235630 -Node: Seconds since the Epoch236611 -Node: Specifying time zone rules238236 -Node: Authors of get_date240600 -Node: Formats241352 -Node: Portability246068 -Node: Portable Names247368 -Node: dereference248073 -Node: old249466 -Node: ustar250543 -Node: gnu251133 -Node: posix252420 -Node: Checksumming253124 -Node: Large or Negative Values255048 -Node: Compression257034 -Node: gzip257346 -Node: sparse262234 -Ref: sparse-Footnote-1267514 -Node: Attributes267810 -Node: Standard273223 -Node: Extensions299111 -Node: cpio301663 -Node: Media306411 -Node: Device308372 -Node: Remote Tape Server313411 -Node: Common Problems and Solutions317236 -Node: Blocking317628 -Node: Format Variations324240 -Node: Blocking Factor325177 -Node: Many336857 -Node: Tape Positioning340651 -Node: mt342510 -Node: Using Multiple Tapes344350 -Node: Multi-Volume Archives349453 -Node: Tape Files353515 -Node: label354991 -Ref: label-Footnote-1358790 -Node: verify359025 -Node: Write Protection362404 -Node: Free Software Needs Free Documentation363234 -Node: Copying This Manual368203 -Node: GNU Free Documentation License368461 -Node: Index390867 +Node: Top1265 +Node: Introduction9091 +Node: Book Contents9950 +Node: Definitions12122 +Node: What tar Does13923 +Node: Naming tar Archives16688 +Node: Current status17415 +Node: Authors19473 +Node: Reports21178 +Node: Tutorial21537 +Node: assumptions22350 +Node: stylistic conventions24829 +Node: basic tar options25272 +Node: frequent operations28911 +Node: Two Frequent Options29563 +Node: file tutorial30194 +Node: verbose tutorial31277 +Node: help tutorial33011 +Node: create33365 +Node: prepare for examples34866 +Node: Creating the archive36580 +Node: create verbose39379 +Node: short create40200 +Node: create dir43097 +Node: list45703 +Node: list dir48224 +Node: extract49213 +Node: extracting archives50415 +Node: extracting files50905 +Node: extract dir53005 +Node: extracting untrusted archives55388 +Node: failing commands56267 +Node: going further57352 +Node: tar invocation57502 +Node: Synopsis58999 +Node: using tar options63418 +Node: Styles66023 +Node: Mnemonic Options67832 +Node: Short Options70032 +Ref: Short Options-Footnote-171840 +Node: Old Options72057 +Ref: Old Options-Footnote-175009 +Node: Mixing75179 +Ref: Mixing-Footnote-177545 +Node: All Options77669 +Node: Operation Summary78274 +Node: Option Summary79535 +Ref: Option Summary-Footnote-1101316 +Node: Short Option Summary101379 +Node: help103155 +Ref: help-Footnote-1106599 +Node: verbose106808 +Node: interactive111074 +Node: operations113153 +Node: Basic tar113412 +Ref: Basic tar-Footnote-1116725 +Node: Advanced tar116869 +Node: Operations117714 +Node: append119672 +Ref: append-Footnote-1122852 +Node: appending files123018 +Node: multiple124796 +Node: update127497 +Node: how to update128505 +Node: concatenate130288 +Node: delete133564 +Node: compare135554 +Node: create options137208 +Node: Ignore Failed Read137610 +Node: extract options137813 +Node: Reading138724 +Node: read full records140311 +Node: Ignore Zeros140647 +Node: Writing141658 +Node: Dealing with Old Files142126 +Node: Overwrite Old Files144552 +Node: Keep Old Files146009 +Node: Keep Newer Files146527 +Node: Unlink First146816 +Node: Recursive Unlink147220 +Node: Modification Times147768 +Node: Setting Access Permissions148546 +Node: Writing to Standard Output149170 +Node: remove files150602 +Node: Scarce150791 +Node: Starting File151039 +Node: Same Order151869 +Node: backup152705 +Node: Applications156387 +Node: looking ahead157649 +Node: Backups158474 +Node: Full Dumps161480 +Node: Inc Dumps166993 +Node: incremental and listed-incremental168278 +Node: Backup Levels172730 +Node: Backup Parameters175087 +Node: General-Purpose Variables176264 +Node: Magnetic Tape Control180943 +Node: User Hooks182275 +Node: backup-specs example183586 +Node: Scripted Backups184729 +Ref: Scripted Backups-Footnote-1187470 +Node: Scripted Restoration187852 +Node: Choosing190349 +Node: file191291 +Node: Selecting Archive Members194940 +Node: files196283 +Node: nul197887 +Node: exclude199269 +Node: controlling pattern-patching with exclude201158 +Node: problems with exclude203206 +Node: Wildcards205417 +Node: after207950 +Node: recurse211058 +Node: one213681 +Node: directory215317 +Node: absolute218392 +Node: Date input formats221537 +Node: General date syntax223853 +Node: Calendar date items226558 +Node: Time of day items228555 +Node: Time zone items230607 +Node: Day of week items231841 +Node: Relative items in date strings232830 +Node: Pure numbers in date strings235632 +Node: Seconds since the Epoch236613 +Node: Specifying time zone rules238238 +Node: Authors of get_date240602 +Node: Formats241354 +Node: Portability246070 +Node: Portable Names247370 +Node: dereference248075 +Node: old249468 +Node: ustar250545 +Node: gnu251135 +Node: posix252422 +Node: Checksumming253212 +Node: Large or Negative Values255136 +Node: Compression257122 +Node: gzip257434 +Node: sparse262322 +Ref: sparse-Footnote-1267602 +Node: Attributes267898 +Node: Standard274771 +Node: Extensions301343 +Node: cpio303895 +Node: Media308643 +Node: Device310604 +Node: Remote Tape Server315643 +Node: Common Problems and Solutions319468 +Node: Blocking319860 +Node: Format Variations326472 +Node: Blocking Factor327409 +Node: Many339089 +Node: Tape Positioning342883 +Node: mt344742 +Node: Using Multiple Tapes346582 +Node: Multi-Volume Archives351685 +Node: Tape Files355747 +Node: label357223 +Ref: label-Footnote-1361022 +Node: verify361257 +Node: Write Protection364636 +Node: Free Software Needs Free Documentation365466 +Node: Copying This Manual370435 +Node: GNU Free Documentation License370693 +Node: Index393099  End Tag Table diff -rup tar-1.15.1-orig/doc/tar.texi tar-1.15.1/doc/tar.texi --- tar-1.15.1-orig/doc/tar.texi 2004-12-18 14:20:19.000000000 -0500 +++ tar-1.15.1/doc/tar.texi 2006-09-25 11:01:16.000000000 -0400 @@ -7012,6 +7012,8 @@ was given @value{op-format-posix} option Notice, that currently @acronym{GNU} extensions are not allowed with this format. Following is the list of options that cannot be used with @value{op-format-posix}: +This is the only format that can store ACLs, SELinux context and extended +attributes. @itemize @bullet @item @value{op-label}, when used with @value{op-create}. @@ -7501,6 +7503,51 @@ It is equivalent to @value{op-same-permi @FIXME{I do not see the purpose of such an option. (Neither I. FP.)} +@opindex acls +@item --acls +This option causes @command{tar} to store each file's ACLs in the archive. + +The @option{--acls} option has no equivalent short option name. + +@opindex selinux +@item --selinux +This option causes @command{tar} to store each file's SELinux security context +information in the archive. + +The @option{--selinux} option has no equivalent short option name. + +@opindex xattrs +@item --xattrs +This option causes @command{tar} to store each file's extended attributes in +the archive. This option also enables @option{--acls} and @option{--selinux} if+they haven't been set already, due to the fact that the data for those are +stored in special xattrs. + +The @option{--xattrs} option has no equivalent short option name. + +@opindex no-acls +@item --no-acls +This option causes @command{tar} not to store each file's ACLs in the archive +and not to extract any ACL information in an archive. + +The @option{--acls} option has no equivalent short option name. + +@opindex no-selinux +@item --no-selinux +This option causes @command{tar} not to store each file's SELinux security +context information in the archive and not to extract any SELinux information in +an archive. + +The @option{--selinux} option has no equivalent short option name. + +@opindex no-xattrs +@item --no-xattrs +This option causes @command{tar} not to store each file's extended attributes in +the archive and not to extract any extended attributes in an archive. This +option also enables @option{--acls} and @option{--selinux} if +they haven't been set already. + +The @option{--xattrs} option has no equivalent short option name. + @end table @node Standard diff -rup tar-1.15.1-orig/doc/version.texi tar-1.15.1/doc/version.texi --- tar-1.15.1-orig/doc/version.texi 2004-12-21 08:03:18.000000000 -0500 +++ tar-1.15.1/doc/version.texi 2006-09-25 11:01:16.000000000 -0400 @@ -1,4 +1,4 @@ -@set UPDATED 18 December 2004 -@set UPDATED-MONTH December 2004 +@set UPDATED 23 September 2006 +@set UPDATED-MONTH September 2006 @set EDITION 1.15.1 @set VERSION 1.15.1 diff -rup tar-1.15.1-orig/lib/localedir.h tar-1.15.1/lib/localedir.h --- tar-1.15.1-orig/lib/localedir.h 2004-12-21 09:01:12.000000000 -0500 +++ tar-1.15.1/lib/localedir.h 2006-09-25 11:01:16.000000000 -0400 @@ -1,4 +1,4 @@ #define LOCALEDIR "/usr/share/locale" #ifndef DEFAULT_RMT_COMMAND -# define DEFAULT_RMT_COMMAND "/etc/rmt" +# define DEFAULT_RMT_COMMAND "/sbin/rmt" #endif diff -rup tar-1.15.1-orig/lib/Makefile.in tar-1.15.1/lib/Makefile.in --- tar-1.15.1-orig/lib/Makefile.in 2004-12-21 08:31:00.000000000 -0500 +++ tar-1.15.1/lib/Makefile.in 2006-09-25 11:01:16.000000000 -0400 @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.3 from Makefile.am. +# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004 Free Software Foundation, Inc. +# 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -20,8 +20,6 @@ # Free Software Foundation, Inc. -SOURCES = $(libtar_a_SOURCES) - srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ diff -rup tar-1.15.1-orig/Makefile.in tar-1.15.1/Makefile.in --- tar-1.15.1-orig/Makefile.in 2004-12-21 08:31:04.000000000 -0500 +++ tar-1.15.1/Makefile.in 2006-09-25 11:01:16.000000000 -0400 @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.3 from Makefile.am. +# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004 Free Software Foundation, Inc. +# 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -311,7 +311,13 @@ uninstall-info-am: # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): - @set fnord $$MAKEFLAGS; amf=$$2; \ + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ @@ -323,7 +329,7 @@ $(RECURSIVE_TARGETS): local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ @@ -331,7 +337,13 @@ $(RECURSIVE_TARGETS): mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: - @set fnord $$MAKEFLAGS; amf=$$2; \ + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ @@ -352,7 +364,7 @@ maintainer-clean-recursive: local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ diff -rup tar-1.15.1-orig/rmt/Makefile.in tar-1.15.1/rmt/Makefile.in --- tar-1.15.1-orig/rmt/Makefile.in 2004-12-21 08:31:01.000000000 -0500 +++ tar-1.15.1/rmt/Makefile.in 2006-09-25 11:01:16.000000000 -0400 @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.3 from Makefile.am. +# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004 Free Software Foundation, Inc. +# 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -14,8 +14,6 @@ @SET_MAKE@ -SOURCES = $(rmt_SOURCES) - srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -304,7 +302,8 @@ installcheck-rmtPROGRAMS: $(rmt_PROGRAMS f=`echo "$$p" | \ sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ for opt in --help --version; do \ - if "$(DESTDIR)$(rmtdir)/$$f" $$opt > c$${pid}_.out 2> c$${pid}_.err \ + if "$(DESTDIR)$(rmtdir)/$$f" $$opt >c$${pid}_.out \ + 2>c$${pid}_.err &2; bad=1; fi; \ diff -rup tar-1.15.1-orig/scripts/Makefile.in tar-1.15.1/scripts/Makefile.in --- tar-1.15.1-orig/scripts/Makefile.in 2004-12-21 08:31:01.000000000 -0500 +++ tar-1.15.1/scripts/Makefile.in 2006-09-25 11:01:16.000000000 -0400 @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.3 from Makefile.am. +# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004 Free Software Foundation, Inc. +# 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -299,7 +299,8 @@ installcheck-libexecSCRIPTS: $(libexec_S esac; \ f=`echo "$$p" | sed 's,^.*/,,;$(transform)'`; \ for opt in --help --version; do \ - if "$(DESTDIR)$(libexecdir)/$$f" $$opt > c$${pid}_.out 2> c$${pid}_.err \ + if "$(DESTDIR)$(libexecdir)/$$f" $$opt >c$${pid}_.out \ + 2>c$${pid}_.err &2; bad=1; fi; \ @@ -332,7 +333,8 @@ installcheck-sbinSCRIPTS: $(sbin_SCRIPTS esac; \ f=`echo "$$p" | sed 's,^.*/,,;$(transform)'`; \ for opt in --help --version; do \ - if "$(DESTDIR)$(sbindir)/$$f" $$opt > c$${pid}_.out 2> c$${pid}_.err \ + if "$(DESTDIR)$(sbindir)/$$f" $$opt >c$${pid}_.out \ + 2>c$${pid}_.err &2; bad=1; fi; \ diff -rup tar-1.15.1-orig/src/common.h tar-1.15.1/src/common.h --- tar-1.15.1-orig/src/common.h 2004-12-21 09:31:58.000000000 -0500 +++ tar-1.15.1/src/common.h 2006-09-25 11:01:16.000000000 -0400 @@ -247,6 +247,15 @@ GLOBAL int same_owner_option; /* If positive, preserve permissions when extracting. */ GLOBAL int same_permissions_option; +/* If positive, save the SELinux context. */ +GLOBAL int selinux_context_option; + +/* If positive, save the ACLs. */ +GLOBAL int acls_option; + +/* If positive, save the user and root xattrs. */ +GLOBAL int xattrs_option; + /* When set, strip the given number of file name components from the file name before extracting */ GLOBAL size_t strip_name_components; @@ -654,6 +663,9 @@ extern char *output_start; void update_archive (void); +/* Module attrs.c. */ +#include "xattrs.h" + /* Module xheader.c. */ void xheader_decode (struct tar_stat_info *); @@ -669,6 +681,12 @@ char *xheader_ghdr_name (void); void xheader_write (char, char *, struct xheader *); void xheader_write_global (void); void xheader_set_option (char *string); +void xheader_xattr_init(struct tar_stat_info *st); +void xheader_xattr_free(struct xattr_array *vals, size_t sz); +void xheader_xattr_copy(const struct tar_stat_info *st, + struct xattr_array **vals, size_t *sz); +void xheader_xattr_add(struct tar_stat_info *st, + const char *key, const char *val, size_t len); /* Module system.c */ @@ -703,3 +721,9 @@ bool sparse_diff_file (int, struct tar_s /* Module utf8.c */ bool string_ascii_p (const char *str); bool utf8_convert (bool to_utf, char const *input, char **output); + +/* backport externs ... */ +void +call_arg_error (char const *call, char const *name); +void +call_arg_warn (char const *call, char const *name); diff -rup tar-1.15.1-orig/src/create.c tar-1.15.1/src/create.c --- tar-1.15.1-orig/src/create.c 2006-09-20 11:35:16.000000000 -0400 +++ tar-1.15.1/src/create.c 2006-09-25 11:01:16.000000000 -0400 @@ -753,6 +753,30 @@ start_header (struct tar_stat_info *st) GNAME_TO_CHARS (st->gname, header->header.gname); } + if (archive_format == POSIX_FORMAT) + { + if (acls_option > 0) + { + if (st->acls_a_ptr) + xheader_store ("SCHILY.xattr.system.posix_acl_access", st, NULL); + if (st->acls_d_ptr) + xheader_store ("SCHILY.xattr.system.posix_acl_default", st, NULL); + } + if ((selinux_context_option > 0) && st->cntx_name) + xheader_store ("SCHILY.xattr.security.selinux", st, NULL); + if (xattrs_option > 0) + { + 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); + ++scan_xattr; + } + } + } + return header; } @@ -984,6 +1008,10 @@ dump_dir0 (char *directory, if (!blk) return; + xattrs_acls_get(st, directory, -1); + xattrs_selinux_get(st, directory, -1); + xattrs_xattrs_get(st, directory, -1); + if (incremental_option) blk->header.typeflag = GNUTYPE_DUMPDIR; else /* if (standard_option) */ @@ -1438,6 +1466,10 @@ dump_file0 (struct tar_stat_info *st, ch open_diag (st->orig_file_name); return; } + + xattrs_acls_get(st, p, fd); + xattrs_selinux_get(st, p, fd); + xattrs_xattrs_get(st, p, fd); } else fd = -1; diff -rup tar-1.15.1-orig/src/extract.c tar-1.15.1/src/extract.c --- tar-1.15.1-orig/src/extract.c 2006-09-20 11:35:16.000000000 -0400 +++ tar-1.15.1/src/extract.c 2006-09-25 11:01:16.000000000 -0400 @@ -71,6 +71,13 @@ struct delayed_set_stat mode_t invert_permissions; enum permstatus permstatus; bool after_symlinks; + char *cntx_name; + 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; char file_name[1]; }; @@ -95,6 +102,18 @@ struct delayed_symlink 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]; }; @@ -228,7 +247,7 @@ check_time (char const *file_name, time_ static void set_stat (char const *file_name, - struct stat const *stat_info, + struct tar_stat_info const *st, struct stat const *cur_info, mode_t invert_permissions, enum permstatus permstatus, char typeflag) @@ -249,11 +268,11 @@ set_stat (char const *file_name, /* FIXME: incremental_option should set ctime too, but how? */ if (incremental_option) - utimbuf.actime = stat_info->st_atime; + utimbuf.actime = st->stat.st_atime; else utimbuf.actime = start_time; - utimbuf.modtime = stat_info->st_mtime; + utimbuf.modtime = st->stat.st_mtime; if (utime (file_name, &utimbuf) < 0) utime_error (file_name); @@ -268,10 +287,14 @@ set_stat (char const *file_name, done, it is not possible anymore to change file permissions, so we have to set permissions prior to possibly giving files away. */ - set_mode (file_name, stat_info, cur_info, + set_mode (file_name, &st->stat, cur_info, invert_permissions, permstatus, typeflag); } + xattrs_acls_set(st, file_name, typeflag); + xattrs_selinux_set(st, file_name, typeflag); + xattrs_xattrs_set(st, file_name, typeflag); + if (0 < same_owner_option && permstatus != INTERDIR_PERMSTATUS) { /* When lchown exists, it should be used to change the attributes of @@ -282,22 +305,22 @@ set_stat (char const *file_name, if (typeflag == SYMTYPE) { #if HAVE_LCHOWN - if (lchown (file_name, stat_info->st_uid, stat_info->st_gid) < 0) + if (lchown (file_name, st->stat.st_uid, st->stat.st_gid) < 0) chown_error_details (file_name, - stat_info->st_uid, stat_info->st_gid); + st->stat.st_uid, st->stat.st_gid); #endif } else { - if (chown (file_name, stat_info->st_uid, stat_info->st_gid) < 0) + if (chown (file_name, st->stat.st_uid, st->stat.st_gid) < 0) chown_error_details (file_name, - stat_info->st_uid, stat_info->st_gid); + st->stat.st_uid, st->stat.st_gid); /* On a few systems, and in particular, those allowing to give files away, changing the owner or group destroys the suid or sgid bits. So let's attempt setting these bits once more. */ - if (stat_info->st_mode & (S_ISUID | S_ISGID | S_ISVTX)) - set_mode (file_name, stat_info, 0, + if (st->stat.st_mode & (S_ISUID | S_ISGID | S_ISVTX)) + set_mode (file_name, &st->stat, 0, invert_permissions, permstatus, typeflag); } } @@ -310,7 +333,7 @@ set_stat (char const *file_name, INVERT_PERMISSIONS bits from the file's current permissions. PERMSTATUS specifies the status of the file's permissions. */ static void -delay_set_stat (char const *file_name, struct stat const *stat_info, +delay_set_stat (char const *file_name, struct tar_stat_info const *st, mode_t invert_permissions, enum permstatus permstatus) { size_t file_name_len = strlen (file_name); @@ -322,7 +345,24 @@ delay_set_stat (char const *file_name, s data->invert_permissions = invert_permissions; data->permstatus = permstatus; data->after_symlinks = 0; - data->stat_info = *stat_info; + data->cntx_name = NULL; + assign_string (&data->cntx_name, st->cntx_name); + if (st->acls_a_ptr) + data->acls_a_ptr = xmemdup(st->acls_a_ptr, st->acls_a_len); + else + { + data->acls_a_ptr = NULL; + data->acls_a_len = 0; + } + if (st->acls_d_ptr) + data->acls_d_ptr = xmemdup(st->acls_d_ptr, st->acls_d_len); + else + { + data->acls_d_ptr = NULL; + data->acls_d_len = 0; + } + xheader_xattr_copy (st, &data->xattr_map, &data->xattr_map_size); + data->stat_info = st->stat; data->next = delayed_set_stat_head; delayed_set_stat_head = data; } @@ -404,7 +444,7 @@ make_directories (char *file_name) invert_permissions is zero, because repair_delayed_set_stat may need to update the struct. */ delay_set_stat (file_name, - ¤t_stat_info.stat, + ¤t_stat_info, invert_permissions, INTERDIR_PERMSTATUS); print_for_mkdir (file_name, cursor - file_name, mode); @@ -594,10 +634,27 @@ apply_nonancestor_delayed_set_stat (char } if (! skip_this_one) - set_stat (data->file_name, &data->stat_info, cur_info, - data->invert_permissions, data->permstatus, DIRTYPE); + { + struct tar_stat_info st1; + st1.stat = data->stat_info; + st1.cntx_name = data->cntx_name; + st1.acls_a_ptr = data->acls_a_ptr; + st1.acls_a_len = data->acls_a_len; + st1.acls_d_ptr = data->acls_d_ptr; + st1.acls_d_len = data->acls_d_len; + st1.xattr_map = data->xattr_map; + st1.xattr_map_size = data->xattr_map_size; + + set_stat (data->file_name, &st1, cur_info, + data->invert_permissions, data->permstatus, DIRTYPE); + } + delayed_set_stat_head = data->next; + xheader_xattr_free (data->xattr_map, data->xattr_map_size); + free (data->cntx_name); + free (data->acls_a_ptr); + free (data->acls_d_ptr); free (data); } } @@ -800,7 +857,7 @@ extract_archive (void) undo_last_backup (); } - set_stat (file_name, ¤t_stat_info.stat, 0, 0, + set_stat (file_name, ¤t_stat_info, 0, 0, (old_files_option == OVERWRITE_OLD_FILES ? UNKNOWN_PERMSTATUS : ARCHIVED_PERMSTATUS), @@ -822,7 +879,7 @@ extract_archive (void) break; if (status == 0) - set_stat (file_name, ¤t_stat_info.stat, 0, 0, 0, SYMTYPE); + set_stat (file_name, ¤t_stat_info, 0, 0, 0, SYMTYPE); else symlink_error (current_stat_info.link_name, file_name); } @@ -995,7 +1052,7 @@ extract_archive (void) undo_last_backup (); break; }; - set_stat (file_name, ¤t_stat_info.stat, 0, 0, + set_stat (file_name, ¤t_stat_info, 0, 0, ARCHIVED_PERMSTATUS, typeflag); break; #endif @@ -1011,7 +1068,7 @@ extract_archive (void) break; if (status == 0) - set_stat (file_name, ¤t_stat_info.stat, NULL, 0, + set_stat (file_name, ¤t_stat_info, NULL, 0, ARCHIVED_PERMSTATUS, typeflag); else { @@ -1090,11 +1147,11 @@ extract_archive (void) || old_files_option == OVERWRITE_OLD_FILES) { if (status == 0) - delay_set_stat (file_name, ¤t_stat_info.stat, + delay_set_stat (file_name, ¤t_stat_info, MODE_RWX & (mode ^ current_stat_info.stat.st_mode), ARCHIVED_PERMSTATUS); else /* For an already existing directory, invert_perms must be 0 */ - delay_set_stat (file_name, ¤t_stat_info.stat, + delay_set_stat (file_name, ¤t_stat_info, 0, UNKNOWN_PERMSTATUS); } @@ -1168,10 +1225,19 @@ apply_delayed_symlinks (void) symlink_error (ds->target, source); else { + struct tar_stat_info st1; + valid_source = source; - st.st_uid = ds->uid; - st.st_gid = ds->gid; - set_stat (source, &st, 0, 0, 0, SYMTYPE); + st1.stat.st_uid = ds->uid; + st1.stat.st_gid = ds->gid; + st1.cntx_name = ds->cntx_name; + st1.acls_a_ptr = ds->acls_a_ptr; + st1.acls_a_len = ds->acls_a_len; + st1.acls_d_ptr = ds->acls_d_ptr; + st1.acls_d_len = ds->acls_d_len; + st1.xattr_map = ds->xattr_map; + st1.xattr_map_size = ds->xattr_map_size; + set_stat (source, &st1, 0, 0, 0, SYMTYPE); } } } diff -rup tar-1.15.1-orig/src/list.c tar-1.15.1/src/list.c --- tar-1.15.1-orig/src/list.c 2006-09-20 11:35:15.000000000 -0400 +++ tar-1.15.1/src/list.c 2006-09-25 11:01:16.000000000 -0400 @@ -563,6 +563,13 @@ decode_header (union block *header, stru stat_info->stat.st_atime = start_time; stat_info->stat.st_ctime = start_time; + stat_info->acls_a_ptr = NULL; + stat_info->acls_a_len = 0; + stat_info->acls_d_ptr = NULL; + stat_info->acls_d_len = 0; + stat_info->cntx_name = NULL; + xheader_xattr_init(stat_info); + if (format == OLDGNU_FORMAT && incremental_option) { stat_info->stat.st_atime = TIME_FROM_HEADER (header->oldgnu_header.atime); diff -rup tar-1.15.1-orig/src/Makefile.am tar-1.15.1/src/Makefile.am --- tar-1.15.1-orig/src/Makefile.am 2004-10-25 10:55:49.000000000 -0400 +++ tar-1.15.1/src/Makefile.am 2006-09-25 11:01:16.000000000 -0400 @@ -20,7 +20,7 @@ bin_PROGRAMS = tar -noinst_HEADERS = arith.h common.h tar.h +noinst_HEADERS = arith.h common.h tar.h xattrs.h tar_SOURCES = \ buffer.c\ compare.c\ @@ -37,7 +37,8 @@ tar_SOURCES = \ system.c\ tar.c\ update.c\ - utf8.c + utf8.c\ + xattrs.c INCLUDES = -I$(top_srcdir)/lib -I../ -I../lib @@ -45,4 +46,4 @@ tar.o: ../lib/localedir.h LDADD = ../lib/libtar.a $(LIBINTL) $(LIBICONV) -tar_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) +tar_LDADD = $(LIBS) $(LDADD) $(LIB_CLOCK_GETTIME) diff -rup tar-1.15.1-orig/src/Makefile.in tar-1.15.1/src/Makefile.in --- tar-1.15.1-orig/src/Makefile.in 2004-12-21 08:31:02.000000000 -0500 +++ tar-1.15.1/src/Makefile.in 2006-09-25 11:01:16.000000000 -0400 @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.3 from Makefile.am. +# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004 Free Software Foundation, Inc. +# 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -20,8 +20,6 @@ # Software Foundation, Inc. -SOURCES = $(tar_SOURCES) - srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -113,12 +111,14 @@ am_tar_OBJECTS = buffer.$(OBJEXT) compar delete.$(OBJEXT) extract.$(OBJEXT) xheader.$(OBJEXT) \ incremen.$(OBJEXT) list.$(OBJEXT) mangle.$(OBJEXT) \ misc.$(OBJEXT) names.$(OBJEXT) sparse.$(OBJEXT) \ - system.$(OBJEXT) tar.$(OBJEXT) update.$(OBJEXT) utf8.$(OBJEXT) + system.$(OBJEXT) tar.$(OBJEXT) update.$(OBJEXT) utf8.$(OBJEXT) \ + xattrs.$(OBJEXT) tar_OBJECTS = $(am_tar_OBJECTS) am__DEPENDENCIES_1 = am__DEPENDENCIES_2 = ../lib/libtar.a $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) -tar_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) +tar_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles @@ -246,7 +246,7 @@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -noinst_HEADERS = arith.h common.h tar.h +noinst_HEADERS = arith.h common.h tar.h xattrs.h tar_SOURCES = \ buffer.c\ compare.c\ @@ -263,11 +263,12 @@ tar_SOURCES = \ system.c\ tar.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: @@ -333,7 +334,8 @@ installcheck-binPROGRAMS: $(bin_PROGRAMS f=`echo "$$p" | \ sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ for opt in --help --version; do \ - if "$(DESTDIR)$(bindir)/$$f" $$opt > c$${pid}_.out 2> c$${pid}_.err \ + if "$(DESTDIR)$(bindir)/$$f" $$opt >c$${pid}_.out \ + 2>c$${pid}_.err &2; bad=1; fi; \ @@ -364,6 +366,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tar.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: diff -rup tar-1.15.1-orig/src/misc.c tar-1.15.1/src/misc.c --- tar-1.15.1-orig/src/misc.c 2004-09-13 04:12:05.000000000 -0400 +++ tar-1.15.1/src/misc.c 2006-09-25 11:01:16.000000000 -0400 @@ -545,7 +545,7 @@ decode_mode (mode_t mode, char *string) /* Report an error associated with the system call CALL and the optional name NAME. */ -static void +void call_arg_error (char const *call, char const *name) { int e = errno; @@ -563,7 +563,7 @@ call_arg_fatal (char const *call, char c /* Report a warning associated with the system call CALL and the optional file name NAME. */ -static void +void call_arg_warn (char const *call, char const *name) { int e = errno; diff -rup tar-1.15.1-orig/src/tar.c tar-1.15.1/src/tar.c --- tar-1.15.1-orig/src/tar.c 2006-09-20 11:35:16.000000000 -0400 +++ tar-1.15.1/src/tar.c 2006-09-25 11:01:16.000000000 -0400 @@ -180,7 +180,8 @@ assert_format(unsigned fmt_mask) enum { - ANCHORED_OPTION = CHAR_MAX + 1, + ACLS_OPTION = CHAR_MAX + 1, + ANCHORED_OPTION, ATIME_PRESERVE_OPTION, BACKUP_OPTION, CHECKPOINT_OPTION, @@ -197,14 +198,17 @@ enum LICENSE_OPTION, MODE_OPTION, NEWER_MTIME_OPTION, + NO_ACLS_OPTION, NO_ANCHORED_OPTION, NO_IGNORE_CASE_OPTION, NO_OVERWRITE_DIR_OPTION, NO_RECURSION_OPTION, NO_SAME_OWNER_OPTION, NO_SAME_PERMISSIONS_OPTION, + NO_SELINUX_CONTEXT_OPTION, NO_WILDCARDS_OPTION, NO_WILDCARDS_MATCH_SLASH_OPTION, + NO_XATTR_OPTION, NULL_OPTION, NUMERIC_OWNER_OPTION, OCCURRENCE_OPTION, @@ -222,6 +226,7 @@ enum RMT_COMMAND_OPTION, RSH_COMMAND_OPTION, SAME_OWNER_OPTION, + SELINUX_CONTEXT_OPTION, SHOW_DEFAULTS_OPTION, SHOW_OMITTED_DIRS_OPTION, STRIP_COMPONENTS_OPTION, @@ -233,7 +238,8 @@ enum VERSION_OPTION, VOLNO_FILE_OPTION, WILDCARDS_OPTION, - WILDCARDS_MATCH_SLASH_OPTION + WILDCARDS_MATCH_SLASH_OPTION, + XATTR_OPTION }; const char *argp_program_version = "tar (" PACKAGE_NAME ") " VERSION; @@ -326,6 +332,10 @@ static struct argp_option options[] = { {NULL, 0, NULL, 0, N_("Handling of file attributes:"), 30 }, + {"acls", ACLS_OPTION, 0, 0, + N_("Save the ACLs to the archive"), 31 }, + {"no-acls", NO_ACLS_OPTION, 0, 0, + N_("Don't extract the ACLs from the archive"), 31 }, {"owner", OWNER_OPTION, N_("NAME"), 0, N_("force NAME as owner for added files"), 31 }, {"group", GROUP_OPTION, N_("NAME"), 0, @@ -350,6 +360,14 @@ static struct argp_option options[] = { {"preserve-order", 's', 0, 0, N_("sort names to extract to match archive"), 31 }, {"same-order", 0, 0, OPTION_ALIAS, NULL, 31 }, + {"selinux", SELINUX_CONTEXT_OPTION, 0, 0, + N_("Save the SELinux context to the archive"), 31 }, + {"no-selinux", NO_SELINUX_CONTEXT_OPTION, 0, 0, + N_("Don't extract the SELinux context from the archive"), 31 }, + {"xattrs", XATTR_OPTION, 0, 0, + N_("Save the user/root xattrs to the archive"), 31 }, + {"no-xattrs", NO_XATTR_OPTION, 0, 0, + N_("Don't extract the user/root xattrs from the archive"), 31 }, {"preserve", PRESERVE_OPTION, 0, 0, N_("same as both -p and -s"), 31 }, @@ -1157,6 +1175,37 @@ parse_opt(int key, char *arg, struct arg same_permissions_option = -1; break; + case ACLS_OPTION: + set_archive_format ("posix"); + acls_option = 1; + break; + + case NO_ACLS_OPTION: + acls_option = -1; + break; + + case SELINUX_CONTEXT_OPTION: + set_archive_format ("posix"); + selinux_context_option = 1; + break; + + case NO_SELINUX_CONTEXT_OPTION: + selinux_context_option = -1; + break; + + case XATTR_OPTION: + set_archive_format ("posix"); + if (!acls_option) acls_option = 1; + if (!selinux_context_option) selinux_context_option = 1; + xattrs_option = 1; + break; + + case NO_XATTR_OPTION: + if (!acls_option) acls_option = -1; + if (!selinux_context_option) selinux_context_option = -1; + xattrs_option = -1; + break; + case RECURSION_OPTION: recursion_option = FNM_LEADING_DIR; break; @@ -1545,6 +1594,29 @@ decode_options (int argc, char **argv) || subcommand_option != LIST_SUBCOMMAND)) USAGE_ERROR ((0, 0, _("--pax-option can be used only on POSIX archives"))); + /* star create's non-POSIX typed archives with xattr support, so allow the + extra headers */ + if ((acls_option > 0) + && archive_format != POSIX_FORMAT + && (subcommand_option != EXTRACT_SUBCOMMAND + || subcommand_option != DIFF_SUBCOMMAND + || subcommand_option != LIST_SUBCOMMAND)) + USAGE_ERROR ((0, 0, _("--acls can be used only on POSIX archives"))); + + if ((selinux_context_option > 0) + && archive_format != POSIX_FORMAT + && (subcommand_option != EXTRACT_SUBCOMMAND + || subcommand_option != DIFF_SUBCOMMAND + || subcommand_option != LIST_SUBCOMMAND)) + USAGE_ERROR ((0, 0, _("--selinux can be used only on POSIX archives"))); + + if ((xattrs_option > 0) + && archive_format != POSIX_FORMAT + && (subcommand_option != EXTRACT_SUBCOMMAND + || subcommand_option != DIFF_SUBCOMMAND + || subcommand_option != LIST_SUBCOMMAND)) + USAGE_ERROR ((0, 0, _("--xattrs can be used only on POSIX archives"))); + /* If ready to unlink hierarchies, so we are for simpler files. */ if (recursive_unlink_option) old_files_option = UNLINK_FIRST_OLD_FILES; @@ -1729,11 +1801,15 @@ tar_stat_init (struct tar_stat_info *st) void tar_stat_destroy (struct tar_stat_info *st) { + xheader_xattr_free (st->xattr_map, st->xattr_map_size); free (st->orig_file_name); free (st->file_name); free (st->link_name); free (st->uname); free (st->gname); + free (st->cntx_name); + free (st->acls_a_ptr); + free (st->acls_d_ptr); free (st->sparse_map); memset (st, 0, sizeof (*st)); } diff -rup tar-1.15.1-orig/src/tar.h tar-1.15.1/src/tar.h --- tar-1.15.1-orig/src/tar.h 2004-04-04 05:53:30.000000000 -0400 +++ tar-1.15.1/src/tar.h 2006-09-25 11:02:33.000000000 -0400 @@ -265,6 +265,14 @@ struct sp_array size_t numbytes; }; +/* Information about xattrs for a file. */ +struct xattr_array + { + char *xkey; + char *xval_ptr; + size_t xval_len; + }; + struct tar_stat_info { char *orig_file_name; /* name of file read from the archive header */ @@ -278,6 +286,15 @@ struct tar_stat_info unsigned int devmajor; /* device major number */ char *uname; /* user name of owner */ char *gname; /* group name of owner */ + + char *cntx_name; /* SELinux context for the current archive entry. */ + + 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. */ + struct stat stat; /* regular filesystem stat */ /* Nanosecond parts of file timestamps (if available) */ @@ -294,7 +311,10 @@ struct tar_stat_info sparse_map array. Zero if the file is not sparse */ size_t sparse_map_size; /* Size of the sparse map */ - struct sp_array *sparse_map; + struct sp_array *sparse_map; + + size_t xattr_map_size; /* Size of the xattr map */ + struct xattr_array *xattr_map; }; union block diff -rup tar-1.15.1-orig/src/xheader.c tar-1.15.1/src/xheader.c --- tar-1.15.1-orig/src/xheader.c 2006-09-20 11:35:16.000000000 -0400 +++ tar-1.15.1/src/xheader.c 2006-09-25 11:01:16.000000000 -0400 @@ -414,6 +414,74 @@ xheader_write_global (void) global_header_count++; } +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); + (*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; + } +} + /* General Interface */ @@ -421,9 +489,10 @@ struct xhdr_tab { char const *keyword; void (*coder) (struct tar_stat_info const *, char const *, - struct xheader *, void *data); - void (*decoder) (struct tar_stat_info *, char const *); + 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 @@ -440,8 +509,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; } @@ -451,7 +529,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; } @@ -462,7 +540,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; } @@ -522,7 +600,7 @@ run_override_list (struct keyword_list * { struct xhdr_tab const *t = locate_handler (kp->pattern); if (t) - t->decoder (st, kp->value); + t->decoder (st, t->keyword, kp->value, strlen (kp->value)); } } @@ -538,7 +616,10 @@ decx (void *data, char const *keyword, c t = locate_handler (keyword); if (t) - t->decoder (st, value); + t->decoder (st, keyword, value, strlen (value)); + else + ERROR((0, 0, _("Ignoring unknown extended header keyword `%s'"), + keyword)); } void @@ -665,9 +746,10 @@ format_uintmax (uintmax_t val, char *buf } static void -xheader_print (struct xheader *xhdr, char const *keyword, char const *value) +xheader_print_n (struct xheader *xhdr, char const *keyword, char const *value, + size_t val_len) { - size_t len = strlen (keyword) + strlen (value) + 3; /* ' ' + '=' + '\n' */ + size_t len = strlen (keyword) + val_len + 3; /* ' ' + '=' + '\n' */ size_t p, n = 0; char nbuf[100]; @@ -683,10 +765,16 @@ xheader_print (struct xheader *xhdr, cha obstack_1grow (xhdr->stk, ' '); obstack_grow (xhdr->stk, keyword, strlen (keyword)); obstack_1grow (xhdr->stk, '='); - obstack_grow (xhdr->stk, value, strlen (value)); + obstack_grow (xhdr->stk, value, val_len); obstack_1grow (xhdr->stk, '\n'); } +static void +xheader_print (struct xheader *xhdr, char const *keyword, char const *value) +{ + xheader_print_n (xhdr, keyword, value, strlen (value)); +} + void xheader_finish (struct xheader *xhdr) { @@ -813,38 +901,44 @@ static void dummy_coder (struct tar_stat_info const *st __attribute__ ((unused)), char const *keyword __attribute__ ((unused)), struct xheader *xhdr __attribute__ ((unused)), - void *data __attribute__ ((unused))) + const void *data __attribute__ ((unused))) { } static void dummy_decoder (struct tar_stat_info *st __attribute__ ((unused)), - char const *arg __attribute__ ((unused))) + char const *keyword __attribute__ ((unused)), + char const *arg __attribute__ ((unused)), + size_t size __attribute__((unused))) { } static void atime_coder (struct tar_stat_info const *st, char const *keyword, - struct xheader *xhdr, void *data __attribute__ ((unused))) + struct xheader *xhdr, const void *data __attribute__ ((unused))) { code_time (st->stat.st_atime, st->atime_nsec, keyword, xhdr); } static void -atime_decoder (struct tar_stat_info *st, char const *arg) +atime_decoder (struct tar_stat_info *st, + char const *keyword __attribute__ ((unused)), char const *arg, + size_t size __attribute__((unused))) { decode_time (arg, &st->stat.st_atime, &st->atime_nsec); } static void gid_coder (struct tar_stat_info const *st, char const *keyword, - struct xheader *xhdr, void *data __attribute__ ((unused))) + struct xheader *xhdr, const void *data __attribute__ ((unused))) { code_num (st->stat.st_gid, keyword, xhdr); } static void -gid_decoder (struct tar_stat_info *st, char const *arg) +gid_decoder (struct tar_stat_info *st, + char const *keyword __attribute__ ((unused)), char const *arg, + size_t size __attribute__((unused))) { uintmax_t u; if (decode_num (&u, arg, TYPE_MAXIMUM (gid_t), "gid")) @@ -853,65 +947,75 @@ gid_decoder (struct tar_stat_info *st, c static void gname_coder (struct tar_stat_info const *st, char const *keyword, - struct xheader *xhdr, void *data __attribute__ ((unused))) + struct xheader *xhdr, const void *data __attribute__ ((unused))) { code_string (st->gname, keyword, xhdr); } static void -gname_decoder (struct tar_stat_info *st, char const *arg) +gname_decoder (struct tar_stat_info *st, + char const *keyword __attribute__ ((unused)), char const *arg, + size_t size __attribute__ ((unused))) { decode_string (&st->gname, arg); } static void linkpath_coder (struct tar_stat_info const *st, char const *keyword, - struct xheader *xhdr, void *data __attribute__ ((unused))) + struct xheader *xhdr, const void *data __attribute__ ((unused))) { code_string (st->link_name, keyword, xhdr); } static void -linkpath_decoder (struct tar_stat_info *st, char const *arg) +linkpath_decoder (struct tar_stat_info *st, + char const *keyword __attribute__ ((unused)), char const *arg, + size_t size __attribute__ ((unused))) { decode_string (&st->link_name, arg); } static void ctime_coder (struct tar_stat_info const *st, char const *keyword, - struct xheader *xhdr, void *data __attribute__ ((unused))) + struct xheader *xhdr, const void *data __attribute__ ((unused))) { code_time (st->stat.st_ctime, st->ctime_nsec, keyword, xhdr); } static void -ctime_decoder (struct tar_stat_info *st, char const *arg) +ctime_decoder (struct tar_stat_info *st, + char const *keyword __attribute__ ((unused)), char const *arg, + size_t size __attribute__ ((unused))) { decode_time (arg, &st->stat.st_ctime, &st->ctime_nsec); } static void mtime_coder (struct tar_stat_info const *st, char const *keyword, - struct xheader *xhdr, void *data __attribute__ ((unused))) + struct xheader *xhdr, const void *data __attribute__ ((unused))) { code_time (st->stat.st_mtime, st->mtime_nsec, keyword, xhdr); } static void -mtime_decoder (struct tar_stat_info *st, char const *arg) +mtime_decoder (struct tar_stat_info *st, + char const *keyword __attribute__ ((unused)), char const *arg, + size_t size __attribute__ ((unused))) { decode_time (arg, &st->stat.st_mtime, &st->mtime_nsec); } static void path_coder (struct tar_stat_info const *st, char const *keyword, - struct xheader *xhdr, void *data __attribute__ ((unused))) + struct xheader *xhdr, const void *data __attribute__ ((unused))) { code_string (st->file_name, keyword, xhdr); } static void -path_decoder (struct tar_stat_info *st, char const *arg) +path_decoder (struct tar_stat_info *st, + char const *keyword __attribute__ ((unused)), char const *arg, + size_t size __attribute__ ((unused))) { decode_string (&st->orig_file_name, arg); decode_string (&st->file_name, arg); @@ -920,13 +1024,15 @@ path_decoder (struct tar_stat_info *st, static void size_coder (struct tar_stat_info const *st, char const *keyword, - struct xheader *xhdr, void *data __attribute__ ((unused))) + struct xheader *xhdr, const void *data __attribute__ ((unused))) { code_num (st->stat.st_size, keyword, xhdr); } static void -size_decoder (struct tar_stat_info *st, char const *arg) +size_decoder (struct tar_stat_info *st, + char const *keyword __attribute__ ((unused)), char const *arg, + size_t size __attribute__ ((unused))) { uintmax_t u; if (decode_num (&u, arg, TYPE_MAXIMUM (off_t), "size")) @@ -935,13 +1041,15 @@ size_decoder (struct tar_stat_info *st, static void uid_coder (struct tar_stat_info const *st, char const *keyword, - struct xheader *xhdr, void *data __attribute__ ((unused))) + struct xheader *xhdr, const void *data __attribute__ ((unused))) { code_num (st->stat.st_uid, keyword, xhdr); } static void -uid_decoder (struct tar_stat_info *st, char const *arg) +uid_decoder (struct tar_stat_info *st, + char const *keyword __attribute__ ((unused)), char const *arg, + size_t size __attribute__ ((unused))) { uintmax_t u; if (decode_num (&u, arg, TYPE_MAXIMUM (uid_t), "uid")) @@ -950,26 +1058,31 @@ uid_decoder (struct tar_stat_info *st, c static void uname_coder (struct tar_stat_info const *st, char const *keyword, - struct xheader *xhdr, void *data __attribute__ ((unused))) + struct xheader *xhdr, const void *data __attribute__ ((unused))) { code_string (st->uname, keyword, xhdr); } static void -uname_decoder (struct tar_stat_info *st, char const *arg) +uname_decoder (struct tar_stat_info *st, + char const *keyword __attribute__ ((unused)), char const *arg, + size_t size __attribute__ ((unused))) { decode_string (&st->uname, arg); } static void sparse_size_coder (struct tar_stat_info const *st, char const *keyword, - struct xheader *xhdr, void *data) + struct xheader *xhdr, const void *data) { size_coder (st, keyword, xhdr, data); } static void -sparse_size_decoder (struct tar_stat_info *st, char const *arg) +sparse_size_decoder (struct tar_stat_info *st, + char const *keyword __attribute__ ((unused)), + char const *arg, + size_t size __attribute__ ((unused))) { uintmax_t u; if (decode_num (&u, arg, TYPE_MAXIMUM (off_t), "GNU.sparse.size")) @@ -979,13 +1092,16 @@ sparse_size_decoder (struct tar_stat_inf static void sparse_numblocks_coder (struct tar_stat_info const *st, char const *keyword, struct xheader *xhdr, - void *data __attribute__ ((unused))) + const void *data __attribute__ ((unused))) { code_num (st->sparse_map_avail, keyword, xhdr); } static void -sparse_numblocks_decoder (struct tar_stat_info *st, char const *arg) +sparse_numblocks_decoder (struct tar_stat_info *st, + char const *keyword __attribute__ ((unused)), + char const *arg, + size_t size __attribute__ ((unused))) { uintmax_t u; if (decode_num (&u, arg, SIZE_MAX, "GNU.sparse.numblocks")) @@ -998,14 +1114,17 @@ sparse_numblocks_decoder (struct tar_sta static void sparse_offset_coder (struct tar_stat_info const *st, char const *keyword, - struct xheader *xhdr, void *data) + struct xheader *xhdr, const void *data) { size_t i = *(size_t*)data; code_num (st->sparse_map[i].offset, keyword, xhdr); } static void -sparse_offset_decoder (struct tar_stat_info *st, char const *arg) +sparse_offset_decoder (struct tar_stat_info *st, + char const *keyword __attribute__ ((unused)), + char const *arg, + size_t size __attribute__ ((unused))) { uintmax_t u; if (decode_num (&u, arg, TYPE_MAXIMUM (off_t), "GNU.sparse.offset")) @@ -1020,14 +1139,17 @@ sparse_offset_decoder (struct tar_stat_i static void sparse_numbytes_coder (struct tar_stat_info const *st, char const *keyword, - struct xheader *xhdr, void *data) + struct xheader *xhdr, const void *data) { size_t i = *(size_t*)data; code_num (st->sparse_map[i].numbytes, keyword, xhdr); } static void -sparse_numbytes_decoder (struct tar_stat_info *st, char const *arg) +sparse_numbytes_decoder (struct tar_stat_info *st, + char const *keyword __attribute__ ((unused)), + char const *arg, + size_t size __attribute__ ((unused))) { uintmax_t u; if (decode_num (&u, arg, SIZE_MAX, "GNU.sparse.numbytes")) @@ -1041,28 +1163,94 @@ sparse_numbytes_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); + 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); + 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); +} + + 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.size", sparse_size_coder, sparse_size_decoder, true }, + { "GNU.sparse.size", sparse_size_coder, sparse_size_decoder, true, false }, { "GNU.sparse.numblocks", sparse_numblocks_coder, sparse_numblocks_decoder, - true }, + true, false }, { "GNU.sparse.offset", sparse_offset_coder, sparse_offset_decoder, - true }, + true, false }, { "GNU.sparse.numbytes", sparse_numbytes_coder, sparse_numbytes_decoder, - true }, + true, false }, #if 0 /* GNU private keywords (not yet implemented) */ @@ -1086,5 +1274,21 @@ struct xhdr_tab const xhdr_tab[] = { { "GNU.volume.offset", volume_offset_coder, volume_offset_decoder, false }, #endif + /* SELinux, use the star format... */ + { "SCHILY.xattr.security.selinux", + xattr_selinux_coder, xattr_selinux_decoder, false, false }, + + /* ACLs, use the star format... */ + { "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/root varients... */ + { "SCHILY.xattr.user", xattr_coder, xattr_decoder, false, true }, + { "SCHILY.xattr.root", xattr_coder, xattr_decoder, false, true }, + { "SCHILY.xattr", dummy_coder, dummy_decoder, false, true }, + { NULL, NULL, NULL, false } }; diff -rup tar-1.15.1-orig/tests/Makefile.in tar-1.15.1/tests/Makefile.in --- tar-1.15.1-orig/tests/Makefile.in 2004-12-21 08:31:03.000000000 -0500 +++ tar-1.15.1/tests/Makefile.in 2006-09-25 11:01:16.000000000 -0400 @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.3 from Makefile.am. +# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004 Free Software Foundation, Inc. +# 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -21,8 +21,6 @@ # François Pinard , 1988. # Sergey Poznyakoff , 2004. -SOURCES = $(genfile_SOURCES) - srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ --- tar-1.15.1-orig/src/xattrs.c 1969-12-31 19:00:00.000000000 -0500 +++ tar-1.15.1/src/xattrs.c 2006-09-25 11:01:31.000000000 -0400 @@ -0,0 +1,402 @@ +/* Create a tar archive. + + Copyright (C) 2006 Free Software Foundation, Inc. + + Written by James Antill, on 2006-07-27. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any later + version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General + Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +#include + +#include + +#include "common.h" + + +#ifndef HAVE_SELINUX_SELINUX_H +# undef HAVE_LIBSELINUX +#endif + +#ifndef HAVE_ATTR_XATTR_H +# undef HAVE_XATTRS +#endif + +#ifndef HAVE_SYS_ACL_H +# undef HAVE_LIBACL +#endif + +#ifdef HAVE_SELINUX_SELINUX_H +# include +#endif + +#ifdef HAVE_ATTR_XATTR_H +# include +#endif + +#ifdef HAVE_SYS_ACL_H +# include +#endif + + +#if 0 /* unused by xattr's atm. */ +static void xattrs__fd_get(struct tar_stat_info *st, + char const *file_name, int fd, const char *attr, + char **ret_ptr, size_t *ret_len) +{ +#ifdef HAVE_XATTRS + 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); + *ret_len = ret; + } + else if (errno != ENOATTR) + call_arg_warn ("fgetxattr", file_name); +#endif +} +#endif + +static void xattrs__acls_get_a(struct tar_stat_info *st, + char const *file_name, int fd, + char **ret_ptr, size_t *ret_len) +{ /* "system.posix_acl_access" */ +#ifdef HAVE_LIBACL + char *val = NULL; + acl_t acl; + + if (fd != -1) + { + if ((acl = acl_get_fd (fd)) == (acl_t)NULL) + { + if (errno != ENOTSUP) + call_arg_warn ("acl_get_fd", file_name); + return; + } + } + else if ((acl = acl_get_file (file_name, ACL_TYPE_ACCESS)) == (acl_t)NULL) + { + if (errno != ENOTSUP) + call_arg_warn ("acl_get_file", file_name); + return; + } + + + val = acl_to_text(acl, NULL); + acl_free (acl); + + if (val == NULL) + { + call_arg_warn ("acl_to_text", file_name); + return; + } + + *ret_ptr = xstrdup (val); + *ret_len = strlen (val); + + acl_free (val); +#endif +} + +static void xattrs__acls_get_d(struct tar_stat_info *st, + char const *file_name, + char **ret_ptr, size_t *ret_len) +{ /* "system.posix_acl_default" */ +#ifdef HAVE_LIBACL + char *val = NULL; + 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, NULL); + acl_free (acl); + + if (val == NULL) + { + call_arg_warn ("acl_to_text", file_name); + return; + } + + *ret_ptr = xstrdup (val); + *ret_len = strlen (val); + + acl_free (val); +#endif +} + +void xattrs_acls_get(struct tar_stat_info *st, char const *file_name, int fd) +{ + if (acls_option > 0) + { + xattrs__acls_get_a (st, file_name, fd, + &st->acls_a_ptr, &st->acls_a_len); + if (fd == -1) /* Hack: default is on directories only */ + xattrs__acls_get_d (st, file_name, + &st->acls_d_ptr, &st->acls_d_len); + } +} + +void xattrs_selinux_get(struct tar_stat_info *st, char const *file_name, int fd) +{ +#ifdef HAVE_LIBSELINUX + if (selinux_context_option > 0) + if (fd == -1) + { + if (getfilecon (file_name, &st->cntx_name) == -1) + call_arg_warn ("fgetfilecon", file_name); + } + else if (fgetfilecon (fd, &st->cntx_name) == -1) + call_arg_warn ("fgetfilecon", file_name); +#endif +} + +void xattrs_xattrs_get(struct tar_stat_info *st, char const *file_name, int fd) +{ +#ifdef HAVE_XATTRS + if (xattrs_option > 0) + { /* get all xattrs ... this include security.* and system.* if + available. We filter them here, but we have to filter them + in xattrs_xattrs_set() anyway. + */ + static ssize_t xsz = 1024; + static char *xatrs = NULL; + ssize_t xret = -1; + + if (!xatrs) xatrs = xmalloc (xsz); + + while (((fd == -1) ? + ((xret = listxattr (file_name, xatrs, xsz)) == -1) : + ((xret = flistxattr (fd, xatrs, xsz)) == -1)) && + (errno == ERANGE)) + { + xsz <<= 1; + xatrs = xrealloc (xatrs, xsz); + } + + if (xret == -1) + call_arg_warn ((fd == -1) ? "listxattrs" : "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, "root.", strlen("root."))) + goto next_attr; /* only store normal xattrs */ + + while (((fd == -1) ? + ((xret = getxattr (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: + attr += len + 1; + xret -= len + 1; + } + } + } +#endif +} + +static void xattrs__fd_set(struct tar_stat_info const *st, + char const *file_name, char typeflag, + const char *attr, + const char *ptr, size_t len) +{ +#ifdef HAVE_XATTRS + if (ptr) + { + const char *sysname = "setxattr"; + int ret = -1; + + if (typeflag != SYMTYPE) + ret = setxattr (file_name, attr, ptr, len, 0); + else + { + sysname = "lsetxattr"; + ret = lsetxattr (file_name, attr, ptr, len, 0); + } + + if ((ret == -1) && (errno == EPERM)) + call_arg_warn(sysname, file_name); + else if ((ret == -1) && (errno != EOPNOTSUPP)) + call_arg_error(sysname, file_name); + } +#endif +} + +/* convert unix permissions into an ACL ... needed due to "default" ACLs */ +#ifdef HAVE_LIBACL +static acl_t perms2acl(int perms) +{ + char val[] = "user::---,group::---,other::---"; + /* 0123456789 123456789 123456789 123456789 */ + + /* user */ + if (perms & 0400) val[ 6] = 'r'; + if (perms & 0200) val[ 7] = 'w'; + if (perms & 0100) val[ 8] = 'x'; + + /* group */ + if (perms & 0040) val[17] = 'r'; + if (perms & 0020) val[18] = 'w'; + if (perms & 0010) val[19] = 'x'; + + /* other */ + if (perms & 0004) val[28] = 'r'; + if (perms & 0002) val[29] = 'w'; + if (perms & 0001) val[30] = 'x'; + + return (acl_from_text (val)); +} +#endif + +static void xattrs__acls_set(struct tar_stat_info const *st, + char const *file_name, int type, + const char *ptr, size_t len) +{ /* "system.posix_acl_access" */ +#ifdef HAVE_LIBACL + acl_t acl; + + if (ptr) + { + /* assert (strlen (ptr) == len); */ + acl = acl_from_text (ptr); + acls_option = 1; + } + else if (acls_option > 0) + acl = perms2acl (st->stat.st_mode); + 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) + call_arg_warn ("acl_set_file", file_name); + } + acl_free (acl); +#endif +} + +void xattrs_acls_set(struct tar_stat_info const *st, + char const *file_name, char typeflag) +{ + if ((acls_option >= 0) && (typeflag != SYMTYPE)) + { +#ifdef HAVE_LIBACL + xattrs__acls_set (st, file_name, ACL_TYPE_ACCESS, + st->acls_a_ptr, st->acls_a_len); + if (S_ISDIR (st->stat.st_mode)) + xattrs__acls_set (st, file_name, ACL_TYPE_DEFAULT, + st->acls_d_ptr, st->acls_d_len); +#endif + } +} + +void xattrs_selinux_set(struct tar_stat_info const *st, + char const *file_name, char typeflag) +{ +#ifdef HAVE_LIBSELINUX + if ((selinux_context_option >= 0) && st->cntx_name) + { + const char *sysname = "setfilecon"; + int ret = -1; + + if (typeflag != SYMTYPE) + ret = setfilecon (file_name, st->cntx_name); + else + { + sysname = "lsetfilecon"; + ret = lsetfilecon (file_name, st->cntx_name); + } + + if ((ret == -1) && (errno == EPERM)) + call_arg_warn(sysname, file_name); + else if ((ret == -1) && (errno != EOPNOTSUPP)) + call_arg_error(sysname, file_name); + } +#endif +} + +void xattrs_xattrs_set(struct tar_stat_info const *st, + char const *file_name, char typeflag) +{ +#ifdef HAVE_XATTRS + if ((xattrs_option >= 0) && st->xattr_map_size) + { + size_t scan = 0; + + while (scan < st->xattr_map_size) + { + char *keyword = st->xattr_map[scan].xkey; + + /* assert (!memcpy (keyword, "SCHILY.xattr.", strlen("SCHILY.xattr."))); */ + keyword += strlen("SCHILY.xattr."); + + if (strncmp (keyword, "user.", strlen("user.")) && + strncmp (keyword, "root.", strlen("root."))) + continue; /* don't try and set anything but normal xattrs */ + + /* should we ignore root.* 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 +} + --- tar-1.15.1-orig/src/xattrs.h 1969-12-31 19:00:00.000000000 -0500 +++ tar-1.15.1/src/xattrs.h 2006-09-25 11:01:16.000000000 -0400 @@ -0,0 +1,14 @@ + +extern void xattrs_acls_get(struct tar_stat_info *st, + char const *file_name, int fd); +extern void xattrs_selinux_get(struct tar_stat_info *st, + char const *file_name, int fd); +extern void xattrs_xattrs_get(struct tar_stat_info *st, + char const *file_name, int fd); + +extern void xattrs_acls_set(struct tar_stat_info const *st, + char const *file_name, char typeflag); +extern void xattrs_selinux_set(struct tar_stat_info const *st, + char const *file_name, char typeflag); +extern void xattrs_xattrs_set(struct tar_stat_info const *st, + char const *file_name, char typeflag);