Commit Graph

38 Commits

Author SHA1 Message Date
kientzle
bd948d43ca Default is to restore timestamps, even when operating as root. <sigh> 2004-05-19 01:21:11 +00:00
kientzle
6d58177232 Fix a segfault when looking up a non-existent group. 2004-05-18 23:40:25 +00:00
kientzle
82ad771fc4 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
kientzle
a2d65f2ff8 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
kientzle
f113d8daf6 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
kientzle
d8d0d2b68a Propagate struct bsdtar down into a lot more places.
Move global progname variable into struct bsdtar.
2004-05-17 05:44:53 +00:00
kientzle
5cfb79a67b 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
kientzle
edb4c36c4e 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
kientzle
5d71bf79b9 Update manpage to track new security features. 2004-05-17 03:19:31 +00:00
kientzle
e1906beac0 Add --unlink and --unlink-first synonyms for -U
Make indentation of tar_longopts array more consistent.
2004-05-05 21:06:37 +00:00
kientzle
5065cf7b7e 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
c8273e2bc6 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
kientzle
84e96d489d For portability, don't rely on libc's strmode(3). <sigh> 2004-05-03 21:05:59 +00:00
kientzle
4b4a571a3e 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
97877ff6da Style: Use single tab after #define 2004-05-02 22:58:18 +00:00
kientzle
beb914d299 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
69b5efd65f 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
d97881b04d -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
ec3c314996 Refuse to extract entries with '..' in pathname.
Pointed out by: David Schultz
2004-04-28 18:53:07 +00:00
kientzle
97952ffda5 Remove information about specific formats; replace with a
reference to libarchive-formats(5).
2004-04-28 04:43:57 +00:00
kientzle
2b16eb2b37 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
kientzle
376ec8c9e0 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
kientzle
3b74d9991f Eliminate a redundant call to archive_entry_set_pathname() 2004-04-21 05:16:28 +00:00
kientzle
b04bbaade3 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
kientzle
2e82e5328b --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
6f03b58e36 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
kientzle
c57065d23f 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
dce91c3e9f 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
078965198a 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
6b1b47eafd 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
kientzle
bc70569650 Style fixes
Pointed out by: bde
2004-04-12 18:06:07 +00:00
kientzle
ba578aff1a 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
kientzle
4eb00e0ad8 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
kientzle
f6193fa569 Document the newly-implemented -T option. 2004-04-08 06:21:03 +00:00
kientzle
cc91920b92 Add support for -T option on create.
(Required by pkg_create.)
2004-04-08 06:12:01 +00:00
kientzle
b9401a4a25 Correct signature in alternative stub implementation of setup_acls() 2004-04-07 17:43:48 +00:00
kientzle
af68728588 Archive both access and default ACLs. 2004-04-06 23:08:31 +00:00
kientzle
9b7e6b0200 Initial commit for bsdtar. 2004-04-05 21:32:18 +00:00