summaryrefslogtreecommitdiffstats
path: root/lib/libarchive/archive_write_set_format_shar.c
Commit message (Collapse)AuthorAgeFilesLines
* libarchive 2.2.3kientzle2007-05-291-21/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * "compression_program" support uses an external program * Portability: no longer uses "struct stat" as a primary data interchange structure internally * Part of the above: refactor archive_entry to separate out copy_stat() and stat() functions * More complete tests for archive_entry * Finish archive_entry_clone() * Isolate major()/minor()/makedev() in archive_entry; remove these from everywhere else. * Bug fix: properly handle decompression look-ahead at end-of-data * Bug fixes to 'ar' support * Fix memory leak in ZIP reader * Portability: better timegm() emulation in iso9660 reader * New write_disk flags to suppress auto dir creation and not overwrite newer files (for future cpio front-end) * Simplify trailing-'/' fixup when writing tar and pax * Test enhancements: fix various compiler warnings, improve portability, add lots of new tests. * Documentation: document new functions, first draft of libarchive_internals.3 MFC after: 14 days Thanks to: Joerg Sonnenberger (compression_program) Thanks to: Kai Wang (ar) Thanks to: Colin Percival (many small fixes) Thanks to: Many others who sent me various patches and problem reports.
* Don't forget to free a string allocated by strdup where necessary.cperciva2007-05-191-2/+9
| | | | | Found by: Coverity Prevent Coverity ID: CID 3132
* libarchive 2.0kientzle2007-03-031-20/+34
| | | | | | | | | | | | | | | | | | | * libarchive_test program exercises many of the core features * Refactored old "read_extract" into new "archive_write_disk", which uses archive_write methods to put entries onto disk. In particular, you can now use archive_write_disk to create objects on disk without having an archive available. * Pushed some security checks from bsdtar down into libarchive, where they can be better optimized. * Rearchitected the logic for creating objects on disk to reduce the number of system calls. Several common cases now use a minimum number of system calls. * Virtualized some internal interfaces to provide a clearer separation of read and write handling and make it simpler to override key methods. * New "empty" format reader. * Corrected return types (this ABI breakage required the "2.0" version bump) * Many bug fixes.
* Fix the copyright notice; it was always intended to bekientzle2007-01-091-3/+2
| | | | | | | | | a vanilla 2-clause BSD license, but somehow some confusing extra verbage get copied from somewhere. Also, update the copyright dates to 2007 for all of the files. Prompted by: several questions about what those extra words really mean
* Style: Use the correct type for a sizeof() variable.kientzle2006-11-151-1/+1
|
* Change the internal API for writing data to an entry; make thekientzle2006-11-151-6/+9
| | | | | | | | | | | | internal format-specific functions return the same as the public function, so that the public API layer doesn't have to guess the correct return value. This addresses an obscure problem that occurs when someone tries to write more data than the size of the entry (as indicated in the entry header). In this case, the return value from archive_write_data() was incorrect, reflecting the requested write rather than the amount actually written. MFC after: 15 days
* Portability and style fixes:kientzle2006-11-101-10/+18
| | | | | | | | | | | | | | * Actually use the HAVE_<header>_H macros to conditionally include system headers. They've been defined for a long time, but only used in a few places. Now they're used pretty consistently throughout. * Fill in a lot of missing casts for conversions from void*. Although Standard C doesn't require this, some people have been trying to use C++ compilers with this code, and they do require it. Bit-for-bit, the compiled object files are identical, except for one assert() whose line number changed, so I'm pretty confident I didn't break anything. ;-)
* Clean up the error handling in thekientzle2004-11-051-58/+109
| | | | | | write path. In particular, this should solve some problems people have seen with bsdtar not exiting on various write errors.
* Clean up some consistent confusion between "dev" and "rdev."kientzle2004-06-271-4/+4
| | | | | | | | Mostly, these were being used correctly even though a lot of variables and function names were mis-named. In the process, I found and fixed a couple of latent bugs and added a guard against adding an archive to itself.
* Correct spelling of "shell archive" to match /usr/share/misc/magic.kientzle2004-04-281-1/+1
|
* Update file flag handling.kientzle2004-04-261-1/+1
| | | | | | | | | | | | | | | | The new fflags support in archive_entry supports Linux and FreeBSD file flags and is a bit more gracious about unrecognized flag names than strtofflags(3). This involves some minor API breakage. The default tar format ("restricted pax") now enables pax extensions when archiving files that have flags. In particular, copying dir heirarchies with 'bsdtar cf - -C src . | bsdtar xpf - -C dest' now preserves file flags. (Note the "p" on extract!) While I'm here, fill in some additional explanation in the archive_entry.3 manpage, fill in some missing MLINKS, mark some overlooked internal functions 'static', and make a few minor style fixes.
* Set the 'dump' flag for shardump format.kientzle2004-04-231-0/+4
| | | | | Credit Juergen Lock. Pointy hat to me for deleting this somewhere along the way.
* Yucky bug: Don't emit 'mkdir' commands for regular files in shar archives.kientzle2004-04-201-15/+27
| | | | | | While I'm here, add some logic to avoid "mkdir ." Reported by: Juergen Lock
* * Plug a buffer overrun in ACL parsing. (archive_entry.c)kientzle2004-04-131-14/+32
| | | | | | | * Re-use a single buffer for shar output formatting rather than hammering the heap. (archive_write_set_format_shar.c) * Fix a handful of minor memory leaks and clean up some of the memory-management code.
* More work on ACLs: fix error in archive_entry's ACL parsing code,kientzle2004-04-121-3/+0
| | | | | | | | | | | | | | try to set ACLs even if fflag restore fails, first cut at reading Solaris tar ACLs Code improvement: merge gnu tar read support into main tar reader; this eliminates a lot of duplicate code and generalizes the tar reader to handle formats with GNU-like extensions. Style: Makefile cleanup, eliminate 'dmalloc' references, remove 'tartype' from archive_entry (this makes archive_entry more format-agnostic) Thanks to: David Magda for providing Solaris tar test files
* Many fixes.kientzle2004-03-091-3/+3
| | | | | | | | | | | | | | | | Portability: Thanks to Juergen Lock, libarchive now compiles cleanly on Linux. Along the way, I cleaned up a lot of error return codes and reorganized some code to simplify conditional compilation of certain sections. Bug fixes: * pax format now actually stores filenames that are 101-154 characters long. * pax format now allows newline characters in extended attributes (this fixes a long-standing bug in ACL handling) * mtime/atime are now restored for directories * directory list is now sorted prior to fix-up to permit correct restore of non-writable dir heirarchies
* Minor API tweak: The format-specific write_header function now setskientzle2004-03-061-21/+70
| | | | | | | | | | | | | | | | | | the size in the archive_entry object to zero if that format doesn't store a body for that file type. This allows the client to determine whether or not it should feed the file body to the archive. In particular, cpio stores the file body for hardlinks, tar and shar don't. With this change, bsdtar now correctly archives hardlinks in all supported formats. While I'm here, make shar output be more aggressive about creating directories. Before this, commands such as: bsdtar -cv -F shar some/explicit/path/to/a/file wouldn't create the directory. Some simple logic to remember the last directory creation helps reduce unnecessary mkdirs here. At this point, I think the only flaw in libarchive's cpio support is the failure to recognize hardlinks when reading.
* Initial import of libarchive.kientzle2004-02-091-0/+403
What it is: A library for reading and writing various streaming archive formats, especially tar and cpio. Being a library, it should be easy to incorporate into pkg_* tools, sysinstall, and any other place that needs to read or write such archives. Features: * Full automatic detection of both compression and archive format. * Extensible internal architecture to make it easy to add new formats. * Support for "pax interchange format," a new POSIX-standard tar format that eliminates essentially all of the restrictions of historic formats. * BSD license Thanks to: jkh for pushing me to start this work, gordon for encouraging me to commit it, bde for answering endless style questions, and many others for feedback and encouragement. Status: Pretty good overall, though there are still a few rough edges and the library could always use more testing. Feedback eagerly solicited.
OpenPOWER on IntegriCloud