Commit Graph

155 Commits

Author SHA1 Message Date
ed
19e06e6384 Add missing `void' for function without arguments. 2009-12-29 08:45:50 +00:00
delphij
10746e90df Plug a memory leak.
PR:		bin/141835
Submitted by:	Henning Petersen <henning.petersen t-online.de>
MFC after:	2 weeks
2009-12-21 19:18:27 +00:00
kientzle
be5fcb8006 Before this fix, pax would stop the restore sequence for
symlinks after setting the owner.  As a result, mode
and timestamp were not restored.  This patch corrects the
problem by simply removing the short-circuit for symlinks
and using lchown()/lchmod()/lutimes() always for restoring
metadata.

PR:		bin/91316
Submitted by:	Jaakko Heinonen
Reviewed by:	Joerg Sonnenberger
MFC after:	14 days
2009-02-01 06:15:46 +00:00
brian
ca73550609 Remove unnecessary free argument casts.
Don't abuse arcname's constness.
2007-05-25 17:53:38 +00:00
rse
22615a5b86 Cleanup pax(1) sources a little bit while I poked around in them:
- remove a superfluous doubled trailing semicolon.
- remove the extra void casts on calls to void-function free(3).
2007-05-24 06:44:37 +00:00
ru
04681b9d6f Fix some of the alignment warnings on ARM. 2006-11-27 22:17:11 +00:00
ru
36d05684e7 Markup fixes. 2006-09-17 17:40:07 +00:00
cokane
178c925c64 Fix the wording about the blocksize (-b) parameter. The existing
wording makes it look like pax archives > 32256 bytes are not
POSIX-compliant! Correct this to state that pax archives with
block sizes > 32256 are not POSIX compliant...and settle our fears.

PR:		docs/97059
Reviewed by:	Giorgos Keramidas <keramida>
2006-05-10 20:32:57 +00:00
obrien
ed5564cbbf Fix bin/pax doesn't wait for compress/gzip before exiting.
Submitted by:	Joerg Sonnenberger <joerg@britannica.bec.de>
Obtained from:	OpenBSD (commited fix to PR 3455)
2005-03-12 06:38:01 +00:00
ru
1541af42f1 Expand *n't contractions. 2005-02-13 22:25:33 +00:00
ru
114ea39c76 Fixed the misplaced $FreeBSD$. 2005-02-09 18:07:17 +00:00
ru
ffd9fd4c0e Add the new standard EXIT STATUS section where appropriate.
Sort standard sections in the (documented) preferred order.
2005-01-16 16:41:59 +00:00
brian
0e5f9d308c Don't decend into directories when -d is set and the directory itself doesn't
match.

PR:		28095
Submitted by:	bill at twwells dot com
MFC after:	7 days
2005-01-12 03:25:55 +00:00
imp
a76898b849 /*- or .\"- or #- to begin license clauses. 2005-01-10 08:39:26 +00:00
yar
32d92d3a1a Fix off-by-one errors and potential buffer overruns
WRT handling file and link names that reach the allowed
maximum for old tar and ustar archive formats.

PR:		bin/40466
Submitted by:	Cyrille Lefevre <email in the PR> (portions)
Reviewed by:	freebsd-arch (silence)
MFC after:	1 month
2004-11-13 10:56:35 +00:00
tjr
82e3e73431 Document missing multibyte character handling in utilities specified
by POSIX.
2004-07-03 02:03:44 +00:00
ru
305463f129 Deal with double whitespace. 2004-07-03 00:06:28 +00:00
ru
d40c857e0d Mechanically kill hard sentence breaks. 2004-07-02 21:04:19 +00:00
obrien
8714fd098c Don't continue if the '-C' option (a-la GNUtar; commited in options.c
rev 1.18, but not documented in the man page) caused a failed chdir.
Otherwise, one can easily overwrite files.

Submitted by:	Robert Nagy <robert@openbsd.org>
Obtained from:	OpenBSD
2004-06-25 05:27:59 +00:00
cognet
797424d85b Use WARNS?=3 for these in the arm case for now, due to toolchain issues. 2004-05-14 13:31:21 +00:00
markm
4383f14801 Remove clause 3 from the UCB licenses.
OK'ed by:	imp, core
2004-04-06 20:06:54 +00:00
cperciva
4d1e6cb1d3 Fix memory leak
PR:		bin/64321
Submitted by:	Rodney Ruddock <rodney@interopsystems.com>
MFOpenBSD:	rev 1.17
MFC after:	3 days
2004-03-16 08:33:33 +00:00
markm
0b0ae8e16e Make NULL a (void*)0 whereever possible, and fix the warnings(-Werror)
that this provokes. "Wherever possible" means "In the kernel OR NOT
C++" (implying C).

There are places where (void *) pointers are not valid, such as for
function pointers, but in the special case of (void *)0, agreement
settles on it being OK.

Most of the fixes were NULL where an integer zero was needed; many
of the fixes were NULL where ascii <nul> ('\0') was needed, and a
few were just "other".

Tested on: i386 sparc64
2004-03-05 08:10:19 +00:00
markm
aafc494847 Get this area compiling with the highest WARNS= that it works with.
Obsolete WFORMAT= junk also removed where possible.

OK'ed by:	obrien
Tested on:	sparc64, alpha, i386
2003-06-13 07:04:02 +00:00
markm
0bdf7b1ca4 Fix a bazillion warnings. This makes almost the whole of src/bin/*
WARNS=6, std=c99 clean.

Tested on:	i386, alpha
2003-05-03 16:39:34 +00:00
obrien
14593b22f8 Quiet warnings about copyright[]. 2003-05-02 00:04:21 +00:00
obrien
3557f18a16 Fix signed/unsigned mix comparisons involving sizeof. 2003-05-02 00:03:10 +00:00
tjr
910109ede4 Add the -j and -y options to the synopsis. 2003-05-01 02:37:46 +00:00
obrien
1cb150c8dd Make the "tarcp" example more direct. 2003-01-10 17:37:23 +00:00
schweikh
d3367c5f5d Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,
especially in troff files.
2003-01-01 18:49:04 +00:00
tjr
86028a3db2 Ensure all va_starts have a matching va_end.
Obtained from:	NetBSD
2002-10-06 09:23:58 +00:00
tjr
140769726d /dev/sa0 is the default tape device, not /dev/rst0. 2002-10-06 07:56:27 +00:00
tjr
0eb784108f Fix format string errors relating mainly to the use of %qu to print off_t's.
Instead use %ju and cast the argument.

WFORMAT=0 is still required in the Makefile because gcc warns about
some strftime() calls (I don't think this behaviour is useful.)

Tested on:	sparc64, alpha, i386
2002-10-06 03:20:27 +00:00
bde
d47e5d8db2 Removed extra $FreeBSD$. Moved #if 0 for the vendor id to the correct
place.  Restored indent protection of copyright comment.
2002-08-22 01:07:16 +00:00
trhodes
9618da3e35 s/filesystem/file system/ as discussed on -developers 2002-08-21 17:32:44 +00:00
keramida
467c3ff452 Fix a couple of typos in a comment.
PR:		docs/33559
Submitted by:	Marc Olzheim <marcolz@ilse.nl>
2002-07-15 02:03:30 +00:00
obrien
f6f518b207 Consistently use FBSDID 2002-06-30 05:15:05 +00:00
trhodes
0c40c9d08e more file system > filesystem 2002-05-16 03:51:38 +00:00
trhodes
56036d2623 Consistancy check s/file system/filesystem/
Reviewed by:	brian
2002-05-16 01:57:20 +00:00
charnier
0865462d56 Use `The .Nm utility' 2002-04-21 12:53:08 +00:00
charnier
487a22adbf Use `The .Nm utility' 2002-04-20 11:58:12 +00:00
charnier
64ab19a185 Do not return(f_returning_void());. Spell FALLTHROUGH to make it lint()able. 2002-04-12 20:23:51 +00:00
markm
09171e09d6 No need to cast; ().gr_gid is already the correct type. 2002-03-22 15:54:44 +00:00
kris
a1a10418c8 Correct inadvertent style botches in previous commit. 2002-02-04 03:06:51 +00:00
kris
bb3058824a Lock down with WFORMAT=1 except those directories with unfixed warnings.
Tested on i386 and alpha.
2002-02-04 02:49:19 +00:00
imp
0496eb97bd Ooops, forgot to remove the registers here. 2002-02-02 07:07:59 +00:00
imp
50014e3541 o __P has been reoved
o Old-style K&R declarations have been converted to new C89 style
o register has been removed
o prototype for main() has been removed (gcc3 makes it an error)
o int main(int argc, char *argv[]) is the preferred main definition.
o Attempt to not break style(9) conformance for declarations more than
  they already are.
2002-02-02 06:48:10 +00:00
obrien
099f8ecbe9 Default to WARNS=2. Binary builds that cannot handle this must explicitly
set WARNS=0.

Reviewed by:	mike
2001-12-04 01:57:47 +00:00
dillon
4394f0950f Use a quad int conversion routine for time_t instead of ulong, capable of
decoding tar's full time buffer (12 digits).
2001-10-28 02:51:43 +00:00
dillon
6ce5111d95 Various string fields for certain cpio types are 11 rather then 8
characters.  Use quad conversion functions rather then long conversion
where appropriate to handle the available range.  Mainly fixes time_t
but there was also a st_size ulong conversion in there that has to be
quad or cpio cannot be used to copy files > 2G.

MFC after:	1 day
2001-10-28 02:45:04 +00:00
dillon
5bb0a362e0 Remove unnecessary casts in timeval.tv_sec load from st_*time 2001-10-28 02:42:26 +00:00
ru
24c7b0a61d mdoc(7) police: s/BSD/.Bx/ where appropriate. 2001-08-14 10:01:54 +00:00
peter
d58a143b4f Initialize listf at main() 2001-08-13 21:54:47 +00:00
ru
f858dca3dc mdoc(7) police: join split punctuation to macro calls. 2001-08-10 17:35:21 +00:00
dd
a145482cf6 Remove whitespace at EOL. 2001-07-15 07:53:42 +00:00
ru
2149a5069b mdoc(7) police: removed HISTORY info from the .Os call. 2001-07-10 10:04:09 +00:00
dd
eaa6ee03b8 mdoc(7) police: remove extraneous .Pp before and/or after .Sh. 2001-07-09 09:54:33 +00:00
brian
8636b161b3 Fix the type of the NULL arg to execl()
Idea from: Theo de Raadt <deraadt@openbsd.org>
2001-07-09 09:24:06 +00:00
dd
ef9ae51ffe Include missing header files which define functions for which gcc has
builtins (e.g., exit, strcmp).
2001-06-24 23:04:23 +00:00
imp
0155282ad7 Minor comment fix 2001-05-30 03:25:45 +00:00
ru
8476412152 mdoc(7) police: fix markup, rename and reorder some sections. 2001-05-08 08:12:53 +00:00
ru
9b0de0da1c mdoc(7) police: sort xrefs. 2001-05-08 07:19:19 +00:00
kris
6f2ea93cf4 Sync up with OpenBSD. Too many changes to note, but the major features
are:
* Implement cpio compatibility mode when pax is invoked as cpio
* Extend tar compatibility mode to cover many of the GNU tar single-letter
  options (bzip2 mode, aka -y/-j is not present in OpenBSD).  When
  invoked as tar, pax is now full-featured enough for use by the ports
  collection to extract distfiles and create packages.
* Many bug fixes to the operation of pax and the tar compatibility modes
* Code fixes for things like correct string buffer termination.

I tried to preserve existing FreeBSD fixes to this utility; please let me
know if I have inadvertently spammed something.
2001-05-08 06:19:06 +00:00
kris
b48e2b1dc2 Add -z flag to pax to allow gzipping of archive output. Add -z and -Z (gzip
and compress) to pax when used in tar mode (invoked as 'tar') for
compatibility with GNU tar.

bzip2 functionality for further GNU tar compatibility will be added at a
later date.

Note in the manpage that -z is non-standard.

Obtained from:	OpenBSD
Reviewed by:	-hackers
MFC after:	2 weeks
2001-05-05 01:10:13 +00:00
kris
f94a8fb47c Whitespace cleanup pass; reduce diffs with OpenBSD. No functional changes. 2001-04-26 09:22:28 +00:00
kris
b146fa78f3 Reduce diffs with OpenBSD:
#if __STDC__ -> #ifdef __STDC__
  pax_warn() -> paxwarn()
  sys_warn() -> syswarn()
  (foo *)NULL -> NULL
  bcopy -> memmove()/memcpy()
  bzero -> memset()
  Typo fixes
  sprintf() -> snprintf()
  rindex() -> strrchr()
  index() -> strchr()
  sys_errlist[] -> strerror()

Obtained from:	OpenBSD
2001-04-26 08:37:00 +00:00
kris
b4108a0697 Use mkstemp() for secure tempfile creation instead of tempnam()
Obtained from:	OpenBSD
Reviewed by:	mikeh
2001-04-26 07:32:27 +00:00
kris
b6da0fca77 -Wnon-const-format sweep: make format strings const char *'s, add
__printflike()/__printf0like() to function prototypes, as appropriate.

Reviewed by:	bde, -audit
2001-04-17 07:46:38 +00:00
ache
0a97601c2d Use nl_langinfo instead of %Ef 2001-03-21 13:33:09 +00:00
ru
a79ec4865f POSIX wrote:
: LC_TIME   This variable shall determine the format and
:           contents of date and time strings when the -v
:           option is specified.

Developers took this wrong.  LC_TIME specifies the locale
name, not the ``format'' argument of strftime().

Oops:
	pax -w -f /tmp/foo /dev/null
	LC_TIME=de_DE.ISO_8859-1 pax -v -f /tmp/foo
2001-03-02 16:19:49 +00:00
ru
b5cd63f616 mdoc(7) police: use the default ``file ...'' feature of the .Ar macro. 2001-02-13 09:56:35 +00:00
asmodai
47a2266000 Fix typo: seperate -> separate.
Seperate does not exist in the english language.

Submitted to look at by:	kris
2001-02-06 10:39:38 +00:00
ru
8a6f8b5fe4 mdoc(7) police: split punctuation characters + misc fixes. 2001-02-01 16:38:02 +00:00
ru
036612bde9 Prepare for mdoc(7)NG. 2000-12-18 14:48:17 +00:00
ru
be1f850a8f mdoc(7) police: use the new features of the Nm macro. 2000-11-20 11:39:41 +00:00
imp
d5e7ddb4c9 Don't explicitly declare optarg and optind. These are declared in
unistd.h, which is already included.
2000-08-16 05:14:49 +00:00
ache
2f0b29c459 Use %Ef 2000-06-22 16:57:39 +00:00
sheldonh
244b8ead7d Remove more single-space hard sentence breaks. 2000-03-02 14:54:02 +00:00
sheldonh
306562fd67 Remove single-space hard sentence breaks. These degrade the quality
of the typeset output, tend to make diffs harder to read and provide
bad examples for new-comers to mdoc.
2000-03-01 10:43:09 +00:00
peter
66312e4a8d $Id$ -> $FreeBSD$ 1999-08-27 23:15:48 +00:00
kris
713dd62834 Various spelling/formatting changes.
Submitted by: Philippe Charnier <charnier@xp11.frmug.org>
1999-05-08 10:22:15 +00:00
obrien
28f22f9b9d Rev 1.13 fixes PR bin/8958 1998-12-06 05:49:29 +00:00
obrien
97f6d04b8b There is a bug in /bin/pax -s option processing. The code assumes that all
pattern matches will occur at offset zero of the source string.  The bug causes
the input source string pointer to be incremented by the offset of the end of
the match, instead of it's length.  The fix is to only increment the pointer by
the length of the pattern match (eo-so).

Of course, the one example in the man page shows a situation where the match
occurs at offset 0.

Submitted by:	John W. DeBoskey <jwd@unx.sas.com>
Obtained from:	freebsd-current@freebsd.org
1998-12-05 10:29:10 +00:00
msmith
ab79d507a2 - Fix off-by-one problem in tar where filenames of length 100
and dirnames of length 99 don't archive.

Submitted by:	Wilfredo Sanchez <wsanchez@apple.com>
Obtained from:  OpenBSD
1998-10-20 05:52:33 +00:00
imp
c530c6747a Make sure we pass the length - 1 to readlink, since it adds its own
NUL at the end of the path.
Inspired by: OpenBSD's changes in this area by theo de raadt
1998-06-09 03:38:43 +00:00
steve
b881531554 Clarify the example a bit.
PR:		6801
Reviewed by:	David Kelly <dkelly@hiwaay.net>
1998-05-31 22:43:57 +00:00
charnier
cf1a881890 Correct use of .Nm. Add rcsid. 1998-05-15 06:30:58 +00:00
charnier
f055275992 .Sh AUTHOR -> .Sh AUTHORS
Use .An/.Aq
1998-03-19 07:26:37 +00:00
eivind
15bda558ba Make code slightly more robust towards change by calculating size
in-place.

Obtained from:  OpenBSD ar_subs.c rev 1.7 by Tood Miller <millert@openbsd.org)
1997-12-12 18:38:22 +00:00
eivind
2208ac1acf Remove simultaneous include of <sys/param.h> and <sys/types.h>.
Reorder includes to be alphabetical some places since I already was in
here.
1997-12-10 22:18:54 +00:00
sos
99b7368a45 Dont have an internal function named "warn" it clashes with libc..
Needed for ELF.
1997-08-29 16:12:30 +00:00
charnier
961f5b3e1a Off by 1 adjustment. Properly NUL terminate after strncpy.
Obtained from: {Net|Open}BSD
1997-06-02 06:30:06 +00:00
imp
054f35c222 compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.
1997-03-28 15:24:41 +00:00
peter
83b3c2c161 Revert $FreeBSD$ to $Id$ 1997-02-22 14:13:04 +00:00
jkh
808a36ef65 Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
steve
c5d0f9cb39 -Wall cleaning. 1996-12-14 06:08:03 +00:00
ache
af9609604e Pick collate info for RE character ranges 1996-08-11 16:59:27 +00:00
ache
73ab20d2fc Remove unneded ctype.h everywhere
Add setlocale LC_TIME
1995-10-23 21:23:27 +00:00
nate
de358b5139 Fix possible FS corruption caused by extra parameter to pax.
oo
Turns out, it's pretty important if you use PAX for backup.  In the man
page for PAX, there is an error (OK, we could call it a "potentially
catastrophic incompleteness").  It reads:

>  The command:
>
>      pax -r -v -f filename
>
>  gives the verbose table of contents for an archive stored in filename.

Yup, it does do that.  With a side effect: it also _replaces_ all the
files that come in from the archive.  As is my custom, I did my
backup-validation real soon after the backup was written.  Precisely
because I've seen the same sort of thing happen on other systems.  So all
that file-restoring didn't do a lot of damage.  Probably helped my
fragmentation somewhat (aha, an online defragger?) It did confuse one
hapless user, who lost an email message he _knew_ he hadn't deleted.
Apparently the system restored the file as of just before that critical
message came in.

The correct entry should read:

>  The command:
>
>      pax -v -f filename
>




>  gives the verbose table of contents for an archive stored in filename.


Submitted by:	John Beckett <jbeckett@southern.edu> via the BSDI mailing list
1995-08-16 23:12:25 +00:00
wollman
fc1f6c1d76 Delete bogus referneces to timezone code internal header file `tzfile.h',
which is no longer bogusly installed in /usr/include.
1995-08-07 19:17:46 +00:00