Compare commits
58 Commits
release_1_
...
release_1_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
44cfdfb8b6 | ||
|
|
97d8951536 | ||
|
|
bf5d66109c | ||
|
|
bd1b0fc97c | ||
|
|
a7289daf5c | ||
|
|
72506bddee | ||
|
|
a311b908c0 | ||
|
|
cb07844454 | ||
|
|
2f5a57be4b | ||
|
|
3da8c2850d | ||
|
|
c697d62598 | ||
|
|
b0930da045 | ||
|
|
f86722c34c | ||
|
|
aa0684ce90 | ||
|
|
85c005ee13 | ||
|
|
2684c88a49 | ||
|
|
1ed62596cf | ||
|
|
9d1993f651 | ||
|
|
e7cd377f78 | ||
|
|
c15c42ccd1 | ||
|
|
3c2a2cd94d | ||
|
|
ea3aea06f1 | ||
|
|
983a82a376 | ||
|
|
916fe62ae9 | ||
|
|
99d415e190 | ||
|
|
c7c59b57fa | ||
|
|
eae48289c0 | ||
|
|
62c0c3a780 | ||
|
|
ba472050da | ||
|
|
f6e2860e8a | ||
|
|
2777a2bfd9 | ||
|
|
9fc1cb40f9 | ||
|
|
6238296458 | ||
|
|
9042dfc4b1 | ||
|
|
016d6d27d1 | ||
|
|
e54741745c | ||
|
|
110e3bd7a6 | ||
|
|
c1b569d9d6 | ||
|
|
577dc34565 | ||
|
|
c7b3f0217f | ||
|
|
e81c89ddd6 | ||
|
|
07b0026e5d | ||
|
|
b531801d6f | ||
|
|
f563b896cc | ||
|
|
c90c6fee01 | ||
|
|
0a0242582f | ||
|
|
2baa531ce5 | ||
|
|
ccef8581b8 | ||
|
|
2d00d8b321 | ||
|
|
e8c3f4860d | ||
|
|
00f03498a9 | ||
|
|
688924d2a8 | ||
|
|
3d45373d3b | ||
|
|
64b43fdf70 | ||
|
|
7b8efcc7cb | ||
|
|
c13401c0a7 | ||
|
|
847a36f064 | ||
|
|
2b7fc4aee9 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -8,6 +8,7 @@
|
||||
.deps
|
||||
.emacs*
|
||||
.libs
|
||||
.gdbinit
|
||||
ABOUT-NLS
|
||||
ChangeLog
|
||||
INSTALL
|
||||
@@ -28,3 +29,4 @@ libtool
|
||||
m4
|
||||
rmt
|
||||
stamp-h1
|
||||
TAGS
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
# Main Makefile for GNU tar.
|
||||
|
||||
# Copyright 1994-1997, 1999-2001, 2003, 2007, 2009, 2013-2014, 2016-2017
|
||||
# Free Software Foundation, Inc.
|
||||
# Copyright 1994-2019 Free Software Foundation, Inc.
|
||||
|
||||
# This file is part of GNU tar.
|
||||
|
||||
|
||||
52
NEWS
52
NEWS
@@ -1,6 +1,52 @@
|
||||
GNU tar NEWS - User visible changes. 2017-12-17
|
||||
GNU tar NEWS - User visible changes. 2019-02-23
|
||||
Please send GNU tar bug reports to <bug-tar@gnu.org>
|
||||
|
||||
|
||||
version 1.32 - Sergey Poznyakoff, 2019-02-23
|
||||
|
||||
* Fix the use of --checkpoint without explicit --checkpoint-action
|
||||
|
||||
* Fix extraction with the -U option
|
||||
|
||||
See http://lists.gnu.org/archive/html/bug-tar/2019-01/msg00015.html,
|
||||
for details
|
||||
|
||||
* Fix iconv usage on BSD-based systems
|
||||
|
||||
* Fix possible NULL dereference (savannah bug #55369)
|
||||
|
||||
* Improve the testsuite
|
||||
|
||||
|
||||
version 1.31 - Sergey Poznyakoff, 2019-01-02
|
||||
|
||||
* Fix heap-buffer-overrun with --one-top-level.
|
||||
Bug introduced with the addition of that option in 1.28.
|
||||
|
||||
* Support for zstd compression
|
||||
|
||||
New option '--zstd' instructs tar to use zstd as compression program.
|
||||
When listing, extractng and comparing, zstd compressed archives are
|
||||
recognized automatically.
|
||||
When '-a' option is in effect, zstd compression is selected if the
|
||||
destination archive name ends in '.zst' or '.tzst'.
|
||||
|
||||
* The -K option interacts properly with member names given in the command line
|
||||
|
||||
Names of members to extract can be specified along with the "-K NAME"
|
||||
option. In this case, tar will extract NAME and those of named members
|
||||
that appear in the archive after it, which is consistent with the
|
||||
semantics of the option.
|
||||
|
||||
Previous versions of tar extracted NAME, those of named members that
|
||||
appeared before it, and everything after it.
|
||||
|
||||
* Fix CVE-2018-20482
|
||||
|
||||
When creating archives with the --sparse option, previous versions of
|
||||
tar would loop endlessly if a sparse file had been truncated while
|
||||
being archived.
|
||||
|
||||
|
||||
version 1.30 - Sergey Poznyakoff, 2017-12-17
|
||||
|
||||
@@ -42,7 +88,7 @@ causing subsequent link extractions in that directory to fail.
|
||||
|
||||
This new warning control option suppresses warning messages about
|
||||
unreadable files and directories. It has effect only if used together
|
||||
with the --ignore-failed-read option.
|
||||
with the --ignore-failed-read option.
|
||||
|
||||
* The --warnings=none option now suppresses all warnings
|
||||
|
||||
@@ -1641,7 +1687,7 @@ Versions 1.07 back to 1.00 by Jay Fenlason.
|
||||
|
||||
|
||||
|
||||
Copyright 1994-2001, 2003-2010, 2013-2017 Free Software Foundation, Inc.
|
||||
Copyright 1994-2019 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU tar.
|
||||
|
||||
|
||||
3
README
3
README
@@ -221,8 +221,7 @@ and share your findings by writing to <bug-tar@gnu.org>.
|
||||
|
||||
* Copying
|
||||
|
||||
Copyright 1990-1992, 1994, 1997-2001, 2003-2004, 2007, 2012-2014,
|
||||
2016-2017 Free Software Foundation, Inc.
|
||||
Copyright 1990-2019 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU tar.
|
||||
|
||||
|
||||
@@ -35,8 +35,7 @@ behavior. Run 'bootstrap --help' for a list.
|
||||
|
||||
|
||||
|
||||
Copyright 2001, 2003-2005, 2007, 2013-2017 Free Software Foundation,
|
||||
Inc.
|
||||
Copyright 2001-2019 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU tar.
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ See 'bootstrap --help' for a detailed list.
|
||||
|
||||
* Copyright information
|
||||
|
||||
Copyright 2007-2009, 2013-2017 Free Software Foundation, Inc.
|
||||
Copyright 2007-2019 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU tar.
|
||||
|
||||
|
||||
2
THANKS
2
THANKS
@@ -8,6 +8,7 @@ list of these people. Help me keep it complete and exempt of errors.
|
||||
See various ChangeLogs for a detailed description of contributions.
|
||||
|
||||
Aage Robeck aagero@ifi.uio.no
|
||||
Adam Borowski kilobyte@angband.pl
|
||||
Adye, TJ (Tim) T.J.Adye@rl.ac.uk
|
||||
Akiko Matsushita matusita@sra.co.jp
|
||||
Alan Bawden Alan@lcs.mit.edu
|
||||
@@ -94,6 +95,7 @@ Christian Laubscher christian.laubscher@tiscalinet.ch
|
||||
Christian T. Dum ctd@mpe-garching.mpg.de
|
||||
Christian von Roques roques@pond.sub.org
|
||||
Christian Wetzel wetzel@phoenix-pacs.de
|
||||
Christian Weisgerber naddy@mips.inka.de
|
||||
Christoph Litauer litauer@mailhost.uni-koblenz.de
|
||||
Christophe Colle colle@krtkg1.rug.ac.be
|
||||
Christophe Kalt Christophe.Kalt@kbcfp.com
|
||||
|
||||
3
TODO
3
TODO
@@ -45,8 +45,7 @@ Suggestions for improving GNU tar.
|
||||
|
||||
* Copyright notice
|
||||
|
||||
Copyright 2003-2004, 2007, 2013-2014, 2016-2017 Free Software
|
||||
Foundation, Inc.
|
||||
Copyright 2003-2019 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU tar.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
dnl Special Autoconf macros for GNU tar -*- autoconf -*-
|
||||
|
||||
dnl Copyright 2009, 2013-2014, 2016-2017 Free Software Foundation, Inc.
|
||||
dnl Copyright 2009-2019 Free Software Foundation, Inc.
|
||||
dnl
|
||||
dnl This file is part of GNU tar.
|
||||
dnl
|
||||
|
||||
@@ -4,7 +4,7 @@ scriptversion=2015-08-24.08; # UTC
|
||||
|
||||
# Bootstrap this package from checked-out sources.
|
||||
|
||||
# Copyright (C) 2003-2017 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2003-2019 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 @@
|
||||
# Bootstrap configuration for GNU tar.
|
||||
|
||||
# Copyright 2006-2009, 2013-2014, 2016-2017 Free Software Foundation,
|
||||
# Inc.
|
||||
# Copyright 2006-2019 Free Software Foundation, Inc.
|
||||
|
||||
# This file is part of GNU tar.
|
||||
|
||||
|
||||
17
configure.ac
17
configure.ac
@@ -1,6 +1,6 @@
|
||||
# Configure template for GNU tar. -*- autoconf -*-
|
||||
|
||||
# Copyright 1991, 1994-2010, 2013-2017 Free Software Foundation, Inc.
|
||||
# Copyright 1991, 1994-2010, 2013-2019 Free Software Foundation, Inc.
|
||||
|
||||
# This file is part of GNU tar.
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
AC_INIT([GNU tar], [1.30], [bug-tar@gnu.org])
|
||||
AC_INIT([GNU tar], [1.32], [bug-tar@gnu.org])
|
||||
AC_CONFIG_SRCDIR([src/tar.c])
|
||||
AC_CONFIG_AUX_DIR([build-aux])
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
@@ -102,6 +102,18 @@ gt_TYPE_SSIZE_T
|
||||
|
||||
# gnulib modules
|
||||
gl_INIT
|
||||
|
||||
if test $ac_cv_lib_error_at_line = no; then
|
||||
# This means that the error() function is not present in libc, so
|
||||
# the one from gnulib will be used instead. This function precedes
|
||||
# error messages it prints with the program name as returned by getprogname()
|
||||
# call, instead of using the name set by set_program_name.
|
||||
# Install workaround.
|
||||
AC_DEFINE([ENABLE_ERROR_PRINT_PROGNAME],[1],
|
||||
[Enable the use of error_print_progname to print program name with error messages.
|
||||
See comment to function tar_print_progname in src/tar.c])
|
||||
fi
|
||||
|
||||
# paxutils modules
|
||||
tar_PAXUTILS
|
||||
|
||||
@@ -250,6 +262,7 @@ TAR_COMPR_PROGRAM(lzip)
|
||||
TAR_COMPR_PROGRAM(lzma)
|
||||
TAR_COMPR_PROGRAM(lzop)
|
||||
TAR_COMPR_PROGRAM(xz)
|
||||
TAR_COMPR_PROGRAM(zstd)
|
||||
|
||||
AC_MSG_CHECKING(for default archive format)
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
%%comments:
|
||||
Copyright 2004, 2013-2014 Free Software Foundation, Inc.
|
||||
Copyright 2004-2019 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
|
||||
1
doc/.gitignore
vendored
1
doc/.gitignore
vendored
@@ -24,3 +24,4 @@ tar.tp
|
||||
tar.vr
|
||||
version.texi
|
||||
/parse-datetime.texi
|
||||
/rmt.8
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
# Makefile for GNU tar documentation.
|
||||
|
||||
# Copyright 1994-1997, 1999-2001, 2003, 2006-2007, 2013-2014, 2016-2017
|
||||
# Free Software Foundation, Inc.
|
||||
# Copyright 1994-2019 Free Software Foundation, Inc.
|
||||
|
||||
# This file is part of GNU tar.
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
@c This is part of the paxutils manual.
|
||||
@c Copyright (C) 2006-2007, 2014, 2016-2017 Free Software Foundation,
|
||||
@c Inc.
|
||||
@c Copyright (C) 2006-2019 Free Software Foundation, Inc.
|
||||
@c Written by Sergey Poznyakoff
|
||||
@c This file is distributed under GFDL 1.1 or any later version
|
||||
@c published by the Free Software Foundation.
|
||||
|
||||
@@ -5,8 +5,7 @@
|
||||
@c hence no sectioning command or @node.
|
||||
|
||||
@display
|
||||
Copyright @copyright{} 2000-2002, 2007-2008, 2014, 2016-2017 Free
|
||||
Software Foundation, Inc.
|
||||
Copyright @copyright{} 2000-2019 Free Software Foundation, Inc.
|
||||
@uref{http://fsf.org/}
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
|
||||
@@ -106,7 +106,7 @@ Please send broken links and other corrections (or suggestions) to
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Copyright 2004, 2013-2014, 2016-2017 Free Software Foundation, Inc.,
|
||||
Copyright 2004-2019 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02111, USA
|
||||
<br />
|
||||
Verbatim copying and distribution of this entire article is
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
@c This is part of the paxutils manual.
|
||||
@c Copyright (C) 2006, 2014, 2016-2017 Free Software Foundation, Inc.
|
||||
@c Copyright (C) 2006-2019 Free Software Foundation, Inc.
|
||||
@c This file is distributed under GFDL 1.1 or any later version
|
||||
@c published by the Free Software Foundation.
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
;;; mastermenu.el --- Redefinition of texinfo-master-menu-list
|
||||
|
||||
;; Copyright 2006-2007, 2013-2014, 2016-2017 Free Software Foundation,
|
||||
;; Inc.
|
||||
;; Copyright 2006-2019 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Sergey Poznyakoff
|
||||
;; Maintainer: bug-tar@gnu.org
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
@c This is part of the GNU tar manual.
|
||||
@c Copyright (C) 2017 Free Software Foundation, Inc.
|
||||
@c Copyright (C) 2017-2019 Free Software Foundation, Inc.
|
||||
@c This file is distributed under GFDL 1.3 or any later version
|
||||
@c published by the Free Software Foundation.
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
@c This is part of GNU tar manual.
|
||||
@c Copyright 1992, 1994-1997, 1999-2004, 2006, 2013-2014, 2016-2017 Free
|
||||
@c Software Foundation, Inc.
|
||||
@c Copyright 1992-2019 Free Software Foundation, Inc.
|
||||
@c See file tar.texi for copying conditions.
|
||||
|
||||
@c This file contains support for 'renditions' by Fran@,{c}ois Pinard
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
@c This is part of the paxutils manual.
|
||||
@c Copyright (C) 2005, 2007, 2014, 2016-2017 Free Software Foundation,
|
||||
@c Inc.
|
||||
@c Copyright (C) 2005-2019 Free Software Foundation, Inc.
|
||||
@c Written by Sergey Poznyakoff
|
||||
@c This file is distributed under GFDL 1.1 or any later version
|
||||
@c published by the Free Software Foundation.
|
||||
@@ -147,7 +146,7 @@ is compiled. To see the specific ranges allowed for a particular
|
||||
@option{--show-snapshot-field-ranges} option:
|
||||
|
||||
@smallexample
|
||||
$ @kbd{tar --show-shapshot-field-ranges}
|
||||
$ @kbd{tar --show-snapshot-field-ranges}
|
||||
This tar's snapshot file field ranges are
|
||||
(field name => [ min, max ]):
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
@c This is part of the paxutils manual.
|
||||
@c Copyright (C) 2006, 2014, 2016-2017 Free Software Foundation, Inc.
|
||||
@c Copyright (C) 2006-2019 Free Software Foundation, Inc.
|
||||
@c This file is distributed under GFDL 1.1 or any later version
|
||||
@c published by the Free Software Foundation.
|
||||
|
||||
@@ -218,12 +218,12 @@ The real name of the sparse file is stored in the variable
|
||||
variable @code{GNU.sparse.realsize}.
|
||||
|
||||
The sparse map itself is stored in the file data block, preceding the actual
|
||||
file data. It consists of a series of octal numbers of arbitrary length, delimited
|
||||
file data. It consists of a series of decimal numbers delimited
|
||||
by newlines. The map is padded with nulls to the nearest block boundary.
|
||||
|
||||
The first number gives the number of entries in the map. Following are map entries,
|
||||
each one consisting of two numbers giving the offset and size of the
|
||||
data block it describes.
|
||||
The first number gives the number of entries in the map. Following are
|
||||
map entries, each one consisting of two numbers giving the offset and
|
||||
size of the data block it describes.
|
||||
|
||||
The format is designed in such a way that non-posix aware @command{tar}s and @command{tar}s not
|
||||
supporting @code{GNU.sparse.*} keywords will extract each sparse file
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
@c This is part of the paxutils manual.
|
||||
@c Copyright (C) 2007, 2014, 2016-2017 Free Software Foundation, Inc.
|
||||
@c Copyright (C) 2007-2019 Free Software Foundation, Inc.
|
||||
@c This file is distributed under GFDL 1.1 or any later version
|
||||
@c published by the Free Software Foundation.
|
||||
|
||||
|
||||
50
doc/tar.1
50
doc/tar.1
@@ -1,5 +1,5 @@
|
||||
.\" This file is part of GNU tar. -*- nroff -*-
|
||||
.\" Copyright 2013-2014, 2016-2017 Free Software Foundation, Inc.
|
||||
.\" Copyright 2013-2019 Free Software Foundation, Inc.
|
||||
.\"
|
||||
.\" GNU tar 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 this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
.TH TAR 1 "November 16, 2017" "TAR" "GNU TAR Manual"
|
||||
.TH TAR 1 "February 4, 2019" "TAR" "GNU TAR Manual"
|
||||
.SH NAME
|
||||
tar \- an archiving utility
|
||||
.SH SYNOPSIS
|
||||
@@ -111,7 +111,7 @@ into the archive file
|
||||
verbosely listing the files being archived:
|
||||
.PP
|
||||
.EX
|
||||
.B tar cfv a.tar /etc
|
||||
.B tar cfv etc.tar /etc
|
||||
.EE
|
||||
.PP
|
||||
In
|
||||
@@ -133,9 +133,9 @@ The example command above written in the
|
||||
could look like:
|
||||
.PP
|
||||
.EX
|
||||
.B tar -cvf a.tar /etc
|
||||
.B tar -cvf etc.tar /etc
|
||||
or
|
||||
.B tar -c -v -f a.tar /etc
|
||||
.B tar -c -v -f etc.tar /etc
|
||||
.EE
|
||||
.PP
|
||||
In
|
||||
@@ -152,11 +152,11 @@ method.
|
||||
Here are several ways of writing the example command in this style:
|
||||
.PP
|
||||
.EX
|
||||
.B tar --create --file a.tar --verbose /etc
|
||||
.B tar --create --file etc.tar --verbose /etc
|
||||
.EE
|
||||
or (abbreviating some options):
|
||||
.EX
|
||||
.B tar --cre --file=a.tar --verb /etc
|
||||
.B tar --cre --file=etc.tar --verb /etc
|
||||
.EE
|
||||
.PP
|
||||
The options in all three styles can be intermixed, although doing so
|
||||
@@ -256,7 +256,7 @@ exist when creating an archive, it will be created and all files will
|
||||
be added to the resulting archive (the \fBlevel 0\fR dump). To create
|
||||
incremental archives of non-zero level \fBN\fR, create a copy of the
|
||||
snapshot file created during the level \fBN-1\fR, and use it as
|
||||
\fIFILE\fR.
|
||||
\fIFILE\fR.
|
||||
|
||||
When listing or extracting, the actual contents of \fIFILE\fR is not
|
||||
inspected, it is needed only due to syntactical requirements. It is
|
||||
@@ -287,7 +287,7 @@ effect only if the archive is open for reading (e.g. with
|
||||
.B \-\-list
|
||||
or
|
||||
.B \-\-extract
|
||||
options).
|
||||
options).
|
||||
.TP
|
||||
\fB\-\-no\-check\-device\fR
|
||||
Do not check device numbers when creating incremental archives.
|
||||
@@ -383,7 +383,7 @@ Extract files to standard output.
|
||||
Pipe extracted files to \fICOMMAND\fR. The argument is the pathname
|
||||
of an external program, optionally with command line arguments. The
|
||||
program will be invoked and the contents of the file being extracted
|
||||
supplied to it on its standard output. Additional data will be
|
||||
supplied to it on its standard input. Additional data will be
|
||||
supplied via the following environment variables:
|
||||
.RS
|
||||
.TP
|
||||
@@ -465,7 +465,7 @@ Format of the archive being processed. One of:
|
||||
.BR v7 .
|
||||
.B TAR_SUBCOMMAND
|
||||
A short option (with a leading dash) describing the operation \fBtar\fR is
|
||||
executing.
|
||||
executing.
|
||||
.RE
|
||||
.SS Handling of file attributes
|
||||
.TP
|
||||
@@ -562,9 +562,6 @@ stored in archive with owner name \fINEWUSR\fR and UID \fINEWUID\fR.
|
||||
\fB\-p\fR, \fB\-\-preserve\-permissions\fR, \fB\-\-same\-permissions\fR
|
||||
extract information about file permissions (default for superuser)
|
||||
.TP
|
||||
\fB\-\-preserve\fR
|
||||
Same as both \fB\-p\fR and \fB\-s\fR.
|
||||
.TP
|
||||
\fB\-\-same\-owner\fR
|
||||
Try extracting files with the same ownership as exists in the archive
|
||||
(default for superuser).
|
||||
@@ -694,7 +691,7 @@ executing.
|
||||
.B TAR_FD
|
||||
File descriptor which can be used to communicate the new volume name
|
||||
to
|
||||
.BR tar .
|
||||
.BR tar .
|
||||
.RE
|
||||
.RS
|
||||
|
||||
@@ -732,7 +729,7 @@ When this option is used in conjunction with
|
||||
.BR \-\-multi\-volume ,
|
||||
.B tar
|
||||
will keep track of which volume of a multi-volume archive it is
|
||||
working in \fIFILE\fR.
|
||||
working in \fIFILE\fR.
|
||||
.SS Device blocking
|
||||
.TP
|
||||
\fB\-b\fR, \fB\-\-blocking\-factor\fR=\fIBLOCKS\fR
|
||||
@@ -740,7 +737,7 @@ Set record size to \fIBLOCKS\fRx\fB512\fR bytes.
|
||||
.TP
|
||||
\fB\-B\fR, \fB\-\-read\-full\-records\fR
|
||||
When listing or extracting, accept incomplete input records after
|
||||
end-of-file marker.
|
||||
end-of-file marker.
|
||||
.TP
|
||||
\fB\-i\fR, \fB\-\-ignore\-zeros\fR
|
||||
Ignore zeroed blocks in archive. Normally two consecutive 512-blocks
|
||||
@@ -831,6 +828,10 @@ Filter the archive through
|
||||
\fB\-Z\fR, \fB\-\-compress\fR, \fB\-\-uncompress\fR
|
||||
Filter the archive through
|
||||
.BR compress (1).
|
||||
.TP
|
||||
\fB\-\-zstd\fR
|
||||
Filter the archive through
|
||||
.BR zstd (1).
|
||||
.SS Local file selection
|
||||
.TP
|
||||
\fB\-\-add\-file\fR=\fIFILE\fR
|
||||
@@ -1102,7 +1103,7 @@ Show file or archive names after transformation by \fB\-\-strip\fR and
|
||||
Print total bytes after processing the archive. If \fISIGNAL\fR is
|
||||
given, print total bytes when this signal is delivered. Allowed
|
||||
signals are:
|
||||
.BR SIGHUP ,
|
||||
.BR SIGHUP ,
|
||||
.BR SIGQUIT ,
|
||||
.BR SIGINT ,
|
||||
.BR SIGUSR1 ", and"
|
||||
@@ -1113,7 +1114,11 @@ The \fBSIG\fR prefix can be omitted.
|
||||
Print file modification times in UTC.
|
||||
.TP
|
||||
\fB\-v\fR, \fB\-\-verbose\fR
|
||||
Verbosely list files processed.
|
||||
Verbosely list files processed. Each instance of this option on the
|
||||
command line increases the verbosity level by one. The maximum
|
||||
verbosity level is 3. For a detailed discussion of how various
|
||||
verbosity levels affect tar's output, please refer to \fBGNU Tar
|
||||
Manual\fR, subsection 2.5.1 "\fBThe \-\-verbose Option\fR".
|
||||
.TP
|
||||
\fB\-\-warning\fR=\fIKEYWORD\fR
|
||||
Enable or disable warning messages identified by \fIKEYWORD\fR. The
|
||||
@@ -1205,7 +1210,7 @@ default (unless \fB\-\-verbose\fR is used). A common example of what
|
||||
you can get when using this warning is:
|
||||
|
||||
.EX
|
||||
$ \fBtar --warning=decompress-program -x -f archive.Z
|
||||
$ tar --warning=decompress-program -x -f archive.Z
|
||||
tar (child): cannot run compress: No such file or directory
|
||||
tar (child): trying gzip
|
||||
.EE
|
||||
@@ -1296,8 +1301,8 @@ failure during backup to a remote device.
|
||||
.BR lzop (1),
|
||||
.BR rmt (8),
|
||||
.BR symlink (7),
|
||||
.BR tar (5),
|
||||
.BR xz (1).
|
||||
.BR xz (1),
|
||||
.BR zstd (1).
|
||||
.PP
|
||||
Complete \fBtar\fR manual: run
|
||||
.B info tar
|
||||
@@ -1328,4 +1333,3 @@ There is NO WARRANTY, to the extent permitted by law.
|
||||
.\" time-stamp-end: "\""
|
||||
.\" time-stamp-line-limit: 20
|
||||
.\" end:
|
||||
|
||||
|
||||
74
doc/tar.texi
74
doc/tar.texi
@@ -1464,7 +1464,7 @@ tar: Removing leading '/' from member names
|
||||
/home/myself/practice/folk
|
||||
/home/myself/practice/jazz
|
||||
/home/myself/practice/collection.tar
|
||||
$ @kbd{tar --test --file practice.tar}
|
||||
$ @kbd{tar --list --file practice.tar}
|
||||
home/myself/practice/
|
||||
home/myself/practice/blues
|
||||
home/myself/practice/folk
|
||||
@@ -1495,7 +1495,7 @@ home/myself/practice/blues
|
||||
home/myself/practice/folk
|
||||
home/myself/practice/jazz
|
||||
home/myself/practice/collection.tar
|
||||
$ @kbd{tar --test --file practice.tar}
|
||||
$ @kbd{tar --list --file practice.tar}
|
||||
home/myself/practice/
|
||||
home/myself/practice/blues
|
||||
home/myself/practice/folk
|
||||
@@ -2553,6 +2553,12 @@ Wait for @var{time} seconds.
|
||||
|
||||
@item ttyout=@var{string}
|
||||
Output @var{string} on the current console (@file{/dev/tty}).
|
||||
|
||||
@item totals
|
||||
Print statistics (see @pxref{totals}).
|
||||
|
||||
@item wait=@var{signo}
|
||||
Wait for signal @var{signo}.
|
||||
@end table
|
||||
|
||||
Several @option{--checkpoint-action} options can be specified. The
|
||||
@@ -3713,6 +3719,9 @@ only attributes from the user namespace.
|
||||
@itemx -J
|
||||
Use @command{xz} for compressing or decompressing the archives. @xref{gzip}.
|
||||
|
||||
@item --zstd
|
||||
Use @command{zstd} for compressing or decompressing the archives. @xref{gzip}.
|
||||
|
||||
@end table
|
||||
|
||||
@node Short Option Summary
|
||||
@@ -3786,8 +3795,8 @@ them with the equivalent long option.
|
||||
|
||||
@item -m @tab @ref{--touch}.
|
||||
|
||||
@item -o @tab When creating, @ref{--no-same-owner}, when extracting ---
|
||||
@ref{--portability}.
|
||||
@item -o @tab When extracting, same as @ref{--no-same-owner}. When creating,
|
||||
-- @ref{--old-archive}.
|
||||
|
||||
The latter usage is deprecated. It is retained for compatibility with
|
||||
the earlier versions of @GNUTAR{}. In future releases
|
||||
@@ -3968,7 +3977,7 @@ successfully. For example, @w{@samp{tar --version}} might print:
|
||||
|
||||
@smallexample
|
||||
tar (GNU tar) @value{VERSION}
|
||||
Copyright (C) 2013-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 2013-2019 Free Software Foundation, Inc.
|
||||
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
|
||||
This is free software: you are free to change and redistribute it.
|
||||
There is NO WARRANTY, to the extent permitted by law.
|
||||
@@ -4449,6 +4458,25 @@ checkpoint:
|
||||
$ @kbd{tar -c --checkpoint=1000 --checkpoint-action=sleep=30}
|
||||
@end smallexample
|
||||
|
||||
@anchor{checkpoint wait}
|
||||
@cindex @code{wait}, checkpoint action
|
||||
The @code{wait=@var{signo}} action stops further execution until the
|
||||
signal @var{signo} is delivered. Valid values for @var{signo} are:
|
||||
@code{SIGHUP}, @code{SIGQUIT}, @code{SIGINT}, @code{SIGUSR1} and
|
||||
@code{SIGUSR2}. The @samp{SIG} prefix is optional. For example:
|
||||
|
||||
@example
|
||||
$ @kbd{tar -c -f arc --checkpoint=1000 --checkpoint-action wait=USR1 .}
|
||||
@end example
|
||||
|
||||
In this example, @GNUTAR{} will stop archivation at each 1000th
|
||||
checkpoint. wait until the @samp{SIGUSR1} signal is delivered,
|
||||
and resume processing.
|
||||
|
||||
This action is used by the @command{genfile} utility to perform
|
||||
modifications on the input files upon hitting certain checkpoints
|
||||
(@pxref{Exec Mode, genfile}).
|
||||
|
||||
@anchor{checkpoint exec}
|
||||
@cindex @code{exec}, checkpoint action
|
||||
Finally, the @code{exec} action executes a given external command.
|
||||
@@ -5477,7 +5505,7 @@ reproducible archives given a common timestamp for generated files
|
||||
while still retaining the original timestamps of untouched files.
|
||||
|
||||
@smallexample
|
||||
$ @kbd{tar -c -f archive.tar --clamp-mtime --mtime=@atchar{}$SOURCE_DATE_EPOCH .}
|
||||
$ @kbd{tar -c -f archive.tar --clamp-mtime --mtime=@@$SOURCE_DATE_EPOCH .}
|
||||
@end smallexample
|
||||
|
||||
@item --owner=@var{user}
|
||||
@@ -9520,24 +9548,32 @@ switch to @samp{posix}.
|
||||
@cindex lzma
|
||||
@cindex lzop
|
||||
@cindex compress
|
||||
@cindex zstd
|
||||
@GNUTAR{} is able to create and read compressed archives. It supports
|
||||
a wide variety of compression programs, namely: @command{gzip},
|
||||
@command{bzip2}, @command{lzip}, @command{lzma}, @command{lzop},
|
||||
@command{xz} and traditional @command{compress}. The latter is
|
||||
supported mostly for backward compatibility, and we recommend
|
||||
@command{zstd}, @command{xz} and traditional @command{compress}. The
|
||||
latter is supported mostly for backward compatibility, and we recommend
|
||||
against using it, because it is by far less effective than the other
|
||||
compression programs@footnote{It also had patent problems in the past.}.
|
||||
|
||||
Creating a compressed archive is simple: you just specify a
|
||||
@dfn{compression option} along with the usual archive creation
|
||||
commands. The compression option is @option{-z} (@option{--gzip}) to
|
||||
create a @command{gzip} compressed archive, @option{-j}
|
||||
(@option{--bzip2}) to create a @command{bzip2} compressed archive,
|
||||
@option{--lzip} to create an @asis{lzip} compressed archive,
|
||||
@option{-J} (@option{--xz}) to create an @asis{XZ} archive,
|
||||
@option{--lzma} to create an @asis{LZMA} compressed
|
||||
archive, @option{--lzop} to create an @asis{LZOP} archive, and
|
||||
@option{-Z} (@option{--compress}) to use @command{compress} program.
|
||||
commands. Available compression options are summarized in the
|
||||
table below:
|
||||
|
||||
@multitable @columnfractions 0.4 0.2 0.4
|
||||
@headitem Long @tab Short @tab Archive format
|
||||
@item @option{--gzip} @tab @option{-z} @tab @command{gzip}
|
||||
@item @option{--bzip2} @tab @option{-j} @tab @command{bzip2}
|
||||
@item @option{--xz} @tab @option{-J} @tab @command{xz}
|
||||
@item @option{--lzip} @tab @tab @command{lzip}
|
||||
@item @option{--lzma} @tab @tab @command{lzma}
|
||||
@item @option{--lzop} @tab @tab @command{lzop}
|
||||
@item @option{--zstd} @tab @tab @command{zstd}
|
||||
@item @option{--compress} @tab @option{-Z} @tab @command{compress}
|
||||
@end multitable
|
||||
|
||||
For example:
|
||||
|
||||
@smallexample
|
||||
@@ -9658,6 +9694,10 @@ Filter the archive through @command{lzma}.
|
||||
@item --lzop
|
||||
Filter the archive through @command{lzop}.
|
||||
|
||||
@opindex zstd
|
||||
@item --zstd
|
||||
Filter the archive through @command{zstd}.
|
||||
|
||||
@opindex compress
|
||||
@opindex uncompress
|
||||
@item -Z
|
||||
@@ -9730,6 +9770,8 @@ suffix. The following suffixes are recognized:
|
||||
@item @samp{.tlz} @tab @command{lzma}
|
||||
@item @samp{.lzo} @tab @command{lzop}
|
||||
@item @samp{.xz} @tab @command{xz}
|
||||
@item @samp{.zst} @tab @command{zstd}
|
||||
@item @samp{.tzst} @tab @command{zstd}
|
||||
@end multitable
|
||||
|
||||
@anchor{use-compress-program}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
# Copyright 2006-2007, 2013-2014, 2016-2017 Free Software Foundation,
|
||||
# Inc.
|
||||
# Copyright 2006-2019 Free Software Foundation, Inc.
|
||||
|
||||
# This file is part of GNU tar.
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
@c This is part of GNU tar manual.
|
||||
@c Copyright 1992, 1994-1997, 1999-2006, 2013-2014, 2016-2017 Free
|
||||
@c Software Foundation, Inc.
|
||||
@c Copyright 1992-2019 Free Software Foundation, Inc.
|
||||
@c See file tar.texi for copying conditions.
|
||||
|
||||
@macro GNUTAR
|
||||
|
||||
2
gnulib
2
gnulib
Submodule gnulib updated: 91e834891d...4652c7bafa
@@ -1,7 +1,7 @@
|
||||
# List of gnulib modules needed for GNU tar.
|
||||
# A module name per line. Empty lines and comments are ignored.
|
||||
|
||||
# Copyright 2005-2010, 2012-2014, 2017 Free Software Foundation, Inc.
|
||||
# Copyright 2005-2019 Free Software Foundation, Inc.
|
||||
|
||||
# This file is part of GNU tar.
|
||||
|
||||
@@ -85,6 +85,7 @@ stdint
|
||||
stpcpy
|
||||
strdup-posix
|
||||
strerror
|
||||
strnlen
|
||||
strtoimax
|
||||
strtol
|
||||
strtoul
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
# Makefile for GNU tar library. -*- Makefile -*-
|
||||
|
||||
# Copyright 1994-1997, 1999-2001, 2003-2007, 2009-2010, 2013-2014,
|
||||
# 2016-2017 Free Software Foundation, Inc.
|
||||
# Copyright 1994-2019 Free Software Foundation, Inc.
|
||||
|
||||
# This file is part of GNU tar.
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Replacement <attr/xattr.h> for platforms that lack it.
|
||||
Copyright 2012-2014, 2016-2017 Free Software Foundation, Inc.
|
||||
Copyright 2012-2019 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 @@
|
||||
/* stdopen.c - ensure that the three standard file descriptors are in use
|
||||
|
||||
Copyright 2005, 2007, 2013-2014, 2016-2017 Free Software Foundation,
|
||||
Inc.
|
||||
Copyright 2005-2019 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
|
||||
|
||||
1699
lib/wordsplit.c
1699
lib/wordsplit.c
File diff suppressed because it is too large
Load Diff
219
lib/wordsplit.h
219
lib/wordsplit.h
@@ -1,5 +1,5 @@
|
||||
/* wordsplit - a word splitter
|
||||
Copyright (C) 2009-2014, 2016-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 2009-2018 Sergey Poznyakoff
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
@@ -12,10 +12,7 @@
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Written by Sergey Poznyakoff
|
||||
*/
|
||||
with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef __WORDSPLIT_H
|
||||
#define __WORDSPLIT_H
|
||||
@@ -28,42 +25,106 @@
|
||||
# define __WORDSPLIT_ATTRIBUTE_FORMAT(spec) /* empty */
|
||||
#endif
|
||||
|
||||
struct wordsplit
|
||||
typedef struct wordsplit wordsplit_t;
|
||||
|
||||
/* Structure used to direct the splitting. Members marked with [Input]
|
||||
can be defined before calling wordsplit(), those marked with [Output]
|
||||
provide return values when the function returns. If neither mark is
|
||||
used, the member is internal and must not be used by the caller.
|
||||
|
||||
In the comments below, the identifiers in parentheses indicate bits that
|
||||
must be set (or unset, if starting with !) in ws_flags (if starting with
|
||||
WRDSF_) or ws_options (if starting with WRDSO_) to initialize or use the
|
||||
given member.
|
||||
|
||||
If not redefined explicitly, most of them are set to some reasonable
|
||||
default value upon entry to wordsplit(). */
|
||||
struct wordsplit
|
||||
{
|
||||
size_t ws_wordc;
|
||||
char **ws_wordv;
|
||||
size_t ws_offs;
|
||||
size_t ws_wordn;
|
||||
int ws_flags;
|
||||
const char *ws_delim;
|
||||
const char *ws_comment;
|
||||
const char *ws_escape;
|
||||
void (*ws_alloc_die) (struct wordsplit * wsp);
|
||||
size_t ws_wordc; /* [Output] Number of words in ws_wordv. */
|
||||
char **ws_wordv; /* [Output] Array of parsed out words. */
|
||||
size_t ws_offs; /* [Input] (WRDSF_DOOFFS) Number of initial
|
||||
elements in ws_wordv to fill with NULLs. */
|
||||
size_t ws_wordn; /* Number of elements ws_wordv can accomodate. */
|
||||
unsigned ws_flags; /* [Input] Flags passed to wordsplit. */
|
||||
unsigned ws_options; /* [Input] (WRDSF_OPTIONS)
|
||||
Additional options. */
|
||||
size_t ws_maxwords; /* [Input] (WRDSO_MAXWORDS) Return at most that
|
||||
many words */
|
||||
size_t ws_wordi; /* [Output] (WRDSF_INCREMENTAL) Total number of
|
||||
words returned so far */
|
||||
|
||||
const char *ws_delim; /* [Input] (WRDSF_DELIM) Word delimiters. */
|
||||
const char *ws_comment; /* [Input] (WRDSF_COMMENT) Comment characters. */
|
||||
const char *ws_escape[2]; /* [Input] (WRDSF_ESCAPE) Characters to be escaped
|
||||
with backslash. */
|
||||
void (*ws_alloc_die) (wordsplit_t *wsp);
|
||||
/* [Input] (WRDSF_ALLOC_DIE) Function called when
|
||||
out of memory. Must not return. */
|
||||
void (*ws_error) (const char *, ...)
|
||||
__WORDSPLIT_ATTRIBUTE_FORMAT ((__printf__, 1, 2));
|
||||
__attribute__ ((__format__ (__printf__, 1, 2)));
|
||||
/* [Input] (WRDSF_ERROR) Function used for error
|
||||
reporting */
|
||||
void (*ws_debug) (const char *, ...)
|
||||
__WORDSPLIT_ATTRIBUTE_FORMAT ((__printf__, 1, 2));
|
||||
__attribute__ ((__format__ (__printf__, 1, 2)));
|
||||
/* [Input] (WRDSF_DEBUG) Function used for debug
|
||||
output. */
|
||||
const char **ws_env; /* [Input] (WRDSF_ENV, !WRDSF_NOVAR) Array of
|
||||
environment variables. */
|
||||
|
||||
const char **ws_env;
|
||||
const char *(*ws_getvar) (const char *, size_t, void *);
|
||||
void *ws_closure;
|
||||
char **ws_envbuf;
|
||||
size_t ws_envidx;
|
||||
size_t ws_envsiz;
|
||||
|
||||
int (*ws_getvar) (char **ret, const char *var, size_t len, void *clos);
|
||||
/* [Input] (WRDSF_GETVAR, !WRDSF_NOVAR) Looks up
|
||||
the name VAR (LEN bytes long) in the table of
|
||||
variables and if found returns in memory
|
||||
location pointed to by RET the value of that
|
||||
variable. Returns WRDSE_OK (0) on success,
|
||||
and an error code (see WRDSE_* defines below)
|
||||
on error. User-specific errors can be returned
|
||||
by storing the error diagnostic string in RET
|
||||
and returning WRDSE_USERERR.
|
||||
Whatever is stored in RET, it must be allocated
|
||||
using malloc(3). */
|
||||
void *ws_closure; /* [Input] (WRDSF_CLOSURE) Passed as the CLOS
|
||||
argument to ws_getvar and ws_command. */
|
||||
int (*ws_command) (char **ret, const char *cmd, size_t len, char **argv,
|
||||
void *clos);
|
||||
/* [Input] (!WRDSF_NOCMD) Returns in the memory
|
||||
location pointed to by RET the expansion of
|
||||
the command CMD (LEN bytes long). If WRDSO_ARGV
|
||||
option is set, ARGV contains CMD split out to
|
||||
words. Otherwise ARGV is NULL.
|
||||
|
||||
const char *ws_input;
|
||||
size_t ws_len;
|
||||
size_t ws_endp;
|
||||
int ws_errno;
|
||||
See ws_getvar for a discussion of possible
|
||||
return values. */
|
||||
|
||||
const char *ws_input; /* Input string (the S argument to wordsplit. */
|
||||
size_t ws_len; /* Length of ws_input. */
|
||||
size_t ws_endp; /* Points past the last processed byte in
|
||||
ws_input. */
|
||||
int ws_errno; /* [Output] Error code, if an error occurred. */
|
||||
char *ws_usererr; /* Points to textual description of
|
||||
the error, if ws_errno is WRDSE_USERERR. Must
|
||||
be allocated with malloc(3). */
|
||||
struct wordsplit_node *ws_head, *ws_tail;
|
||||
/* Doubly-linked list of parsed out nodes. */
|
||||
int ws_lvl; /* Invocation nesting level. */
|
||||
};
|
||||
|
||||
/* Wordsplit flags. Only 2 bits of a 32-bit word remain unused.
|
||||
It is getting crowded... */
|
||||
/* Initial size for ws_env, if allocated automatically */
|
||||
#define WORDSPLIT_ENV_INIT 16
|
||||
|
||||
/* Wordsplit flags. */
|
||||
/* Append the words found to the array resulting from a previous
|
||||
call. */
|
||||
#define WRDSF_APPEND 0x00000001
|
||||
/* Insert we_offs initial NULLs in the array ws_wordv.
|
||||
/* Insert ws_offs initial NULLs in the array ws_wordv.
|
||||
(These are not counted in the returned ws_wordc.) */
|
||||
#define WRDSF_DOOFFS 0x00000002
|
||||
/* Don't do command substitution. Reserved for future use. */
|
||||
/* Don't do command substitution. */
|
||||
#define WRDSF_NOCMD 0x00000004
|
||||
/* The parameter p resulted from a previous call to
|
||||
wordsplit(), and wordsplit_free() was not called. Reuse the
|
||||
@@ -71,10 +132,8 @@ struct wordsplit
|
||||
#define WRDSF_REUSE 0x00000008
|
||||
/* Print errors */
|
||||
#define WRDSF_SHOWERR 0x00000010
|
||||
/* Consider it an error if an undefined shell variable
|
||||
is expanded. */
|
||||
/* Consider it an error if an undefined variable is expanded. */
|
||||
#define WRDSF_UNDEF 0x00000020
|
||||
|
||||
/* Don't do variable expansion. */
|
||||
#define WRDSF_NOVAR 0x00000040
|
||||
/* Abort on ENOMEM error */
|
||||
@@ -85,7 +144,7 @@ struct wordsplit
|
||||
#define WRDSF_SQUOTE 0x00000200
|
||||
/* Handle double quotes */
|
||||
#define WRDSF_DQUOTE 0x00000400
|
||||
/* Handle quotes and escape directives */
|
||||
/* Handle single and double quotes */
|
||||
#define WRDSF_QUOTE (WRDSF_SQUOTE|WRDSF_DQUOTE)
|
||||
/* Replace each input sequence of repeated delimiters with a single
|
||||
delimiter */
|
||||
@@ -113,56 +172,106 @@ struct wordsplit
|
||||
/* Don't split input into words. Useful for side effects. */
|
||||
#define WRDSF_NOSPLIT 0x00400000
|
||||
/* Keep undefined variables in place, instead of expanding them to
|
||||
empty string */
|
||||
empty strings. */
|
||||
#define WRDSF_KEEPUNDEF 0x00800000
|
||||
/* Warn about undefined variables */
|
||||
#define WRDSF_WARNUNDEF 0x01000000
|
||||
/* Handle C escapes */
|
||||
#define WRDSF_CESCAPES 0x02000000
|
||||
|
||||
/* ws_closure is set */
|
||||
#define WRDSF_CLOSURE 0x04000000
|
||||
/* ws_env is a Key/Value environment, i.e. the value of a variable is
|
||||
stored in the element that follows its name. */
|
||||
#define WRDSF_ENV_KV 0x08000000
|
||||
|
||||
/* ws_escape is set */
|
||||
#define WRDSF_ESCAPE 0x10000000
|
||||
|
||||
/* Incremental mode */
|
||||
#define WRDSF_INCREMENTAL 0x20000000
|
||||
/* Perform pathname and tilde expansion */
|
||||
#define WRDSF_PATHEXPAND 0x40000000
|
||||
/* ws_options is initialized */
|
||||
#define WRDSF_OPTIONS 0x80000000
|
||||
|
||||
#define WRDSF_DEFFLAGS \
|
||||
(WRDSF_NOVAR | WRDSF_NOCMD | \
|
||||
WRDSF_QUOTE | WRDSF_SQUEEZE_DELIMS | WRDSF_CESCAPES)
|
||||
|
||||
#define WRDSE_EOF 0
|
||||
/* Remove the word that produces empty string after path expansion */
|
||||
#define WRDSO_NULLGLOB 0x00000001
|
||||
/* Print error message if path expansion produces empty string */
|
||||
#define WRDSO_FAILGLOB 0x00000002
|
||||
/* Allow a leading period to be matched by metacharacters. */
|
||||
#define WRDSO_DOTGLOB 0x00000004
|
||||
/* ws_command needs argv parameter */
|
||||
#define WRDSO_ARGV 0x00000008
|
||||
/* Keep backslash in unrecognized escape sequences in words */
|
||||
#define WRDSO_BSKEEP_WORD 0x00000010
|
||||
/* Handle octal escapes in words */
|
||||
#define WRDSO_OESC_WORD 0x00000020
|
||||
/* Handle hex escapes in words */
|
||||
#define WRDSO_XESC_WORD 0x00000040
|
||||
|
||||
/* ws_maxwords field is initialized */
|
||||
#define WRDSO_MAXWORDS 0x00000080
|
||||
|
||||
/* Keep backslash in unrecognized escape sequences in quoted strings */
|
||||
#define WRDSO_BSKEEP_QUOTE 0x00000100
|
||||
/* Handle octal escapes in quoted strings */
|
||||
#define WRDSO_OESC_QUOTE 0x00000200
|
||||
/* Handle hex escapes in quoted strings */
|
||||
#define WRDSO_XESC_QUOTE 0x00000400
|
||||
|
||||
#define WRDSO_BSKEEP WRDSO_BSKEEP_WORD
|
||||
#define WRDSO_OESC WRDSO_OESC_WORD
|
||||
#define WRDSO_XESC WRDSO_XESC_WORD
|
||||
|
||||
/* Indices into ws_escape */
|
||||
#define WRDSX_WORD 0
|
||||
#define WRDSX_QUOTE 1
|
||||
|
||||
/* Set escape option F in WS for words (Q==0) or quoted strings (Q==1) */
|
||||
#define WRDSO_ESC_SET(ws,q,f) ((ws)->ws_options |= ((f) << 4*(q)))
|
||||
/* Test WS for escape option F for words (Q==0) or quoted strings (Q==1) */
|
||||
#define WRDSO_ESC_TEST(ws,q,f) ((ws)->ws_options & ((f) << 4*(q)))
|
||||
|
||||
#define WRDSE_OK 0
|
||||
#define WRDSE_EOF WRDSE_OK
|
||||
#define WRDSE_QUOTE 1
|
||||
#define WRDSE_NOSPACE 2
|
||||
#define WRDSE_NOSUPP 3
|
||||
#define WRDSE_USAGE 4
|
||||
#define WRDSE_CBRACE 5
|
||||
#define WRDSE_UNDEF 6
|
||||
#define WRDSE_NOINPUT 7
|
||||
#define WRDSE_USAGE 3
|
||||
#define WRDSE_CBRACE 4
|
||||
#define WRDSE_UNDEF 5
|
||||
#define WRDSE_NOINPUT 6
|
||||
#define WRDSE_PAREN 7
|
||||
#define WRDSE_GLOBERR 8
|
||||
#define WRDSE_USERERR 9
|
||||
|
||||
int wordsplit (const char *s, struct wordsplit *p, int flags);
|
||||
int wordsplit_len (const char *s, size_t len,
|
||||
struct wordsplit *p, int flags);
|
||||
void wordsplit_free (struct wordsplit *p);
|
||||
void wordsplit_free_words (struct wordsplit *ws);
|
||||
int wordsplit (const char *s, wordsplit_t *ws, unsigned flags);
|
||||
int wordsplit_len (const char *s, size_t len, wordsplit_t *ws, unsigned flags);
|
||||
void wordsplit_free (wordsplit_t *ws);
|
||||
void wordsplit_free_words (wordsplit_t *ws);
|
||||
void wordsplit_free_envbuf (wordsplit_t *ws);
|
||||
int wordsplit_get_words (wordsplit_t *ws, size_t *wordc, char ***wordv);
|
||||
|
||||
static inline void wordsplit_getwords (wordsplit_t *ws, size_t *wordc, char ***wordv)
|
||||
__attribute__ ((deprecated));
|
||||
|
||||
static inline void
|
||||
wordsplit_getwords (wordsplit_t *ws, size_t *wordc, char ***wordv)
|
||||
{
|
||||
wordsplit_get_words (ws, wordc, wordv);
|
||||
}
|
||||
|
||||
int wordsplit_append (wordsplit_t *wsp, int argc, char **argv);
|
||||
|
||||
int wordsplit_c_unquote_char (int c);
|
||||
int wordsplit_c_quote_char (int c);
|
||||
size_t wordsplit_c_quoted_length (const char *str, int quote_hex,
|
||||
int *quote);
|
||||
void wordsplit_general_unquote_copy (char *dst, const char *src, size_t n,
|
||||
const char *escapable);
|
||||
void wordsplit_sh_unquote_copy (char *dst, const char *src, size_t n);
|
||||
void wordsplit_c_unquote_copy (char *dst, const char *src, size_t n);
|
||||
size_t wordsplit_c_quoted_length (const char *str, int quote_hex, int *quote);
|
||||
void wordsplit_c_quote_copy (char *dst, const char *src, int quote_hex);
|
||||
|
||||
void wordsplit_perror (struct wordsplit *ws);
|
||||
const char *wordsplit_strerror (struct wordsplit *ws);
|
||||
void wordsplit_perror (wordsplit_t *ws);
|
||||
const char *wordsplit_strerror (wordsplit_t *ws);
|
||||
|
||||
void wordsplit_clearerr (wordsplit_t *ws);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* openat-style fd-relative functions for operating with extended file
|
||||
attributes.
|
||||
|
||||
Copyright 2012-2014, 2016-2017 Free Software Foundation, Inc.
|
||||
Copyright 2012-2019 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,7 @@
|
||||
/* Prototypes for openat-style fd-relative functions for operating with
|
||||
extended file attributes.
|
||||
|
||||
Copyright 2012-2014, 2016-2017 Free Software Foundation, Inc.
|
||||
Copyright 2012-2019 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
|
||||
|
||||
2
paxutils
2
paxutils
Submodule paxutils updated: d03eab65d3...56939847bf
@@ -1,7 +1,6 @@
|
||||
# List of files which contain translatable strings.
|
||||
|
||||
# Copyright 1996, 1999-2000, 2003-2005, 2007, 2013-2014, 2016-2017 Free
|
||||
# Software Foundation, Inc.
|
||||
# Copyright 1996-2019 Free Software Foundation, Inc.
|
||||
|
||||
# This file is part of GNU tar.
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
# Make GNU tar scripts.
|
||||
|
||||
# Copyright 2004, 2006-2007, 2013-2014, 2016-2017 Free Software
|
||||
# Foundation, Inc.
|
||||
# Copyright 2004-2019 Free Software Foundation, Inc.
|
||||
|
||||
# This file is part of GNU tar.
|
||||
|
||||
|
||||
@@ -82,8 +82,7 @@ SLEEP_MESSAGE="`awk '
|
||||
}' /dev/null`"
|
||||
|
||||
|
||||
# Copyright 2004, 2007, 2013-2014, 2016-2017 Free Software Foundation,
|
||||
# Inc.
|
||||
# Copyright 2004-2019 Free Software Foundation, Inc.
|
||||
|
||||
# This file is part of GNU tar.
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
#! /bin/sh
|
||||
# Make backups.
|
||||
|
||||
# Copyright 2004-2006, 2013-2014, 2016-2017 Free Software Foundation,
|
||||
# Inc.
|
||||
# Copyright 2004-2019 Free Software Foundation, Inc.
|
||||
|
||||
# This file is part of GNU tar.
|
||||
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
# interested parties that a tape for the next volume of the backup needs to
|
||||
# be put in the tape drive.
|
||||
|
||||
# Copyright 2004-2005, 2010, 2012-2014, 2016-2017 Free Software
|
||||
# Foundation, Inc.
|
||||
# Copyright 2004-2019 Free Software Foundation, Inc.
|
||||
|
||||
# This file is part of GNU tar.
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
#! /bin/sh
|
||||
# Restore backups.
|
||||
|
||||
# Copyright 2004, 2006, 2013-2014, 2016-2017 Free Software Foundation,
|
||||
# Inc.
|
||||
# Copyright 2004-2019 Free Software Foundation, Inc.
|
||||
|
||||
# This file is part of GNU tar.
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#! /usr/bin/perl -w
|
||||
# Display and edit the 'dev' field in tar's snapshots
|
||||
# Copyright 2007, 2011, 2013-2014, 2016-2017 Free Software Foundation,
|
||||
# Inc.
|
||||
# Copyright 2007-2019 Free Software Foundation, Inc.
|
||||
|
||||
# This file is part of GNU tar.
|
||||
|
||||
@@ -409,7 +408,7 @@ sub check_field_values ($) {
|
||||
}
|
||||
if ( $msg ne "" ) {
|
||||
$error_found = 1;
|
||||
print "\n shapshot file header:\n";
|
||||
print "\n snapshot file header:\n";
|
||||
print $msg;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
# concatenates a GNU tar multi-volume archive into a single tar archive.
|
||||
# Author: Bruno Haible <bruno@clisp.org>, Sergey Poznyakoff <gray@gnu.org.ua>
|
||||
|
||||
# Copyright 2004-2005, 2010, 2013-2014, 2016-2017 Free Software
|
||||
# Foundation, Inc.
|
||||
# Copyright 2004-2019 Free Software Foundation, Inc.
|
||||
|
||||
# This file is part of GNU tar.
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
/* xsparse - expands compressed sparse file images extracted from GNU tar
|
||||
archives.
|
||||
|
||||
Copyright 2006-2007, 2010, 2013-2014, 2016-2017 Free Software
|
||||
Foundation, Inc.
|
||||
Copyright 2006-2019 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU tar.
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
# Makefile for GNU tar sources.
|
||||
|
||||
# Copyright 1994-1997, 1999-2001, 2003, 2006-2007, 2009, 2013-2014,
|
||||
# 2016-2017 Free Software Foundation, Inc.
|
||||
# Copyright 1994-2019 Free Software Foundation, Inc.
|
||||
|
||||
# This file is part of GNU tar.
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/* Long integers, for GNU tar.
|
||||
Copyright 1999, 2007, 2013-2014, 2016-2017 Free Software Foundation,
|
||||
Inc.
|
||||
Copyright 1999-2019 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU tar.
|
||||
|
||||
|
||||
39
src/buffer.c
39
src/buffer.c
@@ -1,7 +1,6 @@
|
||||
/* Buffer management for tar.
|
||||
|
||||
Copyright 1988, 1992-1994, 1996-1997, 1999-2010, 2013-2014, 2016-2017
|
||||
Free Software Foundation, Inc.
|
||||
Copyright 1988-2019 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU tar.
|
||||
|
||||
@@ -281,7 +280,8 @@ enum compress_type {
|
||||
ct_lzip,
|
||||
ct_lzma,
|
||||
ct_lzop,
|
||||
ct_xz
|
||||
ct_xz,
|
||||
ct_zstd
|
||||
};
|
||||
|
||||
static enum compress_type archive_compression_type = ct_none;
|
||||
@@ -310,6 +310,7 @@ static struct zip_magic const magic[] = {
|
||||
{ ct_lzma, 6, "\xFFLZMA" },
|
||||
{ ct_lzop, 4, "\211LZO" },
|
||||
{ ct_xz, 6, "\xFD" "7zXZ" },
|
||||
{ ct_zstd, 4, "\x28\xB5\x2F\xFD" },
|
||||
};
|
||||
|
||||
#define NMAGIC (sizeof(magic)/sizeof(magic[0]))
|
||||
@@ -325,6 +326,7 @@ static struct zip_program zip_program[] = {
|
||||
{ ct_lzma, XZ_PROGRAM, "-J" },
|
||||
{ ct_lzop, LZOP_PROGRAM, "--lzop" },
|
||||
{ ct_xz, XZ_PROGRAM, "-J" },
|
||||
{ ct_zstd, ZSTD_PROGRAM, "--zstd" },
|
||||
{ ct_none }
|
||||
};
|
||||
|
||||
@@ -1500,7 +1502,7 @@ try_new_volume (void)
|
||||
if (!read_header0 (&dummy))
|
||||
return false;
|
||||
tar_stat_destroy (&dummy);
|
||||
assign_string (&volume_label, current_header->header.name);
|
||||
ASSIGN_STRING_N (&volume_label, current_header->header.name);
|
||||
set_next_block_after (header);
|
||||
header = find_next_block ();
|
||||
if (header->header.typeflag != GNUTYPE_MULTIVOL)
|
||||
@@ -1510,7 +1512,7 @@ try_new_volume (void)
|
||||
if (!read_header0 (&dummy))
|
||||
return false;
|
||||
tar_stat_destroy (&dummy);
|
||||
assign_string (&continued_file_name, current_header->header.name);
|
||||
ASSIGN_STRING_N (&continued_file_name, current_header->header.name);
|
||||
continued_file_size =
|
||||
UINTMAX_FROM_HEADER (current_header->header.size);
|
||||
continued_file_offset =
|
||||
@@ -1653,15 +1655,7 @@ match_volume_label (void)
|
||||
quote (volume_label_option)));
|
||||
if (label->header.typeflag == GNUTYPE_VOLHDR)
|
||||
{
|
||||
if (memchr (label->header.name, '\0', sizeof label->header.name))
|
||||
assign_string (&volume_label, label->header.name);
|
||||
else
|
||||
{
|
||||
volume_label = xmalloc (sizeof (label->header.name) + 1);
|
||||
memcpy (volume_label, label->header.name,
|
||||
sizeof (label->header.name));
|
||||
volume_label[sizeof (label->header.name)] = 0;
|
||||
}
|
||||
ASSIGN_STRING_N (&volume_label, label->header.name);
|
||||
}
|
||||
else if (label->header.typeflag == XGLTYPE)
|
||||
{
|
||||
@@ -1697,8 +1691,7 @@ _write_volume_label (const char *str)
|
||||
memset (label, 0, BLOCKSIZE);
|
||||
|
||||
strcpy (label->header.name, str);
|
||||
assign_string (¤t_stat_info.file_name,
|
||||
label->header.name);
|
||||
assign_string (¤t_stat_info.file_name, label->header.name);
|
||||
current_stat_info.had_trailing_slash =
|
||||
strip_trailing_slashes (current_stat_info.file_name);
|
||||
|
||||
@@ -1768,15 +1761,19 @@ gnu_add_multi_volume_header (struct bufmap *map)
|
||||
{
|
||||
int tmp;
|
||||
union block *block = find_next_block ();
|
||||
size_t len = strlen (map->file_name);
|
||||
|
||||
if (strlen (map->file_name) > NAME_FIELD_SIZE)
|
||||
WARN ((0, 0,
|
||||
_("%s: file name too long to be stored in a GNU multivolume header, truncated"),
|
||||
quotearg_colon (map->file_name)));
|
||||
if (len > NAME_FIELD_SIZE)
|
||||
{
|
||||
WARN ((0, 0,
|
||||
_("%s: file name too long to be stored in a GNU multivolume header, truncated"),
|
||||
quotearg_colon (map->file_name)));
|
||||
len = NAME_FIELD_SIZE;
|
||||
}
|
||||
|
||||
memset (block, 0, BLOCKSIZE);
|
||||
|
||||
strncpy (block->header.name, map->file_name, NAME_FIELD_SIZE);
|
||||
memcpy (block->header.name, map->file_name, len);
|
||||
block->header.typeflag = GNUTYPE_MULTIVOL;
|
||||
|
||||
OFF_TO_CHARS (map->sizeleft, block->header.size);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Checkpoint management for tar.
|
||||
|
||||
Copyright 2007, 2013-2014, 2016-2017 Free Software Foundation, Inc.
|
||||
Copyright 2007-2019 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU tar.
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <sys/ioctl.h>
|
||||
#include <termios.h>
|
||||
#include "fprintftime.h"
|
||||
#include <signal.h>
|
||||
|
||||
enum checkpoint_opcode
|
||||
{
|
||||
@@ -32,7 +33,8 @@ enum checkpoint_opcode
|
||||
cop_ttyout,
|
||||
cop_sleep,
|
||||
cop_exec,
|
||||
cop_totals
|
||||
cop_totals,
|
||||
cop_wait
|
||||
};
|
||||
|
||||
struct checkpoint_action
|
||||
@@ -43,6 +45,7 @@ struct checkpoint_action
|
||||
{
|
||||
time_t time;
|
||||
char *command;
|
||||
int signal;
|
||||
} v;
|
||||
};
|
||||
|
||||
@@ -52,6 +55,16 @@ static unsigned checkpoint;
|
||||
/* List of checkpoint actions */
|
||||
static struct checkpoint_action *checkpoint_action, *checkpoint_action_tail;
|
||||
|
||||
/* State of the checkpoint system */
|
||||
enum {
|
||||
CHKP_INIT, /* Needs initialization */
|
||||
CHKP_COMPILE, /* Actions are being compiled */
|
||||
CHKP_RUN /* Actions are being run */
|
||||
};
|
||||
static int checkpoint_state;
|
||||
/* Blocked signals */
|
||||
static sigset_t sigs;
|
||||
|
||||
static struct checkpoint_action *
|
||||
alloc_action (enum checkpoint_opcode opcode)
|
||||
{
|
||||
@@ -85,6 +98,12 @@ checkpoint_compile_action (const char *str)
|
||||
{
|
||||
struct checkpoint_action *act;
|
||||
|
||||
if (checkpoint_state == CHKP_INIT)
|
||||
{
|
||||
sigemptyset (&sigs);
|
||||
checkpoint_state = CHKP_COMPILE;
|
||||
}
|
||||
|
||||
if (strcmp (str, ".") == 0 || strcmp (str, "dot") == 0)
|
||||
alloc_action (cop_dot);
|
||||
else if (strcmp (str, "bell") == 0)
|
||||
@@ -117,6 +136,12 @@ checkpoint_compile_action (const char *str)
|
||||
}
|
||||
else if (strcmp (str, "totals") == 0)
|
||||
alloc_action (cop_totals);
|
||||
else if (strncmp (str, "wait=", 5) == 0)
|
||||
{
|
||||
act = alloc_action (cop_wait);
|
||||
act->v.signal = decode_signal (str + 5);
|
||||
sigaddset (&sigs, act->v.signal);
|
||||
}
|
||||
else
|
||||
FATAL_ERROR ((0, 0, _("%s: unknown checkpoint action"), str));
|
||||
}
|
||||
@@ -124,15 +149,24 @@ checkpoint_compile_action (const char *str)
|
||||
void
|
||||
checkpoint_finish_compile (void)
|
||||
{
|
||||
if (checkpoint_option)
|
||||
if (checkpoint_state == CHKP_INIT
|
||||
&& checkpoint_option
|
||||
&& !checkpoint_action)
|
||||
{
|
||||
if (!checkpoint_action)
|
||||
/* Provide a historical default */
|
||||
checkpoint_compile_action ("echo");
|
||||
/* Provide a historical default */
|
||||
checkpoint_compile_action ("echo");
|
||||
}
|
||||
|
||||
if (checkpoint_state == CHKP_COMPILE)
|
||||
{
|
||||
sigprocmask (SIG_BLOCK, &sigs, NULL);
|
||||
|
||||
if (!checkpoint_option)
|
||||
/* set default checkpoint rate */
|
||||
checkpoint_option = DEFAULT_CHECKPOINT;
|
||||
|
||||
checkpoint_state = CHKP_RUN;
|
||||
}
|
||||
else if (checkpoint_action)
|
||||
/* Otherwise, set default checkpoint rate */
|
||||
checkpoint_option = DEFAULT_CHECKPOINT;
|
||||
}
|
||||
|
||||
static const char *checkpoint_total_format[] = {
|
||||
@@ -390,6 +424,13 @@ run_checkpoint_actions (bool do_write)
|
||||
case cop_totals:
|
||||
compute_duration ();
|
||||
print_total_stats ();
|
||||
break;
|
||||
|
||||
case cop_wait:
|
||||
{
|
||||
int n;
|
||||
sigwait (&sigs, &n);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
13
src/common.h
13
src/common.h
@@ -1,7 +1,6 @@
|
||||
/* Common declarations for the tar program.
|
||||
|
||||
Copyright 1988, 1992-1994, 1996-1997, 1999-2010, 2012-2017 Free
|
||||
Software Foundation, Inc.
|
||||
Copyright 1988-2019 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU tar.
|
||||
|
||||
@@ -302,6 +301,10 @@ enum hole_detection_method
|
||||
|
||||
GLOBAL enum hole_detection_method hole_detection;
|
||||
|
||||
/* The first entry in names.c:namelist specifies the member name to
|
||||
start extracting from. Set by add_starting_file() upon seeing the
|
||||
-K option.
|
||||
*/
|
||||
GLOBAL bool starting_file_option;
|
||||
|
||||
/* Specified maximum byte length of each tape volume (multiple of 1024). */
|
||||
@@ -628,6 +631,8 @@ void skip_member (void);
|
||||
|
||||
char const *quote_n_colon (int n, char const *arg);
|
||||
void assign_string (char **dest, const char *src);
|
||||
void assign_string_n (char **string, const char *value, size_t n);
|
||||
#define ASSIGN_STRING_N(s,v) assign_string_n (s, v, sizeof (v))
|
||||
int unquote_string (char *str);
|
||||
char *zap_slashes (char *name);
|
||||
char *normalize_filename (int cdidx, const char *name);
|
||||
@@ -750,6 +755,7 @@ const char *name_next (int change_dirs);
|
||||
void name_gather (void);
|
||||
struct name *addname (char const *string, int change_dir,
|
||||
bool cmdline, struct name *parent);
|
||||
void add_starting_file (char const *file_name);
|
||||
void remname (struct name *name);
|
||||
bool name_match (const char *name);
|
||||
void names_notfound (void);
|
||||
@@ -791,6 +797,8 @@ void set_exit_status (int val);
|
||||
|
||||
void request_stdin (const char *option);
|
||||
|
||||
int decode_signal (const char *);
|
||||
|
||||
/* Where an option comes from: */
|
||||
enum option_source
|
||||
{
|
||||
@@ -829,6 +837,7 @@ void xheader_store (char const *keyword, struct tar_stat_info *st,
|
||||
void xheader_read (struct xheader *xhdr, union block *header, off_t size);
|
||||
void xheader_write (char type, char *name, time_t t, struct xheader *xhdr);
|
||||
void xheader_write_global (struct xheader *xhdr);
|
||||
void xheader_forbid_global (void);
|
||||
void xheader_finish (struct xheader *hdr);
|
||||
void xheader_destroy (struct xheader *hdr);
|
||||
char *xheader_xhdr_name (struct tar_stat_info *st);
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/* Diff files from a tar archive.
|
||||
|
||||
Copyright 1988, 1992-1994, 1996-1997, 1999-2001, 2003-2007,
|
||||
2009-2010, 2012-2014, 2016-2017 Free Software Foundation, Inc.
|
||||
Copyright 1988-2019 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU tar.
|
||||
|
||||
|
||||
11
src/create.c
11
src/create.c
@@ -1,7 +1,6 @@
|
||||
/* Create a tar archive.
|
||||
|
||||
Copyright 1985, 1992-1994, 1996-1997, 1999-2001, 2003-2007,
|
||||
2009-2010, 2012-2014, 2016-2017 Free Software Foundation, Inc.
|
||||
Copyright 1985-2019 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU tar.
|
||||
|
||||
@@ -518,8 +517,8 @@ start_private_header (const char *name, size_t size, time_t t)
|
||||
MODE_TO_CHARS (S_IFREG|S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH, header->header.mode);
|
||||
UID_TO_CHARS (0, header->header.uid);
|
||||
GID_TO_CHARS (0, header->header.gid);
|
||||
strncpy (header->header.magic, TMAGIC, TMAGLEN);
|
||||
strncpy (header->header.version, TVERSION, TVERSLEN);
|
||||
memcpy (header->header.magic, TMAGIC, TMAGLEN);
|
||||
memcpy (header->header.version, TVERSION, TVERSLEN);
|
||||
return header;
|
||||
}
|
||||
|
||||
@@ -917,8 +916,8 @@ start_header (struct tar_stat_info *st)
|
||||
|
||||
case POSIX_FORMAT:
|
||||
case USTAR_FORMAT:
|
||||
strncpy (header->header.magic, TMAGIC, TMAGLEN);
|
||||
strncpy (header->header.version, TVERSION, TVERSLEN);
|
||||
memcpy (header->header.magic, TMAGIC, TMAGLEN);
|
||||
memcpy (header->header.version, TVERSION, TVERSLEN);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/* Delete entries from a tar archive.
|
||||
|
||||
Copyright 1988, 1992, 1994, 1996-1997, 2000-2001, 2003-2006, 2010,
|
||||
2013-2014, 2016-2017 Free Software Foundation, Inc.
|
||||
Copyright 1988-2019 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU tar.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Per-directory exclusion files for tar.
|
||||
|
||||
Copyright 2014, 2016-2017 Free Software Foundation, Inc.
|
||||
Copyright 2014-2019 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU tar.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Exit from GNU tar.
|
||||
|
||||
Copyright 2009, 2013-2014, 2016-2017 Free Software Foundation, Inc.
|
||||
Copyright 2009-2019 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU tar.
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/* Extract files from a tar archive.
|
||||
|
||||
Copyright 1988, 1992-1994, 1996-2001, 2003-2007, 2010, 2012-2014,
|
||||
2016-2017 Free Software Foundation, Inc.
|
||||
Copyright 1988-2019 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU tar.
|
||||
|
||||
@@ -788,6 +787,7 @@ maybe_recoverable (char *file_name, bool regular, bool *interdir_made)
|
||||
case UNLINK_FIRST_OLD_FILES:
|
||||
break;
|
||||
}
|
||||
FALLTHROUGH;
|
||||
|
||||
case ENOENT:
|
||||
/* Attempt creating missing intermediate directories. */
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/* GNU dump extensions to tar.
|
||||
|
||||
Copyright 1988, 1992-1994, 1996-1997, 1999-2001, 2003-2009,
|
||||
2013-2014, 2016-2017 Free Software Foundation, Inc.
|
||||
Copyright 1988-2019 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU tar.
|
||||
|
||||
@@ -915,6 +914,7 @@ store_rename (struct directory *dir, struct obstack *stk)
|
||||
obstack_code_rename (stk, p->orig->name, p->name);
|
||||
|
||||
obstack_code_rename (stk, "", prev->name);
|
||||
free (temp_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -997,10 +997,10 @@ read_incr_db_01 (int version, const char *initbuf)
|
||||
newer_mtime_option = decode_timespec (buf, &ebuf, false);
|
||||
|
||||
if (! valid_timespec (newer_mtime_option))
|
||||
ERROR ((0, errno, "%s:%ld: %s",
|
||||
quotearg_colon (listed_incremental_option),
|
||||
lineno,
|
||||
_("Invalid time stamp")));
|
||||
FATAL_ERROR ((0, errno, "%s:%ld: %s",
|
||||
quotearg_colon (listed_incremental_option),
|
||||
lineno,
|
||||
_("Invalid time stamp")));
|
||||
else
|
||||
{
|
||||
if (version == 1 && *ebuf)
|
||||
@@ -1042,9 +1042,9 @@ read_incr_db_01 (int version, const char *initbuf)
|
||||
mtime = decode_timespec (strp, &ebuf, false);
|
||||
strp = ebuf;
|
||||
if (!valid_timespec (mtime) || *strp != ' ')
|
||||
ERROR ((0, errno, "%s:%ld: %s",
|
||||
quotearg_colon (listed_incremental_option), lineno,
|
||||
_("Invalid modification time")));
|
||||
FATAL_ERROR ((0, errno, "%s:%ld: %s",
|
||||
quotearg_colon (listed_incremental_option), lineno,
|
||||
_("Invalid modification time")));
|
||||
|
||||
errno = 0;
|
||||
u = strtoumax (strp, &ebuf, 10);
|
||||
@@ -1052,9 +1052,9 @@ read_incr_db_01 (int version, const char *initbuf)
|
||||
errno = ERANGE;
|
||||
if (errno || strp == ebuf || *ebuf != ' ')
|
||||
{
|
||||
ERROR ((0, errno, "%s:%ld: %s",
|
||||
quotearg_colon (listed_incremental_option), lineno,
|
||||
_("Invalid modification time (nanoseconds)")));
|
||||
FATAL_ERROR ((0, errno, "%s:%ld: %s",
|
||||
quotearg_colon (listed_incremental_option), lineno,
|
||||
_("Invalid modification time (nanoseconds)")));
|
||||
mtime.tv_nsec = -1;
|
||||
}
|
||||
else
|
||||
@@ -1068,17 +1068,17 @@ read_incr_db_01 (int version, const char *initbuf)
|
||||
TYPE_MINIMUM (dev_t), TYPE_MAXIMUM (dev_t));
|
||||
strp = ebuf;
|
||||
if (errno || *strp != ' ')
|
||||
ERROR ((0, errno, "%s:%ld: %s",
|
||||
FATAL_ERROR ((0, errno, "%s:%ld: %s",
|
||||
quotearg_colon (listed_incremental_option), lineno,
|
||||
_("Invalid device number")));
|
||||
_("Invalid device number")));
|
||||
|
||||
ino = strtosysint (strp, &ebuf,
|
||||
TYPE_MINIMUM (ino_t), TYPE_MAXIMUM (ino_t));
|
||||
strp = ebuf;
|
||||
if (errno || *strp != ' ')
|
||||
ERROR ((0, errno, "%s:%ld: %s",
|
||||
quotearg_colon (listed_incremental_option), lineno,
|
||||
_("Invalid inode number")));
|
||||
FATAL_ERROR ((0, errno, "%s:%ld: %s",
|
||||
quotearg_colon (listed_incremental_option), lineno,
|
||||
_("Invalid inode number")));
|
||||
|
||||
strp++;
|
||||
unquote_string (strp);
|
||||
|
||||
25
src/list.c
25
src/list.c
@@ -1,7 +1,6 @@
|
||||
/* List a tar archive, with support routines for reading a tar archive.
|
||||
|
||||
Copyright 1988, 1992-1994, 1996-2001, 2003-2007, 2010, 2012-2017 Free
|
||||
Software Foundation, Inc.
|
||||
Copyright 1988-2019 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU tar.
|
||||
|
||||
@@ -23,7 +22,7 @@
|
||||
#include <system.h>
|
||||
#include <inttostr.h>
|
||||
#include <quotearg.h>
|
||||
|
||||
#include <time.h>
|
||||
#include "common.h"
|
||||
|
||||
union block *current_header; /* points to current archive header */
|
||||
@@ -631,10 +630,12 @@ decode_header (union block *header, struct tar_stat_info *stat_info,
|
||||
stat_info->stat.st_mode = mode;
|
||||
stat_info->mtime.tv_sec = TIME_FROM_HEADER (header->header.mtime);
|
||||
stat_info->mtime.tv_nsec = 0;
|
||||
assign_string (&stat_info->uname,
|
||||
header->header.uname[0] ? header->header.uname : NULL);
|
||||
assign_string (&stat_info->gname,
|
||||
header->header.gname[0] ? header->header.gname : NULL);
|
||||
assign_string_n (&stat_info->uname,
|
||||
header->header.uname[0] ? header->header.uname : NULL,
|
||||
sizeof (header->header.uname));
|
||||
assign_string_n (&stat_info->gname,
|
||||
header->header.gname[0] ? header->header.gname : NULL,
|
||||
sizeof (header->header.gname));
|
||||
|
||||
xheader_xattr_init (stat_info);
|
||||
|
||||
@@ -1049,15 +1050,11 @@ tartime (struct timespec t, bool full_time)
|
||||
{
|
||||
if (full_time)
|
||||
{
|
||||
sprintf (buffer, "%04ld-%02d-%02d %02d:%02d:%02d",
|
||||
tm->tm_year + 1900L, tm->tm_mon + 1, tm->tm_mday,
|
||||
tm->tm_hour, tm->tm_min, tm->tm_sec);
|
||||
strftime (buffer, sizeof buffer, "%Y-%m-%d %H:%M:%S", tm);
|
||||
code_ns_fraction (ns, buffer + strlen (buffer));
|
||||
}
|
||||
else
|
||||
sprintf (buffer, "%04ld-%02d-%02d %02d:%02d",
|
||||
tm->tm_year + 1900L, tm->tm_mon + 1, tm->tm_mday,
|
||||
tm->tm_hour, tm->tm_min);
|
||||
strftime (buffer, sizeof buffer, "%Y-%m-%d %H:%M", tm);
|
||||
return buffer;
|
||||
}
|
||||
|
||||
@@ -1443,7 +1440,7 @@ test_archive_label (void)
|
||||
decode_header (current_header,
|
||||
¤t_stat_info, ¤t_format, 0);
|
||||
if (current_header->header.typeflag == GNUTYPE_VOLHDR)
|
||||
assign_string (&volume_label, current_header->header.name);
|
||||
ASSIGN_STRING_N (&volume_label, current_header->header.name);
|
||||
|
||||
if (volume_label)
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Owner/group mapping for tar
|
||||
|
||||
Copyright 2015-2017 Free Software Foundation, Inc.
|
||||
Copyright 2015-2019 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU tar.
|
||||
|
||||
|
||||
19
src/misc.c
19
src/misc.c
@@ -1,7 +1,6 @@
|
||||
/* Miscellaneous functions, not really specific to GNU tar.
|
||||
|
||||
Copyright 1988, 1992, 1994-1997, 1999-2001, 2003-2007, 2009-2010,
|
||||
2012-2014, 2016-2017 Free Software Foundation, Inc.
|
||||
Copyright 1988-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
@@ -50,6 +49,20 @@ assign_string (char **string, const char *value)
|
||||
*string = value ? xstrdup (value) : 0;
|
||||
}
|
||||
|
||||
void
|
||||
assign_string_n (char **string, const char *value, size_t n)
|
||||
{
|
||||
free (*string);
|
||||
if (value)
|
||||
{
|
||||
size_t l = strnlen (value, n);
|
||||
char *p = xmalloc (l + 1);
|
||||
memcpy (p, value, l);
|
||||
p[l] = 0;
|
||||
*string = p;
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* This function is currently unused; perhaps it should be removed? */
|
||||
|
||||
@@ -727,7 +740,7 @@ maybe_backup_file (const char *file_name, bool this_is_the_archive)
|
||||
&& (S_ISBLK (file_stat.st_mode) || S_ISCHR (file_stat.st_mode)))
|
||||
return true;
|
||||
|
||||
after_backup_name = find_backup_file_name (file_name, backup_type);
|
||||
after_backup_name = find_backup_file_name (chdir_fd, file_name, backup_type);
|
||||
if (! after_backup_name)
|
||||
xalloc_die ();
|
||||
|
||||
|
||||
55
src/names.c
55
src/names.c
@@ -1,7 +1,6 @@
|
||||
/* Various processing of names.
|
||||
|
||||
Copyright 1988, 1992, 1994, 1996-2001, 2003-2007, 2009, 2013-2017
|
||||
Free Software Foundation, Inc.
|
||||
Copyright 1988-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
@@ -1227,6 +1226,34 @@ addname (char const *string, int change_dir, bool cmdline, struct name *parent)
|
||||
return name;
|
||||
}
|
||||
|
||||
void
|
||||
add_starting_file (char const *file_name)
|
||||
{
|
||||
struct name *name = make_name (file_name);
|
||||
|
||||
if (starting_file_option)
|
||||
{
|
||||
struct name *head = namelist;
|
||||
remname (head);
|
||||
free_name (head);
|
||||
}
|
||||
|
||||
name->prev = NULL;
|
||||
name->next = namelist;
|
||||
namelist = name;
|
||||
if (!nametail)
|
||||
nametail = namelist;
|
||||
|
||||
name->found_count = 0;
|
||||
name->matching_flags = INCLUDE_OPTIONS;
|
||||
name->change_dir = 0;
|
||||
name->directory = NULL;
|
||||
name->parent = NULL;
|
||||
name->cmdline = true;
|
||||
|
||||
starting_file_option = true;
|
||||
}
|
||||
|
||||
/* Find a match for FILE_NAME (whose string length is LENGTH) in the name
|
||||
list. */
|
||||
static struct name *
|
||||
@@ -1283,19 +1310,22 @@ name_match (const char *file_name)
|
||||
}
|
||||
|
||||
cursor = namelist_match (file_name, length);
|
||||
if (starting_file_option)
|
||||
{
|
||||
/* If starting_file_option is set, the head of the list is the name
|
||||
of the member to start extraction from. Skip the match unless it
|
||||
is head. */
|
||||
if (cursor == namelist)
|
||||
starting_file_option = false;
|
||||
else
|
||||
cursor = NULL;
|
||||
}
|
||||
if (cursor)
|
||||
{
|
||||
if (!(ISSLASH (file_name[cursor->length]) && recursion_option)
|
||||
|| cursor->found_count == 0)
|
||||
cursor->found_count++; /* remember it matched */
|
||||
if (starting_file_option)
|
||||
{
|
||||
free (namelist);
|
||||
namelist = NULL;
|
||||
nametail = NULL;
|
||||
}
|
||||
chdir_do (cursor->change_dir);
|
||||
|
||||
/* We got a match. */
|
||||
return ISFOUND (cursor);
|
||||
}
|
||||
@@ -1767,6 +1797,11 @@ collect_and_sort_names (void)
|
||||
name->found_count++;
|
||||
add_hierarchy_to_namelist (&st, name);
|
||||
}
|
||||
else
|
||||
{
|
||||
errno = ENOTDIR;
|
||||
open_diag (name->name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1821,7 +1856,7 @@ collect_and_sort_names (void)
|
||||
|
||||
if (listed_incremental_option)
|
||||
{
|
||||
for (name = namelist; name && name->name[0] == 0; name++)
|
||||
for (name = namelist; name && name->name[0] == 0; name = name->next)
|
||||
;
|
||||
if (name)
|
||||
append_incremental_renames (name->directory);
|
||||
|
||||
54
src/sparse.c
54
src/sparse.c
@@ -1,6 +1,6 @@
|
||||
/* Functions for dealing with sparse files
|
||||
|
||||
Copyright 2003-2007, 2010, 2013-2017 Free Software Foundation, Inc.
|
||||
Copyright 2003-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
@@ -427,6 +427,30 @@ sparse_dump_region (struct tar_sparse_file *file, size_t i)
|
||||
bufsize);
|
||||
return false;
|
||||
}
|
||||
else if (bytes_read == 0)
|
||||
{
|
||||
char buf[UINTMAX_STRSIZE_BOUND];
|
||||
struct stat st;
|
||||
size_t n;
|
||||
if (fstat (file->fd, &st) == 0)
|
||||
n = file->stat_info->stat.st_size - st.st_size;
|
||||
else
|
||||
n = file->stat_info->stat.st_size
|
||||
- (file->stat_info->sparse_map[i].offset
|
||||
+ file->stat_info->sparse_map[i].numbytes
|
||||
- bytes_left);
|
||||
|
||||
WARNOPT (WARN_FILE_SHRANK,
|
||||
(0, 0,
|
||||
ngettext ("%s: File shrank by %s byte; padding with zeros",
|
||||
"%s: File shrank by %s bytes; padding with zeros",
|
||||
n),
|
||||
quotearg_colon (file->stat_info->orig_file_name),
|
||||
STRINGIFY_BIGINT (n, buf)));
|
||||
if (! ignore_failed_read_option)
|
||||
set_exit_status (TAREXIT_DIFFERS);
|
||||
return false;
|
||||
}
|
||||
|
||||
memset (blk->buffer + bytes_read, 0, BLOCKSIZE - bytes_read);
|
||||
bytes_left -= bytes_read;
|
||||
@@ -464,9 +488,9 @@ sparse_extract_region (struct tar_sparse_file *file, size_t i)
|
||||
return false;
|
||||
}
|
||||
set_next_block_after (blk);
|
||||
file->dumped_size += BLOCKSIZE;
|
||||
count = blocking_write (file->fd, blk->buffer, wrbytes);
|
||||
write_size -= count;
|
||||
file->dumped_size += count;
|
||||
mv_size_left (file->stat_info->archive_file_size - file->dumped_size);
|
||||
file->offset += count;
|
||||
if (count != wrbytes)
|
||||
@@ -598,6 +622,12 @@ check_sparse_region (struct tar_sparse_file *file, off_t beg, off_t end)
|
||||
rdsize);
|
||||
return false;
|
||||
}
|
||||
else if (bytes_read == 0)
|
||||
{
|
||||
report_difference (file->stat_info, _("Size differs"));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!zero_block_p (diff_buffer, bytes_read))
|
||||
{
|
||||
char begbuf[INT_BUFSIZE_BOUND (off_t)];
|
||||
@@ -609,6 +639,7 @@ check_sparse_region (struct tar_sparse_file *file, off_t beg, off_t end)
|
||||
|
||||
beg += bytes_read;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -635,6 +666,7 @@ check_data_region (struct tar_sparse_file *file, size_t i)
|
||||
return false;
|
||||
}
|
||||
set_next_block_after (blk);
|
||||
file->dumped_size += BLOCKSIZE;
|
||||
bytes_read = safe_read (file->fd, diff_buffer, rdsize);
|
||||
if (bytes_read == SAFE_READ_ERROR)
|
||||
{
|
||||
@@ -645,7 +677,11 @@ check_data_region (struct tar_sparse_file *file, size_t i)
|
||||
rdsize);
|
||||
return false;
|
||||
}
|
||||
file->dumped_size += bytes_read;
|
||||
else if (bytes_read == 0)
|
||||
{
|
||||
report_difference (¤t_stat_info, _("Size differs"));
|
||||
return false;
|
||||
}
|
||||
size_left -= bytes_read;
|
||||
mv_size_left (file->stat_info->archive_file_size - file->dumped_size);
|
||||
if (memcmp (blk->buffer, diff_buffer, rdsize))
|
||||
@@ -1213,7 +1249,8 @@ pax_decode_header (struct tar_sparse_file *file)
|
||||
union block *blk;
|
||||
char *p;
|
||||
size_t i;
|
||||
|
||||
off_t start;
|
||||
|
||||
#define COPY_BUF(b,buf,src) do \
|
||||
{ \
|
||||
char *endp = b->buffer + BLOCKSIZE; \
|
||||
@@ -1229,8 +1266,9 @@ pax_decode_header (struct tar_sparse_file *file)
|
||||
if (src == endp) \
|
||||
{ \
|
||||
set_next_block_after (b); \
|
||||
file->dumped_size += BLOCKSIZE; \
|
||||
b = find_next_block (); \
|
||||
if (!b) \
|
||||
FATAL_ERROR ((0, 0, _("Unexpected EOF in archive"))); \
|
||||
src = b->buffer; \
|
||||
endp = b->buffer + BLOCKSIZE; \
|
||||
} \
|
||||
@@ -1240,9 +1278,11 @@ pax_decode_header (struct tar_sparse_file *file)
|
||||
dst[-1] = 0; \
|
||||
} while (0)
|
||||
|
||||
start = current_block_ordinal ();
|
||||
set_next_block_after (current_header);
|
||||
file->dumped_size += BLOCKSIZE;
|
||||
blk = find_next_block ();
|
||||
if (!blk)
|
||||
FATAL_ERROR ((0, 0, _("Unexpected EOF in archive")));
|
||||
p = blk->buffer;
|
||||
COPY_BUF (blk,nbuf,p);
|
||||
if (!decode_num (&u, nbuf, TYPE_MAXIMUM (size_t)))
|
||||
@@ -1278,6 +1318,8 @@ pax_decode_header (struct tar_sparse_file *file)
|
||||
sparse_add_map (file->stat_info, &sp);
|
||||
}
|
||||
set_next_block_after (blk);
|
||||
|
||||
file->dumped_size += BLOCKSIZE * (current_block_ordinal () - start);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
16
src/suffix.c
16
src/suffix.c
@@ -1,6 +1,5 @@
|
||||
/* This file is part of GNU tar.
|
||||
Copyright 2007, 2009, 2013-2014, 2016-2017 Free Software Foundation,
|
||||
Inc.
|
||||
Copyright 2007-2019 Free Software Foundation, Inc.
|
||||
|
||||
Written by Sergey Poznyakoff.
|
||||
|
||||
@@ -46,6 +45,8 @@ static struct compression_suffix compression_suffixes[] = {
|
||||
{ S(lzo, LZOP) },
|
||||
{ S(xz, XZ) },
|
||||
{ S(txz, XZ) }, /* Slackware */
|
||||
{ S(zst, ZSTD) },
|
||||
{ S(tzst, ZSTD) },
|
||||
{ NULL }
|
||||
#undef S
|
||||
#undef __CAT2__
|
||||
@@ -60,7 +61,7 @@ find_compression_suffix (const char *name, size_t *ret_len)
|
||||
{
|
||||
size_t len;
|
||||
struct compression_suffix *p;
|
||||
|
||||
|
||||
suf++;
|
||||
len = strlen (suf);
|
||||
|
||||
@@ -99,10 +100,14 @@ strip_compression_suffix (const char *name)
|
||||
{
|
||||
char *s = NULL;
|
||||
size_t len;
|
||||
struct compression_suffix const *p = find_compression_suffix (name, &len);
|
||||
|
||||
if (find_compression_suffix (name, &len))
|
||||
if (p)
|
||||
{
|
||||
if (strncmp (name + len - 4, ".tar", 4) == 0)
|
||||
/* Strip an additional ".tar" suffix, but only if the just-stripped
|
||||
"outer" suffix did not begin with "t". */
|
||||
if (len > 4 && strncmp (name + len - 4, ".tar", 4) == 0
|
||||
&& p->suffix[0] != 't')
|
||||
len -= 4;
|
||||
if (len == 0)
|
||||
return NULL;
|
||||
@@ -112,4 +117,3 @@ strip_compression_suffix (const char *name)
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/* System-dependent calls for tar.
|
||||
|
||||
Copyright 2003-2008, 2010, 2013-2014, 2016-2017 Free Software
|
||||
Foundation, Inc.
|
||||
Copyright 2003-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
|
||||
70
src/tar.c
70
src/tar.c
@@ -1,7 +1,6 @@
|
||||
/* A tar (tape archiver) program.
|
||||
|
||||
Copyright 1988, 1992-1997, 1999-2001, 2003-2007, 2012-2017 Free
|
||||
Software Foundation, Inc.
|
||||
Copyright 1988-2019 Free Software Foundation, Inc.
|
||||
|
||||
Written by John Gilmore, starting 1985-08-25.
|
||||
|
||||
@@ -348,7 +347,8 @@ enum
|
||||
WARNING_OPTION,
|
||||
XATTR_OPTION,
|
||||
XATTR_EXCLUDE,
|
||||
XATTR_INCLUDE
|
||||
XATTR_INCLUDE,
|
||||
ZSTD_OPTION,
|
||||
};
|
||||
|
||||
static char const doc[] = N_("\
|
||||
@@ -682,6 +682,7 @@ static struct argp_option options[] = {
|
||||
{"lzma", LZMA_OPTION, 0, 0, NULL, GRID+1 },
|
||||
{"lzop", LZOP_OPTION, 0, 0, NULL, GRID+1 },
|
||||
{"xz", 'J', 0, 0, NULL, GRID+1 },
|
||||
{"zstd", ZSTD_OPTION, 0, 0, NULL, GRID+1 },
|
||||
#undef GRID
|
||||
|
||||
#define GRID 100
|
||||
@@ -974,36 +975,37 @@ stat_on_signal (int signo)
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
set_stat_signal (const char *name)
|
||||
int
|
||||
decode_signal (const char *name)
|
||||
{
|
||||
static struct sigtab
|
||||
{
|
||||
char const *name;
|
||||
int signo;
|
||||
} const sigtab[] = {
|
||||
{ "SIGUSR1", SIGUSR1 },
|
||||
{ "USR1", SIGUSR1 },
|
||||
{ "SIGUSR2", SIGUSR2 },
|
||||
{ "USR2", SIGUSR2 },
|
||||
{ "SIGHUP", SIGHUP },
|
||||
{ "HUP", SIGHUP },
|
||||
{ "SIGINT", SIGINT },
|
||||
{ "INT", SIGINT },
|
||||
{ "SIGQUIT", SIGQUIT },
|
||||
{ "QUIT", SIGQUIT }
|
||||
};
|
||||
struct sigtab const *p;
|
||||
char const *s = name;
|
||||
|
||||
if (strncmp (s, "SIG", 3) == 0)
|
||||
s += 3;
|
||||
for (p = sigtab; p < sigtab + sizeof (sigtab) / sizeof (sigtab[0]); p++)
|
||||
if (strcmp (p->name, name) == 0)
|
||||
{
|
||||
stat_on_signal (p->signo);
|
||||
return;
|
||||
}
|
||||
if (strcmp (p->name, s) == 0)
|
||||
return p->signo;
|
||||
FATAL_ERROR ((0, 0, _("Unknown signal name: %s"), name));
|
||||
}
|
||||
|
||||
static void
|
||||
set_stat_signal (const char *name)
|
||||
{
|
||||
stat_on_signal (decode_signal (name));
|
||||
}
|
||||
|
||||
|
||||
struct textual_date
|
||||
{
|
||||
@@ -1129,6 +1131,10 @@ tar_help_filter (int key, const char *text, void *input)
|
||||
s = xasprintf (_("filter the archive through %s"), XZ_PROGRAM);
|
||||
break;
|
||||
|
||||
case ZSTD_OPTION:
|
||||
s = xasprintf (_("filter the archive through %s"), ZSTD_PROGRAM);
|
||||
break;
|
||||
|
||||
case ARGP_KEY_HELP_EXTRA:
|
||||
{
|
||||
const char *tstr;
|
||||
@@ -1151,7 +1157,7 @@ tar_help_filter (int key, const char *text, void *input)
|
||||
return s;
|
||||
}
|
||||
|
||||
static char *
|
||||
static char * _GL_ATTRIBUTE_MALLOC
|
||||
expand_pax_option (struct tar_args *targs, const char *arg)
|
||||
{
|
||||
struct obstack stk;
|
||||
@@ -1437,8 +1443,7 @@ parse_opt (int key, char *arg, struct argp_state *state)
|
||||
|
||||
case 'K':
|
||||
optloc_save (OC_STARTING_FILE, args->loc);
|
||||
starting_file_option = true;
|
||||
addname (arg, 0, true, NULL);
|
||||
add_starting_file (arg);
|
||||
break;
|
||||
|
||||
case ONE_FILE_SYSTEM_OPTION:
|
||||
@@ -1650,6 +1655,10 @@ parse_opt (int key, char *arg, struct argp_state *state)
|
||||
set_use_compress_program_option (COMPRESS_PROGRAM, args->loc);
|
||||
break;
|
||||
|
||||
case ZSTD_OPTION:
|
||||
set_use_compress_program_option (ZSTD_PROGRAM, args->loc);
|
||||
break;
|
||||
|
||||
case ATIME_PRESERVE_OPTION:
|
||||
atime_preserve_option =
|
||||
(arg
|
||||
@@ -2656,7 +2665,28 @@ decode_options (int argc, char **argv)
|
||||
|
||||
report_textual_dates (&args);
|
||||
}
|
||||
|
||||
#ifdef ENABLE_ERROR_PRINT_PROGNAME
|
||||
/* The error() function from glibc correctly prefixes each message it
|
||||
prints with program_name as set by set_program_name. However, its
|
||||
replacement from gnulib, which is linked in on systems where this
|
||||
function is not available, prints the name returned by getprogname()
|
||||
instead. Due to this messages output by tar subprocess (which sets its
|
||||
program name to 'tar (child)') become indiscernible from those printed
|
||||
by the main process. In particular, this breaks the remfiles01.at and
|
||||
remfiles02.at test cases.
|
||||
|
||||
To avoid this, on such systems the following helper function is used
|
||||
to print proper program name. Its address is assigned to the
|
||||
error_print_progname variable, which error() then uses instead of
|
||||
printing getprogname() result.
|
||||
*/
|
||||
static void
|
||||
tar_print_progname (void)
|
||||
{
|
||||
fprintf (stderr, "%s: ", program_name);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Tar proper. */
|
||||
|
||||
@@ -2666,7 +2696,9 @@ main (int argc, char **argv)
|
||||
{
|
||||
set_start_time ();
|
||||
set_program_name (argv[0]);
|
||||
|
||||
#ifdef ENABLE_ERROR_PRINT_PROGNAME
|
||||
error_print_progname = tar_print_progname;
|
||||
#endif
|
||||
setlocale (LC_ALL, "");
|
||||
bindtextdomain (PACKAGE, LOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/* GNU tar Archive Format description.
|
||||
|
||||
Copyright 1988-1989, 1991-1997, 2000-2001, 2003-2007, 2012-2014,
|
||||
2016-2017 Free Software Foundation, Inc.
|
||||
Copyright 1988-2019 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU tar.
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/* This file is part of GNU tar.
|
||||
Copyright 2006-2008, 2013-2014, 2016-2017 Free Software Foundation,
|
||||
Inc.
|
||||
Copyright 2006-2019 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
@@ -101,7 +100,7 @@ add_segment (struct transform *tf)
|
||||
}
|
||||
|
||||
static void
|
||||
add_literal_segment (struct transform *tf, char *str, char *end)
|
||||
add_literal_segment (struct transform *tf, const char *str, const char *end)
|
||||
{
|
||||
size_t len = end - str;
|
||||
if (len)
|
||||
@@ -273,7 +272,7 @@ parse_transform_expr (const char *expr)
|
||||
USAGE_ERROR ((0, 0, _("Invalid transform expression: %s"), errbuf));
|
||||
}
|
||||
|
||||
if (str[0] == '^' || str[strlen (str) - 1] == '$')
|
||||
if (str[0] == '^' || (i > 2 && str[i - 3] == '$'))
|
||||
tf->transform_type = transform_first;
|
||||
|
||||
free (str);
|
||||
@@ -403,6 +402,7 @@ parse_transform_expr (const char *expr)
|
||||
cur++;
|
||||
}
|
||||
add_literal_segment (tf, beg, cur);
|
||||
free(str);
|
||||
|
||||
return p;
|
||||
}
|
||||
@@ -550,7 +550,7 @@ _single_transform_name_to_obstack (struct transform *tf, char *input)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
/*FALL THROUGH*/
|
||||
FALLTHROUGH;
|
||||
|
||||
case ctl_upcase:
|
||||
case ctl_locase:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Unlink files.
|
||||
|
||||
Copyright 2009, 2013-2014, 2016-2017 Free Software Foundation, Inc.
|
||||
Copyright 2009-2019 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU tar.
|
||||
|
||||
@@ -127,7 +127,9 @@ flush_deferred_unlinks (bool force)
|
||||
case EEXIST:
|
||||
/* OpenSolaris >=10 sets EEXIST instead of ENOTEMPTY
|
||||
if trying to remove a non-empty directory */
|
||||
#if defined ENOTEMPTY && ENOTEMPTY != EEXIST
|
||||
case ENOTEMPTY:
|
||||
#endif
|
||||
/* Keep the record in list, in the hope we'll
|
||||
be able to remove it later */
|
||||
prev = p;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/* Update a tar archive.
|
||||
|
||||
Copyright 1988, 1992, 1994, 1996-1997, 1999-2001, 2003-2005, 2007,
|
||||
2010, 2013-2014, 2016-2017 Free Software Foundation, Inc.
|
||||
Copyright 1988-2019 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU tar.
|
||||
|
||||
@@ -111,7 +110,7 @@ update_archive (void)
|
||||
|
||||
name_gather ();
|
||||
open_archive (ACCESS_UPDATE);
|
||||
buffer_write_global_xheader ();
|
||||
xheader_forbid_global ();
|
||||
|
||||
while (!found_end)
|
||||
{
|
||||
|
||||
33
src/utf8.c
33
src/utf8.c
@@ -1,7 +1,6 @@
|
||||
/* Charset handling for GNU tar.
|
||||
|
||||
Copyright 2004, 2006-2007, 2013-2014, 2016-2017 Free Software
|
||||
Foundation, Inc.
|
||||
Copyright 2004-2019 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU tar.
|
||||
|
||||
@@ -36,11 +35,14 @@
|
||||
# define iconv_open(tocode, fromcode) ((iconv_t) -1)
|
||||
|
||||
# undef iconv
|
||||
# define iconv(cd, inbuf, inbytesleft, outbuf, outbytesleft) ((size_t) 0)
|
||||
# define iconv(cd, inbuf, inbytesleft, outbuf, outbytesleft) (errno = ENOSYS, (size_t) -1)
|
||||
|
||||
# undef iconv_close
|
||||
# define iconv_close(cd) 0
|
||||
|
||||
# undef iconv_t
|
||||
# define iconv_t int
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -65,10 +67,9 @@ bool
|
||||
utf8_convert (bool to_utf, char const *input, char **output)
|
||||
{
|
||||
char ICONV_CONST *ib;
|
||||
char *ob;
|
||||
char *ob, *ret;
|
||||
size_t inlen;
|
||||
size_t outlen;
|
||||
size_t rc;
|
||||
iconv_t cd = utf8_init (to_utf);
|
||||
|
||||
if (cd == 0)
|
||||
@@ -81,11 +82,27 @@ utf8_convert (bool to_utf, char const *input, char **output)
|
||||
|
||||
inlen = strlen (input) + 1;
|
||||
outlen = inlen * MB_LEN_MAX + 1;
|
||||
ob = *output = xmalloc (outlen);
|
||||
ob = ret = xmalloc (outlen);
|
||||
ib = (char ICONV_CONST *) input;
|
||||
rc = iconv (cd, &ib, &inlen, &ob, &outlen);
|
||||
/* According to POSIX, "if iconv() encounters a character in the input
|
||||
buffer that is valid, but for which an identical character does not
|
||||
exist in the target codeset, iconv() shall perform an
|
||||
implementation-defined conversion on this character." It will "update
|
||||
the variables pointed to by the arguments to reflect the extent of the
|
||||
conversion and return the number of non-identical conversions performed".
|
||||
On error, it returns -1.
|
||||
In other words, non-zero return always indicates failure, either because
|
||||
the input was not fully converted, or because it was converted in a
|
||||
non-reversible way.
|
||||
*/
|
||||
if (iconv (cd, &ib, &inlen, &ob, &outlen) != 0)
|
||||
{
|
||||
free (ret);
|
||||
return false;
|
||||
}
|
||||
*ob = 0;
|
||||
return rc != -1;
|
||||
*output = ret;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Warnings for GNU tar.
|
||||
|
||||
Copyright 2009, 2012-2014, 2016-2017 Free Software Foundation, Inc.
|
||||
Copyright 2009-2019 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU tar.
|
||||
|
||||
|
||||
41
src/xattrs.c
41
src/xattrs.c
@@ -1,6 +1,6 @@
|
||||
/* Support for extended attributes.
|
||||
|
||||
Copyright (C) 2006-2014, 2016-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 2006-2019 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU tar.
|
||||
|
||||
@@ -246,13 +246,36 @@ xattrs__acls_set (struct tar_stat_info const *st,
|
||||
acl_free (acl);
|
||||
}
|
||||
|
||||
/* Cleanup textual representation of the ACL in VAL by eliminating tab
|
||||
characters and comments */
|
||||
static void
|
||||
xattrs_acls_cleanup (char *val, size_t *plen)
|
||||
{
|
||||
char *p, *q;
|
||||
|
||||
p = q = val + strcspn (val, "#\t");
|
||||
while (*q)
|
||||
{
|
||||
if (*q == '\t')
|
||||
q++;
|
||||
else if (*q == '#')
|
||||
{
|
||||
while (*q != '\n')
|
||||
q++;
|
||||
}
|
||||
else
|
||||
*p++ = *q++;
|
||||
}
|
||||
*plen = p - val;
|
||||
*p++ = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
xattrs__acls_get_a (int parentfd, const char *file_name,
|
||||
struct tar_stat_info *st,
|
||||
char **ret_ptr, size_t * ret_len)
|
||||
{
|
||||
char *val = NULL;
|
||||
ssize_t len;
|
||||
acl_t acl;
|
||||
|
||||
if (!(acl = acl_get_file_at (parentfd, file_name, ACL_TYPE_ACCESS)))
|
||||
@@ -262,7 +285,7 @@ xattrs__acls_get_a (int parentfd, const char *file_name,
|
||||
return;
|
||||
}
|
||||
|
||||
val = acl_to_text (acl, &len);
|
||||
val = acl_to_text (acl, NULL);
|
||||
acl_free (acl);
|
||||
|
||||
if (!val)
|
||||
@@ -272,8 +295,7 @@ xattrs__acls_get_a (int parentfd, const char *file_name,
|
||||
}
|
||||
|
||||
*ret_ptr = xstrdup (val);
|
||||
*ret_len = len;
|
||||
|
||||
xattrs_acls_cleanup (*ret_ptr, ret_len);
|
||||
acl_free (val);
|
||||
}
|
||||
|
||||
@@ -284,7 +306,6 @@ xattrs__acls_get_d (int parentfd, char const *file_name,
|
||||
char **ret_ptr, size_t * ret_len)
|
||||
{
|
||||
char *val = NULL;
|
||||
ssize_t len;
|
||||
acl_t acl;
|
||||
|
||||
if (!(acl = acl_get_file_at (parentfd, file_name, ACL_TYPE_DEFAULT)))
|
||||
@@ -294,7 +315,7 @@ xattrs__acls_get_d (int parentfd, char const *file_name,
|
||||
return;
|
||||
}
|
||||
|
||||
val = acl_to_text (acl, &len);
|
||||
val = acl_to_text (acl, NULL);
|
||||
acl_free (acl);
|
||||
|
||||
if (!val)
|
||||
@@ -304,8 +325,7 @@ xattrs__acls_get_d (int parentfd, char const *file_name,
|
||||
}
|
||||
|
||||
*ret_ptr = xstrdup (val);
|
||||
*ret_len = len;
|
||||
|
||||
xattrs_acls_cleanup (*ret_ptr, ret_len);
|
||||
acl_free (val);
|
||||
}
|
||||
#endif /* HAVE_POSIX_ACLS */
|
||||
@@ -336,6 +356,7 @@ acls_one_line (const char *prefix, char delim,
|
||||
obstack_grow (&stk, prefix, pref_len);
|
||||
obstack_grow (&stk, aclstring, move);
|
||||
|
||||
pos += move + 1;
|
||||
aclstring += move + 1;
|
||||
}
|
||||
|
||||
@@ -740,6 +761,8 @@ xattrs_print (struct tar_stat_info const *st)
|
||||
{
|
||||
fprintf (stdlis, " a: ");
|
||||
acls_one_line ("", ',', st->acls_a_ptr, st->acls_a_len);
|
||||
if (st->acls_a_len && st->acls_d_len)
|
||||
fprintf (stdlis, ",");
|
||||
acls_one_line ("default:", ',', st->acls_d_ptr, st->acls_d_len);
|
||||
fprintf (stdlis, "\n");
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Support for extended attributes.
|
||||
|
||||
Copyright (C) 2006-2014, 2016-2017 Free Software Foundation, Inc.
|
||||
Copyright (C) 2006-2019 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU tar.
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/* POSIX extended headers for tar.
|
||||
|
||||
Copyright (C) 2003-2007, 2009-2010, 2012-2014, 2016-2017 Free
|
||||
Software Foundation, Inc.
|
||||
Copyright (C) 2003-2019 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU tar.
|
||||
|
||||
@@ -185,6 +184,9 @@ xheader_set_keyword_equal (char *kw, char *eq)
|
||||
bool global = true;
|
||||
char *p = eq;
|
||||
|
||||
if (eq == kw)
|
||||
USAGE_ERROR ((0, 0, _("Malformed pax option: %s"), quote (kw)));
|
||||
|
||||
if (eq[-1] == ':')
|
||||
{
|
||||
p--;
|
||||
@@ -255,7 +257,7 @@ char *
|
||||
xheader_format_name (struct tar_stat_info *st, const char *fmt, size_t n)
|
||||
{
|
||||
char *buf;
|
||||
size_t len = strlen (fmt);
|
||||
size_t len;
|
||||
char *q;
|
||||
const char *p;
|
||||
char *dirp = NULL;
|
||||
@@ -266,43 +268,51 @@ xheader_format_name (struct tar_stat_info *st, const char *fmt, size_t n)
|
||||
char nbuf[UINTMAX_STRSIZE_BOUND];
|
||||
char const *nptr = NULL;
|
||||
|
||||
for (p = fmt; *p && (p = strchr (p, '%')); )
|
||||
len = 0;
|
||||
for (p = fmt; *p; p++)
|
||||
{
|
||||
switch (p[1])
|
||||
if (*p == '%' && p[1])
|
||||
{
|
||||
case '%':
|
||||
len--;
|
||||
break;
|
||||
|
||||
case 'd':
|
||||
if (st)
|
||||
switch (*++p)
|
||||
{
|
||||
if (!dirp)
|
||||
dirp = dir_name (st->orig_file_name);
|
||||
dir = safer_name_suffix (dirp, false, absolute_names_option);
|
||||
len += strlen (dir) - 2;
|
||||
case '%':
|
||||
len++;
|
||||
break;
|
||||
|
||||
case 'd':
|
||||
if (st)
|
||||
{
|
||||
if (!dirp)
|
||||
dirp = dir_name (st->orig_file_name);
|
||||
dir = safer_name_suffix (dirp, false, absolute_names_option);
|
||||
len += strlen (dir);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'f':
|
||||
if (st)
|
||||
{
|
||||
base = last_component (st->orig_file_name);
|
||||
len += strlen (base);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'p':
|
||||
pptr = umaxtostr (getpid (), pidbuf);
|
||||
len += pidbuf + sizeof pidbuf - 1 - pptr;
|
||||
break;
|
||||
|
||||
case 'n':
|
||||
nptr = umaxtostr (n, nbuf);
|
||||
len += nbuf + sizeof nbuf - 1 - nptr;
|
||||
break;
|
||||
|
||||
default:
|
||||
len += 2;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'f':
|
||||
if (st)
|
||||
{
|
||||
base = last_component (st->orig_file_name);
|
||||
len += strlen (base) - 2;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'p':
|
||||
pptr = umaxtostr (getpid (), pidbuf);
|
||||
len += pidbuf + sizeof pidbuf - 1 - pptr - 2;
|
||||
break;
|
||||
|
||||
case 'n':
|
||||
nptr = umaxtostr (n, nbuf);
|
||||
len += nbuf + sizeof nbuf - 1 - nptr - 2;
|
||||
break;
|
||||
}
|
||||
p++;
|
||||
else
|
||||
len++;
|
||||
}
|
||||
|
||||
buf = xmalloc (len + 1);
|
||||
@@ -458,6 +468,14 @@ xheader_write_global (struct xheader *xhdr)
|
||||
}
|
||||
}
|
||||
|
||||
/* Forbid modifications of the global extended header */
|
||||
void
|
||||
xheader_forbid_global (void)
|
||||
{
|
||||
if (keyword_global_override_list)
|
||||
USAGE_ERROR ((0, 0, _("can't update global extended header record")));
|
||||
}
|
||||
|
||||
void
|
||||
xheader_xattr_init (struct tar_stat_info *st)
|
||||
{
|
||||
|
||||
1
tests/.gitignore
vendored
1
tests/.gitignore
vendored
@@ -12,3 +12,4 @@ download
|
||||
ttyemu
|
||||
checkseekhole
|
||||
ckmtime
|
||||
/compress-*.at
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Makefile for GNU tar regression tests.
|
||||
|
||||
# Copyright 1996-1997, 1999-2001, 2003-2007, 2009, 2012-2015 Free Software
|
||||
# Copyright 1996-2019 Free Software Foundation, Inc.
|
||||
|
||||
# This file is part of GNU tar.
|
||||
|
||||
@@ -17,9 +17,13 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
EXTRA_DIST = $(TESTSUITE_AT) testsuite package.m4 star/README star/quicktest.sh
|
||||
EXTRA_DIST = $(TESTSUITE_AT) \
|
||||
testsuite package.m4 star/README star/quicktest.sh \
|
||||
compress.m4
|
||||
|
||||
DISTCLEANFILES = atconfig $(check_SCRIPTS)
|
||||
MAINTAINERCLEANFILES = Makefile.in $(TESTSUITE)
|
||||
CLEANFILES =
|
||||
|
||||
## ------------ ##
|
||||
## package.m4. ##
|
||||
@@ -43,6 +47,7 @@ $(srcdir)/package.m4: $(top_srcdir)/configure.ac
|
||||
|
||||
TESTSUITE_AT = \
|
||||
testsuite.at\
|
||||
compress.m4\
|
||||
T-cd.at\
|
||||
T-dir00.at\
|
||||
T-dir01.at\
|
||||
@@ -66,6 +71,11 @@ TESTSUITE_AT = \
|
||||
chtype.at\
|
||||
comprec.at\
|
||||
comperr.at\
|
||||
checkpoint/defaults.at\
|
||||
checkpoint/interval.at\
|
||||
checkpoint/dot.at\
|
||||
checkpoint/dot-compat.at\
|
||||
checkpoint/dot-int.at\
|
||||
delete01.at\
|
||||
delete02.at\
|
||||
delete03.at\
|
||||
@@ -228,6 +238,9 @@ TESTSUITE_AT = \
|
||||
spmvp00.at\
|
||||
spmvp01.at\
|
||||
spmvp10.at\
|
||||
sptrcreat.at\
|
||||
sptrdiff00.at\
|
||||
sptrdiff01.at\
|
||||
time01.at\
|
||||
time02.at\
|
||||
truncate.at\
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Process this file with autom4te to create testsuite. -*- Autotest -*-
|
||||
#
|
||||
# Test suite for GNU tar.
|
||||
# Copyright 2013-2014, 2016-2017 Free Software Foundation, Inc.
|
||||
# Copyright 2013-2019 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is part of GNU tar.
|
||||
#
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Process this file with autom4te to create testsuite. -*- Autotest -*-
|
||||
#
|
||||
# Test suite for GNU tar.
|
||||
# Copyright 2014, 2016-2017 Free Software Foundation, Inc.
|
||||
# Copyright 2014-2019 Free Software Foundation, Inc.
|
||||
|
||||
# This file is part of GNU tar.
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Process this file with autom4te to create testsuite. -*- Autotest -*-
|
||||
#
|
||||
# Test suite for GNU tar.
|
||||
# Copyright 2014, 2016-2017 Free Software Foundation, Inc.
|
||||
# Copyright 2014-2019 Free Software Foundation, Inc.
|
||||
|
||||
# This file is part of GNU tar.
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
# Process this file with autom4te to create testsuite. -*- Autotest -*-
|
||||
|
||||
# Test suite for GNU tar.
|
||||
# Copyright 2006-2007, 2013-2014, 2016-2017 Free Software Foundation,
|
||||
# Inc.
|
||||
# Copyright 2006-2019 Free Software Foundation, Inc.
|
||||
|
||||
# This file is part of GNU tar.
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Process this file with autom4te to create testsuite. -*- Autotest -*-
|
||||
#
|
||||
# Test suite for GNU tar.
|
||||
# Copyright 2013-2014, 2016-2017 Free Software Foundation, Inc.
|
||||
# Copyright 2013-2019 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is part of GNU tar.
|
||||
#
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Process this file with autom4te to create testsuite. -*- Autotest -*-
|
||||
#
|
||||
# Test suite for GNU tar.
|
||||
# Copyright 2013-2014, 2016-2017 Free Software Foundation, Inc.
|
||||
# Copyright 2013-2019 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is part of GNU tar.
|
||||
#
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Process this file with autom4te to create testsuite. -*- Autotest -*-
|
||||
#
|
||||
# Test suite for GNU tar.
|
||||
# Copyright 2013-2014, 2016-2017 Free Software Foundation, Inc.
|
||||
# Copyright 2013-2019 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is part of GNU tar.
|
||||
#
|
||||
@@ -29,9 +29,8 @@ AT_KEYWORDS([files-from nonewline nonl T-nonl])
|
||||
|
||||
AT_TAR_CHECK([
|
||||
genfile --length=0 --file empty
|
||||
AS_ECHO_N(c) > 1.nonl
|
||||
echo d > 2.nonl
|
||||
AS_ECHO_N(e) >> 2.nonl
|
||||
printf c > 1.nonl
|
||||
printf 'd\ne' > 2.nonl
|
||||
touch a b c d e
|
||||
AT_DATA([filelist],[a
|
||||
b
|
||||
@@ -59,4 +58,3 @@ c
|
||||
[],[],[],[ustar])
|
||||
|
||||
AT_CLEANUP
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
# Process this file with autom4te to create testsuite. -*- Autotest -*-
|
||||
|
||||
# Test suite for GNU tar.
|
||||
# Copyright 2006-2007, 2013-2014, 2016-2017 Free Software Foundation,
|
||||
# Inc.
|
||||
# Copyright 2006-2019 Free Software Foundation, Inc.
|
||||
|
||||
# This file is part of GNU tar.
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# This file is part of test suite for GNU tar. -*- Autotest -*-
|
||||
# Copyright 2015-2017 Free Software Foundation, Inc.
|
||||
# Copyright 2015-2019 Free Software Foundation, Inc.
|
||||
#
|
||||
# GNU tar 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,7 @@
|
||||
# Process this file with autom4te to create testsuite. -*- Autotest -*-
|
||||
#
|
||||
# Test suite for GNU tar.
|
||||
# Copyright 2013-2014, 2016-2017 Free Software Foundation, Inc.
|
||||
# Copyright 2013-2019 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is part of GNU tar.
|
||||
#
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Process this file with autom4te to create testsuite. -*- Autotest -*-
|
||||
|
||||
# Test suite for GNU tar.
|
||||
# Copyright 2015-2017 Free Software Foundation, Inc.
|
||||
# Copyright 2015-2019 Free Software Foundation, Inc.
|
||||
|
||||
# This file is part of GNU tar.
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Process this file with autom4te to create testsuite. -*- Autotest -*-
|
||||
#
|
||||
# Test suite for GNU tar.
|
||||
# Copyright 2013-2014, 2016-2017 Free Software Foundation, Inc.
|
||||
# Copyright 2013-2019 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is part of GNU tar.
|
||||
#
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Process this file with autom4te to create testsuite. -*- Autotest -*-
|
||||
#
|
||||
# Test suite for GNU tar.
|
||||
# Copyright 2011, 2013-2014, 2016-2017 Free Software Foundation, Inc.
|
||||
# Copyright 2011-2019 Free Software Foundation, Inc.
|
||||
|
||||
# This file is part of GNU tar.
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Process this file with autom4te to create testsuite. -*- Autotest -*-
|
||||
#
|
||||
# Test suite for GNU tar.
|
||||
# Copyright 2011, 2013-2014, 2016-2017 Free Software Foundation, Inc.
|
||||
# Copyright 2011-2019 Free Software Foundation, Inc.
|
||||
|
||||
# This file is part of GNU tar.
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Process this file with autom4te to create testsuite. -*- Autotest -*-
|
||||
#
|
||||
# Test suite for GNU tar.
|
||||
# Copyright 2013-2014, 2016-2017 Free Software Foundation, Inc.
|
||||
# Copyright 2013-2019 Free Software Foundation, Inc.
|
||||
|
||||
# This file is part of GNU tar.
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Process this file with autom4te to create testsuite. -*- Autotest -*-
|
||||
#
|
||||
# Test suite for GNU tar.
|
||||
# Copyright 2016-2017 Free Software Foundation, Inc.
|
||||
# Copyright 2016-2019 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is part of GNU tar.
|
||||
#
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
# Process this file with autom4te to create testsuite. -*- Autotest -*-
|
||||
|
||||
# Test suite for GNU tar.
|
||||
# Copyright 2004, 2006-2007, 2013-2014, 2016-2017 Free Software
|
||||
# Foundation, Inc.
|
||||
# Copyright 2004-2019 Free Software Foundation, Inc.
|
||||
|
||||
# This file is part of GNU tar.
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
# Process this file with autom4te to create testsuite. -*- Autotest -*-
|
||||
|
||||
# Test suite for GNU tar.
|
||||
# Copyright 2005-2007, 2013-2014, 2016-2017 Free Software Foundation,
|
||||
# Inc.
|
||||
# Copyright 2005-2019 Free Software Foundation, Inc.
|
||||
|
||||
# This file is part of GNU tar.
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
# Process this file with autom4te to create testsuite. -*- Autotest -*-
|
||||
|
||||
# Test suite for GNU tar.
|
||||
# Copyright 2006-2007, 2009, 2013-2014, 2016-2017 Free Software
|
||||
# Foundation, Inc.
|
||||
# Copyright 2006-2019 Free Software Foundation, Inc.
|
||||
|
||||
# This file is part of GNU tar.
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Process this file with autom4te to create testsuite. -*- Autotest -*-
|
||||
#
|
||||
# Test suite for GNU tar.
|
||||
# Copyright 2010, 2013-2014, 2016-2017 Free Software Foundation, Inc.
|
||||
# Copyright 2010-2019 Free Software Foundation, Inc.
|
||||
|
||||
# This file is part of GNU tar.
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Process this file with autom4te to create testsuite. -*- Autotest -*-
|
||||
#
|
||||
# Test suite for GNU tar.
|
||||
# Copyright 2013-2014, 2016-2017 Free Software Foundation, Inc.
|
||||
# Copyright 2013-2019 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is part of GNU tar.
|
||||
#
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user