Commit Graph

83 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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 Kientzle
fe44171ebd Eliminate a redundant call to archive_entry_set_pathname() 2004-04-21 05:16:28 +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
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
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
Tim Kientzle
c7141791f3 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
Tim Kientzle
907d74bb26 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
Tim Kientzle
de60e4436b 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
Tim Kientzle
5316058f3c Style fixes
Pointed out by: bde
2004-04-12 18:06:07 +00:00
Tim Kientzle
4cbbc3a35e Add DPADD to Makefile (thanks to Andrey for pointing this out).
Generally clean up Makefile, remove dmalloc references from source
(there are better ways to do this than pollute the FreeBSD src tree).
2004-04-12 00:13:23 +00:00
Tim Kientzle
f6f4796250 Allow arguments to appear in any order.
While I'm here, add a couple of extra sanity-checks to
the argument parsing (reject -j -z, for instance) and
update the docs a bit.

Requested by: most everyone ;-)
2004-04-08 19:37:01 +00:00
Tim Kientzle
54b3a82544 Document the newly-implemented -T option. 2004-04-08 06:21:03 +00:00
Tim Kientzle
330924f9bd Add support for -T option on create.
(Required by pkg_create.)
2004-04-08 06:12:01 +00:00
Tim Kientzle
4102998278 Correct signature in alternative stub implementation of setup_acls() 2004-04-07 17:43:48 +00:00
Tim Kientzle
1eb80e1673 Archive both access and default ACLs. 2004-04-06 23:08:31 +00:00
Tim Kientzle
d7fe3b4f52 Initial commit for bsdtar. 2004-04-05 21:32:18 +00:00