summaryrefslogtreecommitdiffstats
path: root/lib/libarchive/archive_read_support_format_cpio.c
Commit message (Collapse)AuthorAgeFilesLines
* Use contrib sources for building libarchive, tar and cpio.mm2011-12-221-777/+0
| | | | | | Make "make test" fully operational. MFC after: 2 weeks
* Update libarchive, tar and cpio to version 2.8.5mm2011-12-201-3/+3
| | | | | | | | | | The following additional vendor revisions are applied: Revision 3740: Use archive_clear_error() to clear the error markers. Obtained from: http://code.google.com/p/libarchive MFC after: 2 weeks
* Fix cpio on ARM.kientzle2011-09-131-3/+3
| | | | | | | PR: bin/160430 Submitted by: Ian Lepore Approved by: re (Kostik Belousov) MFC after: 7 days
* Be a little more skeptical of dev/ino matches when reading cpio files.kientzle2009-12-291-35/+35
| | | | This eliminates some false-positives in the hardlink detection logic.
* Merge two cpio fixes from libarchive.googlecode.com:kientzle2009-12-101-2/+5
| | | | | | | | | 1) Avoid an infinite loop in the header resync for certain malformed archives. 2) Don't try to match hardlinks if the nlinks count is < 2. This reduces the likelihood of a false hardlink match due to ino truncation. MFC after: 7 days
* Merge r1061,r1062,r1063 from libarchive.googlecode.com:kientzle2009-04-271-1/+6
| | | | | | | | | | Fix reading big-endian binary cpio archives, and add a test. While I'm here, add a note about Solaris ACL extension for cpio, which should be relatively straightforward to support. Thanks to: Edward Napierala, who sent me a big-endian cpio archive from a Solaris system he's been playing with. Pointy hat: me
* Merge r491,493,500,507,510,530,543 from libarchive.googlecode.com:kientzle2009-03-061-0/+2
| | | | | This implements the new generic options framework that provides a way to override format- and compression-specific parameters.
* Argh. r189389 was supposed to include r539 from libarchive.googlecode.comkientzle2009-03-051-2/+4
| | | | but those compile fixes somehow got lost. This should fix the build.
* MfP4: Big read filter refactoring.kientzle2008-12-061-43/+31
| | | | | | | | | | | | | | | | | | | | | | | This is an attempt to eliminate a lot of redundant code from the read ("decompression") filters by changing them to juggle arbitrary-sized blocks and consolidate reblocking code at a single point in archive_read.c. Along the way, I've changed the internal read/consume API used by the format handlers to a slightly different style originally suggested by des@. It does seem to simplify a lot of common cases. The most dramatic change is, of course, to archive_read_support_compression_none(), which has just evaporated into a no-op as the blocking code this used to hold has all been moved up a level. There's at least one more big round of refactoring yet to come before the individual filters are as straightforward as I think they should be...
* Support uppercase hex digits in cpio archives.kientzle2008-01-151-3/+5
| | | | | Thanks to: Joshua Kwan MFC after: 7 days
* Update libarchive to 2.4.10. This includes a number of improvementskientzle2007-12-301-7/+175
| | | | | | | | | | | | | | | | | | | | | | | | that I've been working on but put off committing until after the RELENG_7 branch, including: * New manpages: cpio.5 mtree.5 * New archive_entry_strmode() * New archive_entry_link_resolver() * New read support: mtree format * Internal API change: read format auction only runs once * Running the auction only once allowed simplifying a lot of bid logic. * Cpio robustness: search for next header after a sync error * Support device nodes on ISO9660 images * Eliminate a lot of unnecessary copies for uncompressed archives * Corrected handling of new GNU --sparse --posix formats * Correctly handle a zero-byte write to a compressed archive * Fixed memory leaks Many of these improvements were motivated by the upcoming bsdcpio front-end. There have also been extensive improvements to the libarchive_test test harness, which I'll commit separately.
* libarchive 2.2.3kientzle2007-05-291-117/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * "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.
* Portability.kientzle2007-04-131-0/+2
|
* libarchive 2.0kientzle2007-03-031-30/+32
| | | | | | | | | | | | | | | | | | | * 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
* Correct spelling of "accommodate", "guarantee", "guaranteed", "guard",cperciva2006-12-281-2/+2
| | | | | | "return", "ridiculous", and "success". MFC after: 3 days
* Portability and style fixes:kientzle2006-11-101-14/+24
| | | | | | | | | | | | | | * 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. ;-)
* Conditionally include sys/mkdev.h on platforms (such as Solaris) that need it.kientzle2006-07-301-0/+3
| | | | Thanks to: VMiklos
* POSIX.1e-style Extended Attribute supportkientzle2006-03-211-1/+1
| | | | | | | | | | | This commit implements storing/reading POSIX.1e-style extended attribute information in "pax" format archives. An outline of the storage format is in the tar.5 manpage. The archive_read_extract() function has code to restore those archives to disk for Linux; FreeBSD implementation is forthcoming. Many thanks to Jaakko Heinonen for finding flaws in earlier proposals and doing the bulk of the coding in this work.
* Extract device number information from SVR4 CPIO archives.kientzle2006-02-141-0/+6
| | | | | | | Without this, you cannot properly restore device node entries from such archives. Thanks to: Steve 'dillo Okay for reporting this oversight.
* Fine-tune the format detection for CPIO and ISO9660 sub-types.kientzle2005-11-081-6/+14
| | | | | This has no impact on the actual operation, it just fixes some inaccuracies in the format code and description reported back to the caller.
* Add a lot of error checks, based on the patches provided by Dan Lukes.kientzle2005-09-211-0/+8
| | | | | | | Also fixes a memory leak reported by Andrew Turner. PR: bin/83476 Thanks to: Dan Lukes, Andrew Turner
* A number of improvements to ZIP support.kientzle2005-04-061-0/+1
| | | | | | | | | | | | | * Handles entries with compressed size >2GB (signed/unsigned cleanup) * Handles entries with compressed size >4GB ("ZIP64" extension) * Handles Unix extensions (ctime, atime, mtime, mode, uid, etc) * Format-specific "skip data" override allows ZIP reader to skip entries without decompressing them, which makes "tar -t" a lot faster. * Handles "length-at-end" entries generated by, e.g., "zip -r - foo" Many thanks to: Dan Nelson, who contributed the code and test files for the first three items above and suggested the fourth.
* Correctly pass low-level I/O errors back up to the caller whenkientzle2005-03-131-1/+4
| | | | reading cpio format.
* Eliminate reliance on non-portable <err.h> by implementing a verykientzle2004-08-141-1/+0
| | | | | | | simple errx() function. Improve behavior when bzlib/zlib are missing by detecting and issuing an error message on attempts to read gzip/bzip2 compressed archives.
* Refactor read_data:kientzle2004-06-021-28/+72
| | | | | | | | | | | * New read_data_block is both sparse-file aware and uses zero-copy semantics * Push read_data_block down into specific formats (opens door to various encoded entry bodies, such as zip or gtar -S) * Reimplement read_data, read_data_skip, read_data_into_fd in terms of new read_data_block. * Update documentation It's unfortunate that I couldn't just call the new interface archive_read_data, but didn't want to upset the API that much.
* Consistify: #define gets 1 tab character afterwardskientzle2004-05-031-1/+1
| | | | Pointed out by: Simon Nielsen
* Add read support for four more common cpio variants:kientzle2004-04-281-64/+304
| | | | | | | | | | * little-endian old-style binary cpio archives * big-endian old-style binary cpio archives * SVR4 portable archives without CRC * SVR4 portable archives with CRC Note that I don't yet verify the CRC for the last one, and I'm not quite certain I'm correctly parsing device numbers.
* * Plug a buffer overrun in ACL parsing. (archive_entry.c)kientzle2004-04-131-2/+7
| | | | | | | * 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-191-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Disabled shared-library building, as some API breakage is still likely. (I didn't realize it was turned on by default.) If you have an existing /usr/lib/libarchive.so.2, I recommend deleting it. * Pax interchange format now correctly stores and reads UTF8 for extended attributes. In particular, pax format can portably handle arbitrarily long pathnames containing arbitrary characters. * Library compiles cleanly at -O2, -O3, and WARNS=6 on all FreeBSD-CURRENT platforms. * Minor portability improvements inspired by Juergen Lock and Greg Lewis. (Less reliance on stdint.h, isolating of various portability-challenged constructs.) * archive_entry transparently converts multi-byte <-> wide character strings, allowing clients and format handlers to deal with either one, as appropriate. * Support for reading 'L' and 'K' entries in standard tar archives for star compatibility. * Recognize (but don't yet handle) ACL entries from Solaris tar. * Pushed format-specific data for format readers down into format-specific storage and out of library-global storage. This should make it easier to maintain individual formats without mucking with the core library management. * Documentation updates to track the above changes. * Updates to tar.5 to correct a few mistakes and add some additional information about GNU tar and Solaris tar formats. Notes: * The basic 'tar' reader is getting more general; there's not much point in keeping the 'gnutar' reader separate. Merging the two would lose a bunch of duplicate code. * The libc ACL support is looking increasingly inadequate for my needs here. I might need to assemble some fairly significant code for parsing and building ACLs. <sigh>
* Many fixes.kientzle2004-03-091-2/+2
| | | | | | | | | | | | | | | | 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
* Recognize hardlinks when reading cpio files.kientzle2004-03-071-5/+100
| | | | | | | | | This doesn't yet address the issue of selective restore of hardlinked files. With cpio format, it's possible to correctly restore any linked file; the API doesn't yet fully support this. (There's no way for the library to inform a client whether or not there's a file body associated with this entry. The assumption right now is that "hardlink" entries have no file body.)
* Correctly read symlinks from cpio files.kientzle2004-03-061-1/+15
| | | | | | While I'm here, fix a bug in reading filenames from cpio files. (Copy should count the length of the name, not the number of bytes available for input.)
* Initial import of libarchive.kientzle2004-02-091-0/+187
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