summaryrefslogtreecommitdiffstats
path: root/usr.bin/tar/read.c
Commit message (Collapse)AuthorAgeFilesLines
* Support path-rewriting options (including --strip-components) for bothkientzle2005-04-171-60/+41
| | | | | | 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.
* Add --strip-components option, per bin/77666.kientzle2005-03-131-0/+58
| | | | Thanks to: Sangwoo Shim
* Cosmetic goof: Use two spaces in "Jan 03 2004" but only one in "Jan 03 12:32"kientzle2004-10-171-1/+1
| | | | MFC after: 15 days
* Support -t -O as in gtar. Perversely enough, -O means "send to stderr"kientzle2004-08-271-10/+15
| | | | | | | 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
* Move the smart chdir logic into a couple of utility functions in util.c.kientzle2004-08-081-4/+1
| | | | | Then use them to provide consistent -C support throughout the program. Thanks to: Christoph Mallon
* Ensure that there's always a space between the user name andkientzle2004-08-051-1/+1
| | | | group name in -tv output format.
* A bunch of style and security fixes (error checking return values, etc),kientzle2004-07-251-6/+9
| | | | mostly from: Tim J Robbins
* A bunch of stuff from Christoph Mellon:kientzle2004-07-241-13/+18
| | | | | | | | * Whitespace fixes * Check some malloc calls * Simplify long_help formatting * Spell "LINUX" -> "linux" * A few other miscellaneous style improvements
* Make the day/month ordering dependent on the current locale bykientzle2004-07-151-4/+7
| | | | | testing the locale at program startup and setting a flag, then using that flag to determine appropriate strftime() arguments.
* Mimic ls(1) by putting an extra space before the year in old dateskientzle2004-07-121-1/+1
|
* Augment the -T handling:kientzle2004-06-271-0/+3
| | | | | | | | | | | | * 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.
* Fix the symlink-detection code. Don't squawk if we're just replacingkientzle2004-06-071-6/+22
| | | | | | | | | | 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)
* If -b is specified, then force full padding for the last block.kientzle2004-06-071-1/+3
|
* Per style(9), don't use double spaces in expressions.kientzle2004-06-071-1/+1
| | | | Pointed out by: njl, des.
* Minor corrections to error handling and user notifications:kientzle2004-05-271-23/+26
| | | | | | | | * 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.
* Propagate struct bsdtar down into a lot more places.kientzle2004-05-171-10/+13
| | | | Move global progname variable into struct bsdtar.
* Make symlink protection a bit more useful:kientzle2004-05-171-4/+15
| | | | | | * Remove terminal symlinks so they can be replaced. * If -U, remove intermediate symlinks as well * Otherwise, refuse the extraction
* For portability, don't rely on libc's strmode(3). <sigh>kientzle2004-05-031-1/+1
|
* A security issue: An archive containing a symlink to anotherkientzle2004-05-021-13/+70
| | | | | | | | 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.
* Refuse to extract entries with '..' in pathname.kientzle2004-04-281-7/+40
| | | | Pointed out by: David Schultz
* Add DPADD to Makefile (thanks to Andrey for pointing this out).kientzle2004-04-121-3/+0
| | | | | Generally clean up Makefile, remove dmalloc references from source (there are better ways to do this than pollute the FreeBSD src tree).
* Initial commit for bsdtar.kientzle2004-04-051-0/+292
OpenPOWER on IntegriCloud