summaryrefslogtreecommitdiffstats
path: root/usr.bin/tar/write.c
Commit message (Collapse)AuthorAgeFilesLines
* Correct the copyright messages: Make this a standard vanillakientzle2007-01-091-3/+2
| | | | 2-clause BSD license, update the year to 2007.
* If append_archive fails while writing an archive header, output the errorcperciva2007-01-051-1/+1
| | | | | | | message from the archive being written (not the message from the archive being read, where no error has occurred). MFC after: 3 days
* Clean up the struct archive used for reading an archive in the handlingcperciva2007-01-021-0/+1
| | | | | | | of @archive commands. This bug should be harmless as long as you don't use an excessive number of @archive commands. MFC after: 1 week
* Handle errors which occur during archive_write_data and archive_write_closecperciva2007-01-021-5/+11
| | | | | | by printing an error message and exiting with a non-zero status code. MFC after: 1 week
* Remove two unused variables.kientzle2006-07-311-6/+0
| | | | Thanks to: Stefan Farfeleder
* If you see a broken symlink, don't try to follow it,kientzle2006-04-021-3/+6
| | | | | | | | just archive it as a symlink, even if -h was specified. Thanks to: Jin Guojun PR: bin/95175 MFC After: 1 week
* Extended attribute support on write for Linux; FreeBSD hooks arekientzle2006-03-211-12/+125
| | | | | | | | | | forthcoming. This commit also has a number of style(9) fixes and minor corrections so the code works better with the build system being used for non-FreeBSD builds. Many thanks to: Jaakko Heinonen, who proposed a mechanism for extended attribute support and implemented both the machine-independent portion and the Linux-specific portion.
* Edit pathnames for -x but not for -t. Otherwise, people get confusedkientzle2005-11-061-1/+1
| | | | | | | | when list the archive contents, then try to extract selected files (file selection always works against unedited pathnames). With this change, -t always shows the pathnames as they appear in the archive. Thanks to: Robert Watson
* In mode 'u', check for an error return from archive_read_open.kientzle2005-11-011-2/+6
| | | | | | | | | | | | | 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.
* Fix -u with absolute paths (e.g., "tar -uf foo.tar /bar") by handlingkientzle2005-09-241-12/+12
| | | | | | pathname edits before comparing pathnames on disk to those in the archive. Thanks to: Gareth Bailey, Lowell Gilbert
* Clarify some error messages.kientzle2005-05-081-4/+4
|
* bsdtar now uses the "tree" package instead of "fts" for walkingkientzle2005-04-241-175/+116
| | | | directory heirarchies.
* A number of fixes to the autoconf-generated build system. Inkientzle2005-04-171-3/+7
| | | | | | | | 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
* Support path-rewriting options (including --strip-components) for bothkientzle2005-04-171-27/+17
| | | | | | 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.
* A handful of minor portability and style improvements.kientzle2005-03-141-14/+13
|
* Add --newer-ctime, --newer-mtime, --newer-ctime-than, and --newer-mtime-thankientzle2005-03-131-20/+44
| | | | | | | 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.
* Correct error handling on failed writeskientzle2004-11-051-4/+2
| | | | to the archive.
* Make -C and -T work correctly together.kientzle2004-08-281-4/+5
| | | | | MFC after: 3 days Thanks to: Guy Helmer
* Better low-memory handling: If the link cache runs out of memory, justkientzle2004-08-081-35/+36
| | | | | | 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.
* Move the smart chdir logic into a couple of utility functions in util.c.kientzle2004-08-081-78/+3
| | | | | Then use them to provide consistent -C support throughout the program. Thanks to: Christoph Mallon
* Add --totals option. Unlike gtar, this reports the bytes actuallykientzle2004-08-071-0/+16
| | | | | written to the archive, not the ones written to the compressor. For uncompressed archives, these numbers are the same, of course.
* Add "make distfile" capabilities to bsdtar, including informationalkientzle2004-08-071-0/+4
| | | | COPYING file and some conditional compilation cleanups.
* A bunch of style and security fixes (error checking return values, etc),kientzle2004-07-251-22/+44
| | | | mostly from: Tim J Robbins
* A bunch of stuff from Christoph Mellon:kientzle2004-07-241-8/+15
| | | | | | | | * Whitespace fixes * Check some malloc calls * Simplify long_help formatting * Spell "LINUX" -> "linux" * A few other miscellaneous style improvements
* Warn about stripping leading '/' when creating archives.kientzle2004-06-271-1/+8
|
* Augment the -T handling:kientzle2004-06-271-39/+31
| | | | | | | | | | | | * 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 "@-" which has apparently been broken for some time. <sigh>kientzle2004-06-271-8/+28
| | | | While I'm here, add in a lot more error-checking around append_archive.
* Don't abort immediately on directory change errors.kientzle2004-06-271-6/+16
| | | | | | 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.
* Rename C=dir to -C dir, which is what people expect.kientzle2004-06-261-11/+17
| | | | | | | 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.
* Set program exit value to 1 if there are any of various errors whenkientzle2004-06-071-0/+4
| | | | | | | creating an archive. Pointed out by: Failure to complain when building certain broken packages (Thanks again to Kris Kennaway for finding this!)
* Ooops! Previous commit added an over-zealous error check.kientzle2004-06-071-0/+2
| | | | | It is, in fact, perfectly legal to not specify a compression when writing an archive. <sigh>
* If -b is specified, then force full padding for the last block.kientzle2004-06-071-3/+25
|
* Per style(9), don't use double spaces in expressions.kientzle2004-06-071-2/+2
| | | | Pointed out by: njl, des.
* Fix a segfault when looking up a non-existent group.kientzle2004-05-181-1/+1
|
* Set errno to 0 before calling getpwuid/getgrgid, so that errorkientzle2004-05-171-0/+2
| | | | messages will be displayed only when there is, in fact, an error.
* Propagate struct bsdtar down into a lot more places.kientzle2004-05-171-44/+52
| | | | Move global progname variable into struct bsdtar.
* Refactor name caching to use a common piece of code for uname_cache andkientzle2004-05-171-86/+111
| | | | | gname_cache. Cache negative lookups to dramatically improve performance building archives containing nonexistent uid/gid.
* Correct copy/paste error in Linux nodump support.kientzle2004-05-031-3/+4
| | | | | Thanks to: Juergen Lock for his continuing patience while I botch his patches.
* Style: Use single tab after #definekientzle2004-05-021-3/+3
|
* More of Juergen Lock's patches for Linux.kientzle2004-05-021-5/+52
| | | | | (fflags support on Linux, nanosecond timestamp portability, enable 64-bit file offsets)
* Update write.c to follow recent API changes to libarchive.kientzle2004-04-261-8/+11
| | | | | Also, bump up the default copy buffer from 8k to 64k to improve performance.
* Fix username/groupname cache so it returns a name thatkientzle2004-04-231-0/+2
| | | | | | | 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.
* Eliminate a redundant call to archive_entry_set_pathname()kientzle2004-04-211-8/+6
|
* As suggested by Julian Elischer, use a self-sizing hashkientzle2004-04-151-70/+238
| | | | | | | | 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.
* A simple cache of uid->uname lookups and gid->gname lookups eliminateskientzle2004-04-141-12/+35
| | | | | almost 1/2 of the CPU time required to create an uncompressed archive and makes a noticable reduction in wallclock time.
* When all the links to a file have been dumped, don't forgetkientzle2004-04-131-1/+3
| | | | to free() the memory used to store the filename.
* 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).
* Add support for -T option on create.kientzle2004-04-081-2/+51
| | | | (Required by pkg_create.)
* Correct signature in alternative stub implementation of setup_acls()kientzle2004-04-071-1/+3
|
* Archive both access and default ACLs.kientzle2004-04-061-6/+19
|
OpenPOWER on IntegriCloud