diff options
author | joerg <joerg@pkgsrc.org> | 2007-08-13 18:17:26 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2007-08-13 18:17:26 +0000 |
commit | e8b53a39603c3a3f69f17f1e63814f58f2cb6509 (patch) | |
tree | e9726a3e08b4af6b2e65f32ac4a050ace512a3ce /archivers | |
parent | e44754831d93cb491c0c84d470258e2463639fb6 (diff) | |
download | pkgsrc-e8b53a39603c3a3f69f17f1e63814f58f2cb6509.tar.gz |
Update in-tree libarchive to 2.2.6. This merges the local changes
and some bugfixes from FreeBSD.
Diffstat (limited to 'archivers')
27 files changed, 1105 insertions, 636 deletions
diff --git a/archivers/libarchive/files/Makefile.am b/archivers/libarchive/files/Makefile.am index 5f76b5bd841..68ef238eab7 100644 --- a/archivers/libarchive/files/Makefile.am +++ b/archivers/libarchive/files/Makefile.am @@ -28,10 +28,9 @@ distclean-local: -rm -rf autom4te.cache/ -rm -f *~ +# Always build libarchive, regardless lib_LTLIBRARIES= libarchive.la -if BUILD_BSDTAR -bin_PROGRAMS= bsdtar -endif +bin_PROGRAMS= $(bsdtar_programs) check_PROGRAMS= libarchive_test dist_man_MANS=$(libarchive_dist_man_MANS) $(bsdtar_dist_man_MANS) TESTS= libarchive_test @@ -206,13 +205,21 @@ bsdtar_DEPENDENCIES = libarchive.la \ libarchive/archive_entry.h \ libarchive/archive.h +if STATIC_BSDTAR +bsdtar_static=-static +else +bsdtar_static= +endif + bsdtar_LDADD= libarchive.la bsdtar_CPPFLAGS=-I$(top_builddir)/libarchive -# Link libarchive statically... -bsdtar_dist_man_MANS= tar/bsdtar.1 +bsdtar_LDFLAGS= $(bsdtar_static) -I$(destdir)/libarchive -if STATIC_BSDTAR -bsdtar_LDFLAGS= -static -I$(destdir)/libarchive +if BUILD_BSDTAR +bsdtar_dist_man_MANS= tar/bsdtar.1 +bsdtar_programs=bsdtar else -bsdtar_LDFLAGS= -I$(destdir)/libarchive +bsdtar_dist_man_MANS= +bsdtar_programs= endif + diff --git a/archivers/libarchive/files/Makefile.in b/archivers/libarchive/files/Makefile.in index fd98403d36c..0e39ba42441 100644 --- a/archivers/libarchive/files/Makefile.in +++ b/archivers/libarchive/files/Makefile.in @@ -34,7 +34,7 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -@BUILD_BSDTAR_TRUE@bin_PROGRAMS = bsdtar$(EXEEXT) +bin_PROGRAMS = $(am__EXEEXT_1) check_PROGRAMS = libarchive_test$(EXEEXT) TESTS = libarchive_test$(EXEEXT) subdir = . @@ -122,6 +122,7 @@ libarchive_la_OBJECTS = $(am_libarchive_la_OBJECTS) libarchive_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libarchive_la_LDFLAGS) $(LDFLAGS) -o $@ +@BUILD_BSDTAR_TRUE@am__EXEEXT_1 = bsdtar$(EXEEXT) binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_bsdtar_OBJECTS = tar/bsdtar-bsdtar.$(OBJEXT) \ @@ -396,6 +397,8 @@ EXTRA_DIST = version \ tar/getdate.c \ cpio + +# Always build libarchive, regardless lib_LTLIBRARIES = libarchive.la dist_man_MANS = $(libarchive_dist_man_MANS) $(bsdtar_dist_man_MANS) @@ -561,12 +564,15 @@ bsdtar_DEPENDENCIES = libarchive.la \ libarchive/archive_entry.h \ libarchive/archive.h +@STATIC_BSDTAR_FALSE@bsdtar_static = +@STATIC_BSDTAR_TRUE@bsdtar_static = -static bsdtar_LDADD = libarchive.la bsdtar_CPPFLAGS = -I$(top_builddir)/libarchive -# Link libarchive statically... -bsdtar_dist_man_MANS = tar/bsdtar.1 -@STATIC_BSDTAR_FALSE@bsdtar_LDFLAGS = -I$(destdir)/libarchive -@STATIC_BSDTAR_TRUE@bsdtar_LDFLAGS = -static -I$(destdir)/libarchive +bsdtar_LDFLAGS = $(bsdtar_static) -I$(destdir)/libarchive +@BUILD_BSDTAR_FALSE@bsdtar_dist_man_MANS = +@BUILD_BSDTAR_TRUE@bsdtar_dist_man_MANS = tar/bsdtar.1 +@BUILD_BSDTAR_FALSE@bsdtar_programs = +@BUILD_BSDTAR_TRUE@bsdtar_programs = bsdtar all: $(BUILT_SOURCES) config.h $(MAKE) $(AM_MAKEFLAGS) all-am diff --git a/archivers/libarchive/files/NEWS b/archivers/libarchive/files/NEWS index 941a62a4e3a..758d9e55e33 100644 --- a/archivers/libarchive/files/NEWS +++ b/archivers/libarchive/files/NEWS @@ -1,4 +1,10 @@ +Aug 05, 2007: libarchive 2.2.6 released + +Aug 05, 2007: New configure option --disable-bsdtar, thanks to Joerg + Sonnenberger. +Aug 05, 2007: Several bug fixes from FreeBSD CVS repo. + Jul 13, 2007: libarchive 2.2.5 released Jul 12, 2007: libarchive 2.2.4 released diff --git a/archivers/libarchive/files/config.h.in b/archivers/libarchive/files/config.h.in index e6b463d1551..4e8a0d6c2ed 100644 --- a/archivers/libarchive/files/config.h.in +++ b/archivers/libarchive/files/config.h.in @@ -44,6 +44,14 @@ don't. */ #undef HAVE_DECL_INT64_MIN +/* Define to 1 if you have the declaration of `optarg', and to 0 if you don't. + */ +#undef HAVE_DECL_OPTARG + +/* Define to 1 if you have the declaration of `optind', and to 0 if you don't. + */ +#undef HAVE_DECL_OPTIND + /* Define to 1 if you have the declaration of `SIZE_MAX', and to 0 if you don't. */ #undef HAVE_DECL_SIZE_MAX @@ -127,6 +135,9 @@ /* Define to 1 if you have the <grp.h> header file. */ #undef HAVE_GRP_H +/* Define to 1 if the system has the type `intmax_t'. */ +#undef HAVE_INTMAX_T + /* Define to 1 if you have the <inttypes.h> header file. */ #undef HAVE_INTTYPES_H @@ -175,6 +186,9 @@ /* Define to 1 if you have the <locale.h> header file. */ #undef HAVE_LOCALE_H +/* Define to 1 if the system has the type `long long int'. */ +#undef HAVE_LONG_LONG_INT + /* Define to 1 if you have the `lsetxattr' function. */ #undef HAVE_LSETXATTR @@ -218,9 +232,6 @@ /* Define to 1 if you have the <pwd.h> header file. */ #undef HAVE_PWD_H -/* Define to 1 if you have the `reallocf' function. */ -#undef HAVE_REALLOCF - /* Define to 1 if you have the `select' function. */ #undef HAVE_SELECT @@ -323,6 +334,9 @@ /* Define to 1 if the system has the type `unsigned long long'. */ #undef HAVE_UNSIGNED_LONG_LONG +/* Define to 1 if the system has the type `unsigned long long int'. */ +#undef HAVE_UNSIGNED_LONG_LONG_INT + /* Define to 1 if you have the `utime' function. */ #undef HAVE_UTIME @@ -407,6 +421,11 @@ /* Define for large files, on AIX-style hosts. */ #undef _LARGE_FILES +/* Define for Solaris 2.5.1 so the uint64_t typedef from <sys/synch.h>, + <pthread.h>, or <semaphore.h> is not used. If the typedef was allowed, the + #define below would cause a syntax error. */ +#undef _UINT64_T + /* Define to empty if `const' does not conform to ANSI C. */ #undef const @@ -416,16 +435,18 @@ /* Define to `unsigned long' if <sys/types.h> does not define. */ #undef id_t -/* Define int64_t to a valid signed 64-bit type, if necessary. */ +/* Define to the type of a signed integer type of width exactly 64 bits if + such a type exists and the standard includes do not define it. */ #undef int64_t -/* Define to `int64_t' if <sys/types.h> does not define. */ +/* Define to the widest signed integer type if <stdint.h> and <inttypes.h> do + not define. */ #undef intmax_t /* Define to `int' if <sys/types.h> does not define. */ #undef mode_t -/* Define to `int64_t' if <sys/types.h> does not define. */ +/* Define to `long long' if <sys/types.h> does not define. */ #undef off_t /* Define to `unsigned int' if <sys/types.h> does not define. */ @@ -434,10 +455,12 @@ /* Define to `int' if <sys/types.h> doesn't define. */ #undef uid_t -/* Define uint64_t to an unsigned 64-bit type, if necessary. */ +/* Define to the type of an unsigned integer type of width exactly 64 bits if + such a type exists and the standard includes do not define it. */ #undef uint64_t -/* Define to `uint64_t' if <sys/types.h> does not define. */ +/* Define to the widest unsigned integer type if <stdint.h> and <inttypes.h> + do not define. */ #undef uintmax_t /* Define to `unsigned int' if <sys/types.h> does not define. */ diff --git a/archivers/libarchive/files/configure b/archivers/libarchive/files/configure index cd9ee413261..eea14a20a85 100755 --- a/archivers/libarchive/files/configure +++ b/archivers/libarchive/files/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for libarchive 2.2.5. +# Generated by GNU Autoconf 2.61 for libarchive 2.2.6. # # Report bugs to <kientzle@freebsd.org>. # @@ -728,8 +728,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='libarchive' PACKAGE_TARNAME='libarchive' -PACKAGE_VERSION='2.2.5' -PACKAGE_STRING='libarchive 2.2.5' +PACKAGE_VERSION='2.2.6' +PACKAGE_STRING='libarchive 2.2.6' PACKAGE_BUGREPORT='kientzle@freebsd.org' ac_unique_file="libarchive" @@ -1407,7 +1407,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures libarchive 2.2.5 to adapt to many kinds of systems. +\`configure' configures libarchive 2.2.6 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1477,7 +1477,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libarchive 2.2.5:";; + short | recursive ) echo "Configuration of libarchive 2.2.6:";; esac cat <<\_ACEOF @@ -1491,6 +1491,9 @@ Optional Features: --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) + --enable-bsdtar enable build of bsdtar (default) + --enable-bsdtar=static force static build of bsdtar + --enable-bsdtar=shared force dynamic build of bsdtar --disable-bsdtar disable build of bsdtar --disable-largefile omit support for large files @@ -1586,7 +1589,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libarchive configure 2.2.5 +libarchive configure 2.2.6 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1600,7 +1603,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libarchive $as_me 2.2.5, which was +It was created by libarchive $as_me 2.2.6, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -2294,7 +2297,7 @@ fi # Define the identity of the package. PACKAGE='libarchive' - VERSION='2.2.5' + VERSION='2.2.6' cat >>confdefs.h <<_ACEOF @@ -4517,7 +4520,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 4520 "configure"' > conftest.$ac_ext + echo '#line 4523 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -7248,11 +7251,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7251: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7254: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7255: \$? = $ac_status" >&5 + echo "$as_me:7258: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7516,11 +7519,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7519: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7522: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7523: \$? = $ac_status" >&5 + echo "$as_me:7526: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7620,11 +7623,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7623: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7626: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7627: \$? = $ac_status" >&5 + echo "$as_me:7630: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -9928,7 +9931,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 9931 "configure" +#line 9934 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -10028,7 +10031,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 10031 "configure" +#line 10034 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12364,11 +12367,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12367: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12370: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:12371: \$? = $ac_status" >&5 + echo "$as_me:12374: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -12468,11 +12471,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12471: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12474: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:12475: \$? = $ac_status" >&5 + echo "$as_me:12478: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -14038,11 +14041,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14041: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14044: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14045: \$? = $ac_status" >&5 + echo "$as_me:14048: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -14142,11 +14145,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14145: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14148: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:14149: \$? = $ac_status" >&5 + echo "$as_me:14152: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -16340,11 +16343,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16343: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16346: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:16347: \$? = $ac_status" >&5 + echo "$as_me:16350: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -16608,11 +16611,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16611: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16614: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:16615: \$? = $ac_status" >&5 + echo "$as_me:16618: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -16712,11 +16715,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16715: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16718: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:16719: \$? = $ac_status" >&5 + echo "$as_me:16722: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -19471,9 +19474,12 @@ else fi +# Default is to build bsdtar, but allow people to override that. # Check whether --enable-bsdtar was given. if test "${enable_bsdtar+set}" = set; then enableval=$enable_bsdtar; +else + enable_bsdtar=yes fi @@ -19487,7 +19493,7 @@ yes) build_bsdtar=yes ;; -shared) +dynamic|shared) if test "$enable_shared" = "no"; then { { echo "$as_me:$LINENO: error: Shared linking of bsdtar requires shared libarchive See \`config.log' for more details." >&5 @@ -19498,6 +19504,10 @@ See \`config.log' for more details." >&2;} build_bsdtar=yes static_bsdtar=no ;; +static) + build_bsdtar=yes + static_bsdtar=yes + ;; no) build_bsdtar=no static_bsdtar=no @@ -21696,7 +21706,7 @@ _ACEOF fi # AC_TYPE_OFF_T defaults to "long", which limits us to 4GB files on -# most systems... +# most systems... default to "long long" instead. { echo "$as_me:$LINENO: checking for off_t" >&5 echo $ECHO_N "checking for off_t... $ECHO_C" >&6; } if test "${ac_cv_type_off_t+set}" = set; then @@ -21755,7 +21765,7 @@ if test $ac_cv_type_off_t = yes; then else cat >>confdefs.h <<_ACEOF -#define off_t int64_t +#define off_t long long _ACEOF fi @@ -22255,6 +22265,7 @@ _ACEOF fi + { echo "$as_me:$LINENO: checking for struct stat.st_mtim.tv_nsec" >&5 echo $ECHO_N "checking for struct stat.st_mtim.tv_nsec... $ECHO_C" >&6; } if test "${ac_cv_member_struct_stat_st_mtim_tv_nsec+set}" = set; then @@ -22358,12 +22369,12 @@ _ACEOF fi -# -# We need int64_t -# -{ echo "$as_me:$LINENO: checking for int64_t" >&5 -echo $ECHO_N "checking for int64_t... $ECHO_C" >&6; } -if test "${ac_cv_type_int64_t+set}" = set; then +# If you have uintmax_t, we assume printf supports %ju +# If you have unsigned long long, we assume printf supports %llu +# TODO: Check for %ju and %llu support directly. +{ echo "$as_me:$LINENO: checking for uintmax_t" >&5 +echo $ECHO_N "checking for uintmax_t... $ECHO_C" >&6; } +if test "${ac_cv_type_uintmax_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -22373,7 +22384,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef int64_t ac__type_new_; +typedef uintmax_t ac__type_new_; int main () { @@ -22402,26 +22413,29 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_int64_t=yes + ac_cv_type_uintmax_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_int64_t=no + ac_cv_type_uintmax_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_int64_t" >&5 -echo "${ECHO_T}$ac_cv_type_int64_t" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_type_uintmax_t" >&5 +echo "${ECHO_T}$ac_cv_type_uintmax_t" >&6; } +if test $ac_cv_type_uintmax_t = yes; then -# -# If int64_t isn't defined, define it in terms of some other 64-bit type. -# -if test "$ac_cv_type_int64_t" != yes; then - { echo "$as_me:$LINENO: checking for _int64_t" >&5 -echo $ECHO_N "checking for _int64_t... $ECHO_C" >&6; } -if test "${ac_cv_type__int64_t+set}" = set; then +cat >>confdefs.h <<_ACEOF +#define HAVE_UINTMAX_T 1 +_ACEOF + + +fi +{ echo "$as_me:$LINENO: checking for unsigned long long" >&5 +echo $ECHO_N "checking for unsigned long long... $ECHO_C" >&6; } +if test "${ac_cv_type_unsigned_long_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -22431,7 +22445,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef _int64_t ac__type_new_; +typedef unsigned long long ac__type_new_; int main () { @@ -22460,30 +22474,33 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type__int64_t=yes + ac_cv_type_unsigned_long_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type__int64_t=no + ac_cv_type_unsigned_long_long=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type__int64_t" >&5 -echo "${ECHO_T}$ac_cv_type__int64_t" >&6; } -if test $ac_cv_type__int64_t = yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_long" >&5 +echo "${ECHO_T}$ac_cv_type_unsigned_long_long" >&6; } +if test $ac_cv_type_unsigned_long_long = yes; then -cat >>confdefs.h <<\_ACEOF -#define int64_t _int64_t +cat >>confdefs.h <<_ACEOF +#define HAVE_UNSIGNED_LONG_LONG 1 _ACEOF + fi - if test "$ac_cv_type__int64_t" != yes; then - { echo "$as_me:$LINENO: checking for __int64_t" >&5 -echo $ECHO_N "checking for __int64_t... $ECHO_C" >&6; } -if test "${ac_cv_type___int64_t+set}" = set; then + +# We need int64_t, uint64_t, intmax_t, and uintmax_t + + { echo "$as_me:$LINENO: checking for long long int" >&5 +echo $ECHO_N "checking for long long int... $ECHO_C" >&6; } +if test "${ac_cv_type_long_long_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -22492,27 +22509,30 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -typedef __int64_t ac__type_new_; +long long int ll = 9223372036854775807ll; + long long int nll = -9223372036854775807LL; + typedef int a[((-9223372036854775807LL < 0 + && 0 < 9223372036854775807ll) + ? 1 : -1)]; + int i = 63; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; +long long int llmax = 9223372036854775807ll; + return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) + | (llmax / ll) | (llmax % ll)); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -22521,32 +22541,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type___int64_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type___int64_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type___int64_t" >&5 -echo "${ECHO_T}$ac_cv_type___int64_t" >&6; } -if test $ac_cv_type___int64_t = yes; then - -cat >>confdefs.h <<\_ACEOF -#define int64_t __int64_t -_ACEOF - -fi - - if test "$ac_cv_type___int64_t" != yes; then - { echo "$as_me:$LINENO: checking for long long" >&5 -echo $ECHO_N "checking for long long... $ECHO_C" >&6; } -if test "${ac_cv_type_long_long+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + if test "$cross_compiling" = yes; then + ac_cv_type_long_long_int=yes else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -22554,186 +22552,88 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -typedef long long ac__type_new_; +#include <limits.h> + #ifndef LLONG_MAX + # define HALF \ + (1LL << (sizeof (long long int) * CHAR_BIT - 2)) + # define LLONG_MAX (HALF - 1 + HALF) + #endif int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; +long long int n = 1; + int i; + for (i = 0; ; i++) + { + long long int m = n << i; + if (m >> i != n) + return 1; + if (LLONG_MAX / 2 < m) + break; + } + return 0; ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 + (eval "$ac_link") 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_long_long=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_long_long=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 -echo "${ECHO_T}$ac_cv_type_long_long" >&6; } -if test $ac_cv_type_long_long = yes; then - -cat >>confdefs.h <<\_ACEOF -#define int64_t long long -_ACEOF - -fi - - fi - fi -fi - -# -# We need uint64_t -# -{ echo "$as_me:$LINENO: checking for uint64_t" >&5 -echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6; } -if test "${ac_cv_type_uint64_t+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. */ -$ac_includes_default -typedef uint64_t ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 + (eval "$ac_try") 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_uint64_t=yes + (exit $ac_status); }; }; then + ac_cv_type_long_long_int=yes else - echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_uint64_t=no +( exit $ac_status ) +ac_cv_type_long_long_int=no fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5 -echo "${ECHO_T}$ac_cv_type_uint64_t" >&6; } -# -# If uint64_t isn't defined, define it in terms of some other 64-bit type. -# -if test "$ac_cv_type_uint64_t" != yes; then - { echo "$as_me:$LINENO: checking for u_int64_t" >&5 -echo $ECHO_N "checking for u_int64_t... $ECHO_C" >&6; } -if test "${ac_cv_type_u_int64_t+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. */ -$ac_includes_default -typedef u_int64_t ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_u_int64_t=yes + else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_u_int64_t=no + ac_cv_type_long_long_int=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_u_int64_t" >&5 -echo "${ECHO_T}$ac_cv_type_u_int64_t" >&6; } -if test $ac_cv_type_u_int64_t = yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_type_long_long_int" >&5 +echo "${ECHO_T}$ac_cv_type_long_long_int" >&6; } + if test $ac_cv_type_long_long_int = yes; then cat >>confdefs.h <<\_ACEOF -#define uint64_t u_int64_t +#define HAVE_LONG_LONG_INT 1 _ACEOF -fi + fi + - if test "$ac_cv_type_u_int64_t" != yes; then - { echo "$as_me:$LINENO: checking for _uint64_t" >&5 -echo $ECHO_N "checking for _uint64_t... $ECHO_C" >&6; } -if test "${ac_cv_type__uint64_t+set}" = set; then + + { echo "$as_me:$LINENO: checking for intmax_t" >&5 +echo $ECHO_N "checking for intmax_t... $ECHO_C" >&6; } +if test "${ac_cv_type_intmax_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -22743,7 +22643,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef _uint64_t ac__type_new_; +typedef intmax_t ac__type_new_; int main () { @@ -22772,47 +22672,58 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type__uint64_t=yes + ac_cv_type_intmax_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type__uint64_t=no + ac_cv_type_intmax_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type__uint64_t" >&5 -echo "${ECHO_T}$ac_cv_type__uint64_t" >&6; } -if test $ac_cv_type__uint64_t = yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_type_intmax_t" >&5 +echo "${ECHO_T}$ac_cv_type_intmax_t" >&6; } +if test $ac_cv_type_intmax_t = yes; then cat >>confdefs.h <<\_ACEOF -#define uint64_t _uint64_t +#define HAVE_INTMAX_T 1 +_ACEOF + +else + test $ac_cv_type_long_long_int = yes \ + && ac_type='long long int' \ + || ac_type='long int' + +cat >>confdefs.h <<_ACEOF +#define intmax_t $ac_type _ACEOF fi - if test "$ac_cv_type__uint64_t" != yes; then - { echo "$as_me:$LINENO: checking for __uint64_t" >&5 -echo $ECHO_N "checking for __uint64_t... $ECHO_C" >&6; } -if test "${ac_cv_type___uint64_t+set}" = set; then + + + { echo "$as_me:$LINENO: checking for int64_t" >&5 +echo $ECHO_N "checking for int64_t... $ECHO_C" >&6; } +if test "${ac_cv_c_int64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_c_int64_t=no + for ac_type in 'int64_t' 'int' 'long int' \ + 'long long int' 'short int' 'signed char'; do + 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 -typedef __uint64_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; +static int test_array [1 - 2 * !(0 < ($ac_type) (((($ac_type) 1 << (64 - 2)) - 1) * 2 + 1))]; +test_array [0] = 0 + ; return 0; } @@ -22834,32 +22745,6 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type___uint64_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type___uint64_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type___uint64_t" >&5 -echo "${ECHO_T}$ac_cv_type___uint64_t" >&6; } -if test $ac_cv_type___uint64_t = yes; then - -cat >>confdefs.h <<\_ACEOF -#define uint64_t __uint64_t -_ACEOF - -fi - - if test "$ac_cv_type___uint64_t" != yes; then - { echo "$as_me:$LINENO: checking for unsigned long long" >&5 -echo $ECHO_N "checking for unsigned long long... $ECHO_C" >&6; } -if test "${ac_cv_type_unsigned_long_long+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -22867,14 +22752,13 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef unsigned long long ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; +static int test_array [1 - 2 * !(($ac_type) (((($ac_type) 1 << (64 - 2)) - 1) * 2 + 1) + < ($ac_type) (((($ac_type) 1 << (64 - 2)) - 1) * 2 + 2))]; +test_array [0] = 0 + ; return 0; } @@ -22896,99 +22780,46 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_unsigned_long_long=yes + : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_unsigned_long_long=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_long" >&5 -echo "${ECHO_T}$ac_cv_type_unsigned_long_long" >&6; } -if test $ac_cv_type_unsigned_long_long = yes; then - -cat >>confdefs.h <<\_ACEOF -#define uint64_t unsigned long long -_ACEOF - -fi + case $ac_type in + int64_t) ac_cv_c_int64_t=yes ;; + *) ac_cv_c_int64_t=$ac_type ;; +esac - fi - fi - fi fi -# We need uintmax_t and intmax_t -# Define them in terms of uint64_t and int64_t if appropriate. -{ echo "$as_me:$LINENO: checking for uintmax_t" >&5 -echo $ECHO_N "checking for uintmax_t... $ECHO_C" >&6; } -if test "${ac_cv_type_uintmax_t+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. */ -$ac_includes_default -typedef uintmax_t ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_uintmax_t=yes +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_uintmax_t=no + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_int64_t" != no && break + done fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_uintmax_t" >&5 -echo "${ECHO_T}$ac_cv_type_uintmax_t" >&6; } -if test $ac_cv_type_uintmax_t = yes; then - : -else +{ echo "$as_me:$LINENO: result: $ac_cv_c_int64_t" >&5 +echo "${ECHO_T}$ac_cv_c_int64_t" >&6; } + case $ac_cv_c_int64_t in #( + no|yes) ;; #( + *) cat >>confdefs.h <<_ACEOF -#define uintmax_t uint64_t +#define int64_t $ac_cv_c_int64_t _ACEOF +;; + esac -fi -{ echo "$as_me:$LINENO: checking for intmax_t" >&5 -echo $ECHO_N "checking for intmax_t... $ECHO_C" >&6; } -if test "${ac_cv_type_intmax_t+set}" = set; then + { echo "$as_me:$LINENO: checking for unsigned long long int" >&5 +echo $ECHO_N "checking for unsigned long long int... $ECHO_C" >&6; } +if test "${ac_cv_type_unsigned_long_long_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -22997,27 +22828,28 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -typedef intmax_t ac__type_new_; +unsigned long long int ull = 18446744073709551615ULL; + typedef int a[(18446744073709551615ULL <= (unsigned long long int) -1 + ? 1 : -1)]; + int i = 63; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; +unsigned long long int ullmax = 18446744073709551615ull; + return (ull << 63 | ull >> 63 | ull << i | ull >> i + | ullmax / ull | ullmax % ull); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -23026,34 +22858,32 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_intmax_t=yes + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_type_unsigned_long_long_int=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_intmax_t=no + ac_cv_type_unsigned_long_long_int=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_intmax_t" >&5 -echo "${ECHO_T}$ac_cv_type_intmax_t" >&6; } -if test $ac_cv_type_intmax_t = yes; then - : -else +{ echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_long_int" >&5 +echo "${ECHO_T}$ac_cv_type_unsigned_long_long_int" >&6; } + if test $ac_cv_type_unsigned_long_long_int = yes; then -cat >>confdefs.h <<_ACEOF -#define intmax_t int64_t +cat >>confdefs.h <<\_ACEOF +#define HAVE_UNSIGNED_LONG_LONG_INT 1 _ACEOF -fi + fi -# If you have uintmax_t, we assume printf supports %ju -# If you have unsigned long long, we assume printf supports %llu -{ echo "$as_me:$LINENO: checking for uintmax_t" >&5 + { echo "$as_me:$LINENO: checking for uintmax_t" >&5 echo $ECHO_N "checking for uintmax_t... $ECHO_C" >&6; } if test "${ac_cv_type_uintmax_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -23108,32 +22938,44 @@ fi echo "${ECHO_T}$ac_cv_type_uintmax_t" >&6; } if test $ac_cv_type_uintmax_t = yes; then -cat >>confdefs.h <<_ACEOF +cat >>confdefs.h <<\_ACEOF #define HAVE_UINTMAX_T 1 _ACEOF +else + test $ac_cv_type_unsigned_long_long_int = yes \ + && ac_type='unsigned long long int' \ + || ac_type='unsigned long int' + +cat >>confdefs.h <<_ACEOF +#define uintmax_t $ac_type +_ACEOF fi -{ echo "$as_me:$LINENO: checking for unsigned long long" >&5 -echo $ECHO_N "checking for unsigned long long... $ECHO_C" >&6; } -if test "${ac_cv_type_unsigned_long_long+set}" = set; then + + + + { echo "$as_me:$LINENO: checking for uint64_t" >&5 +echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6; } +if test "${ac_cv_c_uint64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_c_uint64_t=no + for ac_type in 'uint64_t' 'unsigned int' 'unsigned long int' \ + 'unsigned long long int' 'unsigned short int' 'unsigned char'; do + 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 -typedef unsigned long long ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; +static int test_array [1 - 2 * !(($ac_type) -1 >> (64 - 1) == 1)]; +test_array [0] = 0 + ; return 0; } @@ -23155,26 +22997,38 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_unsigned_long_long=yes + case $ac_type in + uint64_t) ac_cv_c_uint64_t=yes ;; + *) ac_cv_c_uint64_t=$ac_type ;; +esac + else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_unsigned_long_long=no + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_uint64_t" != no && break + done fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_long" >&5 -echo "${ECHO_T}$ac_cv_type_unsigned_long_long" >&6; } -if test $ac_cv_type_unsigned_long_long = yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_c_uint64_t" >&5 +echo "${ECHO_T}$ac_cv_c_uint64_t" >&6; } + case $ac_cv_c_uint64_t in #( + no|yes) ;; #( + *) -cat >>confdefs.h <<_ACEOF -#define HAVE_UNSIGNED_LONG_LONG 1 +cat >>confdefs.h <<\_ACEOF +#define _UINT64_T 1 _ACEOF -fi +cat >>confdefs.h <<_ACEOF +#define uint64_t $ac_cv_c_uint64_t +_ACEOF +;; + esac # TODO: If any of these are missing, define them right here. @@ -25659,8 +25513,7 @@ done - -for ac_func in nl_langinfo poll reallocf select setlocale +for ac_func in nl_langinfo poll select setlocale do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -27186,6 +27039,144 @@ rm -f conftest* fi +# Interix doesn't provide optarg and optind +{ echo "$as_me:$LINENO: checking whether optarg is declared" >&5 +echo $ECHO_N "checking whether optarg is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_optarg+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. */ +$ac_includes_default +int +main () +{ +#ifndef optarg + (void) optarg; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_optarg=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_optarg=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_optarg" >&5 +echo "${ECHO_T}$ac_cv_have_decl_optarg" >&6; } +if test $ac_cv_have_decl_optarg = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_OPTARG 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_OPTARG 0 +_ACEOF + + +fi + + +{ echo "$as_me:$LINENO: checking whether optind is declared" >&5 +echo $ECHO_N "checking whether optind is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_optind+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. */ +$ac_includes_default +int +main () +{ +#ifndef optind + (void) optind; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_optind=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_optind=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_optind" >&5 +echo "${ECHO_T}$ac_cv_have_decl_optind" >&6; } +if test $ac_cv_have_decl_optind = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_OPTIND 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_OPTIND 0 +_ACEOF + + +fi + + + cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure @@ -27636,7 +27627,7 @@ exec 6>&1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by libarchive $as_me 2.2.5, which was +This file was extended by libarchive $as_me 2.2.6, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -27689,7 +27680,7 @@ Report bugs to <bug-autoconf@gnu.org>." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -libarchive config.status 2.2.5 +libarchive config.status 2.2.6 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff --git a/archivers/libarchive/files/configure.ac b/archivers/libarchive/files/configure.ac index 35af1c5e0fe..7e9606eb028 100644 --- a/archivers/libarchive/files/configure.ac +++ b/archivers/libarchive/files/configure.ac @@ -55,9 +55,13 @@ AC_PROG_YACC AC_PROG_LIBTOOL AC_CHECK_TOOL([STRIP],[strip]) +# Default is to build bsdtar, but allow people to override that. AC_ARG_ENABLE([bsdtar], - [AS_HELP_STRING([--disable-bsdtar], [disable build of bsdtar])], - [], []) + [AS_HELP_STRING([--enable-bsdtar], [enable build of bsdtar (default)]) + AS_HELP_STRING([--enable-bsdtar=static], [force static build of bsdtar]) + AS_HELP_STRING([--enable-bsdtar=shared], [force dynamic build of bsdtar]) +AS_HELP_STRING([--disable-bsdtar], [disable build of bsdtar])], + [], [enable_bsdtar=yes]) case "$enable_bsdtar" in yes) @@ -69,13 +73,17 @@ yes) build_bsdtar=yes ;; -shared) +dynamic|shared) if test "$enable_shared" = "no"; then AC_MSG_FAILURE([Shared linking of bsdtar requires shared libarchive]) fi build_bsdtar=yes static_bsdtar=no ;; +static) + build_bsdtar=yes + static_bsdtar=yes + ;; no) build_bsdtar=no static_bsdtar=no @@ -127,77 +135,28 @@ AC_C_CONST AC_TYPE_UID_T AC_TYPE_MODE_T # AC_TYPE_OFF_T defaults to "long", which limits us to 4GB files on -# most systems... -AC_CHECK_TYPE(off_t, [int64_t]) +# most systems... default to "long long" instead. +AC_CHECK_TYPE(off_t, [long long]) AC_TYPE_SIZE_T AC_CHECK_TYPE(id_t, [unsigned long]) AC_CHECK_TYPE(uintptr_t, [unsigned int]) AC_CHECK_MEMBERS([struct stat.st_rdev]) AC_CHECK_MEMBERS([struct tm.tm_gmtoff]) # Check for high-resolution timestamps in struct stat -AC_CHECK_MEMBERS([struct stat.st_mtimespec.tv_nsec, struct stat.st_mtim.tv_nsec]) - -# -# We need int64_t -# -AC_CHECK_TYPE(int64_t) -# -# If int64_t isn't defined, define it in terms of some other 64-bit type. -# -if test "$ac_cv_type_int64_t" != yes; then - AC_CHECK_TYPE(_int64_t, - [AC_DEFINE([int64_t], [_int64_t], - [Define int64_t to a valid signed 64-bit type, if necessary.])]) - if test "$ac_cv_type__int64_t" != yes; then - AC_CHECK_TYPE(__int64_t, - [AC_DEFINE([int64_t], [__int64_t], - [Define int64_t to a valid signed 64-bit type, if necessary.])]) - if test "$ac_cv_type___int64_t" != yes; then - AC_CHECK_TYPE(long long, - [AC_DEFINE([int64_t], [long long], - [Define int64_t to a valid signed 64-bit type, if necessary.])]) - fi - fi -fi - -# -# We need uint64_t -# -AC_CHECK_TYPE(uint64_t) -# -# If uint64_t isn't defined, define it in terms of some other 64-bit type. -# -if test "$ac_cv_type_uint64_t" != yes; then - AC_CHECK_TYPE(u_int64_t, - [AC_DEFINE([uint64_t], [u_int64_t], - [Define uint64_t to an unsigned 64-bit type, if necessary.])]) - if test "$ac_cv_type_u_int64_t" != yes; then - AC_CHECK_TYPE(_uint64_t, - [AC_DEFINE([uint64_t], [_uint64_t], - [Define uint64_t to an unsigned 64-bit type, if necessary.])]) - if test "$ac_cv_type__uint64_t" != yes; then - AC_CHECK_TYPE(__uint64_t, - [AC_DEFINE([uint64_t], [__uint64_t], - [Define uint64_t to an unsigned 64-bit type, if necessary.])]) - if test "$ac_cv_type___uint64_t" != yes; then - AC_CHECK_TYPE(unsigned long long, - [AC_DEFINE([uint64_t], [unsigned long long], - [Define uint64_t to an unsigned 64-bit type, if necessary.])]) - fi - fi - fi -fi - -# We need uintmax_t and intmax_t -# Define them in terms of uint64_t and int64_t if appropriate. -AC_CHECK_TYPE(uintmax_t, [uint64_t]) -AC_CHECK_TYPE(intmax_t, [int64_t]) - +AC_CHECK_MEMBERS([struct stat.st_mtimespec.tv_nsec]) +AC_CHECK_MEMBERS([struct stat.st_mtim.tv_nsec]) # If you have uintmax_t, we assume printf supports %ju # If you have unsigned long long, we assume printf supports %llu +# TODO: Check for %ju and %llu support directly. AC_CHECK_TYPES([uintmax_t, unsigned long long]) +# We need int64_t, uint64_t, intmax_t, and uintmax_t +AC_TYPE_INTMAX_T +AC_TYPE_INT64_T +AC_TYPE_UINTMAX_T +AC_TYPE_UINT64_T + # TODO: If any of these are missing, define them right here. AC_CHECK_DECLS([SIZE_MAX, INT64_MAX, INT64_MIN, UINT64_MAX, UINT32_MAX]) @@ -226,7 +185,7 @@ AC_CHECK_FUNCS([ftruncate getopt_long getxattr]) AC_CHECK_FUNCS([lchflags lchmod lchown]) AC_CHECK_FUNCS([lgetxattr listxattr llistxattr fsetxattr lsetxattr]) AC_CHECK_FUNCS([lutimes memmove memset mkdir mkfifo]) -AC_CHECK_FUNCS([nl_langinfo poll reallocf select setlocale]) +AC_CHECK_FUNCS([nl_langinfo poll select setlocale]) AC_CHECK_FUNCS([strchr strdup strerror strrchr timegm utime utimes]) AC_CHECK_FUNCS([wcscpy wcslen wmemcmp wmemcpy]) @@ -307,4 +266,8 @@ AC_CHECK_DECL([ACL_USER], # Additional requirements AC_SYS_LARGEFILE +# Interix doesn't provide optarg and optind +AC_CHECK_DECLS([optarg]) +AC_CHECK_DECLS([optind]) + AC_OUTPUT diff --git a/archivers/libarchive/files/libarchive/archive_entry.3 b/archivers/libarchive/files/libarchive/archive_entry.3 index 11b9356264c..6b1b270f1a5 100644 --- a/archivers/libarchive/files/libarchive/archive_entry.3 +++ b/archivers/libarchive/files/libarchive/archive_entry.3 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $FreeBSD: src/lib/libarchive/archive_entry.3,v 1.14 2007/05/29 01:00:18 kientzle Exp $ +.\" $FreeBSD: src/lib/libarchive/archive_entry.3,v 1.15 2007/07/15 19:10:34 kientzle Exp $ .\" .Dd December 15, 2003 .Dt archive_entry 3 @@ -41,6 +41,7 @@ .Nm archive_entry_clear , .Nm archive_entry_clone , .Nm archive_entry_copy_fflags_text_w , +.Nm archive_entry_copy_gname , .Nm archive_entry_copy_gname_w , .Nm archive_entry_copy_hardlink , .Nm archive_entry_copy_hardlink_w , @@ -48,6 +49,7 @@ .Nm archive_entry_copy_stat , .Nm archive_entry_copy_symlink , .Nm archive_entry_copy_symlink_w , +.Nm archive_entry_copy_uname , .Nm archive_entry_copy_uname_w , .Nm archive_entry_dev , .Nm archive_entry_devmajor , @@ -125,6 +127,8 @@ .Ft const wchar_t * .Fn archive_entry_copy_fflags_text_w "struct archive_entry *" "const wchar_t *" .Ft void +.Fn archive_entry_copy_gname "struct archive_entry *" "const char *" +.Ft void .Fn archive_entry_copy_gname_w "struct archive_entry *" "const wchar_t *" .Ft void .Fn archive_entry_copy_hardlink "struct archive_entry *" "const char *" @@ -139,6 +143,8 @@ .Ft void .Fn archive_entry_copy_symlink_w "struct archive_entry *" "const wchar_t *" .Ft void +.Fn archive_entry_copy_uname "struct archive_entry *" "const char *" +.Ft void .Fn archive_entry_copy_uname_w "struct archive_entry *" "const wchar_t *" .Ft dev_t .Fn archive_entry_dev "struct archive_entry *" diff --git a/archivers/libarchive/files/libarchive/archive_entry.c b/archivers/libarchive/files/libarchive/archive_entry.c index 6772d7f01f4..0ef2a18dd7b 100644 --- a/archivers/libarchive/files/libarchive/archive_entry.c +++ b/archivers/libarchive/files/libarchive/archive_entry.c @@ -24,7 +24,7 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_entry.c,v 1.43 2007/05/29 01:00:18 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_entry.c,v 1.44 2007/07/15 19:10:34 kientzle Exp $"); #ifdef HAVE_SYS_STAT_H #include <sys/stat.h> @@ -652,6 +652,12 @@ archive_entry_set_gname(struct archive_entry *entry, const char *name) } void +archive_entry_copy_gname(struct archive_entry *entry, const char *name) +{ + aes_copy_mbs(&entry->ae_gname, name); +} + +void archive_entry_copy_gname_w(struct archive_entry *entry, const wchar_t *name) { aes_copy_wcs(&entry->ae_gname, name); @@ -836,6 +842,12 @@ archive_entry_set_uname(struct archive_entry *entry, const char *name) } void +archive_entry_copy_uname(struct archive_entry *entry, const char *name) +{ + aes_copy_mbs(&entry->ae_uname, name); +} + +void archive_entry_copy_uname_w(struct archive_entry *entry, const wchar_t *name) { aes_copy_wcs(&entry->ae_uname, name); diff --git a/archivers/libarchive/files/libarchive/archive_entry.h b/archivers/libarchive/files/libarchive/archive_entry.h index 69467515383..a6f3291b65c 100644 --- a/archivers/libarchive/files/libarchive/archive_entry.h +++ b/archivers/libarchive/files/libarchive/archive_entry.h @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/lib/libarchive/archive_entry.h,v 1.22 2007/05/29 01:00:18 kientzle Exp $ + * $FreeBSD: src/lib/libarchive/archive_entry.h,v 1.23 2007/07/15 19:10:34 kientzle Exp $ */ #ifndef ARCHIVE_ENTRY_H_INCLUDED @@ -135,6 +135,7 @@ const wchar_t *archive_entry_copy_fflags_text_w(struct archive_entry *, const wchar_t *); void archive_entry_set_gid(struct archive_entry *, gid_t); void archive_entry_set_gname(struct archive_entry *, const char *); +void archive_entry_copy_gname(struct archive_entry *, const char *); void archive_entry_copy_gname_w(struct archive_entry *, const wchar_t *); void archive_entry_set_hardlink(struct archive_entry *, const char *); void archive_entry_copy_hardlink(struct archive_entry *, const char *); @@ -156,6 +157,7 @@ void archive_entry_copy_symlink(struct archive_entry *, const char *); void archive_entry_copy_symlink_w(struct archive_entry *, const wchar_t *); void archive_entry_set_uid(struct archive_entry *, uid_t); void archive_entry_set_uname(struct archive_entry *, const char *); +void archive_entry_copy_uname(struct archive_entry *, const char *); void archive_entry_copy_uname_w(struct archive_entry *, const wchar_t *); /* diff --git a/archivers/libarchive/files/libarchive/archive_read_support_compression_program.c b/archivers/libarchive/files/libarchive/archive_read_support_compression_program.c index 6815a3bd8b1..58b4bbddf0b 100644 --- a/archivers/libarchive/files/libarchive/archive_read_support_compression_program.c +++ b/archivers/libarchive/files/libarchive/archive_read_support_compression_program.c @@ -24,7 +24,7 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_compression_program.c,v 1.1 2007/05/29 01:00:19 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_compression_program.c,v 1.2 2007/07/20 01:28:50 kientzle Exp $"); #ifdef HAVE_SYS_WAIT_H # include <sys/wait.h> @@ -113,6 +113,7 @@ child_read(struct archive_read *a, char *buf, size_t buf_len) { struct archive_decompress_program *state = a->decompressor->data; ssize_t ret, requested; + const void *child_buf; if (state->child_stdout == -1) return (-1); @@ -138,8 +139,10 @@ restart_read: return (-1); if (state->child_in_buf_avail == 0) { + child_buf = state->child_in_buf; ret = (a->client_reader)(&a->archive, - a->client_data, (const void **)&state->child_in_buf); + a->client_data,&child_buf); + state->child_in_buf = (const char *)child_buf; if (ret < 0) { close(state->child_stdin); diff --git a/archivers/libarchive/files/libarchive/archive_read_support_format_tar.c b/archivers/libarchive/files/libarchive/archive_read_support_format_tar.c index 679e4eeef19..9124592ae8a 100644 --- a/archivers/libarchive/files/libarchive/archive_read_support_format_tar.c +++ b/archivers/libarchive/files/libarchive/archive_read_support_format_tar.c @@ -24,7 +24,7 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_tar.c,v 1.58 2007/07/12 15:00:28 cperciva Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_tar.c,v 1.60 2007/07/15 19:13:59 kientzle Exp $"); #ifdef HAVE_ERRNO_H #include <errno.h> @@ -895,8 +895,14 @@ read_body_to_string(struct archive_read *a, struct tar *tar, return (ARCHIVE_FATAL); } + /* Fail if we can't make our buffer big enough. */ + if (archive_string_ensure(as, size+1) == NULL) { + archive_set_error(&a->archive, ENOMEM, + "No memory"); + return (ARCHIVE_FATAL); + } + /* Read the body into the string. */ - archive_string_ensure(as, size+1); padded_size = (size + 511) & ~ 511; dest = as->s; while (padded_size > 0) { @@ -2020,7 +2026,11 @@ readline(struct archive_read *a, struct tar *tar, const char **start) } /* Otherwise, we need to accumulate in a line buffer. */ for (;;) { - archive_string_ensure(&tar->line, total_size + bytes_read); + if (archive_string_ensure(&tar->line, total_size + bytes_read) == NULL) { + archive_set_error(&a->archive, ENOMEM, + "Can't allocate working buffer"); + return (ARCHIVE_FATAL); + } memcpy(tar->line.s + total_size, t, bytes_read); (a->decompressor->consume)(a, bytes_read); total_size += bytes_read; diff --git a/archivers/libarchive/files/libarchive/archive_read_support_format_zip.c b/archivers/libarchive/files/libarchive/archive_read_support_format_zip.c index 651e8dd793f..0d8df370e35 100644 --- a/archivers/libarchive/files/libarchive/archive_read_support_format_zip.c +++ b/archivers/libarchive/files/libarchive/archive_read_support_format_zip.c @@ -24,7 +24,7 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_zip.c,v 1.13 2007/05/29 01:00:19 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_support_format_zip.c,v 1.14 2007/07/15 19:13:59 kientzle Exp $"); #ifdef HAVE_ERRNO_H #include <errno.h> @@ -302,7 +302,8 @@ zip_read_file_header(struct archive_read *a, struct archive_entry *entry, "Truncated ZIP file header"); return (ARCHIVE_FATAL); } - archive_string_ensure(&zip->pathname, zip->filename_length); + if (archive_string_ensure(&zip->pathname, zip->filename_length) == NULL) + __archive_errx(1, "Out of memory"); archive_strncpy(&zip->pathname, (const char *)h, zip->filename_length); (a->decompressor->consume)(a, zip->filename_length); archive_entry_set_pathname(entry, zip->pathname.s); @@ -756,8 +757,8 @@ process_extra(const void* extra, struct zip* zip) if (flags & 0x01) { #ifdef DEBUG - fprintf(stderr, "mtime: %d -> %d\n", - zip->mtime, i4(p + offset)); + fprintf(stderr, "mtime: %lld -> %d\n", + (long long)zip->mtime, i4(p + offset)); #endif if (datasize < 4) break; diff --git a/archivers/libarchive/files/libarchive/archive_string.c b/archivers/libarchive/files/libarchive/archive_string.c index eb26a74935a..7e43b360a4d 100644 --- a/archivers/libarchive/files/libarchive/archive_string.c +++ b/archivers/libarchive/files/libarchive/archive_string.c @@ -24,7 +24,7 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_string.c,v 1.10 2007/05/29 01:00:19 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_string.c,v 1.11 2007/07/15 19:13:59 kientzle Exp $"); /* * Basic resizable string support, to simplify manipulating arbitrary-sized @@ -44,7 +44,8 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_string.c,v 1.10 2007/05/29 01:00: struct archive_string * __archive_string_append(struct archive_string *as, const char *p, size_t s) { - __archive_string_ensure(as, as->length + s + 1); + if (__archive_string_ensure(as, as->length + s + 1) == NULL) + __archive_errx(1, "Out of memory"); memcpy(as->s + as->length, p, s); as->s[as->length + s] = 0; as->length += s; @@ -54,7 +55,8 @@ __archive_string_append(struct archive_string *as, const char *p, size_t s) void __archive_string_copy(struct archive_string *dest, struct archive_string *src) { - __archive_string_ensure(dest, src->length + 1); + if (__archive_string_ensure(dest, src->length + 1) == NULL) + __archive_errx(1, "Out of memory"); memcpy(dest->s, src->s, src->length); dest->length = src->length; dest->s[dest->length] = 0; @@ -69,6 +71,7 @@ __archive_string_free(struct archive_string *as) free(as->s); } +/* Returns NULL on any allocation failure. */ struct archive_string * __archive_string_ensure(struct archive_string *as, size_t s) { @@ -80,10 +83,8 @@ __archive_string_ensure(struct archive_string *as, size_t s) while (as->buffer_length < s) as->buffer_length *= 2; as->s = (char *)realloc(as->s, as->buffer_length); - /* TODO: Return null instead and fix up all of our callers to - * handle this correctly. */ if (as->s == NULL) - __archive_errx(1, "Out of memory"); + return (NULL); return (as); } diff --git a/archivers/libarchive/files/libarchive/archive_string_sprintf.c b/archivers/libarchive/files/libarchive/archive_string_sprintf.c index 13eff5c103a..763e75dcd84 100644 --- a/archivers/libarchive/files/libarchive/archive_string_sprintf.c +++ b/archivers/libarchive/files/libarchive/archive_string_sprintf.c @@ -24,7 +24,7 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_string_sprintf.c,v 1.8 2007/01/09 08:05:55 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_string_sprintf.c,v 1.9 2007/07/15 19:13:59 kientzle Exp $"); /* * The use of printf()-family functions can be troublesome @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD: src/lib/libarchive/archive_string_sprintf.c,v 1.8 2007/01/09 #include <stdio.h> #include "archive_string.h" +#include "archive_private.h" /* * Like 'vsprintf', but ensures the target is big enough, resizing if @@ -56,7 +57,8 @@ __archive_string_vsprintf(struct archive_string *as, const char *fmt, uintmax_t u; /* Unsigned integer temp. */ const char *p, *p2; - __archive_string_ensure(as, 64); + if (__archive_string_ensure(as, 64) == NULL) + __archive_errx(1, "Out of memory"); if (fmt == NULL) { as->s[0] = 0; diff --git a/archivers/libarchive/files/libarchive/archive_write_disk.c b/archivers/libarchive/files/libarchive/archive_write_disk.c index 691dfe48a07..331bfe3b1cd 100644 --- a/archivers/libarchive/files/libarchive/archive_write_disk.c +++ b/archivers/libarchive/files/libarchive/archive_write_disk.c @@ -25,7 +25,7 @@ */ #include "archive_platform.h" -__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_disk.c,v 1.12 2007/05/29 01:00:19 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_disk.c,v 1.13 2007/07/15 19:13:59 kientzle Exp $"); #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> @@ -610,7 +610,10 @@ archive_write_disk_new(void) a->lookup_uid = trivial_lookup_uid; a->lookup_gid = trivial_lookup_gid; a->user_uid = geteuid(); - archive_string_ensure(&a->path_safe, 64); + if (archive_string_ensure(&a->path_safe, 512) == NULL) { + free(a); + return (NULL); + } return (&a->archive); } diff --git a/archivers/libarchive/files/libarchive/archive_write_set_format_ar.c b/archivers/libarchive/files/libarchive/archive_write_set_format_ar.c index bf3ea4de5d7..404b651311e 100644 --- a/archivers/libarchive/files/libarchive/archive_write_set_format_ar.c +++ b/archivers/libarchive/files/libarchive/archive_write_set_format_ar.c @@ -76,7 +76,7 @@ static ssize_t archive_write_ar_data(struct archive_write *, const void *buff, size_t s); static int archive_write_ar_destroy(struct archive_write *); static int archive_write_ar_finish_entry(struct archive_write *); -static const char *basename(const char *path); +static const char *ar_basename(const char *path); static int format_octal(int64_t v, char *p, int s); static int format_decimal(int64_t v, char *p, int s); @@ -192,11 +192,11 @@ archive_write_ar_header(struct archive_write *a, struct archive_entry *entry) goto size; } - /* + /* * Otherwise, entry is a normal archive member. * Strip leading paths from filenames, if any. */ - if ((filename = basename(pathname)) == NULL) { + if ((filename = ar_basename(pathname)) == NULL) { /* Reject filenames with trailing "/" */ archive_set_error(&a->archive, EINVAL, "Invalid filename"); @@ -507,7 +507,7 @@ format_decimal(int64_t v, char *p, int s) } static const char * -basename(const char *path) +ar_basename(const char *path) { const char *endp, *startp; diff --git a/archivers/libarchive/files/libarchive/test/main.c b/archivers/libarchive/files/libarchive/test/main.c index be713c61b83..9dd852ffa75 100644 --- a/archivers/libarchive/files/libarchive/test/main.c +++ b/archivers/libarchive/files/libarchive/test/main.c @@ -32,7 +32,13 @@ #include <time.h> #include "test.h" -__FBSDID("$FreeBSD: src/lib/libarchive/test/main.c,v 1.6 2007/07/13 15:09:07 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/test/main.c,v 1.8 2007/07/31 05:03:27 kientzle Exp $"); + +/* Interix doesn't define these in a standard header. */ +#if __INTERIX__ +extern char *optarg; +extern int optind; +#endif /* Default is to crash and try to force a core dump on failure. */ static int dump_on_failure = 1; @@ -60,12 +66,60 @@ static int skips = 0; */ static char msg[4096]; +/* + * For each test source file, we remember how many times each + * failure was reported. + */ +static const char *failed_filename; +static struct line { + int line; + int count; +} failed_lines[1000]; + + +/* Count this failure; return the number of previous failures. */ +static int +previous_failures(const char *filename, int line) +{ + int i; + int count; + + if (failed_filename == NULL || strcmp(failed_filename, filename) != 0) + memset(failed_lines, 0, sizeof(failed_lines)); + failed_filename = filename; + + for (i = 0; i < sizeof(failed_lines)/sizeof(failed_lines[0]); i++) { + if (failed_lines[i].line == line) { + count = failed_lines[i].count; + failed_lines[i].count++; + return (count); + } + if (failed_lines[i].line == 0) { + failed_lines[i].line = line; + failed_lines[i].count = 1; + return (0); + } + } +} /* Inform user that we're skipping a test. */ +static const char *skipped_filename; +static int skipped_line; +void skipping_setup(const char *filename, int line) +{ + skipped_filename = filename; + skipped_line = line; +} void -skipping(const char *fmt, ...) +test_skipping(const char *fmt, ...) { + int i; + int line = skipped_line; va_list ap; + + if (previous_failures(skipped_filename, skipped_line)) + return; + va_start(ap, fmt); fprintf(stderr, " *** SKIPPING: "); vfprintf(stderr, fmt, ap); @@ -76,8 +130,10 @@ skipping(const char *fmt, ...) /* Common handling of failed tests. */ static void -test_failed(struct archive *a) +test_failed(struct archive *a, int line) { + int i; + failures ++; if (msg[0] != '\0') { @@ -95,6 +151,39 @@ test_failed(struct archive *a) } } +/* Summarize repeated failures in the just-completed test file. */ +int +summarize_comparator(const void *a0, const void *b0) +{ + const struct line *a = a0, *b = b0; + if (a->line == 0 && b->line == 0) + return (0); + if (a->line == 0) + return (1); + if (b->line == 0) + return (-1); + return (a->line - b->line); +} + +void +summarize(const char *filename) +{ + int i; + + qsort(failed_lines, sizeof(failed_lines)/sizeof(failed_lines[0]), + sizeof(failed_lines[0]), summarize_comparator); + for (i = 0; i < sizeof(failed_lines)/sizeof(failed_lines[0]); i++) { + if (failed_lines[i].line == 0) + break; + if (failed_lines[i].count > 1) + fprintf(stderr, "%s:%d: Failed %d times\n", + failed_filename, failed_lines[i].line, + failed_lines[i].count); + } + /* Clear the failure history for the next file. */ + memset(failed_lines, 0, sizeof(failed_lines)); +} + /* Set up a message to display only after a test fails. */ void failure(const char *fmt, ...) @@ -113,9 +202,11 @@ test_assert(const char *file, int line, int value, const char *condition, struct msg[0] = '\0'; return; } + if (previous_failures(file, line)) + return; fprintf(stderr, "%s:%d: Assertion failed\n", file, line); fprintf(stderr, " Condition: %s\n", condition); - test_failed(a); + test_failed(a, line); } /* assertEqualInt() displays the values of the two integers. */ @@ -127,11 +218,13 @@ test_assert_equal_int(const char *file, int line, msg[0] = '\0'; return; } + if (previous_failures(file, line)) + return; fprintf(stderr, "%s:%d: Assertion failed: Ints not equal\n", file, line); fprintf(stderr, " %s=%d\n", e1, v1); fprintf(stderr, " %s=%d\n", e2, v2); - test_failed(a); + test_failed(a, line); } /* assertEqualString() displays the values of the two strings. */ @@ -150,11 +243,13 @@ test_assert_equal_string(const char *file, int line, msg[0] = '\0'; return; } + if (previous_failures(file, line)) + return; fprintf(stderr, "%s:%d: Assertion failed: Strings not equal\n", file, line); fprintf(stderr, " %s = \"%s\"\n", e1, v1); fprintf(stderr, " %s = \"%s\"\n", e2, v2); - test_failed(a); + test_failed(a, line); } /* assertEqualWString() displays the values of the two strings. */ @@ -168,11 +263,13 @@ test_assert_equal_wstring(const char *file, int line, msg[0] = '\0'; return; } + if (previous_failures(file, line)) + return; fprintf(stderr, "%s:%d: Assertion failed: Unicode strings not equal\n", file, line); fwprintf(stderr, L" %s = \"%ls\"\n", e1, v1); fwprintf(stderr, L" %s = \"%ls\"\n", e2, v2); - test_failed(a); + test_failed(a, line); } /* @@ -217,6 +314,7 @@ static int test_run(int i, const char *tmpdir) exit(1); } (*tests[i].func)(); + summarize(tests[i].name); return (failures == failures_before ? 0 : 1); } diff --git a/archivers/libarchive/files/libarchive/test/test.h b/archivers/libarchive/files/libarchive/test/test.h index 3c4c1ed9540..c4a110c7199 100644 --- a/archivers/libarchive/files/libarchive/test/test.h +++ b/archivers/libarchive/files/libarchive/test/test.h @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/lib/libarchive/test/test.h,v 1.5 2007/07/13 15:12:52 kientzle Exp $ + * $FreeBSD: src/lib/libarchive/test/test.h,v 1.6 2007/07/14 17:52:01 kientzle Exp $ */ /* Every test program should #include "test.h" as the first thing. */ @@ -116,9 +116,19 @@ #define assertEqualWString(v1,v2) \ test_assert_equal_wstring(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL) +/* + * This would be simple with C99 variadic macros, but I don't want to + * require that. Instead, I insert a function call before each + * skipping() call to pass the file and line information down. Crude, + * but effective. + */ +#define skipping \ + skipping_setup(__FILE__, __LINE__);test_skipping + /* Function declarations. These are defined in test_utility.c. */ void failure(const char *fmt, ...); -void skipping(const char *fmt, ...); +void skipping_setup(const char *, int); +void test_skipping(const char *fmt, ...); void test_assert(const char *, int, int, const char *, struct archive *); void test_assert_equal_int(const char *, int, int, const char *, int, const char *, struct archive *); void test_assert_equal_string(const char *, int, const char *v1, const char *, const char *v2, const char *, struct archive *); diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse.c b/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse.c index dddf6680115..a3d2a7b75f7 100644 --- a/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse.c +++ b/archivers/libarchive/files/libarchive/test/test_read_format_gtar_sparse.c @@ -23,7 +23,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "test.h" -__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_gtar_sparse.c,v 1.3 2007/07/13 15:16:26 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_gtar_sparse.c,v 1.4 2007/07/14 17:54:14 kientzle Exp $"); /* * Each of the following is an archive of a single sparse file @@ -91,7 +91,12 @@ static unsigned char archive_0_1[] = { 164,'I',243,147,'H','$',18,227,240,1,'Q',127,'c',137,0,14,0,0}; /* GNU tar "1.0" posix format, as written by GNU tar 1.16.1. */ -#if 1 +/* + * Uncompressed, as that exercises some of the code better + * than compressed does. (The uncompression layers try to work with + * large blocks and the parsing code here has sections that have + * to work harder if reads return small pieces of data.) + */ static unsigned char archive_1_0[] = { '.','/','P','a','x','H','e','a','d','e','r','s','.','7','2','6','6','8','/', 's','p','a','r','s','e',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, @@ -229,25 +234,6 @@ static unsigned char archive_1_0[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0}; -#else -static unsigned char archive_1_0[] = { -31,139,8,0,210,221,'l','F',0,3,237,148,207,'N',195,'0',12,198,'s',206,'S', -244,9,210,216,206,159,238,208,'+',236,132,144,16,15,16,'A',14,'E',219,'@', -201,'&','M','<','=','i','G','Q',133,'4','v','`','l',170,240,239,'b',235,'s', -20,'9','q',190,168,250,'>',236,151,'1','<',199,148,149,'G',231,154,':',191, -133,148,163,'8',31,186,224,140,233,'#','x',171,167,'q',0,193,10,208,142,8, -172,'3',30,133,6,178,218,139,'j',127,198,30,142,178,203,219,144,'J','+',191, -221,231,243,',','_','q','&',' ','V',183,'w',143,234,'0','s',181,14,'/',175, -169,5,249,'M',237,'6','E',213,18,221,'T',221,132,'u','l',15,185,'$',152,'V', -'R',12,171,220,189,199,150,192,'X',143,141,'D',']',133,'m','W',150,3,'4', -'`','i',225,200,244,218,211,'T','3',206,202,'k','_',198,'?','D',213,'e','p', -15,195,220,'n',186,'U',252,147,'/',224,132,255,169,183,203,232,127,4,'(', -254,183,224,181,168,'.','b',162,209,255,229,'-',254,184,238,'T','}',166,254, -'\'',185,'(',144,147,22,'P','B','I',27,143,'C','>','z','W',179,'+',153,227, -132,'k','7',192,204,26,'~','?',12,195,'0',12,'s','y','>',0,244,'|','e',9, -0,18,0,0}; -#endif - #endif #define min(a,b) ((a) < (b) ? (a) : (b)) diff --git a/archivers/libarchive/files/libarchive/test/test_read_format_tar.c b/archivers/libarchive/files/libarchive/test/test_read_format_tar.c index 89989211eee..c3b5212d8e7 100644 --- a/archivers/libarchive/files/libarchive/test/test_read_format_tar.c +++ b/archivers/libarchive/files/libarchive/test/test_read_format_tar.c @@ -23,71 +23,410 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "test.h" -__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_tar.c,v 1.1 2007/03/03 07:37:37 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_tar.c,v 1.2 2007/07/14 05:35:17 kientzle Exp $"); -static unsigned char archive[] = { -'.',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'0','0','0','7','5', -'5',' ',0,'0','0','1','7','5','0',' ',0,'0','0','1','7','5','0',' ',0,'0', -'0','0','0','0','0','0','0','0','0','0',' ','1','0','3','3','4','0','4','1', -'7','3','6',' ','0','1','0','5','6','1',0,' ','5',0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,'u','s','t','a','r',0,'0','0','t','i','m',0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'t','i','m',0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'0','0','0','0','0','0', -' ',0,'0','0','0','0','0','0',' ',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; +/* + * Each of these archives is a short archive with a single entry. The + * corresponding verify function verifies the entry structure returned + * from libarchive is what it should be. The support functions pad with + * lots of zeros, so we can trim trailing zero bytes from each hardcoded + * archive to save space. + * + * The naming here follows the tar file type flags. E.g. '1' is a hardlink, + * '2' is a symlink, '5' is a dir, etc. + */ -DEFINE_TEST(test_read_format_tar) +/* Single entry with a hardlink. */ +static unsigned char archive1[] = { +'h','a','r','d','l','i','n','k',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'0','0', +'0','6','4','4',' ',0,'0','0','1','7','5','0',' ',0,'0','0','1','7','5','0', +' ',0,'0','0','0','0','0','0','0','0','0','0','0',' ','1','0','6','4','6', +'0','5','2','6','6','2',' ','0','1','3','0','5','7',0,' ','1','f','i','l', +'e',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'u','s','t','a','r',0,'0', +'0','t','i','m',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +'t','i','m',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'0', +'0','0','0','0','0',' ',0,'0','0','0','0','0','0',' '}; + +static void verify1(struct archive_entry *ae) +{ + /* A hardlink is not a symlink. */ + assert(!S_ISLNK(archive_entry_mode(ae))); + /* Nor is it a directory. */ + assert(!S_ISDIR(archive_entry_mode(ae))); + assertEqualInt(archive_entry_mode(ae) & 0777, 0644); + assertEqualInt(archive_entry_uid(ae), 1000); + assertEqualInt(archive_entry_gid(ae), 1000); + assertEqualString(archive_entry_uname(ae), "tim"); + assertEqualString(archive_entry_gname(ae), "tim"); + assertEqualString(archive_entry_pathname(ae), "hardlink"); + assertEqualString(archive_entry_hardlink(ae), "file"); + assert(archive_entry_symlink(ae) == NULL); + assertEqualInt(archive_entry_mtime(ae), 1184388530); +} + +/* Verify that symlinks are read correctly. */ +static unsigned char archive2[] = { +'s','y','m','l','i','n','k',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'0','0', +'0','0','7','5','5',' ','0','0','0','1','7','5','0',' ','0','0','0','1','7', +'5','0',' ','0','0','0','0','0','0','0','0','0','0','0',' ','1','0','6','4', +'6','0','5','4','1','0','1',' ','0','0','1','3','3','2','3',' ','2','f','i', +'l','e',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'u','s','t','a','r',0, +'0','0','t','i','m',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,'t','i','m',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +'0','0','0','0','0','0','0',' ','0','0','0','0','0','0','0',' '}; + +static void verify2(struct archive_entry *ae) +{ + assert(S_ISLNK(archive_entry_mode(ae))); + assertEqualInt(archive_entry_mode(ae) & 0777, 0755); + assertEqualInt(archive_entry_uid(ae), 1000); + assertEqualInt(archive_entry_gid(ae), 1000); + assertEqualString(archive_entry_uname(ae), "tim"); + assertEqualString(archive_entry_gname(ae), "tim"); + assertEqualString(archive_entry_pathname(ae), "symlink"); + assertEqualString(archive_entry_symlink(ae), "file"); + assert(archive_entry_hardlink(ae) == NULL); + assertEqualInt(archive_entry_mtime(ae), 1184389185); +} + +/* Character device node. */ +static unsigned char archive3[] = { +'d','e','v','c','h','a','r',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'0','0', +'0','0','7','5','5',' ','0','0','0','1','7','5','0',' ','0','0','0','1','7', +'5','0',' ','0','0','0','0','0','0','0','0','0','0','0',' ','1','0','6','4', +'6','0','5','4','1','0','1',' ','0','0','1','2','4','1','2',' ','3',0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'u','s','t','a','r',0, +'0','0','t','i','m',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,'t','i','m',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +'0','0','0','0','0','0','0',' ','0','0','0','0','0','0','0',' '}; + +static void verify3(struct archive_entry *ae) +{ + assert(S_ISCHR(archive_entry_mode(ae))); + assertEqualInt(archive_entry_mode(ae) & 0777, 0755); + assertEqualInt(archive_entry_uid(ae), 1000); + assertEqualInt(archive_entry_gid(ae), 1000); + assertEqualString(archive_entry_uname(ae), "tim"); + assertEqualString(archive_entry_gname(ae), "tim"); + assertEqualString(archive_entry_pathname(ae), "devchar"); + assert(archive_entry_symlink(ae) == NULL); + assert(archive_entry_hardlink(ae) == NULL); + assertEqualInt(archive_entry_mtime(ae), 1184389185); +} + +/* Block device node. */ +static unsigned char archive4[] = { +'d','e','v','b','l','o','c','k',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'0','0', +'0','0','7','5','5',' ','0','0','0','1','7','5','0',' ','0','0','0','1','7', +'5','0',' ','0','0','0','0','0','0','0','0','0','0','0',' ','1','0','6','4', +'6','0','5','4','1','0','1',' ','0','0','1','2','5','7','0',' ','4',0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'u','s','t','a','r',0, +'0','0','t','i','m',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,'t','i','m',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +'0','0','0','0','0','0','0',' ','0','0','0','0','0','0','0',' '}; + +static void verify4(struct archive_entry *ae) +{ + assert(S_ISBLK(archive_entry_mode(ae))); + assertEqualInt(archive_entry_mode(ae) & 0777, 0755); + assertEqualInt(archive_entry_uid(ae), 1000); + assertEqualInt(archive_entry_gid(ae), 1000); + assertEqualString(archive_entry_uname(ae), "tim"); + assertEqualString(archive_entry_gname(ae), "tim"); + assertEqualString(archive_entry_pathname(ae), "devblock"); + assert(archive_entry_symlink(ae) == NULL); + assert(archive_entry_hardlink(ae) == NULL); + assertEqualInt(archive_entry_mtime(ae), 1184389185); +} + +/* Directory. */ +static unsigned char archive5[] = { +'.',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'0','0','0', +'7','5','5',' ',0,'0','0','1','7','5','0',' ',0,'0','0','1','7','5','0', +' ',0,'0','0','0','0','0','0','0','0','0','0','0',' ','1','0','3','3', +'4','0','4','1','7','3','6',' ','0','1','0','5','6','1',0,' ','5',0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'u','s','t','a','r',0, +'0','0','t','i','m',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,'t','i','m',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,'0','0','0','0','0','0',' ',0,'0','0','0','0','0','0',' '}; + +static void verify5(struct archive_entry *ae) +{ + assert(S_ISDIR(archive_entry_mode(ae))); + assertEqualInt(archive_entry_mtime(ae), 1131430878); + assertEqualInt(archive_entry_mode(ae) & 0777, 0755); + assertEqualInt(archive_entry_uid(ae), 1000); + assertEqualInt(archive_entry_gid(ae), 1000); + assertEqualString(archive_entry_uname(ae), "tim"); + assertEqualString(archive_entry_gname(ae), "tim"); +} + +/* fifo */ +static unsigned char archive6[] = { +'f','i','f','o',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'0','0', +'0','0','7','5','5',' ','0','0','0','1','7','5','0',' ','0','0','0','1','7', +'5','0',' ','0','0','0','0','0','0','0','0','0','0','0',' ','1','0','6','4', +'6','0','5','4','1','0','1',' ','0','0','1','1','7','2','4',' ','6',0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'u','s','t','a','r',0, +'0','0','t','i','m',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,'t','i','m',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +'0','0','0','0','0','0','0',' ','0','0','0','0','0','0','0',' '}; + +static void verify6(struct archive_entry *ae) +{ + assert(S_ISFIFO(archive_entry_mode(ae))); + assertEqualInt(archive_entry_mode(ae) & 0777, 0755); + assertEqualInt(archive_entry_uid(ae), 1000); + assertEqualInt(archive_entry_gid(ae), 1000); + assertEqualString(archive_entry_uname(ae), "tim"); + assertEqualString(archive_entry_gname(ae), "tim"); + assertEqualString(archive_entry_pathname(ae), "fifo"); + assert(archive_entry_symlink(ae) == NULL); + assert(archive_entry_hardlink(ae) == NULL); + assertEqualInt(archive_entry_mtime(ae), 1184389185); +} + +/* GNU long link name */ +static unsigned char archiveK[] = { +'.','/','.','/','@','L','o','n','g','L','i','n','k',0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,'0','0','0','0','0','0','0',0,'0','0','0','0','0','0','0',0,'0','0','0', +'0','0','0','0',0,'0','0','0','0','0','0','0','0','6','6','6',0,'0','0','0', +'0','0','0','0','0','0','0','0',0,'0','1','1','7','1','5',0,' ','K',0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'u','s','t','a','r',' ',' ', +0,'r','o','o','t',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +'w','h','e','e','l',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'t', +'h','i','s','_','i','s','_','a','_','v','e','r','y','_','l','o','n','g','_', +'s','y','m','l','i','n','k','_','b','o','d','y','_','a','b','c','d','e','f', +'g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y', +'z','_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q', +'r','s','t','u','v','w','x','y','z','_','a','b','c','d','e','f','g','h','i', +'j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','_','a', +'b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t', +'u','v','w','x','y','z','_','a','b','c','d','e','f','g','h','i','j','k','l', +'m','n','o','p','q','r','s','t','u','v','w','x','y','z','_','a','b','c','d', +'e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w', +'x','y','z','_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o', +'p','q','r','s','t','u','v','w','x','y','z','_','a','b','c','d','e','f','g', +'h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z', +'_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r', +'s','t','u','v','w','x','y','z','_','a','b','c','d','e','f','g','h','i','j', +'k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','_','a','b', +'c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u', +'v','w','x','y','z','_','a','b','c','d','e','f','g','h','i','j','k','l','m', +'n','o','p','q','r','s','t','u','v','w','x','y','z','_','a','b','c','d','e', +'f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x', +'y','z','_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p', +'q','r','s','t','u','v','w','x','y','z','_','a','b','c','d','e','f','g','h', +'i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +'s','y','m','l','i','n','k',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'0','1', +'2','0','7','5','5',0,'0','0','0','1','7','5','0',0,'0','0','0','1','7','5', +'0',0,'0','0','0','0','0','0','0','0','0','0','0',0,'1','0','6','4','6','0', +'5','6','7','7','0',0,'0','3','5','4','4','7',0,' ','2','t','h','i','s','_', +'i','s','_','a','_','v','e','r','y','_','l','o','n','g','_','s','y','m','l', +'i','n','k','_','b','o','d','y','_','a','b','c','d','e','f','g','h','i','j', +'k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','_','a','b', +'c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u', +'v','w','x','y','z','_','a','b','c','d','e','f','g','h','i','j','k','l',0, +'u','s','t','a','r',' ',' ',0,'t','i','m',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,'t','i','m'}; + +static void verifyK(struct archive_entry *ae) +{ + assert(S_ISLNK(archive_entry_mode(ae))); + assertEqualInt(archive_entry_mode(ae) & 0777, 0755); + assertEqualInt(archive_entry_uid(ae), 1000); + assertEqualInt(archive_entry_gid(ae), 1000); + assertEqualString(archive_entry_uname(ae), "tim"); + assertEqualString(archive_entry_gname(ae), "tim"); + assertEqualString(archive_entry_pathname(ae), "symlink"); + assertEqualString(archive_entry_symlink(ae), + "this_is_a_very_long_symlink_body_abcdefghijklmnopqrstuvwxyz_" + "abcdefghijklmnopqrstuvwxyz_abcdefghijklmnopqrstuvwxyz_" + "abcdefghijklmnopqrstuvwxyz_abcdefghijklmnopqrstuvwxyz_" + "abcdefghijklmnopqrstuvwxyz_abcdefghijklmnopqrstuvwxyz_" + "abcdefghijklmnopqrstuvwxyz_abcdefghijklmnopqrstuvwxyz_" + "abcdefghijklmnopqrstuvwxyz_abcdefghijklmnopqrstuvwxyz_" + "abcdefghijklmnopqrstuvwxyz_abcdefghijklmnopqrstuvwxyz_" + "abcdefghijklmnopqrstuvwxyz_abcdefghijklmnopqrstuvwxyz"); + assert(archive_entry_hardlink(ae) == NULL); + assertEqualInt(archive_entry_mtime(ae), 1184390648); +} + +/* TODO: GNU long name */ + +/* TODO: Solaris ACL */ + +/* Pax extended long link name */ +static unsigned char archivexL[] = { +'.','/','P','a','x','H','e','a','d','e','r','s','.','8','6','9','7','5','/', +'s','y','m','l','i','n','k',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,'0','0','0','0','6','4','4',0,'0','0','0','1', +'7','5','0',0,'0','0','0','1','7','5','0',0,'0','0','0','0','0','0','0','0', +'7','5','3',0,'1','0','6','4','6','0','5','7','6','1','1',0,'0','1','3','7', +'1','4',0,' ','x',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'u', +'s','t','a','r',0,'0','0',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,'0','0','0','0','0','0','0',0,'0','0','0','0','0','0','0',0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'4','5','1',' ','l','i','n','k','p','a','t', +'h','=','t','h','i','s','_','i','s','_','a','_','v','e','r','y','_','l','o', +'n','g','_','s','y','m','l','i','n','k','_','b','o','d','y','_','a','b','c', +'d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v', +'w','x','y','z','_','a','b','c','d','e','f','g','h','i','j','k','l','m','n', +'o','p','q','r','s','t','u','v','w','x','y','z','_','a','b','c','d','e','f', +'g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y', +'z','_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q', +'r','s','t','u','v','w','x','y','z','_','a','b','c','d','e','f','g','h','i', +'j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','_','a', +'b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t', +'u','v','w','x','y','z','_','a','b','c','d','e','f','g','h','i','j','k','l', +'m','n','o','p','q','r','s','t','u','v','w','x','y','z','_','a','b','c','d', +'e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w', +'x','y','z','_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o', +'p','q','r','s','t','u','v','w','x','y','z','_','a','b','c','d','e','f','g', +'h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z', +'_','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r', +'s','t','u','v','w','x','y','z','_','a','b','c','d','e','f','g','h','i','j', +'k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','_','a','b', +'c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u', +'v','w','x','y','z','_','a','b','c','d','e','f','g','h','i','j','k','l','m', +'n','o','p','q','r','s','t','u','v','w','x','y','z','_','a','b','c','d','e', +'f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x', +'y','z',10,'2','0',' ','a','t','i','m','e','=','1','1','8','4','3','9','1', +'0','2','5',10,'2','0',' ','c','t','i','m','e','=','1','1','8','4','3','9', +'0','6','4','8',10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'s','y','m', +'l','i','n','k',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'0','0','0','0','7', +'5','5',0,'0','0','0','1','7','5','0',0,'0','0','0','1','7','5','0',0,'0', +'0','0','0','0','0','0','0','0','0','0',0,'1','0','6','4','6','0','5','6', +'7','7','0',0,'0','3','7','1','2','1',0,' ','2','t','h','i','s','_','i','s', +'_','a','_','v','e','r','y','_','l','o','n','g','_','s','y','m','l','i','n', +'k','_','b','o','d','y','_','a','b','c','d','e','f','g','h','i','j','k','l', +'m','n','o','p','q','r','s','t','u','v','w','x','y','z','_','a','b','c','d', +'e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w', +'x','y','z','_','a','b','c','d','e','f','g','h','i','j','k','l','m','u','s', +'t','a','r',0,'0','0','t','i','m',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,'t','i','m',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,'0','0','0','0','0','0','0',0,'0','0','0','0','0','0','0'}; + +static void verifyxL(struct archive_entry *ae) +{ + assert(S_ISLNK(archive_entry_mode(ae))); + assertEqualInt(archive_entry_mode(ae) & 0777, 0755); + assertEqualInt(archive_entry_uid(ae), 1000); + assertEqualInt(archive_entry_gid(ae), 1000); + assertEqualString(archive_entry_uname(ae), "tim"); + assertEqualString(archive_entry_gname(ae), "tim"); + assertEqualString(archive_entry_pathname(ae), "symlink"); + assertEqualString(archive_entry_symlink(ae), + "this_is_a_very_long_symlink_body_abcdefghijklmnopqrstuvwxyz_" + "abcdefghijklmnopqrstuvwxyz_abcdefghijklmnopqrstuvwxyz_" + "abcdefghijklmnopqrstuvwxyz_abcdefghijklmnopqrstuvwxyz_" + "abcdefghijklmnopqrstuvwxyz_abcdefghijklmnopqrstuvwxyz_" + "abcdefghijklmnopqrstuvwxyz_abcdefghijklmnopqrstuvwxyz_" + "abcdefghijklmnopqrstuvwxyz_abcdefghijklmnopqrstuvwxyz_" + "abcdefghijklmnopqrstuvwxyz_abcdefghijklmnopqrstuvwxyz_" + "abcdefghijklmnopqrstuvwxyz_abcdefghijklmnopqrstuvwxyz"); + assert(archive_entry_hardlink(ae) == NULL); + assertEqualInt(archive_entry_mtime(ae), 1184390648); +} + + +/* TODO: Any other types of headers? */ + +static void verify(unsigned char *d, size_t s, + void (*f)(struct archive_entry *), + int compression, int format) { struct archive_entry *ae; struct archive *a; + unsigned char *buff = malloc(100000); + + memcpy(buff, d, s); + memset(buff + s, 0, 2048); + assert((a = archive_read_new()) != NULL); assertA(0 == archive_read_support_compression_all(a)); assertA(0 == archive_read_support_format_all(a)); - assertA(0 == archive_read_open_memory(a, archive, sizeof(archive))); + assertA(0 == archive_read_open_memory(a, buff, s + 1024)); assertA(0 == archive_read_next_header(a, &ae)); - assertA(archive_compression(a) == ARCHIVE_COMPRESSION_NONE); - assertA(archive_format(a) == ARCHIVE_FORMAT_TAR_USTAR); + assertEqualInt(archive_compression(a), compression); + assertEqualInt(archive_format(a), format); + + /* Verify the only entry. */ + f(ae); + assert(0 == archive_read_close(a)); #if ARCHIVE_API_VERSION > 1 assert(0 == archive_read_finish(a)); #else archive_read_finish(a); #endif + free(buff); +} + +DEFINE_TEST(test_read_format_tar) +{ + verify(archive1, sizeof(archive1), verify1, + ARCHIVE_COMPRESSION_NONE, ARCHIVE_FORMAT_TAR_USTAR); + verify(archive2, sizeof(archive2), verify2, + ARCHIVE_COMPRESSION_NONE, ARCHIVE_FORMAT_TAR_USTAR); + verify(archive3, sizeof(archive3), verify3, + ARCHIVE_COMPRESSION_NONE, ARCHIVE_FORMAT_TAR_USTAR); + verify(archive4, sizeof(archive4), verify4, + ARCHIVE_COMPRESSION_NONE, ARCHIVE_FORMAT_TAR_USTAR); + verify(archive5, sizeof(archive5), verify5, + ARCHIVE_COMPRESSION_NONE, ARCHIVE_FORMAT_TAR_USTAR); + verify(archive6, sizeof(archive6), verify6, + ARCHIVE_COMPRESSION_NONE, ARCHIVE_FORMAT_TAR_USTAR); + verify(archiveK, sizeof(archiveK), verifyK, + ARCHIVE_COMPRESSION_NONE, ARCHIVE_FORMAT_TAR_GNUTAR); + verify(archivexL, sizeof(archivexL), verifyxL, + ARCHIVE_COMPRESSION_NONE, ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE); } diff --git a/archivers/libarchive/files/libarchive/test/test_tar_filenames.c b/archivers/libarchive/files/libarchive/test/test_tar_filenames.c index 27c8db4e33d..b75ac7f0cae 100644 --- a/archivers/libarchive/files/libarchive/test/test_tar_filenames.c +++ b/archivers/libarchive/files/libarchive/test/test_tar_filenames.c @@ -23,7 +23,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "test.h" -__FBSDID("$FreeBSD: src/lib/libarchive/test/test_tar_filenames.c,v 1.6 2007/07/06 15:43:11 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/test/test_tar_filenames.c,v 1.7 2007/07/14 17:52:01 kientzle Exp $"); /* * Exercise various lengths of filenames in tar archives, @@ -42,9 +42,6 @@ test_filename(const char *prefix, int dlen, int flen) size_t used; size_t prefix_length = 0; int i = 0; -#if ARCHIVE_VERSION_STAMP < 1009000 - static int bug_reported_1 = 0, bug_reported_2 = 0, bug_reported_3 = 0; -#endif if (prefix) { strcpy(filename, prefix); @@ -118,10 +115,7 @@ test_filename(const char *prefix, int dlen, int flen) /* Read the file and check the filename. */ assertA(0 == archive_read_next_header(a, &ae)); #if ARCHIVE_VERSION_STAMP < 1009000 - if (!bug_reported_3) { - skipping("Leading '/' preserved on long filenames"); - ++bug_reported_3; - } + skipping("Leading '/' preserved on long filenames"); #else assertEqualString(filename, archive_entry_pathname(ae)); #endif @@ -137,10 +131,7 @@ test_filename(const char *prefix, int dlen, int flen) */ assertA(0 == archive_read_next_header(a, &ae)); #if ARCHIVE_VERSION_STAMP < 1009000 - if (!bug_reported_2) { - skipping("Trailing '/' preserved on dirnames"); - ++bug_reported_2; - } + skipping("Trailing '/' preserved on dirnames"); #else assertEqualString(dirname, archive_entry_pathname(ae)); #endif @@ -148,10 +139,7 @@ test_filename(const char *prefix, int dlen, int flen) assertA(0 == archive_read_next_header(a, &ae)); #if ARCHIVE_VERSION_STAMP < 1009000 - if (!bug_reported_1) { - skipping("Trailing '/' added to dir names"); - ++bug_reported_1; - } + skipping("Trailing '/' added to dir names"); #else assertEqualString(dirname, archive_entry_pathname(ae)); #endif diff --git a/archivers/libarchive/files/libarchive/test/test_write_disk_perms.c b/archivers/libarchive/files/libarchive/test/test_write_disk_perms.c index 36cd34581a4..cffe39fe868 100644 --- a/archivers/libarchive/files/libarchive/test/test_write_disk_perms.c +++ b/archivers/libarchive/files/libarchive/test/test_write_disk_perms.c @@ -23,7 +23,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "test.h" -__FBSDID("$FreeBSD: src/lib/libarchive/test/test_write_disk_perms.c,v 1.5 2007/07/06 15:43:11 kientzle Exp $"); +__FBSDID("$FreeBSD: src/lib/libarchive/test/test_write_disk_perms.c,v 1.6 2007/07/15 17:16:42 kientzle Exp $"); #if ARCHIVE_VERSION_STAMP >= 1009000 @@ -235,7 +235,7 @@ DEFINE_TEST(test_write_disk_perms) archive_entry_set_uid(ae, getuid() + 1); archive_write_disk_set_options(a, ARCHIVE_EXTRACT_PERM); assertA(0 == archive_write_header(a, ae)); - assertA(ARCHIVE_WARN == archive_write_finish_entry(a)); + assertEqualInt(ARCHIVE_WARN, archive_write_finish_entry(a)); /* Write a regular file with ARCHIVE_EXTRACT_PERM & SGID bit */ assert(archive_entry_clear(ae) != NULL); diff --git a/archivers/libarchive/files/tar/bsdtar.c b/archivers/libarchive/files/tar/bsdtar.c index f511b861c34..4f6d3c2aef2 100644 --- a/archivers/libarchive/files/tar/bsdtar.c +++ b/archivers/libarchive/files/tar/bsdtar.c @@ -78,6 +78,14 @@ struct option { #include "bsdtar.h" +#if !HAVE_DECL_OPTARG +extern int optarg; +#endif + +#if !HAVE_DECL_OPTIND +extern int optind; +#endif + /* * Per POSIX.1-1988, tar defaults to reading/writing archives to/from * the default tape device for the system. Pick something reasonable here. @@ -911,6 +919,10 @@ bsdtar_getopt(struct bsdtar *bsdtar, const char *optstring, "(matches both %s and %s)", p, (*poption)->name, option->name); + if ((*poption)->has_arg == required_argument + && optarg == NULL) + bsdtar_errc(bsdtar, 1, 0, + "Option \"%s\" requires argument", p); } else { opt = '?'; /* TODO: Set up a fake 'struct option' for diff --git a/archivers/libarchive/files/tar/getdate.c b/archivers/libarchive/files/tar/getdate.c index 8b0609575f1..895320bd670 100644 --- a/archivers/libarchive/files/tar/getdate.c +++ b/archivers/libarchive/files/tar/getdate.c @@ -113,7 +113,7 @@ #ifdef __FreeBSD__ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/usr.bin/tar/getdate.y,v 1.8 2007/03/11 10:36:42 kientzle Exp $"); +__FBSDID("$FreeBSD: src/usr.bin/tar/getdate.y,v 1.9 2007/07/20 01:27:50 kientzle Exp $"); #endif #include <ctype.h> @@ -2142,7 +2142,7 @@ yylex(void) char buff[64]; for ( ; ; ) { - while (isspace(*yyInput)) + while (isspace((unsigned char)*yyInput)) yyInput++; /* Skip parenthesized comments. */ @@ -2169,11 +2169,11 @@ yylex(void) /* Force to lowercase and strip '.' characters. */ while (*src != '\0' - && (isalnum(*src) || *src == '.') + && (isalnum((unsigned char)*src) || *src == '.') && i < sizeof(buff)-1) { if (*src != '.') { - if (isupper(*src)) - buff[i++] = tolower(*src); + if (isupper((unsigned char)*src)) + buff[i++] = tolower((unsigned char)*src); else buff[i++] = *src; } @@ -2207,8 +2207,8 @@ yylex(void) * Because '-' and '+' have other special meanings, I * don't deal with signed numbers here. */ - if (isdigit(c = *yyInput)) { - for (yylval.Number = 0; isdigit(c = *yyInput++); ) + if (isdigit((unsigned char)(c = *yyInput))) { + for (yylval.Number = 0; isdigit((unsigned char)(c = *yyInput++)); ) yylval.Number = 10 * yylval.Number + c - '0'; yyInput--; return (tUNUMBER); diff --git a/archivers/libarchive/files/tar/getdate.y b/archivers/libarchive/files/tar/getdate.y index 84348f8d3f1..3253f6d68ac 100644 --- a/archivers/libarchive/files/tar/getdate.y +++ b/archivers/libarchive/files/tar/getdate.y @@ -26,7 +26,7 @@ #ifdef __FreeBSD__ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/usr.bin/tar/getdate.y,v 1.8 2007/03/11 10:36:42 kientzle Exp $"); +__FBSDID("$FreeBSD: src/usr.bin/tar/getdate.y,v 1.9 2007/07/20 01:27:50 kientzle Exp $"); #endif #include <ctype.h> @@ -611,7 +611,7 @@ yylex(void) char buff[64]; for ( ; ; ) { - while (isspace(*yyInput)) + while (isspace((unsigned char)*yyInput)) yyInput++; /* Skip parenthesized comments. */ @@ -638,11 +638,11 @@ yylex(void) /* Force to lowercase and strip '.' characters. */ while (*src != '\0' - && (isalnum(*src) || *src == '.') + && (isalnum((unsigned char)*src) || *src == '.') && i < sizeof(buff)-1) { if (*src != '.') { - if (isupper(*src)) - buff[i++] = tolower(*src); + if (isupper((unsigned char)*src)) + buff[i++] = tolower((unsigned char)*src); else buff[i++] = *src; } @@ -676,8 +676,8 @@ yylex(void) * Because '-' and '+' have other special meanings, I * don't deal with signed numbers here. */ - if (isdigit(c = *yyInput)) { - for (yylval.Number = 0; isdigit(c = *yyInput++); ) + if (isdigit((unsigned char)(c = *yyInput))) { + for (yylval.Number = 0; isdigit((unsigned char)(c = *yyInput++)); ) yylval.Number = 10 * yylval.Number + c - '0'; yyInput--; return (tUNUMBER); diff --git a/archivers/libarchive/files/tar/read.c b/archivers/libarchive/files/tar/read.c index 4eb2a86c29c..b52c1ee0d54 100644 --- a/archivers/libarchive/files/tar/read.c +++ b/archivers/libarchive/files/tar/read.c @@ -24,7 +24,7 @@ */ #include "bsdtar_platform.h" -__FBSDID("$FreeBSD: src/usr.bin/tar/read.c,v 1.33 2007/05/29 05:39:10 kientzle Exp $"); +__FBSDID("$FreeBSD: src/usr.bin/tar/read.c,v 1.34 2007/07/20 01:24:49 kientzle Exp $"); #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> @@ -129,15 +129,15 @@ read_archive(struct bsdtar *bsdtar, char mode) break; if (r < ARCHIVE_OK) bsdtar_warnc(bsdtar, 0, "%s", archive_error_string(a)); + if (r <= ARCHIVE_WARN) + bsdtar->return_value = 1; if (r == ARCHIVE_RETRY) { /* Retryable error: try again */ bsdtar_warnc(bsdtar, 0, "Retrying..."); continue; } - if (r != ARCHIVE_OK) { - bsdtar->return_value = 1; + if (r == ARCHIVE_FATAL) break; - } /* * Exclude entries that are too old. diff --git a/archivers/libarchive/files/version b/archivers/libarchive/files/version index ecf00d9019d..1506473e24c 100644 --- a/archivers/libarchive/files/version +++ b/archivers/libarchive/files/version @@ -1 +1 @@ -2.2.5
\ No newline at end of file +2.2.6
\ No newline at end of file |