summaryrefslogtreecommitdiffstats
path: root/lib/libarchive/archive_util.c
Commit message (Collapse)AuthorAgeFilesLines
* Use contrib sources for building libarchive, tar and cpio.mm2011-12-221-392/+0
| | | | | | Make "make test" fully operational. MFC after: 2 weeks
* Sync libarchive with vendor branch release/2.8:mm2011-12-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | 3730: Fix issue 174 (Windows path names, not relevant for FreeBSD) 3734: Merge r1989: archive_clear_error should set errno to 0. 3735: Merge r3247 from trunk: Clear errors before returning from archive_read_support_format_all() 3799: Check the position before dereferencing the pointer. This avoids dereferencing one byte past the end of a string 3824: Merge r3823 from trunk for issue 199 (hang in iso9660 reading) Obtained from: http://code.google.com/p/libarchive MFC after: 2 weeks
* New archive_file_count() utility.kientzle2009-12-281-3/+13
|
* Merge r491,493,500,507,510,530,543 from libarchive.googlecode.com:kientzle2009-03-061-0/+193
| | | | | This implements the new generic options framework that provides a way to override format- and compression-specific parameters.
* Merge r457 from libarchive.googlecode.com: Stop appending strerror()kientzle2009-03-061-19/+0
| | | | | | | information to error strings. This caused a lot of unnecessary duplication in error messages; in particular, there are a few cases where error messages get copied from one archive object to another and this would cause the strerror() info to get appended each time.
* Move va_end() updes2008-10-211-1/+1
|
* MFp4: libarchive 2.5.4b. (Still 'b' until I get a bit morekientzle2008-05-261-23/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | feedback, but the 2.5 branch is shaping up nicely.) In addition to many small bug fixes and code improvements: * Another iteration of versioning; I think I've got it right now. * Portability: A lot of progress on Windows support (though I'm not committing all of the Windows support files to FreeBSD CVS) * Explicit tracking of MBS, WCS, and UTF-8 versions of strings in archive_entry; the archive_entry routines now correctly return NULL only when something is unset, setting NULL properly clears string values. Most charset conversions have been pushed down to archive_string. * Better handling of charset conversion failure when writing or reading UTF-8 headers in pax archives * archive_entry_linkify() provides multiple strategies for hardlink matching to suit different format expectations * More accurate bzip2 format detection * Joerg Sonnenberger's extensive improvements to mtree support * Rough support for self-extracting ZIP archives. Not an ideal approach, but it works for the archives I've tried. * New "sparsify" option in archive_write_disk converts blocks of nulls into seeks. * Better default behavior for the test harness; it now reports all failures by default instead of coredumping at the first one.
* Rework the versioning implementation and test to match thekientzle2008-03-141-2/+44
| | | | | | | | | | new interface. Mark the functions that are going away in libarchive 3.0. In particular, archive_version_string() now computes the string rather than assuming that it will be created by the build infrastructure. Eventually, this will allow some simplification of the build infrastructure.
* Update libarchive to 2.4.10. This includes a number of improvementskientzle2007-12-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* New "version stamp" simplifies determining the exact versionkientzle2007-07-061-0/+6
| | | | | | | | of libarchive being used. I've been taking advantage of this with a recent round of updates to libarchive_test so that it can test older and newer versions of the library. Approved by: re (Ken Smith)
* libarchive 2.2.3kientzle2007-05-291-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * "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.
* libarchive 2.0kientzle2007-03-031-0/+6
| | | | | | | | | | | | | | | | | | | * 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
* Portability and style fixes:kientzle2006-11-101-0/+6
| | | | | | | | | | | | | | * 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. ;-)
* Add a lot of error checks, based on the patches provided by Dan Lukes.kientzle2005-09-211-1/+1
| | | | | | | Also fixes a memory leak reported by Andrew Turner. PR: bin/83476 Thanks to: Dan Lukes, Andrew Turner
* Don't return NULL if there's no error message;kientzle2005-02-231-1/+1
| | | | | | | | return a generic text message instead. (Someday, I'll track down all the places that are generating errors but not recording messages. ;-/ Thanks to: Jaakko Heinonen
* Eliminate reliance on non-portable <err.h> by implementing a verykientzle2004-08-141-1/+11
| | | | | | | 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.
* Add some functions to query basic facts about the library:kientzle2004-07-241-0/+18
| | | | | | | | | | | | | | | archive_version: Returns a text string, e.g., "libarchive 1.00.000" archive_api_version: Returns the SHLIB major version archive_api_feature: Returns a feature number useful for answering questions such as "Is this recent enough to do XXX?" The last two also have macros defined in archive.h, so you can compare the compile-time and run-time environments. (In particular, you can compare ARCHIVE_API_VERSION to archive_api_version() to detect library version mismatches.) With these in hand, it will soon be time to turn on the shared-library version of libarchive... stay tuned.
* Add statistics: track offset in compressed and uncompressed archive,kientzle2004-04-281-0/+20
| | | | provide an interface for the client to query this information.
* 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
* Just use autoconf-compatible feature macros; don't try to be clever.kientzle2004-03-221-2/+6
|
* Bug: Standard C still requires declarations to precede statements. <sigh>kientzle2004-03-201-1/+10
| | | | | Portability: Eliminate an accidental __unused, accomodate systems with non-POSIX strerror_r
* Many fixes.kientzle2004-03-091-2/+4
| | | | | | | | | | | | | | | | 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
* Initial import of libarchive.kientzle2004-02-091-0/+101
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