Commit Graph

346 Commits

Author SHA1 Message Date
kientzle
b3577bdc65 In mode 'u', check for an error return from archive_read_open.
This causes attempts to update a non-existent file to report
an actual error instead of triggering an assertion failure.

PR: bin/87911
Thanks to: roemer.ulrich
MFC after: 3 days

Note: This does not entirely fix bin/87911.  I need to decide on
the "correct" response when someone tries to update a non-existent
archive file.
2005-11-01 06:41:05 +00:00
kientzle
2c6448ce6d Include <sys/param.h> in order to get current __FreeBSD_version
in order to properly set HAVE_NL_LANGINFO.  <whew!>

Thanks to: Andrey Chernov
PR: bin/88013
MFC after: 3 days
2005-11-01 05:53:16 +00:00
kientzle
c0fd1c0f79 Spell "--format" correctly in error message. (It hasn't been
called "-F" for a very long time.)

PR: bin/86915
Thanks to: Gary W. Swearingen
MFC after: 3 days
2005-11-01 05:48:02 +00:00
kientzle
4168ea6d08 Fix -u with absolute paths (e.g., "tar -uf foo.tar /bar") by handling
pathname edits before comparing pathnames on disk to those in the archive.

Thanks to: Gareth Bailey, Lowell Gilbert
2005-09-24 21:19:57 +00:00
kientzle
163e4801c5 Detect Mac OS X's broken ACL library.
Thanks to: Diego "Flameeyes" Petten?
2005-09-24 21:17:47 +00:00
kientzle
b035b8b7b3 Style fix: Correct a compiler warning from GCC 4
Thanks to: Divacky Roman
PR: bin/84993
2005-09-21 03:21:35 +00:00
kientzle
5aa08bac53 The bsdtar_warnc() reporting function requires the program name to be
set up before it is called, so move the progname initialization before
the first possible call to bsdtar_warnc().

Thanks to: Stanislav Sedov
PR: bin/83366
MFC after: 7 days
2005-08-02 03:02:55 +00:00
ru
07317cc4f0 Fixed troff warnings.
Approved by:	re (blanket manpages)
2005-06-27 07:37:01 +00:00
kientzle
5fd4825f3c Clarify some error messages. 2005-05-08 06:25:15 +00:00
kientzle
839391fc8e bsdtar now uses the "tree" package instead of "fts" for walking
directory heirarchies.
2005-04-24 05:53:37 +00:00
kientzle
d4451ef08b Correct autoconf/automake invocation to work with devel/gnu-auto* from
ports.

Thanks to: Dag-Erling Sm?rgrav (des@)
2005-04-23 18:44:25 +00:00
kientzle
c4cef244d6 Minor fix to the configure logic to properly detect ACL support. 2005-04-23 18:41:28 +00:00
kientzle
2fe0aef3f1 Overhaul getdate.y. In particular, remove minutes-based logic
(combine with existing seconds-based), treat '-' as punctuation rather
than a negative number indicator (eliminates several special cases),
use a single list of special words instead of several separate lists,
use table-driven abbreviation logic (eliminate duplicate word entries
and special-case abbreviation and plural handling).  The result is
shorter, simpler (judging from comments, earlier maintainers didn't
understand the special handling for "negative years"), handles more
cases (e.g., "tu" is now a recognized abbreviation for "tuesday",
"3rd" is now equivalent to "third") and it has 2 fewer shift/reduce
conflicts.
2005-04-23 18:38:32 +00:00
murray
9097797b6a Point users to tcsh(1) for information about shell globbing patterns,
rather than 'XXXX'.

MFC after:	1 week
2005-04-19 16:06:04 +00:00
kientzle
6857f1e3f7 A very minor tweak to the handling of leading '/' characters. 2005-04-17 19:46:50 +00:00
kientzle
f666e865e6 A number of fixes to the autoconf-generated build system. In
particular, acl support is no longer enabled on FreeBSD 4, acl support
should be correctly enabled on Linux, dirent.d_namlen should be
correctly detected on platforms that support it.

Thanks to: Greg Lewis, Juergen Lock, and Jaakko Heinonen
2005-04-17 19:43:37 +00:00
kientzle
b27e034c99 Configure script needs to test for dirent.d_namlen.
Thanks to: Juergen Lock
2005-04-17 17:53:24 +00:00
kientzle
877f4c482e Update "make distfile" to use newest automake/autoconf from ports.
Thanks to: Juergen Lock
2005-04-17 17:51:05 +00:00
kientzle
ec0a4e2bdb Support path-rewriting options (including --strip-components) for both
extraction and creation.  While I'm here, fix a bug reported by Garrett
Wollman: when stripping the leading '/' from the path "/", don't produce
an entry with an empty name; produce "." instead.
2005-04-17 17:20:54 +00:00
obrien
f37742ff89 Add directory hierarchy copying example. 2005-03-28 18:18:44 +00:00
kientzle
c74d7d94bd Deorbit gtar, step 1: Remove WITH_GTAR knob.
"tar" is now always a synonym for "bsdtar".
  People who need gtar can access it as "gtar."

Approved by:	No objections on arch@
2005-03-20 20:38:46 +00:00
kientzle
7f4dba0f0e A handful of minor portability and style improvements. 2005-03-14 00:30:35 +00:00
kientzle
c46a8c03ea Style correction: one tab after #define. 2005-03-14 00:29:05 +00:00
kientzle
b3cbed0960 Re-unbreak the distfile target.
Also, reduce the WARNS level to 5 since different build environments
end up using different Yacc skeletons.  The BSD one does not
predeclare yyparse, the FSF one does, so it's not really possible to
consistently enforce both -Wmissing-prototypes and -Wredundant-decls.
2005-03-13 23:49:53 +00:00
kientzle
2b38f44c2f Fix a compile warning, fix the build. 2005-03-13 21:36:15 +00:00
kientzle
4949e1d1ad "make depend" with .y files is trickier than it looks. <sigh> 2005-03-13 19:55:53 +00:00
kientzle
5d0c5f694a Brain-o. Missing quote. 2005-03-13 19:44:19 +00:00
kientzle
832a345376 Add --newer-ctime, --newer-mtime, --newer-ctime-than, and --newer-mtime-than
switches to support selecting files by time of modification.

Special thanks to: Steven M. Bellovin, Rich $alz, and Jim Berets,
	authors of the public-domain getdate.y date-parsing code.
2005-03-13 18:36:24 +00:00
kientzle
0eac7627b8 Add --strip-components option, per bin/77666.
Thanks to: Sangwoo Shim
2005-03-13 04:12:30 +00:00
kientzle
34d9e63e65 Document the --null, --one-file-system, and -I options.
Clarify that -T can be used in 'x' mode as well as 'c' mode.
2005-02-18 19:19:45 +00:00
ru
7f3c7f0d46 Sort sections. 2005-01-18 13:43:56 +00:00
ru
6cc4b6c220 Added the EXIT STATUS section where appropriate. 2005-01-17 07:44:44 +00:00
kientzle
5babdbc5e3 Add a fallback version of fnmatch() to the bsdtar
source code.  Include configure logic to pick up the
system one when it exists and use the fallback version
when it doesn't exist.  Set the default for FreeBSD
to use the system version.

With this, bsdtar should now be quite portable.
2004-12-22 06:08:04 +00:00
kientzle
b5c1699658 GC an unused #include 2004-12-22 05:54:10 +00:00
kientzle
5b6c40f225 Fix -W long option handling.
In particular:
  -W excl=text
fails because "excl" is a prefix of both "exclude" and "exclude-from".  But,
  -W exclude=text
is okay because it matches "exclude" exactly.

Thanks to: Jose F Nieves
MFC after: 7 days
2004-12-22 03:38:28 +00:00
kientzle
38e8a38c12 Portability: the included fts.c should now
compile on many non-FreeBSD systems, including
Linux, Solaris, Darwin, etc.

Thanks to: many people who pointed out the same portability problem
2004-12-22 00:21:28 +00:00
ru
7448ff52b4 Use a relative symlinking so that "tar" also works in /stand. 2004-11-12 13:28:42 +00:00
kientzle
4dc09ab3c8 FreeBSD does have uintmax_t, so it can correctly
print out very large file sizes.

Thanks to: Yar Tikhiy
2004-11-06 18:38:13 +00:00
kientzle
ac9cf04ce1 Correct error handling on failed writes
to the archive.
2004-11-05 05:39:37 +00:00
kientzle
a5b447bdc1 getopt(3) prints an "unrecognized option" warning for me, so I
shouldn't print another.

MFC after: 15 days
2004-10-17 23:58:17 +00:00
kientzle
ccd13c40f2 Cosmetic goof: Use two spaces in "Jan 03 2004" but only one in "Jan 03 12:32"
MFC after: 15 days
2004-10-17 23:57:10 +00:00
kientzle
655e07d67c Make -C and -T work correctly together.
MFC after: 3 days
Thanks to: Guy Helmer
2004-08-28 05:28:19 +00:00
kientzle
eb191f46ff Document the -O option's new behavior in the presence of -t.
MFC after: 3 days
2004-08-27 04:19:28 +00:00
kientzle
2e9ab3a6f5 Support -t -O as in gtar. Perversely enough, -O means "send to stderr"
when used with -t, "send to stdout" when used with -x.

Thanks to: Ryan Hamilton for pointing out this odd beast
MFC after: 3 days
2004-08-27 04:13:15 +00:00
kientzle
d48cc88658 Permit -P to be combined with -t. (It's a no-op then, just as in gtar.) 2004-08-26 06:28:39 +00:00
kientzle
e646968085 Tell getopt to accept the (already-implemented) -I option. 2004-08-26 01:58:14 +00:00
kientzle
18881f092f Make -I and --files-from be synonyms for -T 2004-08-13 07:23:02 +00:00
kientzle
74f9ad184e gtar uses -F for another purpose, so bsdtar no longer treats it as a
synonym for --format.  Update the man page to reflect this.  While
I'm here, change the man page to document "tar" rather than "bsdtar,"
update some comments about -l compatibility and fix a few grammar nits.
2004-08-08 17:20:23 +00:00
kientzle
0a68c3721e Better low-memory handling: If the link cache runs out of memory, just
throw out the whole thing and stop tracking links entirely.  That will
break all remaining hardlinks, but should free up enough memory to
let everything finish.
2004-08-08 06:36:03 +00:00
kientzle
03cc09682b Move the smart chdir logic into a couple of utility functions in util.c.
Then use them to provide consistent -C support throughout the program.
Thanks to: Christoph Mallon
2004-08-08 05:50:10 +00:00
kientzle
0a58439922 It shouldn't be an error to specify the same mode twice: allow -cc but not -ct.
Thanks to: Christoph Mallon (whose proposed patch was actually
   simpler than what I ended up with)
2004-08-08 05:10:10 +00:00
kientzle
b2443d940f Another pointy-hat problem: PACKAGE_VERSION macro is set in
CFLAGS, it shouldn't be in bsdtar_platform.h.
Thanks to: Andrey Chernov for looking over my shoulder so much lately.
2004-08-08 04:36:32 +00:00
kientzle
92956ea0cd Minor portability fixes. bsdtar now compiles on Win32/cygwin, though
it doesn't yet seem to work entirely correctly.
2004-08-08 01:30:30 +00:00
kientzle
0457e08c65 Add --totals option. Unlike gtar, this reports the bytes actually
written to the archive, not the ones written to the compressor.
For uncompressed archives, these numbers are the same, of course.
2004-08-07 19:25:34 +00:00
kientzle
e9c1fd002b Linux port corrections:
* Add a more reasonable default device for linux
   * Add an autoconf check for the FNM_LEADING_DIR extension
     (which isn't yet obeyed in the code)
2004-08-07 17:17:11 +00:00
kientzle
a34feb1b97 Add "make distfile" capabilities to bsdtar, including informational
COPYING file and some conditional compilation cleanups.
2004-08-07 03:24:49 +00:00
kientzle
147536f641 Ensure that there's always a space between the user name and
group name in -tv output format.
2004-08-05 05:46:22 +00:00
kientzle
1a1471049f GNU and POSIX disagree about -o and -l.
For -l, upset everyone by breaking it.  Specifically, -l now produces
a lengthy error message that suggests --check-links (POSIX -l) or
--one-file-system (GNU -l) instead.  However, if POSIXLY_CORRECT is set,
use the POSIX interpretation.

For -o, please everyone by making it work both ways:
  * -xo uses POSIX behavior
  * -co uses "almost GNU" behavior (as close as we can get until
    libarchive implements a true V7 tar format)
2004-08-03 06:19:08 +00:00
kientzle
7e43cdbd1b Correct the explanation of the -X option.
Thanks to: Pav Lucistnik
2004-08-01 20:09:08 +00:00
kientzle
0f5c530857 Improve portability to FreeBSD 4.
Thanks to: Barry Bouwsma
2004-07-30 02:59:58 +00:00
kientzle
a3e93910b1 Fix comment.
Thanks to: Johan Karlsson
2004-07-30 02:46:12 +00:00
kientzle
1bb05b6e53 Add a --version option to bsdtar that prints the versions of
both bsdtar and libarchive.  Of course, this requires that bsdtar
have a version number.  Let's call this 1.00, shall we? ;-)
2004-07-26 03:21:41 +00:00
kientzle
c2fb7a1b2d A bunch of style and security fixes (error checking return values, etc),
mostly from: Tim J Robbins
2004-07-25 04:15:50 +00:00
kientzle
da493b4820 Of course, I meant POSIX.1-1996, not 1997.
Thanks to: Andrey Chernov
2004-07-25 00:31:24 +00:00
kientzle
4eaecd41f3 A bunch of stuff from Christoph Mellon:
* Whitespace fixes
  * Check some malloc calls
  * Simplify long_help formatting
  * Spell "LINUX" -> "linux"
  * A few other miscellaneous style improvements
2004-07-24 22:13:44 +00:00
kientzle
88f0f4dce8 My bad: /dev/sa0, no 'r'
Thanks (and many apologies) to: Cristoph Mallon
2004-07-21 06:43:10 +00:00
kientzle
adcf12a12b Guard against argv[0] being NULL.
Thanks to: Tim J Robbins
2004-07-19 14:54:38 +00:00
kientzle
f05f002393 Fix some misspellings, document the TAPE environment
variable and the default tape device.
2004-07-19 05:24:41 +00:00
kientzle
8b3e9f1e03 Remove unused user_uname variable.
Add range-checking to argument of -b.

Thanks to: Tim J Robbins
2004-07-17 18:21:00 +00:00
kientzle
c25602666f Make bsdtar the default system tar. This makes /usr/bin/tar a symlink
pointing to /usr/bin/bsdtar by default.  To make it point to /usr/bin/gtar,
you can define WITH_GTAR.
2004-07-17 06:03:47 +00:00
kientzle
7f77b9d9fb Validate -o usage. Strictly speaking, -o only makes sense with -x,
of course, but I make an effort to accomodate GNU tar scripts that
use -o with -c (with a meaning that totally contradicts SUSv2) by
only issuing a benign warning message in that case.
2004-07-17 04:17:50 +00:00
kientzle
429d9c9041 Make the day/month ordering dependent on the current locale by
testing the locale at program startup and setting a flag, then
using that flag to determine appropriate strftime() arguments.
2004-07-15 03:14:46 +00:00
kientzle
5961a5ef84 Mimic ls(1) by putting an extra space before the year in old dates 2004-07-12 13:15:13 +00:00
kientzle
2e69e93b3c Fix tab/space screwup in long_help() 2004-07-12 13:13:42 +00:00
ru
3832f1d915 Fixed cross-references in SEE ALSO.
Emininated double space and hard sentence breaks.
2004-07-04 21:15:37 +00:00
kientzle
7bcd416f50 Pass the pointy hat, please:
All of --help should go to stdout, not some to stdout and some to stderr.
2004-07-04 18:13:01 +00:00
ru
fb1d8b3724 Mechanically kill hard sentence breaks. 2004-07-02 22:22:35 +00:00
kientzle
b7e4060b9b Add yet another synonym for -n. 2004-06-28 14:02:22 +00:00
kientzle
4965bc7e55 Update -p:
* Don't change the umask; the library now ignores the umask if
    you set EXTRACT_PERM
  * Set the EXTRACT_ACL and EXTRACT_FFLAGS bits (used to be
    controlled by EXTRACT_PERM).
2004-06-27 23:29:44 +00:00
kientzle
34ed55636f Warn about stripping leading '/' when creating archives. 2004-06-27 18:32:14 +00:00
kientzle
2e75ccba07 Augment the -T handling:
* Add --null option (sort #defines here)
 * Add process_lines function to util.c that reads newline-terminated
   or null-terminated lines (with self-sizing buffers, etc) and iteratively
   invokes a provided function.  Use this to dramatically simplify:
   -T handling for -c, --exclude-from-file, and --include-from-file.
 * Add -T handling to -x (via include_from_file)

Hopefully, this will fix the openoffice port and a couple of
others that rely on -T and --null.
2004-06-27 06:29:03 +00:00
kientzle
6d1f3e3cef Fix "@-" which has apparently been broken for some time. <sigh>
While I'm here, add in a lot more error-checking around append_archive.
2004-06-27 03:28:13 +00:00
kientzle
4731df16a2 Don't abort immediately on directory change errors.
Instead, display a warning, clean up, and let main() return the error.
In particular, this means that chdir() problems won't leave broken
archives, though they will prompt an error exit value.
2004-06-27 01:08:54 +00:00
kientzle
168c978957 Document the -W convention for accessing long options.
Also correct an old error: there was no tar command in Sixth Edition.
2004-06-26 22:58:29 +00:00
kientzle
b217b2ee33 Rename C=dir to -C dir, which is what people expect.
This requires some non-trivial surgery to the options parsing.

While here, let people who only have getopt() access long options
through the -W longopt=value convention.
2004-06-26 22:49:51 +00:00
kientzle
60240199d8 Update some internal comments about the --no-same-permissions option.
Thanks to: Kris Kennaway for doing some gtar research for me.
2004-06-15 07:16:44 +00:00
kientzle
c1c16931aa As near as I can tell, --no-same-permissions is a no-op in
gtar, so that makes it easy to implement.

Required by: audio/timidity port
Thanks to: Kris Kennaway
2004-06-15 06:44:41 +00:00
kientzle
da30afcf78 Oops. bsdtar's old -X option didn't take an argument; the new
(gtar-compatible) one does require an argument.
2004-06-15 06:24:54 +00:00
kientzle
5ace8b9fe9 Add gtar-compatible -X/--exclude-from 2004-06-15 05:55:41 +00:00
kientzle
e4e2071ab4 Fix build. 2004-06-15 01:51:45 +00:00
kientzle
09f8eaea14 Rename -X to --one-file-system, as GNU tar uses -X for
something else.  I would really like a short option for
this, but all of the obvious ones conflict with something else.
2004-06-15 00:28:34 +00:00
kientzle
1b46d4f7ae Clean up usage message(s):
* Usage goes to stderr, not stdout
  * Use correct argument markup
  * bsdtar --help  no longer exits with an error return code
  * ensure that the word "bsdtar" appears in the first
    line output from "bsdtar --help" (even if the program is
    invoked as "tar")

In particular, scripts can now test for the presence of bsdtar.
For example, in /bin/sh:

if (tar --help 2>&1 | grep bsdtar >/dev/null 2>&1) then \
          echo bsdtar; else echo not bsdtar; fi
2004-06-15 00:07:23 +00:00
kientzle
4125920b23 Oops: gtar's --dereference should be a synonym for bsdtar's -L, not -H.
Pointed out by: devel/nspr port
Thanks to: Kris Kennaway
2004-06-11 01:35:56 +00:00
kientzle
6404643ce9 Set program exit value to 1 if there are any of various errors when
creating an archive.

Pointed out by: Failure to complain when building certain broken packages
(Thanks again to Kris Kennaway for finding this!)
2004-06-07 07:19:04 +00:00
kientzle
0769b9f0d6 Fix the symlink-detection code. Don't squawk if we're just replacing
an existing symlink (as might happen if you extract an archive twice).
Also, if we remove the offending link, then we've removed the problem
and can safely go forward with the extraction.

Pointed out by: print/adobe-cmaps port (whose distfile has
	duplicate entries for the same symlinks)
Thanks to: Kris Kennaway (for using ports as a testbed for bsdtar)
2004-06-07 04:10:43 +00:00
kientzle
42e3d5a649 The --include='pattern' option is the natural counterpart to
--exclude='pattern'.

I should have added this a long time ago, since it's so useful for testing.
In particular, it allows me to select a few entries from a troublesome
archive so that I can easily focus my debugging efforts:
   bsdtar -czf new.tgz --include='*foo*' @old.tgz
2004-06-07 03:49:48 +00:00
kientzle
270635f958 Ooops! Previous commit added an over-zealous error check.
It is, in fact, perfectly legal to not specify a compression when
writing an archive. <sigh>
2004-06-07 03:38:17 +00:00
kientzle
eadec7015b If -b is specified, then force full padding for the last block. 2004-06-07 03:19:57 +00:00
kientzle
299fedaaae Per style(9), don't use double spaces in expressions.
Pointed out by: njl, des.
2004-06-07 03:16:18 +00:00
kientzle
4cb95ee702 Pointy hat: sticky bit 't' or 'T' is shown over IXOTH bit, not IXGRP. <sigh> 2004-06-03 23:43:40 +00:00
kientzle
44e8bf5a41 Improve help handling:
* --help produces long help message on systems with getopt_long
   * -h with no other options also produces long help message
     (If a mode is specified, -h has its usual meaning.)
2004-06-02 21:01:27 +00:00
kientzle
3ffc90b560 Both "foo/" and "foo" should match "foo/bar", so strip
trailing '/' characters on include patterns for extraction.

Pointed out by: games/quakeforge port (thanks to Kris!)
2004-06-02 07:23:54 +00:00
kientzle
f939002db3 Correction: -h should be a synonym for -L, not -H.
(as specified by Linux Standards Base, GNU tar, and 4.4BSD documentation)
2004-05-31 20:22:41 +00:00
kientzle
b1210dbf1b Permit (but ignore) -Z with -x or -t, now that libarchive
recognizes and decompresses .Z format.
2004-05-30 00:09:43 +00:00
kientzle
cd6cc0b3f2 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
kientzle
7d4928cd75 Provide framework for exiting with non-zero value on non-critical errors. 2004-05-27 04:30:59 +00:00
kientzle
cedda3bff2 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
kientzle
9da5e919aa Add --dereference as a synonym for -H
Pointed out by: Kris Kennaway (unbreaks nspr port build)
2004-05-21 18:40:32 +00:00
kientzle
e3a31f8a6e Default is to restore timestamps, even when operating as root. <sigh> 2004-05-19 01:21:11 +00:00
kientzle
2ccbdbb7fe Fix a segfault when looking up a non-existent group. 2004-05-18 23:40:25 +00:00
kientzle
014551a39f 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
75a7f5bd6e 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
cf027fa3ed 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
7ac80717ef 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
7590026eae 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
87b26a4b19 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
91a38a30fb Update manpage to track new security features. 2004-05-17 03:19:31 +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
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
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
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
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
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
kientzle
15ca1ccb2d Eliminate a redundant call to archive_entry_set_pathname() 2004-04-21 05:16:28 +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
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
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
kientzle
d1f2ebdf42 Style fixes
Pointed out by: bde
2004-04-12 18:06:07 +00:00
kientzle
cd3b6fa4ac 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
e5943c5d79 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
72bca63fd4 Document the newly-implemented -T option. 2004-04-08 06:21:03 +00:00
kientzle
1b8aab3f61 Add support for -T option on create.
(Required by pkg_create.)
2004-04-08 06:12:01 +00:00
kientzle
a970bab144 Correct signature in alternative stub implementation of setup_acls() 2004-04-07 17:43:48 +00:00
kientzle
a356af4fc7 Archive both access and default ACLs. 2004-04-06 23:08:31 +00:00
kientzle
2588e5ad7a Initial commit for bsdtar. 2004-04-05 21:32:18 +00:00