Commit graph

6814 commits

Author SHA1 Message Date
Oliver Eikemeier 1c8329632e - introduce a new primary `-depth n', which tests whether
the depth of the current file relative to the starting
  point of the traversal is n. The usual +/- modifiers
  to the argument apply.

- while I'm here, fix -maxdepth in the case of a depth-first
  traversal

Print the top ten maintainers of python module ports
(works with p5-* too):

find /usr/ports -depth 2 \! -name 'py-*' -prune -o \
  -depth 3 -name Makefile -execdir make -VMAINTAINER \; \
  | sort | uniq -c | sort -nr | head

PR:		66667
Reviewed by:	ru, joerg
Approved by:	joerg
MFC after:	2 weeks
2004-05-28 17:17:15 +00:00
Tim Kientzle f0e6a2b96d Minor corrections to error handling and user notifications:
* Move format/compression reporting to end of output, since
  we don't always know the input format until then.
* Set bsdtar exit value to 1 if any file could not be restored.
* Generate gtar-style warning when stripping leading '/' characters.
* Warn when removing symlinks.
2004-05-27 04:35:36 +00:00
Tim Kientzle 8df3c224c0 Provide framework for exiting with non-zero value on non-critical errors. 2004-05-27 04:30:59 +00:00
Pawel Jakub Dawidek 7d3940bb67 Use humanize_number(3) to format sizes into a human readable form. 2004-05-24 22:22:29 +00:00
Pawel Jakub Dawidek 8cab54e9a8 Mark du(1) as WARNS6 clean.
Tested on:	alpha, amd64, i386, ia64, sparc64
2004-05-24 21:31:30 +00:00
Stefan Farfeleder 8b061e144e Include <string.h> for prototypes of various string functions.
Approved by:	das (mentor)
2004-05-24 12:44:00 +00:00
Stefan Farfeleder 40905e9049 Include <netinet/in.h> for ntoh*() and hton*() prototypes.
Approved by:	das (mentor)
2004-05-24 11:59:17 +00:00
Josef El-Rayes df38fbe11f Add localized calendar file for holidays in Austria.
Approved by:	le
2004-05-23 13:22:01 +00:00
Tim Kientzle 26eddc7f41 Add --no-same-owner as a synonym for -o.
Note that bsdtar's -o (which follows SUSv2) is not the same as GNU tar's -o.
In GNU tar, -o and --no-same-owner are not synonyms.

Pointed out by: Kris Kennaway (required by xpenguins port)
2004-05-22 17:49:54 +00:00
Robert Watson 7d8c7fe102 Add a "-r" flag to ktrdump(1) to print relative timestamps when used
with "-t" rather than absolute timestamps.  This allows the reader
to get a better sense of latency between events, such as time to
schedule an interrupt thread from time the interrupt occurred.  Assert
a copyright on ktrdump.c since I seem to be modifying it more than I
thought.
2004-05-22 08:26:10 +00:00
Robert Watson 7ddc893717 Add a quiet mode to ktrdump(1): if the "-q" flag is used, don't print
the pretty text header on top of the output.  Simplifies feeding the
results of tracing into a script for mechanical processing.
2004-05-21 21:24:58 +00:00
Robert Watson dd6cf019f3 When the 'f' flag is passed to ktrdump(1), use 40 characters for the
"file and line" field consistently; previously, a 32-character field
length was used for the table header, which resulted in the header
not lining up with the table.
2004-05-21 21:15:48 +00:00
Tim Kientzle c5ce4977e6 Add --dereference as a synonym for -H
Pointed out by: Kris Kennaway (unbreaks nspr port build)
2004-05-21 18:40:32 +00:00
Hiten Pandya 151e36fc65 Remove unneeded lseek(2) hack to position past the 2GB point,
use fseeko(3) instead.

This commit fixes breakage when `lastcomm matchstring` is run.

PR:          	bin/66765, bin/64568
Submitted by:	Dan Nelson <dnelson at allantgroup.com>
2004-05-20 19:25:27 +00:00
David Malone 838c00236b Fix a couple of warnings:
1) Missing include for declaration of time conversion functions.
2) Avoid a couple of alignment warnings on 64 bit arches by memcpying the
   things pointed to by caddrs into variables of the right type.

Bump WARNS to 6 while I'm here.
2004-05-19 21:34:52 +00:00
David Malone f2ab33b6eb Add missing %s so that all of the usage message gets printed.
Bump WARNS to 6 while I'm here.
2004-05-19 21:06:36 +00:00
Lukas Ertl be28a6af38 Fix integer overflow in the file size output when dealing with
large files (i.e. DVD images).

Reviewed by:  des@
2004-05-19 11:07:30 +00:00
Ruslan Ermilov a12d0a1aee Added pgrep to the SYNOPSIS.
Fixed SYNOPSIS.
Fixed markup nits.
2004-05-19 10:46:56 +00:00
Ruslan Ermilov fdc1ec368d Clean up language and markup. 2004-05-19 10:45:40 +00:00
Ruslan Ermilov 607e48e7b5 Language and markup polishing. 2004-05-19 10:44:24 +00:00
Ruslan Ermilov 79e447559c Bumped the document date. 2004-05-19 09:54:14 +00:00
Ruslan Ermilov 47a49bc2b5 Bumped the document date.
Fixed the grammar nit.
2004-05-19 09:53:41 +00:00
Ruslan Ermilov c548db0353 Bumped document date.
Fixed markup nit.
2004-05-19 09:53:03 +00:00
Ruslan Ermilov 0d25a5d896 Bumped document date.
Fixed the grammar nit.
2004-05-19 09:52:40 +00:00
Ruslan Ermilov af52678ebd Markup nits. 2004-05-19 09:51:58 +00:00
Ruslan Ermilov 032a157f2b Bumped document date.
Dealt with hard sentence breaks and whitespace at EOL.
2004-05-19 09:51:31 +00:00
Ruslan Ermilov fc7589061d Fixed document date. 2004-05-19 09:49:54 +00:00
Ruslan Ermilov 54874bb6b9 Bumped document date.
Fixed a bunch of hyphen misspellings.
Fixed one warning.
2004-05-19 09:49:37 +00:00
Ruslan Ermilov 4bdd89ba98 Restore part of the word that got (accidentally) removed.
Removed whitespace at EOL.
2004-05-19 09:46:37 +00:00
Ruslan Ermilov 3c12a2e0d2 Markup nits. 2004-05-19 09:45:46 +00:00
Ruslan Ermilov 6f9c5e40fa Bumped document date.
Removed hard sentence break.
2004-05-19 09:44:31 +00:00
Tim Kientzle 04e2d02e20 Default is to restore timestamps, even when operating as root. <sigh> 2004-05-19 01:21:11 +00:00
Tim Kientzle 873e38290a Fix a segfault when looking up a non-existent group. 2004-05-18 23:40:25 +00:00
Ruslan Ermilov aa588a66d1 Bump document date on behalf of the -e option.
Spell "ID" correctly.
2004-05-18 20:45:32 +00:00
Ruslan Ermilov b388c4ac50 Bump document date on behalf of the -E option. 2004-05-18 20:42:36 +00:00
Ruslan Ermilov f18a58b589 Added -u to the SYNOPSIS. 2004-05-18 20:40:37 +00:00
Ruslan Ermilov f0085ed625 Bump document date on behalf of the -u option. 2004-05-18 20:38:43 +00:00
Ruslan Ermilov c9a74f6a2b Bump document date on behalf of the -M option. 2004-05-18 20:36:54 +00:00
Peter Wemm f7dd47a8d1 Build/install gprof on amd64 as well, after repocopying the MD bits.
Not that it has anything to process yet, but that comes next.
2004-05-18 18:05:19 +00:00
Tim Kientzle 656e70b49a Accept (but ignore) GNU tar's -B option. bsdtar never
needs it, but it does no harm for people to specify it.
2004-05-18 17:16:55 +00:00
Stefan Farfeleder ec18ee18ad Don't depend on NULL's expansion being a pointer, cast it before it is passed
to variadic functions.

Approved by:	das (mentor)
2004-05-18 15:53:58 +00:00
Tim Kientzle a25502627d Set errno to 0 before calling getpwuid/getgrgid, so that error
messages will be displayed only when there is, in fact, an error.
2004-05-17 18:29:12 +00:00
Tim Kientzle 9d77c5f29c Speed up safe_fprintf by copying to a temp buffer, then writing
blocks at a time, rather than using putc().
2004-05-17 07:35:52 +00:00
Tim Kientzle 088bdb251d Propagate struct bsdtar down into a lot more places.
Move global progname variable into struct bsdtar.
2004-05-17 05:44:53 +00:00
Tim Kientzle 7283cd6959 Refactor name caching to use a common piece of code for uname_cache and
gname_cache.  Cache negative lookups to dramatically improve performance
building archives containing nonexistent uid/gid.
2004-05-17 05:02:39 +00:00
Tim Kientzle 4a07f42b98 Make symlink protection a bit more useful:
* Remove terminal symlinks so they can be replaced.
  * If -U, remove intermediate symlinks as well
  * Otherwise, refuse the extraction
2004-05-17 03:33:06 +00:00
Tim Kientzle dcec34670d Update manpage to track new security features. 2004-05-17 03:19:31 +00:00
Stefan Farfeleder a752604477 Remove spurious semicolons. Outside of functions they are actually errors but
GCC doesn't warn about them without -pedantic.

Approved by:	das (mentor)
PR:		56649
Reviewed by:	md5
2004-05-16 22:08:17 +00:00
Oliver Eikemeier 9c61111db8 snafu, exchanged the descriptions of -maxdepth and -mindepth.
Noticed by:	ru
2004-05-16 10:35:14 +00:00
Olivier Houchard bb52bd2f06 Insert "arm" between "amd64" and "powerpc"
Requested by:	bde
2004-05-14 23:08:52 +00:00
Bruce Evans 6ff9ebfdc9 Fixed total disorder of MD includes.
Disorder buffer overflowed by:	arm commit
2004-05-14 21:05:35 +00:00
Joerg Wunsch 482b206bf5 Bump the .Dd value.
Update xrefs to more contemporary items.

Requested by:	ru, green
MFC after:	1 week
2004-05-14 19:29:39 +00:00
Joerg Wunsch be06d37c18 When I wrote this man page more than 5 years ago, I simply didn't
understand the true symmetric nature of Enigma, so my description of
``automatically detects that the input is encrypted'' was simply
wrong.  Replace that by a more accurate description of why feeding the
ciphertext again into the engine will decrypt it.

MFC after:	1 week
2004-05-14 18:46:16 +00:00
Olivier Houchard 63b689127c Use four spaces instead of tab for second level indentation.
Requested by:	ru
2004-05-14 14:50:55 +00:00
Olivier Houchard bc67fdeab2 Define PTRDIFF_IS_LONG and SIZEOF_IS_ULONG for arm. 2004-05-14 13:44:36 +00:00
Olivier Houchard 361af5b54b Some arm bits for gprof. 2004-05-14 13:44:04 +00:00
Olivier Houchard 355114cf96 Do not build truss on arm. 2004-05-14 13:43:18 +00:00
Oliver Eikemeier d79829af6c -maxdepth and -mindepth are global variables
PR:		66613
Approved by:	ru
MFC after:	3 days
2004-05-14 12:58:13 +00:00
Ruslan Ermilov 01d3e1c00d Output style nit. 2004-05-12 07:36:59 +00:00
Olivier Houchard 72d8d1c7f3 Do not attempt ro read more than sizeof(buf) from stdin. 2004-05-10 15:52:16 +00:00
Crist J. Clark e075483771 It was pointed out[0] that ctags(1) uses some potentially dangerous
system(3) calls where user-supplied data is used with no sanity
checking. Since ctags(1) is not setuid and is not likely to be used
in a privileged situation, this is not a big deal. However, the
fix is relatively easy and less ugly than the current code, let's be
safe. (I'm sure there are about 2^134 other system(3) calls like this
out there.)

[0] On freebsd-security by Roman Bogorodskiy <bogorodskiy@inbox.ru>
with subject "ctags(1) command execution vulnerability."

MFC after:	3 days
2004-05-07 19:44:40 +00:00
Stefan Farfeleder a2c1b13f5c Use a proper protoype to declare interp() and move it to tip.h. Fix an
invocation with a wrong number of arguments.

Approved by:	das (mentor)
2004-05-06 13:25:09 +00:00
Tim Kientzle 81f3488f97 Add --unlink and --unlink-first synonyms for -U
Make indentation of tar_longopts array more consistent.
2004-05-05 21:06:37 +00:00
Stefan Farfeleder dc34130a70 Add my birthday.
Approved by:	das (mentor)
2004-05-05 13:11:33 +00:00
Tim Kientzle bf0c356cdf Contrariwise, Linux sys/stat.h doesn't define mode_t and friends,
even though POSIX requires it.  <sigh>
2004-05-04 21:40:09 +00:00
Tim Kientzle 6e8b30b778 Include local copies of fts.c and fts.h to be used ONLY on non-FreeBSD
systems.  The fts.h here is an exact copy of include/fts.h (except for
an initial explanatory comment and the revision tags, of course).  The
fts.c here is slightly modified from lib/libc/gen/fts.c so it can
compile correctly on non-FreeBSD systems.
2004-05-04 17:21:01 +00:00
Robert Watson 300b40af25 Add "-M" argument to id(1), which permits the id command to be used
to print the MAC label of the current process.  "-M" selected as that's
what is used in Trusted IRIX.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, McAfee Research
2004-05-03 22:50:23 +00:00
Tim Kientzle 9644b0783f For portability, don't rely on libc's strmode(3). <sigh> 2004-05-03 21:05:59 +00:00
Tim Kientzle ce722a01be Correct copy/paste error in Linux nodump support.
Thanks to: Juergen Lock for his continuing patience
while I botch his patches.
2004-05-03 16:56:42 +00:00
Tim Kientzle f1fe72c1cc Style: Use single tab after #define 2004-05-02 22:58:18 +00:00
Tim Kientzle 732db834d2 More of Juergen Lock's patches for Linux.
(fflags support on Linux, nanosecond timestamp portability, enable
64-bit file offsets)
2004-05-02 18:10:35 +00:00
Tim Kientzle aef39ef75f More style fixes, per bde. 2004-05-02 17:54:57 +00:00
Sean Kelly 080f4020a3 - style(9) improvements courtesy of bde.
- Revise the former commit to behave nicer on filenames containing
  multiple '.' characters.
- Prevent the generation of macros starting with "__".
2004-05-02 07:07:54 +00:00
Sean Kelly 10c546c43f Teach rpcgen to generate .h files properly when the input filename contains
characters that can't be used in preprocessor macros.

PR:		bin/66156
Submitted by:	K S Braunsdorf <rpc@ksb.npcguild.org>
2004-05-02 01:55:23 +00:00
Tim Kientzle 020287607f A security issue: An archive containing a symlink to another
directory, then a file with that symlink as a prefix can drop a file
outside of the current directory, which can be a security hole.

Plug this hole by refusing to extract files if a prefix of the
pathname is a symlink.  The -P option disables this check.
2004-05-02 00:43:02 +00:00
Tim Kientzle 2622aab4ae Style fixes, most suggested by bde. 2004-05-01 21:47:31 +00:00
Sean Kelly 42249c7f31 Fix m4 to properly handle bitwise operators &, ^, and |. Fix operator
precedence. Add short-circuit evaluation.

PR:		bin/60914
Reviewed by:	petef
Discussed with:	jeff, petef
2004-05-01 03:59:43 +00:00
Sean Kelly 15ea803975 m4 script to test the functionality of math operators in eval().
Submitted by:	K S Braunsdorf <sed@ksb.npcguild.org>
2004-05-01 03:27:05 +00:00
Sean Kelly 528d980cc0 A new version that does exponents and lots of other neat things. Update
from the original author of math.sed.

Submitted by:	K S Braunsdorf <sed@ksb.npcguild.org>
2004-05-01 02:15:58 +00:00
Tim Kientzle 231a973125 Speed up hardlink detection by using a self-sizing hash
table rather than the old linear list search.

On my "hardlink detection torture test", this reduced
user time from 4700 seconds down to 4.2 seconds
and wallclock time from 1:24:48 down to 1:08.
(Yes, that's over one THOUSAND times reduction in user time. ;-)
In the worst case, the new code doubles peak memory usage,
though it could actually reduce memory usage in many cases.

MFC after: 1 week
PR: misc/42167, bin/51151
2004-04-30 18:17:51 +00:00
Tim Kientzle 6c6b3d9aa5 -U is now implemented. (It's been recognized by bsdtar for a while;
now libarchive actually supports the underlying request.)
2004-04-29 05:22:13 +00:00
Tim Kientzle d7837b06fe Refuse to extract entries with '..' in pathname.
Pointed out by: David Schultz
2004-04-28 18:53:07 +00:00
Tim Kientzle 0c27da5f82 Remove information about specific formats; replace with a
reference to libarchive-formats(5).
2004-04-28 04:43:57 +00:00
Tim Kientzle 749029a437 Update write.c to follow recent API changes to libarchive.
Also, bump up the default copy buffer from 8k to 64k
to improve performance.
2004-04-26 23:39:17 +00:00
Mike Silbersack fa126c2954 Add the bad reset statistic (corresponds to tcp_input.c rev 1.235) 2004-04-26 02:57:33 +00:00
Tim Kientzle 7e02198e95 Fix username/groupname cache so it returns a name that
was just looked up by get{pw,gr}id().  Otherwise, it
returns a NULL name unless it's already in the cache.

Credit to Juergen Lock.
2004-04-23 16:33:51 +00:00
Tim J. Robbins 6d4ba9cd4e Print fork statistics with %u as they are unsigned quantities.
PR:		65889
Submitted by:	Ken Stailey
2004-04-23 13:10:29 +00:00
Tim Kientzle fe44171ebd Eliminate a redundant call to archive_entry_set_pathname() 2004-04-21 05:16:28 +00:00
Dag-Erling Smørgrav 47d91ba394 Clarify and correct some compatibility notes.
PR:		65822
2004-04-21 00:42:55 +00:00
Brian Feldman 59fb7e543f Treat kevent(2) returning an error EINTR as the non-error it is. 2004-04-20 22:04:12 +00:00
Tim Kientzle 97c4c5308b Allow brave souls to install bsdtar as the
default "tar" command by defining WITH_BSDTAR.

Note: "gtar" and "bsdtar" commands both exist regardless.
2004-04-19 22:09:04 +00:00
Olivier Houchard ec8ffccbdc Handle window resizing better.
Submitted by:	Cyril Nguyen Huu
Obtained from:	OpenBSD
2004-04-19 21:37:29 +00:00
Marius Strobl d3770a0c15 Add my birthday.
Approved by:	marcel (mentor)
2004-04-18 01:05:55 +00:00
Tim J. Robbins 6c488bf29c Restore old value of LESSKEYFILE_SYS. 2004-04-17 07:48:21 +00:00
Tim J. Robbins 55e19c81cb Regenerate with less 381 configure script. 2004-04-17 07:46:08 +00:00
Tim Kientzle cc52bf3428 --help is only supported if you have getopt_long().
This allows bsdtar to compile on FreeBSD 4.x.
2004-04-16 03:50:04 +00:00
Tim Kientzle 855e109158 As suggested by Julian Elischer, use a self-sizing hash
table for the hardlink cache.  This dramatically improves
performance when archiving millions of hardlinked files.

While I'm here, clean up some style bugs (per Bruce Evans)
and clarify some comments.
2004-04-15 22:37:54 +00:00
Bruce Evans 929789b42c Include <sys/proc.h> instead of depending on namespace pollution in
<sys/user.h> for the definition of TDF_SINTR.  Fixed anachronous
spelling of TDF_SINTR in a comment

Demangled VCS ids.  There were 2 misplaced copies of $FreeBSD$ and of
the include before it.  The vendor id infrastructure was edited.

Fixed the only other remaining style bug since rev.1.1 (expansion of
struct member names made a line too long).
2004-04-14 09:34:17 +00:00
Bruce Evans a1541efa63 Include <sys/proc.h> for the definition of PS_INMEM instead of
depending on namespace pollution in <sys/user.h>.

Reduced nearby include messes.
2004-04-14 09:01:56 +00:00
Tim Kientzle 17834543c8 A simple cache of uid->uname lookups and gid->gname lookups eliminates
almost 1/2 of the CPU time required to create an uncompressed archive
and makes a noticable reduction in wallclock time.
2004-04-14 00:40:54 +00:00