diff options
66 files changed, 766 insertions, 459 deletions
diff --git a/Makefile.am b/Makefile.am index 824b888..ab276bf 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,5 @@ # This file is part of GNU cpio -# Copyright (C) 2003-2004, 2007, 2009-2010, 2014-2015, 2017, 2020-2021 -# Free Software Foundation, Inc. +# Copyright (C) 2003-2024 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -1,11 +1,45 @@ -GNU cpio NEWS -- history of user-visible changes. 2021-01-08 -Copyright (C) 2003-2007, 2009-2010, 2014-2015, 2017, 2020-2021 Free -Software Foundation, Inc. +GNU cpio NEWS -- history of user-visible changes. 2024-01-14 +Copyright (C) 2003-2024 Free Software Foundation, Inc. See the end of file for copying conditions. Please send cpio bug reports to <bug-cpio@gnu.org>. -Version 2.13.90 (git) +Version 2.15 - Sergey Poznyakoff, 2024-01-14 + +* Fix operation of --no-absolute-filenames --make-directories +* Restore access and modification times of symlinks in copy-in + and copy-pass modes. + + +Version 2.14 - Sergey Poznyakoff, 2023-05-01 + +* New option --ignore-dirnlink + +Valid in copy-out mode, it instructs cpio to ignore the actual number +of links reported for each directory member and always store 2 +instead. + +* Changes in --reproducible option + +The --reproducible option implies --ignore-dirlink. In other words, +it is equivalent to --ignore-devno --ignore-dirnlink --renumber-inodes. + +* Use GNU ls algorithm for deciding timestamp format in -tv mode + +* Bugfixes + +** Fix cpio header verification. + +** Fix handling of device numbers on copy out. + +** Fix calculation of CRC in copy-out mode. + +** Rewrite the fix for CVE-2015-1197. + +** Fix combination of --create --append --directory. + +** Fix appending to archives bigger than 2G. + Version 2.13 - Sergey Poznyakoff, 2019-11-06 @@ -27,7 +61,7 @@ number. Renumber inodes when storing them in the archive. ** --device-independent or --reproducible -Create reproducible archives. This is equivalent to +Create reproducible archives. This is equivalent to --ignore-devno --renumber-inodes. Version 2.11 - Sergey Poznyakoff, 2010-03-10 @@ -109,7 +143,7 @@ default. See below. * New option --to-stdout extracts files to standard output. * The output of `cpio --help' is largely improved. - + * Bugfixes: ** If a file grew n bytes in copy-pass mode, these n bytes got prepended to the contents of all subsequent files. @@ -135,7 +169,7 @@ Major changes in version 2.3: * in newc and crc format archives, only store 1 copy of multiply linked files * handle multiply linked devices properly -* handle multiply linked files with cpio -pl even when the source and +* handle multiply linked files with cpio -pl even when the source and destination are on different file systems * support HPUX Context Dependent Files * read and write HPUX cpio archives @@ -36,8 +36,7 @@ Please send bug reports and suggestions to <bug-cpio@gnu.org>. * Copyright information -Copyright (C) 2003-2007, 2009-2010, 2014-2015, 2017, 2020-2021 Free -Software Foundation, Inc. +Copyright (C) 2003-2024 Free Software Foundation, Inc. Permission is granted to anyone to make or distribute verbatim copies of this document as received, in any medium, provided that the diff --git a/README-alpha b/README-alpha index 5394930..986b1bc 100644 --- a/README-alpha +++ b/README-alpha @@ -41,8 +41,7 @@ See INSTALL and README for the detailed instructions. * Copyright information: -Copyright (C) 2004, 2006-2007, 2009-2010, 2014-2015, 2017, 2020-2021 -Free Software Foundation, Inc. +Copyright (C) 2004-2024 Free Software Foundation, Inc. This file is part of GNU cpio. diff --git a/README-hacking b/README-hacking index 663416a..f238961 100644 --- a/README-hacking +++ b/README-hacking @@ -39,8 +39,7 @@ See 'bootstrap --help' for a detailed list. * Copyright information - Copyright (C) 2007-2010, 2014-2015, 2017, 2020-2021 Free Software - Foundation, Inc. + Copyright (C) 2007-2024 Free Software Foundation, Inc. Permission is granted to anyone to make or distribute verbatim copies of this document as received, in any medium, provided that the @@ -1,5 +1,5 @@ # This file is part of GNU cpio -# Copyright (C) 2009 Free Software Foundation +# Copyright (C) 2009-2023 Free Software Foundation # # GNU cpio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,21 +19,22 @@ AC_DEFUN([CPIO_PACKED_STRUCTS],[ dnl check for __attribute__((packed)) AC_MSG_CHECKING([for structure packing via __attribute__((packed))]) AC_CACHE_VAL(cpio_cv_have_attrib_packed,[ - AC_TRY_COMPILE(, - [struct { int i __attribute__((packed)); } s; ], - [have_attrib_packed=yes], - [have_attrib_packed=no]) + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([], + [[struct { int i __attribute__((packed)); } s;]])], + [have_attrib_packed=yes], + [have_attrib_packed=no]) ]) AC_MSG_RESULT($have_attrib_packed) if test "$have_attrib_packed" = no; then AC_MSG_CHECKING(for structure packing via pragma) AC_CACHE_VAL(cpio_cv_have_pragma_pack,[ - AC_TRY_RUN(CPIO_FLUSHLEFT([ - int main(int argc, char **argv) { + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[int main(int argc, char **argv) { #pragma pack(1) struct { char c; long l; } s; - return sizeof(s)==sizeof(s.c)+sizeof(s.l) ? 0:1; } ]), + return sizeof(s)==sizeof(s.c)+sizeof(s.l) ? 0:1; }]])], [have_pragma_pack=yes], [have_pragma_pack=no]) ]) @@ -43,12 +44,12 @@ AC_DEFUN([CPIO_PACKED_STRUCTS],[ else AC_MSG_CHECKING(for structure packing via hppa/hp-ux pragma) AC_CACHE_VAL(cpio_cv_have_pragma_pack_hpux,[ - AC_TRY_RUN(CPIO_FLUSHLEFT([ - /* hppa/hp-ux wants pragma outside of function */ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[/* hppa/hp-ux wants pragma outside of function */ #pragma pack 1 struct { char c; long l; } s; int main(int argc, char **argv) { - return sizeof(s)==sizeof(s.c)+sizeof(s.l) ? 0:1; } ]), + return sizeof(s)==sizeof(s.c)+sizeof(s.l) ? 0:1; } ]])], [have_pragma_pack_hpux=yes], [have_pragma_pack_hpux=no]) ]) @@ -4,8 +4,7 @@ scriptversion=2015-08-24.08; # UTC # Bootstrap this package from checked-out sources. -# Copyright (C) 2003-2015, 2017, 2020-2021 Free Software Foundation, -# Inc. +# Copyright (C) 2003-2024 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/bootstrap.conf b/bootstrap.conf index c1cf6a0..7b814fc 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -1,7 +1,6 @@ # Bootstrap configuration. -# Copyright (C) 2006-2007, 2009-2010, 2014-2015, 2017, 2020-2021 Free -# Software Foundation, Inc. +# Copyright (C) 2006-2024 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/configure.ac b/configure.ac index 0a35e4c..93c3d46 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. dnl This file is part of GNU cpio -dnl Copyright (C) 2003-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2003-2024 Free Software Foundation, Inc. dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by @@ -15,13 +15,13 @@ dnl dnl You should have received a copy of the GNU General Public License dnl along with this program. If not, see <http://www.gnu.org/licenses/>. -AC_INIT([GNU cpio], [2.13.90], [bug-cpio@gnu.org],, - [http://www.gnu.org/software/cpio]) +AC_INIT([GNU cpio], [2.15], [bug-cpio@gnu.org],, + [http://www.gnu.org/software/cpio]) AC_CONFIG_SRCDIR(src/cpio.h) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_HEADERS([config.h]) -AC_PREREQ([2.64]) -AM_INIT_AUTOMAKE([1.15 gnits tar-ustar dist-bzip2 std-options silent-rules]) +AC_PREREQ([2.71]) +AM_INIT_AUTOMAKE([1.16.5 gnits tar-ustar dist-bzip2 std-options silent-rules]) # Enable silent rules by default: AM_SILENT_RULES([yes]) @@ -37,16 +37,28 @@ gl_EARLY AC_C_PROTOTYPES AC_SYS_LARGEFILE - -AC_TYPE_SIGNAL AC_HEADER_MAJOR AC_C_CONST AC_TYPE_UID_T AC_CHECK_TYPE(gid_t, int) -AC_HEADER_STDC + AC_HEADER_DIRENT -AC_COMPILE_CHECK_RETTYPE([major], [0]) -AC_COMPILE_CHECK_RETTYPE([minor], [0]) +AX_COMPILE_CHECK_RETTYPE([major], [0], [ +#include <sys/types.h> +#ifdef MAJOR_IN_MKDEV +# include <sys/mkdev.h> +#endif +#ifdef MAJOR_IN_SYSMACROS +# include <sys/sysmacros.h> +#endif]) +AX_COMPILE_CHECK_RETTYPE([minor], [0], [ +#include <sys/types.h> +#ifdef MAJOR_IN_MKDEV +# include <sys/mkdev.h> +#endif +#ifdef MAJOR_IN_SYSMACROS +# include <sys/sysmacros.h> +#endif]) AC_CHECK_FUNCS([fchmod fchown]) # This is needed for mingw build @@ -63,7 +75,7 @@ CPIO_PACKED_STRUCTS CPIO_DEFAULT_QUOTING_STYLE(escape) AC_ARG_ENABLE(mt, - AC_HELP_STRING([--enable-mt], [Enable building of mt program])) + AS_HELP_STRING([--enable-mt],[Enable building of mt program])) AM_CONDITIONAL([CPIO_MT_COND], [test "$enable_mt" = yes]) diff --git a/doc/Makefile.am b/doc/Makefile.am index 61146b5..1d8dfa9 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,6 +1,5 @@ # This file is part of GNU cpio -# Copyright (C) 2004, 2007, 2010, 2014-2015, 2017, 2020-2021 Free -# Software Foundation, Inc. +# Copyright (C) 2004-2024 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -1,5 +1,5 @@ .\" This file is part of GNU cpio. -*- nroff -*- -.\" Copyright 2014-2018, 2020-2021 Free Software Foundation, Inc. +.\" Copyright 2014-2024 Free Software Foundation, Inc. .\" .\" GNU cpio is free software; you can redistribute it and/or modify .\" it under the terms of the GNU General Public License as published by @@ -13,7 +13,7 @@ .\" .\" You should have received a copy of the GNU General Public License .\" along with GNU cpio. If not, see <http://www.gnu.org/licenses/>. -.TH CPIO 1 "September 18, 2020" "CPIO" "GNU CPIO" +.TH CPIO 1 "April 29, 2023" "CPIO" "GNU CPIO" .SH NAME cpio \- copy files to and from archives .SH SYNOPSIS @@ -45,7 +45,7 @@ cpio \- copy files to and from archives [\fB\-\-verbose\fR] [\fB\-\-block\-size=\fIBLOCKS\fR] [\fB\-\-swap\-halfwords\fR] [\fB\-\-io\-size=\fIBYTES\fR] [\fB\-\-pattern\-file=\fIFILE\fR] [\fB\-\-format=\fIFORMAT\fR] -[\fB\-\-owner=\fR[\fIUSER][\fB:.\fR][\fIGROUP\fR]] +[\fB\-\-owner=\fR[\fIUSER\fR][\fB:.\fR][\fIGROUP\fR]] [\fB\-\-no\-preserve\-owner\fR] [\fB\-\-message=\fIMESSAGE\fR] [\fB\-\-force\-local\fR] [\fB\-\-no\-absolute\-filenames\fR] [\fB\-\-sparse\fR] [\fB\-\-only\-verify\-crc\fR] [\fB\-\-to\-stdout\fR] [\fB\-\-quiet\fR] @@ -108,7 +108,7 @@ supplied with the \fB\-\-file\fR option) and extract files from it, or (if the \fB\-t\fR option is given) list its contents to the standard output. If one or more \fIpattern\fRs are supplied, read or list only files matching these patterns. The \fB\-t\fR option alone implies -\fB\-i\fR. +\fB\-i\fR. .TP .BR \-p ", " \-\-pass\-through Pass-through. Read a list of file names from the standard input and @@ -229,7 +229,7 @@ Print \fISTRING\fR when the end of a volume of the backup media is reached. .TP .BR \-b ", " \-\-swap Swap both halfwords of words and bytes of halfwords in the data. -Equivalent to \fB\-sS\fR. +Equivalent to \fB\-sS\fR. .TP .BR \-f ", " \-\-nonmatching Only copy files that do not match any of the given patterns. @@ -264,12 +264,18 @@ Append to an existing archive. .TP .BR \-\-device\-independent ", " \-\-reproducible Create reproducible archives. This is equivalent to -.BR "\-\-ignore\-devno \-\-renumber\-inodes" . +.BR "\-\-ignore\-devno \-\-ignore\-dirnlink \-\-renumber\-inodes" . .TP .B \-\-ignore\-devno Store 0 in the device number field of each archive member, instead of the actual device number. .TP +.B \-\-ignore\-dirnlink +Store 2 in the +.I nlink +field of each directory archive member, +instead of the actual number of links. +.TP \fB\-O\fR [[\fIUSER\fB@\fR]\fIHOST\fB:\fR]\fIARCHIVE-NAME\fR Use \fIARCHIVE-NAME\fR instead of standard output. Optional \fIUSER\fR and \fIHOST\fR specify the user and host names in case of a remote @@ -300,13 +306,13 @@ newlines. .TP .BR \-a ", " \-\-reset\-access\-time Reset the access times of files after reading them. -.TP +.TP \fB\-I\fR [[\fIUSER\fB@\fR]\fIHOST\fB:\fR]\fIARCHIVE-NAME\fR Use \fIARCHIVE-NAME\fR instead of standard input. Optional \fIUSER\fR and \fIHOST\fR specify the user and host names in case of a remote archive. -The input archive name can be specified wither using this option, or +The input archive name can be specified either using this option, or using \fB\-F\fR (\fB\-\-file\fR), but not both. .TP .BR \-L ", " \-\-dereference @@ -338,7 +344,7 @@ complete the requested operation. On errors, it exits with code \fB2\fR. .SH "BUG REPORTS" Report bugs to <bug\-cpio@gnu.org>. .SH COPYRIGHT -Copyright \(co 2014 Free Software Foundation, Inc. +Copyright \(co 2014--2023 Free Software Foundation, Inc. .br .na License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> @@ -353,4 +359,3 @@ There is NO WARRANTY, to the extent permitted by law. .\" time-stamp-end: "\"" .\" time-stamp-line-limit: 20 .\" end: - diff --git a/doc/cpio.texi b/doc/cpio.texi index f528d74..6683806 100644 --- a/doc/cpio.texi +++ b/doc/cpio.texi @@ -15,8 +15,7 @@ @copying This manual documents GNU cpio (version @value{VERSION}, @value{UPDATED}). -Copyright @copyright{} 1995, 2001--2002, 2004, 2010, 2014--2015, 2017, -2020--2021 Free Software Foundation, Inc. +Copyright @copyright{} 1995--2024 Free Software Foundation, Inc. @sp 1 @quotation Permission is granted to copy, distribute and/or modify this document @@ -476,7 +475,7 @@ Create leading directories where needed. @item --device-independent @itemx --reproducible Create reproducible archives. This is equivalent to -@option{--ignore-devno --renumber-inodes}. +@option{--ignore-devno --ignore-dirnlink --renumber-inodes}. @item -D @var{dir} @itemx --directory=@var{dir} Change to directory @var{dir} @@ -502,6 +501,9 @@ formats. @item --ignore-devno Store 0 in the device number field of each archive member, instead of the actual device number. +@item --ignore-dirnlink +Store 2 in the @code{nlink} field of each directory archive member, +instead of the actual number of links. @item -l @itemx --link Link files instead of copying them, when possible. diff --git a/doc/gendocs.sh b/doc/gendocs.sh index 0828905..42557a1 100755 --- a/doc/gendocs.sh +++ b/doc/gendocs.sh @@ -4,7 +4,7 @@ scriptversion=2021-03-01.13 -# Copyright 2003-2021 Free Software Foundation, Inc. +# Copyright 2003-2024 Free Software Foundation, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/doc/gendocs_template b/doc/gendocs_template index cd9ac38..d98eec3 100755 --- a/doc/gendocs_template +++ b/doc/gendocs_template @@ -2,7 +2,7 @@ <!-- Parent-Version: 1.78 --> <!-- -Copyright (C) 2006-2021 Free Software Foundation, Inc. +Copyright (C) 2006-2024 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright @@ -1,5 +1,5 @@ .\" This file is part of GNU cpio. -*- nroff -*- -.\" Copyright 2014-2015, 2017, 2020-2021 Free Software Foundation, Inc. +.\" Copyright 2014-2024 Free Software Foundation, Inc. .\" .\" GNU cpio is free software; you can redistribute it and/or modify .\" it under the terms of the GNU General Public License as published by diff --git a/gnulib b/gnulib -Subproject bdae9a5d4b2cedfaef23f8c55982ba5432dd69e +Subproject 29d705ead11382c8d608dcc254394439cb43b9b diff --git a/gnulib.modules b/gnulib.modules index 15037a0..701abf9 100644 --- a/gnulib.modules +++ b/gnulib.modules @@ -7,11 +7,13 @@ argp argp-version-etc dirname error +fdutimensat fileblocks fnmatch-gnu full-write getline gettext-h +gettime gitlog-to-changelog hash inttostr @@ -24,8 +26,8 @@ stdbool stdint stpcpy strerror +timespec unlocked-io -utimens xalloc xalloc-die xgetcwd diff --git a/lib/Makefile.am b/lib/Makefile.am index 88f76ba..b255451 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -1,7 +1,6 @@ # Makefile for GNU tar library. -*- Makefile -*- -# Copyright (C) 1994-1997, 1999-2001, 2003-2007, 2009-2010, 2014-2015, -# 2017, 2020-2021 Free Software Foundation, Inc. +# Copyright (C) 1994-2024 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -1,7 +1,6 @@ /* System dependent functions for GNU cpio. - Copyright (C) 2007, 2010, 2014-2015, 2017, 2020-2021 Free Software - Foundation, Inc. + Copyright (C) 2007-2024 Free Software Foundation, Inc. GNU cpio is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/paxutils b/paxutils -Subproject 45af1632aa64a5ba1b108e248920e67c180e848 +Subproject 9ad2a83e9c8de70d83dbe956c144be51f66a9ab diff --git a/po/POTFILES.in b/po/POTFILES.in index e1e474e..51d7618 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -1,7 +1,6 @@ # List of files which contain translatable strings. -# Copyright (C) 2008-2010, 2014-2015, 2017, 2020-2021 Free Software -# Foundation, Inc. +# Copyright (C) 2008-2024 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/src/Makefile.am b/src/Makefile.am index 42df8e2..739cb83 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,6 +1,5 @@ # This file is part of GNU cpio -# Copyright (C) 2003-2004, 2007, 2009-2010, 2014-2015, 2017, 2020-2021 -# Free Software Foundation, Inc. +# Copyright (C) 2003-2024 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/src/copyin.c b/src/copyin.c index 4fb14af..ace0a02 100644 --- a/src/copyin.c +++ b/src/copyin.c @@ -1,6 +1,5 @@ /* copyin.c - extract or list a cpio archive - Copyright (C) 1990-1992, 2001-2007, 2009-2010, 2014-2015, 2017, - 2020-2021 Free Software Foundation, Inc. + Copyright (C) 1990-2024 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -31,10 +30,12 @@ #ifndef FNM_PATHNAME # include <fnmatch.h> #endif +#include <hash.h> #ifndef HAVE_LCHOWN # define lchown(f,u,g) 0 #endif +#include <timespec.h> static void copyin_regular_file(struct cpio_file_stat* file_hdr, int in_file_des); |