History log of /netbsd-current/bin/pax/extern.h
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.61 28-May-2023 lukem

pax: don't overwrite destination if -r -w copy fails

Add more error handling to pax -r -w so that any failure
during the copy to the temporary file (including a failed flush)
prevents any existing destination file from being replaced
with the partial (including possibly empty) temporary file.
The partial temporary file is removed. pax still exists non-zero.

Thanks to Michael van Elst (mlelstv@) for the analysis
of the problem in the PR.

Should fix PR misc/33753.


Revision tags: netbsd-10-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base phil-wifi-20200421 phil-wifi-20200411 phil-wifi-20200406
# 1.60 03-Apr-2020 joerg

Move definition of chdname and do_chroot to options.c


Revision tags: netbsd-9-1-RELEASE is-mlppp-base netbsd-8-2-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 netbsd-8-1-RELEASE netbsd-8-1-RC1 pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 netbsd-7-2-RELEASE pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6 tls-maxphys-base
# 1.59 09-Aug-2012 christos

branches: 1.59.26; 1.59.34; 1.59.36;
PR/46786: Simon Burge: After conversion to 64 bit time_t, tar/pax/cpio
erroneously think that negative time_t's never fit in 32 bits. Rework
conversion code to always use uintmax_t, and detect negative values.
XXX[1]: Perhaps we should do the same (use a signed conversion) for all
fields not just for time_t
XXX[2]: pullup for 6


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 yamt-pagecache-base5 yamt-pagecache-base4 netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.58 29-Aug-2011 joerg

branches: 1.58.2;
static + __dead


# 1.57 18-Jun-2011 christos

add --xz


Revision tags: cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231 matt-premerge-20091211 jym-xensuspend-nbase jym-xensuspend-base
# 1.56 07-Apr-2009 perry

branches: 1.56.4;
Fixes from christos for pr-41167

XXX -X is still broken, but that wasn't part of this PR.


Revision tags: netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base keiichi-mipv6-base matt-armv6-nbase hpcarm-cleanup-base
# 1.55 24-Feb-2008 joerg

branches: 1.55.8; 1.55.10;
Kill pre-4.4BSD compat code.


# 1.54 10-Jan-2008 tls

branches: 1.54.2;
Teach set_ftime about symbolic links, because it has to know: on some
Linux systems, when we build as a tool we think we have lutimes but it
doesn't work on some filesystems at runtime. A bit ugly but effective
and without use of AC_TRY_RUN in the tool build. Tidier (than mine)
set_ftime reorganization from christos.


Revision tags: matt-armv6-prevmlocking cube-autoconf-base matt-armv6-base matt-mips64-base
# 1.53 04-May-2007 christos

branches: 1.53.4;
PR/36275: john at iastate dot edu: tar -s modifies symlink targets
- This is explained in a comment in pat_rep.c inside mod_name(). I did not
want to change the default behavior, so I added another modifier "s" which
when set, the pattern will not modify the symlink destination.
- While here I fixed another bug that was introduced before by the fix in
PR/35257 where the renaming was happening twice since we called rep_name
twice.
- Finally if we are renaming hard of soft-link targets print the renames for
those too.


# 1.52 23-Apr-2007 christos

PR/36194: Greg A. Woods: add a '-V' flag to pax for verbose summary without
listing (and other minor fixes)


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base abandoned-netbsd-4-base netbsd-4-base
# 1.51 16-Apr-2006 christos

PR/22995: Sergey Svishchev: If we are cd'ing around and we have directories
with relative paths, convert the directories to absolute paths, so that
restoring timestamps does not fail.


# 1.50 11-Feb-2006 dsl

Ensure we exit with an error if we don't actually do anything.
There are a lot of tty_warn(0,...) and syswarn(0,...) which probably ought
to be tty_warn/syswarn(1,...) to force an error exit. However some are
used in interactive parts (eg opening a continuation archive) where there
is a separate retry loop.
So we just pass a failure code out to main() - how quaint!
This should now cause the NetBSD build to fail when gzip tries to write
to a non-existant directory.
(I suspect there are still many errors that don't get reported correctly.)


# 1.49 16-Sep-2005 christos

Another missing mkdir() race pointed out by chuq. Factor out the mkdir code.


# 1.48 24-Apr-2005 christos

PR/18759: FUKAUMI Naoki: pax/tar dot-dot handling broken
PR/18840: Frederick Bruckman: Fix for PR/18663 incomplete pax symlink handling

This patch makes ``--insecure'' do something. Now if ``--insecure''
is not set (the default) we do a realpath(3) in all the pathnames
that we are trying to create and if either realpath fails, or the
path is outside our working directory, we print a warning and die.
This maybe too strict and might fail on valid archives that create
symlinks and directories in the wrong order.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.47 22-Oct-2004 jmc

For HOSTTOOL builds, just exclude the chroot support as it's not needed and
avoids having to platform check for fchroot(). Fixes PR#27336


# 1.46 17-Oct-2004 dsl

Add an option --chroot to tar. Causes it to chroot(".") before doing
an extract. With -h this will cause existing absolute symlinks to be treated
as relative to the current directory.
Helps sysinst handle existing symlinks in the target system.
Remove 'L' from the usage (got spilt into 'h' and 'H' many moons ago)
Add 'S' to usage, and put into correct place in options list.


# 1.45 22-Sep-2004 christos

Keep track of the length of the gnu long name/link hack, so that
we can append to it. Modify the code so that file_write is re-entrant,
even in the gnu long name/link hack.

The old code assumed that the buffer already contained the necessary
blocks to satisfy the read file request that contained the long
filename. This is not always the case, specially when we are dealing
with pipes which do shorter reads, thus having more probability
that a long file name will fall across a buffer boundary.

To reproduce, create a tar archive with a lot of gnu-long-names
(pkgsrc/devel/libsigc++2 is a good example), do a tar -tf to get
a list of filenames, compress it and do a tar -tzf to get another
list of the filenames. Notice that the two lists differ.


# 1.44 22-Aug-2004 tron

Propery handle "cpio" archives where the last hardlink includes the
data of a file. This fixes PR bin/26514.


# 1.43 19-Jun-2004 christos

add -0 argument to handle nul separated file lists.


# 1.42 11-May-2004 christos

Welcome to WARNS=3


Revision tags: netbsd-2-0-base
# 1.41 13-Feb-2004 matt

branches: 1.41.2;
When pax catches a signal and cleans up, make sure to remove any temporary
file that was being extracted to. This will prevent pax from leaving
droppings when you hit ^C.


# 1.40 13-Oct-2003 agc

Move Keith Muller's code from a 4-clause to a 3-clause licence by removing
the advertising clause. Diffs provided in PR 22397 by Joel Baker, confirmed
to the board by Keith Muller.


# 1.39 07-Aug-2003 agc

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.


# 1.38 08-Jul-2003 simonb

Add support for gnutar's -O "extract to stdout" option.


# 1.37 25-Feb-2003 wiz

Add support for '-j' to create (and extract, but -z already did that)
bzip2 compressed tar files, for GNU tar compatibility.
Patch from Soren Jacobsen in PR 19467, okayed by christos.
Sync usage with options while here.


Revision tags: fvdl_fs64_base
# 1.36 08-Dec-2002 mrg

add --exclude support.

XXX: --exclude & --exclude-from are still not 100% compatible, but since
rafal fixed --exclude-from's most annoying bug, they mostly work now.


# 1.35 17-Oct-2002 christos

Add proper longlink support. Previously we handled longname support, and
the longlink support was completely wrong.


# 1.34 16-Oct-2002 christos

Support gnu long filename extensions by default for tar on create, list, and
extract. We now generate GNU tar archives by default ("ustar ^@" instead of
"ustar^@00"). GNU extensions can be disabled with --strict.

XXX: long symlinks untested.


# 1.33 15-Oct-2002 christos

PR/18663: Jeremy Reed: pax/tar/cpio allows ".." in names.
We now disallow it by default on both archive creation and extraction.
Add --insecure option to override.


# 1.32 13-Oct-2002 mrg

make this build on LP64


# 1.31 12-Oct-2002 christos

merge OpenBSD changes:
- correct -C processing
- add ability to read filenames and flags from a file
- don't print dangerous escape sequences to the terminal
- use strlcpy/strncpy properly.
- handle tmpfile creation better.
- improve documentation of options.
- handle stdout/stderr list selection correctly.
- kill gzip when we get interrupted.
- simplify gzip setup.
- add more flags to programs.

additional changes:
- librmt processing.
- set POSIXLY_CORRECT in options parsing.
- prevent more string overruns.
- support -T

we don't turn the switch on to replace tar and cpio yet.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.30 31-Jan-2002 tv

branches: 1.30.2;
Roll in fixes to permit cross-compiling from non-NetBSD hosts. This
round has been tested on Solaris/x86 and Linux hosts.

* Add host tools cap_mkdb, ctags, m4, uudecode.
* Protect __RCSID() and __COPYRIGHT() better.
* Reduce the number of places that need to include "config.h", to keep
sources closer to their "vanilla" versions.
* Add more compat #defines and autoconf-checked functions.


# 1.29 29-Jan-2002 tv

Make almost all tools compile and run properly on non-NetBSD hosts. (In
particular, most tools now run correctly on Solaris 7.)


# 1.28 28-Oct-2001 lukem

s/u_longlong_t/unsigned long long/ to shut up the parc port


# 1.27 25-Oct-2001 lukem

Implement -M flag: During a write or copy operation, treat the list of
files on standard input as an mtree(8) `specfile' specification, and
write or copy only those items in the specfile.

If the file exists in the underlying file system, its permissions and
modification time will be used unless specifically overridden by the
specfile. An error will be raised if the type of entry in the specfile
conflicts with that of an existing file.

Otherwise, it is necessary to specify at least the following parameters
in the specfile: type, mode, gname or gid, and uname or uid, device
(in the case of block or character devices), and link (in the case of
symbolic links). If time isn't provided, the current time will be used.


# 1.26 25-Oct-2001 lukem

- ansi KNF (just remove all the #ifndef __STDC__ prototype junk,
leaving the ansi stuff)
- use longlong_t instead of quad_t (etc), and rename *uqd*() -> *ull*()
- clean up the NET2_STAT stuff similar to ftpd; provide #defines and
macros which select which cast to use, etc
- clean up the NET2_FTS and NET2_REGEX #define use


# 1.25 22-Oct-2000 kleink

LC_TIME holds a locale name, which isn't a strftime() format string.


# 1.24 04-Jul-2000 thorpej

Add GNU tar-style long options for pax's tar front-end. Still many
GNU options not implemented, but there is an #if 0'd out canonical
list.


Revision tags: netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base minoura-xpg4dl-base
# 1.23 30-Mar-2000 thorpej

branches: 1.23.4;
Add a -O option: force one volume. This causes pax to not prompt for
a new volume upon premature end-of-volume (e.g. broken pipe). This is
especially useful in automated environments where error recovery cannot
be performed by a human.


# 1.22 17-Feb-2000 itohy

Cleanup and fix typos.
Partially from FreeBSD.


# 1.21 17-Feb-2000 itohy

Fix SIGINFO botch (PR #8868).
Continue partial write(2) on signals (xwrite()).
Partial read(2) at a few places are also continued (xread()).

Add {read,write}_with_restart() hooks for porting on systems
which don't restart interrupted read()/write() calls.

Reviewed and discussed in tech-kern and tech-userlevel lists.


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base
# 1.20 01-Nov-1999 mrg

add a new -p subflag: 'f' to preserve 4.4BSD fileflags. this only
really works for `pax -rw' but that's where it is most useful.


# 1.19 22-Oct-1999 is

Implement positional -C argument to tar.


# 1.18 22-Oct-1999 mrg

support ././@LongLink extraction, as created by GNU tar.


# 1.17 24-Aug-1999 tron

branches: 1.17.2;
Strip leading slashes from filenames by default, add new "A" option to
disable this behaviour. Patches supplied by Peter Seebach in PR bin/8233.


Revision tags: netbsd-1-4-PATCH003 netbsd-1-4-PATCH002 netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.16 03-Mar-1999 christos

Add SIGINFO support.


# 1.15 07-Feb-1999 tron

Fix opt_add() prototype.


# 1.14 20-Jan-1999 mrg

implement the gnutar -X flag in terms of pax -s. fix some bugs in pax -s handling while i am here...


# 1.13 10-Aug-1998 tv

Transparently handle old-style GNU tar archives that may have garbage in
the trailing block and do not have an end-of-archive marker. (Does this
handling based on whether the ustar id is "ustar" or "ustar ".)


# 1.12 28-Jul-1998 mycroft

Use the uid/gid caching moved into libc. Fixed a memory leak!


# 1.11 27-Jul-1998 mycroft

__AUDIT__ cleanup.


# 1.10 26-Jul-1998 mycroft

const poisoning.


# 1.9 06-Mar-1998 mrg

- implement -C and -l for pax-as-tar, as inspried by GNU tar.
- minor cleanups to the options parsing code.
- add a cpio frontend.

note: a few GNU/svr4 cpio options are not supported yet (#ifdef
notyet), however all x/open ones are.


# 1.8 28-Feb-1998 mrg

rename variable to "cpio_swp_head"


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base
# 1.7 14-Sep-1997 lukem

* cleanup manpage
* getopt returns -1 not EOF
* deprecate register


# 1.6 20-Jul-1997 christos

- Rename local warn so tty_warn that we can include <err.h> since this program
uses err() and errx().
- Fix printf format strings.
- Added WARNS=1; note
- Added missing prototypes.
- Split overloaded trail function into trail() and subtrail().


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.5 26-Mar-1996 mrg

impliment -z (gzip) in pax and tar, and -Z (compress) in tar.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.4 21-Mar-1995 cgd

convert to new RCS id conventions.


# 1.3 04-Dec-1994 cgd

from James Jegers <jimj@miller.cs.uwm.edu>: quiet -Wall, and squelch
some of the worst style errors.


Revision tags: netbsd-1-0-PATCH06 netbsd-1-0-PATCH05 netbsd-1-0-PATCH04 netbsd-1-0-PATCH03 netbsd-1-0-PATCH02 netbsd-1-0-PATCH1 netbsd-1-0-PATCH0 netbsd-1-0-RELEASE netbsd-1-0-base
# 1.2 13-Jun-1994 jtc

Add RCS ID's


# 1.1 13-Jun-1994 jtc

branches: 1.1.1;
Initial revision


# 1.60 03-Apr-2020 joerg

Move definition of chdname and do_chroot to options.c


Revision tags: netbsd-8-2-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 netbsd-8-1-RELEASE netbsd-8-1-RC1 pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 netbsd-7-2-RELEASE pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6 tls-maxphys-base
# 1.59 09-Aug-2012 christos

PR/46786: Simon Burge: After conversion to 64 bit time_t, tar/pax/cpio
erroneously think that negative time_t's never fit in 32 bits. Rework
conversion code to always use uintmax_t, and detect negative values.
XXX[1]: Perhaps we should do the same (use a signed conversion) for all
fields not just for time_t
XXX[2]: pullup for 6


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 yamt-pagecache-base5 yamt-pagecache-base4 netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.58 29-Aug-2011 joerg

branches: 1.58.2;
static + __dead


# 1.57 18-Jun-2011 christos

add --xz


Revision tags: cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231 matt-premerge-20091211 jym-xensuspend-nbase jym-xensuspend-base
# 1.56 07-Apr-2009 perry

branches: 1.56.4;
Fixes from christos for pr-41167

XXX -X is still broken, but that wasn't part of this PR.


Revision tags: netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base keiichi-mipv6-base matt-armv6-nbase hpcarm-cleanup-base
# 1.55 24-Feb-2008 joerg

branches: 1.55.8; 1.55.10;
Kill pre-4.4BSD compat code.


# 1.54 10-Jan-2008 tls

branches: 1.54.2;
Teach set_ftime about symbolic links, because it has to know: on some
Linux systems, when we build as a tool we think we have lutimes but it
doesn't work on some filesystems at runtime. A bit ugly but effective
and without use of AC_TRY_RUN in the tool build. Tidier (than mine)
set_ftime reorganization from christos.


Revision tags: matt-armv6-prevmlocking cube-autoconf-base matt-armv6-base matt-mips64-base
# 1.53 04-May-2007 christos

branches: 1.53.4;
PR/36275: john at iastate dot edu: tar -s modifies symlink targets
- This is explained in a comment in pat_rep.c inside mod_name(). I did not
want to change the default behavior, so I added another modifier "s" which
when set, the pattern will not modify the symlink destination.
- While here I fixed another bug that was introduced before by the fix in
PR/35257 where the renaming was happening twice since we called rep_name
twice.
- Finally if we are renaming hard of soft-link targets print the renames for
those too.


# 1.52 23-Apr-2007 christos

PR/36194: Greg A. Woods: add a '-V' flag to pax for verbose summary without
listing (and other minor fixes)


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base abandoned-netbsd-4-base netbsd-4-base
# 1.51 16-Apr-2006 christos

PR/22995: Sergey Svishchev: If we are cd'ing around and we have directories
with relative paths, convert the directories to absolute paths, so that
restoring timestamps does not fail.


# 1.50 11-Feb-2006 dsl

Ensure we exit with an error if we don't actually do anything.
There are a lot of tty_warn(0,...) and syswarn(0,...) which probably ought
to be tty_warn/syswarn(1,...) to force an error exit. However some are
used in interactive parts (eg opening a continuation archive) where there
is a separate retry loop.
So we just pass a failure code out to main() - how quaint!
This should now cause the NetBSD build to fail when gzip tries to write
to a non-existant directory.
(I suspect there are still many errors that don't get reported correctly.)


# 1.49 16-Sep-2005 christos

Another missing mkdir() race pointed out by chuq. Factor out the mkdir code.


# 1.48 24-Apr-2005 christos

PR/18759: FUKAUMI Naoki: pax/tar dot-dot handling broken
PR/18840: Frederick Bruckman: Fix for PR/18663 incomplete pax symlink handling

This patch makes ``--insecure'' do something. Now if ``--insecure''
is not set (the default) we do a realpath(3) in all the pathnames
that we are trying to create and if either realpath fails, or the
path is outside our working directory, we print a warning and die.
This maybe too strict and might fail on valid archives that create
symlinks and directories in the wrong order.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.47 22-Oct-2004 jmc

For HOSTTOOL builds, just exclude the chroot support as it's not needed and
avoids having to platform check for fchroot(). Fixes PR#27336


# 1.46 17-Oct-2004 dsl

Add an option --chroot to tar. Causes it to chroot(".") before doing
an extract. With -h this will cause existing absolute symlinks to be treated
as relative to the current directory.
Helps sysinst handle existing symlinks in the target system.
Remove 'L' from the usage (got spilt into 'h' and 'H' many moons ago)
Add 'S' to usage, and put into correct place in options list.


# 1.45 22-Sep-2004 christos

Keep track of the length of the gnu long name/link hack, so that
we can append to it. Modify the code so that file_write is re-entrant,
even in the gnu long name/link hack.

The old code assumed that the buffer already contained the necessary
blocks to satisfy the read file request that contained the long
filename. This is not always the case, specially when we are dealing
with pipes which do shorter reads, thus having more probability
that a long file name will fall across a buffer boundary.

To reproduce, create a tar archive with a lot of gnu-long-names
(pkgsrc/devel/libsigc++2 is a good example), do a tar -tf to get
a list of filenames, compress it and do a tar -tzf to get another
list of the filenames. Notice that the two lists differ.


# 1.44 22-Aug-2004 tron

Propery handle "cpio" archives where the last hardlink includes the
data of a file. This fixes PR bin/26514.


# 1.43 19-Jun-2004 christos

add -0 argument to handle nul separated file lists.


# 1.42 11-May-2004 christos

Welcome to WARNS=3


Revision tags: netbsd-2-0-base
# 1.41 13-Feb-2004 matt

branches: 1.41.2;
When pax catches a signal and cleans up, make sure to remove any temporary
file that was being extracted to. This will prevent pax from leaving
droppings when you hit ^C.


# 1.40 13-Oct-2003 agc

Move Keith Muller's code from a 4-clause to a 3-clause licence by removing
the advertising clause. Diffs provided in PR 22397 by Joel Baker, confirmed
to the board by Keith Muller.


# 1.39 07-Aug-2003 agc

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.


# 1.38 08-Jul-2003 simonb

Add support for gnutar's -O "extract to stdout" option.


# 1.37 25-Feb-2003 wiz

Add support for '-j' to create (and extract, but -z already did that)
bzip2 compressed tar files, for GNU tar compatibility.
Patch from Soren Jacobsen in PR 19467, okayed by christos.
Sync usage with options while here.


Revision tags: fvdl_fs64_base
# 1.36 08-Dec-2002 mrg

add --exclude support.

XXX: --exclude & --exclude-from are still not 100% compatible, but since
rafal fixed --exclude-from's most annoying bug, they mostly work now.


# 1.35 17-Oct-2002 christos

Add proper longlink support. Previously we handled longname support, and
the longlink support was completely wrong.


# 1.34 16-Oct-2002 christos

Support gnu long filename extensions by default for tar on create, list, and
extract. We now generate GNU tar archives by default ("ustar ^@" instead of
"ustar^@00"). GNU extensions can be disabled with --strict.

XXX: long symlinks untested.


# 1.33 15-Oct-2002 christos

PR/18663: Jeremy Reed: pax/tar/cpio allows ".." in names.
We now disallow it by default on both archive creation and extraction.
Add --insecure option to override.


# 1.32 13-Oct-2002 mrg

make this build on LP64


# 1.31 12-Oct-2002 christos

merge OpenBSD changes:
- correct -C processing
- add ability to read filenames and flags from a file
- don't print dangerous escape sequences to the terminal
- use strlcpy/strncpy properly.
- handle tmpfile creation better.
- improve documentation of options.
- handle stdout/stderr list selection correctly.
- kill gzip when we get interrupted.
- simplify gzip setup.
- add more flags to programs.

additional changes:
- librmt processing.
- set POSIXLY_CORRECT in options parsing.
- prevent more string overruns.
- support -T

we don't turn the switch on to replace tar and cpio yet.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.30 31-Jan-2002 tv

branches: 1.30.2;
Roll in fixes to permit cross-compiling from non-NetBSD hosts. This
round has been tested on Solaris/x86 and Linux hosts.

* Add host tools cap_mkdb, ctags, m4, uudecode.
* Protect __RCSID() and __COPYRIGHT() better.
* Reduce the number of places that need to include "config.h", to keep
sources closer to their "vanilla" versions.
* Add more compat #defines and autoconf-checked functions.


# 1.29 29-Jan-2002 tv

Make almost all tools compile and run properly on non-NetBSD hosts. (In
particular, most tools now run correctly on Solaris 7.)


# 1.28 28-Oct-2001 lukem

s/u_longlong_t/unsigned long long/ to shut up the parc port


# 1.27 25-Oct-2001 lukem

Implement -M flag: During a write or copy operation, treat the list of
files on standard input as an mtree(8) `specfile' specification, and
write or copy only those items in the specfile.

If the file exists in the underlying file system, its permissions and
modification time will be used unless specifically overridden by the
specfile. An error will be raised if the type of entry in the specfile
conflicts with that of an existing file.

Otherwise, it is necessary to specify at least the following parameters
in the specfile: type, mode, gname or gid, and uname or uid, device
(in the case of block or character devices), and link (in the case of
symbolic links). If time isn't provided, the current time will be used.


# 1.26 25-Oct-2001 lukem

- ansi KNF (just remove all the #ifndef __STDC__ prototype junk,
leaving the ansi stuff)
- use longlong_t instead of quad_t (etc), and rename *uqd*() -> *ull*()
- clean up the NET2_STAT stuff similar to ftpd; provide #defines and
macros which select which cast to use, etc
- clean up the NET2_FTS and NET2_REGEX #define use


# 1.25 22-Oct-2000 kleink

LC_TIME holds a locale name, which isn't a strftime() format string.


# 1.24 04-Jul-2000 thorpej

Add GNU tar-style long options for pax's tar front-end. Still many
GNU options not implemented, but there is an #if 0'd out canonical
list.


Revision tags: netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base minoura-xpg4dl-base
# 1.23 30-Mar-2000 thorpej

branches: 1.23.4;
Add a -O option: force one volume. This causes pax to not prompt for
a new volume upon premature end-of-volume (e.g. broken pipe). This is
especially useful in automated environments where error recovery cannot
be performed by a human.


# 1.22 17-Feb-2000 itohy

Cleanup and fix typos.
Partially from FreeBSD.


# 1.21 17-Feb-2000 itohy

Fix SIGINFO botch (PR #8868).
Continue partial write(2) on signals (xwrite()).
Partial read(2) at a few places are also continued (xread()).

Add {read,write}_with_restart() hooks for porting on systems
which don't restart interrupted read()/write() calls.

Reviewed and discussed in tech-kern and tech-userlevel lists.


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base
# 1.20 01-Nov-1999 mrg

add a new -p subflag: 'f' to preserve 4.4BSD fileflags. this only
really works for `pax -rw' but that's where it is most useful.


# 1.19 22-Oct-1999 is

Implement positional -C argument to tar.


# 1.18 22-Oct-1999 mrg

support ././@LongLink extraction, as created by GNU tar.


# 1.17 24-Aug-1999 tron

branches: 1.17.2;
Strip leading slashes from filenames by default, add new "A" option to
disable this behaviour. Patches supplied by Peter Seebach in PR bin/8233.


Revision tags: netbsd-1-4-PATCH003 netbsd-1-4-PATCH002 netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.16 03-Mar-1999 christos

Add SIGINFO support.


# 1.15 07-Feb-1999 tron

Fix opt_add() prototype.


# 1.14 20-Jan-1999 mrg

implement the gnutar -X flag in terms of pax -s. fix some bugs in pax -s handling while i am here...


# 1.13 10-Aug-1998 tv

Transparently handle old-style GNU tar archives that may have garbage in
the trailing block and do not have an end-of-archive marker. (Does this
handling based on whether the ustar id is "ustar" or "ustar ".)


# 1.12 28-Jul-1998 mycroft

Use the uid/gid caching moved into libc. Fixed a memory leak!


# 1.11 27-Jul-1998 mycroft

__AUDIT__ cleanup.


# 1.10 26-Jul-1998 mycroft

const poisoning.


# 1.9 06-Mar-1998 mrg

- implement -C and -l for pax-as-tar, as inspried by GNU tar.
- minor cleanups to the options parsing code.
- add a cpio frontend.

note: a few GNU/svr4 cpio options are not supported yet (#ifdef
notyet), however all x/open ones are.


# 1.8 28-Feb-1998 mrg

rename variable to "cpio_swp_head"


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base
# 1.7 14-Sep-1997 lukem

* cleanup manpage
* getopt returns -1 not EOF
* deprecate register


# 1.6 20-Jul-1997 christos

- Rename local warn so tty_warn that we can include <err.h> since this program
uses err() and errx().
- Fix printf format strings.
- Added WARNS=1; note
- Added missing prototypes.
- Split overloaded trail function into trail() and subtrail().


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.5 26-Mar-1996 mrg

impliment -z (gzip) in pax and tar, and -Z (compress) in tar.


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.4 21-Mar-1995 cgd

convert to new RCS id conventions.


# 1.3 04-Dec-1994 cgd

from James Jegers <jimj@miller.cs.uwm.edu>: quiet -Wall, and squelch
some of the worst style errors.


Revision tags: netbsd-1-0-PATCH06 netbsd-1-0-PATCH05 netbsd-1-0-PATCH04 netbsd-1-0-PATCH03 netbsd-1-0-PATCH02 netbsd-1-0-PATCH1 netbsd-1-0-PATCH0 netbsd-1-0-RELEASE netbsd-1-0-base
# 1.2 13-Jun-1994 jtc

Add RCS ID's


# 1.1 13-Jun-1994 jtc

branches: 1.1.1;
Initial revision


# 1.59 09-Aug-2012 christos

PR/46786: Simon Burge: After conversion to 64 bit time_t, tar/pax/cpio
erroneously think that negative time_t's never fit in 32 bits. Rework
conversion code to always use uintmax_t, and detect negative values.
XXX[1]: Perhaps we should do the same (use a signed conversion) for all
fields not just for time_t
XXX[2]: pullup for 6


# 1.58 29-Aug-2011 joerg

branches: 1.58.2;
static + __dead


# 1.57 18-Jun-2011 christos

add --xz


# 1.56 07-Apr-2009 perry

branches: 1.56.4;
Fixes from christos for pr-41167

XXX -X is still broken, but that wasn't part of this PR.


# 1.55 24-Feb-2008 joerg

branches: 1.55.8; 1.55.10;
Kill pre-4.4BSD compat code.


# 1.54 09-Jan-2008 tls

branches: 1.54.2;
Teach set_ftime about symbolic links, because it has to know: on some
Linux systems, when we build as a tool we think we have lutimes but it
doesn't work on some filesystems at runtime. A bit ugly but effective
and without use of AC_TRY_RUN in the tool build. Tidier (than mine)
set_ftime reorganization from christos.


# 1.53 04-May-2007 christos

branches: 1.53.4;
PR/36275: john at iastate dot edu: tar -s modifies symlink targets
- This is explained in a comment in pat_rep.c inside mod_name(). I did not
want to change the default behavior, so I added another modifier "s" which
when set, the pattern will not modify the symlink destination.
- While here I fixed another bug that was introduced before by the fix in
PR/35257 where the renaming was happening twice since we called rep_name
twice.
- Finally if we are renaming hard of soft-link targets print the renames for
those too.


# 1.52 23-Apr-2007 christos

PR/36194: Greg A. Woods: add a '-V' flag to pax for verbose summary without
listing (and other minor fixes)


# 1.51 15-Apr-2006 christos

PR/22995: Sergey Svishchev: If we are cd'ing around and we have directories
with relative paths, convert the directories to absolute paths, so that
restoring timestamps does not fail.


# 1.50 11-Feb-2006 dsl

Ensure we exit with an error if we don't actually do anything.
There are a lot of tty_warn(0,...) and syswarn(0,...) which probably ought
to be tty_warn/syswarn(1,...) to force an error exit. However some are
used in interactive parts (eg opening a continuation archive) where there
is a separate retry loop.
So we just pass a failure code out to main() - how quaint!
This should now cause the NetBSD build to fail when gzip tries to write
to a non-existant directory.
(I suspect there are still many errors that don't get reported correctly.)


# 1.49 15-Sep-2005 christos

Another missing mkdir() race pointed out by chuq. Factor out the mkdir code.


# 1.48 23-Apr-2005 christos

PR/18759: FUKAUMI Naoki: pax/tar dot-dot handling broken
PR/18840: Frederick Bruckman: Fix for PR/18663 incomplete pax symlink handling

This patch makes ``--insecure'' do something. Now if ``--insecure''
is not set (the default) we do a realpath(3) in all the pathnames
that we are trying to create and if either realpath fails, or the
path is outside our working directory, we print a warning and die.
This maybe too strict and might fail on valid archives that create
symlinks and directories in the wrong order.


# 1.47 22-Oct-2004 jmc

For HOSTTOOL builds, just exclude the chroot support as it's not needed and
avoids having to platform check for fchroot(). Fixes PR#27336


# 1.46 17-Oct-2004 dsl

Add an option --chroot to tar. Causes it to chroot(".") before doing
an extract. With -h this will cause existing absolute symlinks to be treated
as relative to the current directory.
Helps sysinst handle existing symlinks in the target system.
Remove 'L' from the usage (got spilt into 'h' and 'H' many moons ago)
Add 'S' to usage, and put into correct place in options list.


# 1.45 22-Sep-2004 christos

Keep track of the length of the gnu long name/link hack, so that
we can append to it. Modify the code so that file_write is re-entrant,
even in the gnu long name/link hack.

The old code assumed that the buffer already contained the necessary
blocks to satisfy the read file request that contained the long
filename. This is not always the case, specially when we are dealing
with pipes which do shorter reads, thus having more probability
that a long file name will fall across a buffer boundary.

To reproduce, create a tar archive with a lot of gnu-long-names
(pkgsrc/devel/libsigc++2 is a good example), do a tar -tf to get
a list of filenames, compress it and do a tar -tzf to get another
list of the filenames. Notice that the two lists differ.


# 1.44 21-Aug-2004 tron

Propery handle "cpio" archives where the last hardlink includes the
data of a file. This fixes PR bin/26514.


# 1.43 18-Jun-2004 christos

add -0 argument to handle nul separated file lists.


# 1.42 11-May-2004 christos

Welcome to WARNS=3


# 1.41 13-Feb-2004 matt

branches: 1.41.2;
When pax catches a signal and cleans up, make sure to remove any temporary
file that was being extracted to. This will prevent pax from leaving
droppings when you hit ^C.


# 1.40 13-Oct-2003 agc

Move Keith Muller's code from a 4-clause to a 3-clause licence by removing
the advertising clause. Diffs provided in PR 22397 by Joel Baker, confirmed
to the board by Keith Muller.


# 1.39 07-Aug-2003 agc

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.


# 1.38 08-Jul-2003 simonb

Add support for gnutar's -O "extract to stdout" option.


# 1.37 25-Feb-2003 wiz

Add support for '-j' to create (and extract, but -z already did that)
bzip2 compressed tar files, for GNU tar compatibility.
Patch from Soren Jacobsen in PR 19467, okayed by christos.
Sync usage with options while here.


# 1.36 07-Dec-2002 mrg

add --exclude support.

XXX: --exclude & --exclude-from are still not 100% compatible, but since
rafal fixed --exclude-from's most annoying bug, they mostly work now.


# 1.35 16-Oct-2002 christos

Add proper longlink support. Previously we handled longname support, and
the longlink support was completely wrong.


# 1.34 15-Oct-2002 christos

Support gnu long filename extensions by default for tar on create, list, and
extract. We now generate GNU tar archives by default ("ustar ^@" instead of
"ustar^@00"). GNU extensions can be disabled with --strict.

XXX: long symlinks untested.


# 1.33 14-Oct-2002 christos

PR/18663: Jeremy Reed: pax/tar/cpio allows ".." in names.
We now disallow it by default on both archive creation and extraction.
Add --insecure option to override.


# 1.32 12-Oct-2002 mrg

make this build on LP64


# 1.31 12-Oct-2002 christos

merge OpenBSD changes:
- correct -C processing
- add ability to read filenames and flags from a file
- don't print dangerous escape sequences to the terminal
- use strlcpy/strncpy properly.
- handle tmpfile creation better.
- improve documentation of options.
- handle stdout/stderr list selection correctly.
- kill gzip when we get interrupted.
- simplify gzip setup.
- add more flags to programs.

additional changes:
- librmt processing.
- set POSIXLY_CORRECT in options parsing.
- prevent more string overruns.
- support -T

we don't turn the switch on to replace tar and cpio yet.


# 1.30 31-Jan-2002 tv

branches: 1.30.2;
Roll in fixes to permit cross-compiling from non-NetBSD hosts. This
round has been tested on Solaris/x86 and Linux hosts.

* Add host tools cap_mkdb, ctags, m4, uudecode.
* Protect __RCSID() and __COPYRIGHT() better.
* Reduce the number of places that need to include "config.h", to keep
sources closer to their "vanilla" versions.
* Add more compat #defines and autoconf-checked functions.


# 1.29 29-Jan-2002 tv

Make almost all tools compile and run properly on non-NetBSD hosts. (In
particular, most tools now run correctly on Solaris 7.)


# 1.28 28-Oct-2001 lukem

s/u_longlong_t/unsigned long long/ to shut up the parc port


# 1.27 25-Oct-2001 lukem

Implement -M flag: During a write or copy operation, treat the list of
files on standard input as an mtree(8) `specfile' specification, and
write or copy only those items in the specfile.

If the file exists in the underlying file system, its permissions and
modification time will be used unless specifically overridden by the
specfile. An error will be raised if the type of entry in the specfile
conflicts with that of an existing file.

Otherwise, it is necessary to specify at least the following parameters
in the specfile: type, mode, gname or gid, and uname or uid, device
(in the case of block or character devices), and link (in the case of
symbolic links). If time isn't provided, the current time will be used.


# 1.26 24-Oct-2001 lukem

- ansi KNF (just remove all the #ifndef __STDC__ prototype junk,
leaving the ansi stuff)
- use longlong_t instead of quad_t (etc), and rename *uqd*() -> *ull*()
- clean up the NET2_STAT stuff similar to ftpd; provide #defines and
macros which select which cast to use, etc
- clean up the NET2_FTS and NET2_REGEX #define use


# 1.25 22-Oct-2000 kleink

LC_TIME holds a locale name, which isn't a strftime() format string.


# 1.24 04-Jul-2000 thorpej

Add GNU tar-style long options for pax's tar front-end. Still many
GNU options not implemented, but there is an #if 0'd out canonical
list.


# 1.23 29-Mar-2000 thorpej

branches: 1.23.4;
Add a -O option: force one volume. This causes pax to not prompt for
a new volume upon premature end-of-volume (e.g. broken pipe). This is
especially useful in automated environments where error recovery cannot
be performed by a human.


# 1.22 16-Feb-2000 itohy

Cleanup and fix typos.
Partially from FreeBSD.


# 1.21 16-Feb-2000 itohy

Fix SIGINFO botch (PR #8868).
Continue partial write(2) on signals (xwrite()).
Partial read(2) at a few places are also continued (xread()).

Add {read,write}_with_restart() hooks for porting on systems
which don't restart interrupted read()/write() calls.

Reviewed and discussed in tech-kern and tech-userlevel lists.


# 1.20 31-Oct-1999 mrg

add a new -p subflag: 'f' to preserve 4.4BSD fileflags. this only
really works for `pax -rw' but that's where it is most useful.


# 1.19 22-Oct-1999 is

Implement positional -C argument to tar.


# 1.18 22-Oct-1999 mrg

support ././@LongLink extraction, as created by GNU tar.


# 1.17 24-Aug-1999 tron

branches: 1.17.2;
Strip leading slashes from filenames by default, add new "A" option to
disable this behaviour. Patches supplied by Peter Seebach in PR bin/8233.


# 1.16 03-Mar-1999 christos

Add SIGINFO support.


# 1.15 07-Feb-1999 tron

Fix opt_add() prototype.


# 1.14 20-Jan-1999 mrg

implement the gnutar -X flag in terms of pax -s. fix some bugs in pax -s handling while i am here...


# 1.13 10-Aug-1998 tv

Transparently handle old-style GNU tar archives that may have garbage in
the trailing block and do not have an end-of-archive marker. (Does this
handling based on whether the ustar id is "ustar" or "ustar ".)


# 1.12 28-Jul-1998 mycroft

Use the uid/gid caching moved into libc. Fixed a memory leak!


# 1.11 26-Jul-1998 mycroft

__AUDIT__ cleanup.


# 1.10 26-Jul-1998 mycroft

const poisoning.


# 1.9 06-Mar-1998 mrg

- implement -C and -l for pax-as-tar, as inspried by GNU tar.
- minor cleanups to the options parsing code.
- add a cpio frontend.

note: a few GNU/svr4 cpio options are not supported yet (#ifdef
notyet), however all x/open ones are.


# 1.8 28-Feb-1998 mrg

rename variable to "cpio_swp_head"


# 1.7 14-Sep-1997 lukem

* cleanup manpage
* getopt returns -1 not EOF
* deprecate register


# 1.6 20-Jul-1997 christos

- Rename local warn so tty_warn that we can include <err.h> since this program
uses err() and errx().
- Fix printf format strings.
- Added WARNS=1; note
- Added missing prototypes.
- Split overloaded trail function into trail() and subtrail().


# 1.5 26-Mar-1996 mrg

impliment -z (gzip) in pax and tar, and -Z (compress) in tar.


# 1.4 21-Mar-1995 cgd

convert to new RCS id conventions.


# 1.3 04-Dec-1994 cgd

from James Jegers <jimj@miller.cs.uwm.edu>: quiet -Wall, and squelch
some of the worst style errors.


# 1.2 12-Jun-1994 jtc

Add RCS ID's


# 1.1 12-Jun-1994 jtc

branches: 1.1.1;
Initial revision


# 1.1.1.1 12-Jun-1994 jtc

From 4.4 lite


# 1.17.2.1 27-Dec-1999 wrstuden

Pull up to last week's -current.


# 1.23.4.1 24-Oct-2000 tv

Pullup 1.25 [kleink]:
Don't abuse LC_TIME for strftime(3) format strings.


# 1.30.2.1 07-Apr-2004 jmc

Pullup rev 1.31-1.41 (requested by rafal in ticket #1021)

Pullup pax to current version on trunk. Includes many fixes.


# 1.41.2.2 11-Nov-2004 jmc

branches: 1.41.2.2.2;
Pullup rev 1.45 (requested by christos in ticket #921)

Keep track of the length of the gnu long name/link hack, so that
we can append to it. Modify the code so that file_write is re-entrant,
even in the gnu long name/link hack.


# 1.41.2.1 24-Aug-2004 jmc

Pullup rev 1.44 (requested by tron in ticket #784)

Propery handle "cpio" archives where the last hardlink includes the
data of a file. PR#26514


# 1.41.2.2.2.1 23-Jul-2005 snj

Apply patch (requested by riz in ticket #5512):
Sync pax with HEAD of 2005-07-22.


# 1.53.4.1 22-Mar-2008 matt

sync with HEAD


# 1.54.2.1 24-Mar-2008 keiichi

sync with head.


# 1.55.10.1 13-May-2009 jym

Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html


# 1.55.8.1 13-Apr-2009 snj

Pull up following revision(s) (requested by christo in ticket #678):
bin/pax/extern.h: revision 1.56
bin/pax/file_subs.c: revision 1.62
bin/pax/options.c: revision 1.104
bin/pax/pat_rep.c: revision 1.29
bin/pax/pax.h: revision 1.30
Fixes from christos for pr-41167
XXX -X is still broken, but that wasn't part of this PR.


# 1.56.4.1 23-Jun-2011 cherry

Catchup with rmind-uvmplock merge.


# 1.58.2.1 30-Oct-2012 yamt

sync with head