Commit Graph

6758 Commits

Author SHA1 Message Date
ru
11a1318135 Output style nit. 2004-05-12 07:36:59 +00:00
cognet
5994ff7b4c Do not attempt ro read more than sizeof(buf) from stdin. 2004-05-10 15:52:16 +00:00
cjc
54af59dd3a 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
stefanf
fd84d10fad 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
kientzle
0e6668dd2e Add --unlink and --unlink-first synonyms for -U
Make indentation of tar_longopts array more consistent.
2004-05-05 21:06:37 +00:00
stefanf
8962112f00 Add my birthday.
Approved by:	das (mentor)
2004-05-05 13:11:33 +00:00
kientzle
34a7b89d37 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
kientzle
7a80636e7f 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
rwatson
bbf5b43ff8 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
kientzle
cc93bc17a0 For portability, don't rely on libc's strmode(3). <sigh> 2004-05-03 21:05:59 +00:00
kientzle
79697f7186 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
kientzle
490330a22a Style: Use single tab after #define 2004-05-02 22:58:18 +00:00
kientzle
a33004e479 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
kientzle
83908c5c8b More style fixes, per bde. 2004-05-02 17:54:57 +00:00
smkelly
746c90d1a0 - 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
smkelly
7d92f80dd2 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
kientzle
e3af2353c4 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
kientzle
568c9e1d05 Style fixes, most suggested by bde. 2004-05-01 21:47:31 +00:00
smkelly
507ac98289 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
smkelly
1728b4c285 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
smkelly
47a42cf8e5 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
kientzle
5aa078d988 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
kientzle
867bb40c44 -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
kientzle
83ecd7781e Refuse to extract entries with '..' in pathname.
Pointed out by: David Schultz
2004-04-28 18:53:07 +00:00
kientzle
927b01d312 Remove information about specific formats; replace with a
reference to libarchive-formats(5).
2004-04-28 04:43:57 +00:00
kientzle
06760f99a1 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
silby
bd609915e0 Add the bad reset statistic (corresponds to tcp_input.c rev 1.235) 2004-04-26 02:57:33 +00:00
kientzle
fe93d4f02e 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
tjr
82d781d1b5 Print fork statistics with %u as they are unsigned quantities.
PR:		65889
Submitted by:	Ken Stailey
2004-04-23 13:10:29 +00:00
kientzle
15ca1ccb2d Eliminate a redundant call to archive_entry_set_pathname() 2004-04-21 05:16:28 +00:00
des
2416b781f7 Clarify and correct some compatibility notes.
PR:		65822
2004-04-21 00:42:55 +00:00
green
2f31d4ad3c Treat kevent(2) returning an error EINTR as the non-error it is. 2004-04-20 22:04:12 +00:00
kientzle
6dec29ccab 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
cognet
7968cd95a0 Handle window resizing better.
Submitted by:	Cyril Nguyen Huu
Obtained from:	OpenBSD
2004-04-19 21:37:29 +00:00
marius
b84b33b31d Add my birthday.
Approved by:	marcel (mentor)
2004-04-18 01:05:55 +00:00
tjr
c5c33ab4e9 Restore old value of LESSKEYFILE_SYS. 2004-04-17 07:48:21 +00:00
tjr
051c999ac2 Regenerate with less 381 configure script. 2004-04-17 07:46:08 +00:00
kientzle
484ec180f1 --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
kientzle
2b19543d6c 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
bde
b07f071cf0 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
bde
253d68a52a 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
kientzle
58455f9e3f 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
kientzle
2d6a22a91d When all the links to a file have been dumped, don't forget
to free() the memory used to store the filename.
2004-04-13 23:50:48 +00:00
kientzle
a67431b09b Eliminate a lot of malloc/free calls by using
a stack-allocated buffer for safe_fprintf formatting.
Only if the result is too large do we resort to malloc.
2004-04-13 23:49:02 +00:00
kientzle
ec9a891664 Manpage changes suggested by Irina Liakh.
Also, add -h as a synonym for -H, for Linux Standards Base compliance.
2004-04-13 19:45:55 +00:00
luigi
ce58934c26 Replace ROUNDUP/ADVANCE with SA_SIZE 2004-04-13 11:24:43 +00:00
ru
01487d9cea The .DEFAULT target with no commands caused a null pointer dereference.
PR:		bin/63405
Obtained from:	NetBSD
2004-04-12 20:05:11 +00:00
kientzle
d1f2ebdf42 Style fixes
Pointed out by: bde
2004-04-12 18:06:07 +00:00
ru
f044d0a524 Document the new .warning directive. 2004-04-12 18:00:54 +00:00
ru
5108eb2d06 Added the new .warning directive.
Submitted by:	Cyrille Lefevre
2004-04-12 17:57:51 +00:00