summaryrefslogtreecommitdiffstats
path: root/lib/libarchive/archive_read_open_filename.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix 'bsdtar -t' on tape drives. Libarchive uses thekientzle2007-06-261-2/+14
| | | | | | | | | | | | | skip() callback to skip over data when reading uncompressed archives. This gets invoked, for example, during tar -t or tar -x with a filename argument. The revised code only calls [lf]seek() on regular files, instead of depending on the kernel to return an error. Thanks to: bde for explaining the implementation of lseek() Thanks to: Daniel O'Connor for testing Approved by: re (Ken Smith) MFC after: 5 days
* Track whether the current read stream supports seek(). For now, wekientzle2007-06-181-0/+11
| | | | | | | assume yes unless seek has previously failed, but I fear I'll have to avoid seeks under other circumstances. (For instance, tape drives on FreeBSD seem to return garbage from lseek().) Also, optimize away zero-byte skips.
* 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
* Change the client skipper API to use off_t instead of size_t/ssize_t; butcperciva2007-01-051-0/+9
| | | | | | wrap this within #if/#else/#endif so that it will only take effect once ARCHIVE_API_VERSION is increased (which should happen on HEAD some time between now and when RELENG_7 is branched).
* Add archive_write_open_filename()/archive_read_open_filename() askientzle2006-11-151-0/+7
| | | | | synonyms for archive_write_open_file()/archive_read_open_file(). The new names are much clearer.
* These files no longer use internal APIs, so no longer need to includekientzle2006-11-131-1/+0
| | | | archive_private.h.
* Minor cleanup of the standard read/write I/O modules:kientzle2006-11-131-3/+4
| | | | | | | | * Use public API, don't access struct archive directly. (People should be able to copy these into their applications as a template for custom I/O callbacks.) * Set "skip" only for regular files. ("skip" allows the low-level library to catch attempts to add an archive to itself or extract over itself.) * Simplify the write_open functions by just calling stat() at the beginning. Somehow, these functions had acquired some complex logic that tried to avoid the stat() call but never succeeded. MFC after: 10 days
* Portability and style fixes:kientzle2006-11-101-6/+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. ;-)
* Some minor corrections:kientzle2006-09-051-1/+1
| | | | | | | * Expose functions for setting the "skip file" dev/ino information * Expose functions for setting/querying the block size on reads * Correctly propagate errors out of archive_read_close/archive_write_close * Update manpage with information about new functions
* Use 'skip' when ignoring data in tar archives. This dramaticallykientzle2006-07-301-2/+47
| | | | | | | | | | | | | | | | | | | | increases performance when extracting a single entry from a large uncompressed archive, especially on slow devices such as USB hard drives. Requires a number of changes: * New archive_read_open2() supports a 'skip' client function * Old archive_read_open() is implemented as a wrapper now, to continue supporting the old API/ABI. * _read_open_fd and _read_open_file sprout new 'skip' functions. * compression layer gets a new 'skip' operation. * compression_none passes skip requests through to client. * compression_{gzip,bzip2,compress} simply ignore skip requests. Thanks to: Benjamin Lutz, who designed and implemented the whole thing. I'm just committing it. ;-) TODO: Need to update the documentation a little bit.
* Add a lot of error checks, based on the patches provided by Dan Lukes.kientzle2005-09-211-0/+4
| | | | | | | Also fixes a memory leak reported by Andrew Turner. PR: bin/83476 Thanks to: Dan Lukes, Andrew Turner
* Better error messages on read and file-open errors.kientzle2005-03-131-3/+15
|
* Flush input when reading from pipe to avoid "broken pipe" warnings.kientzle2005-02-121-6/+31
| | | | | | | For example, when using 'gunzip | tar' to decompress. Also, fix some style issues (write null character as '\0'). Thanks to: Jaakko Heinonen
* Refuse to extract an entry from an archive on top of the archive being read.kientzle2004-06-271-0/+11
| | | | (This is the converse of the "don't add an archive to itself".)
* * Plug a buffer overrun in ACL parsing. (archive_entry.c)kientzle2004-04-131-1/+4
| | | | | | | * 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
* Overhauled ACL support. This makes us compatiblekientzle2004-04-051-1/+8
| | | | | | | | | | | | with 'star' ACL handling, though there's still a bit more work needed in this area. Added 'write_open_fd' and 'read_open_fd' to simplify, e.g., tar's u and r modes. Eliminated old 'write_open_file_position' as a bad idea. (It required closing/reopening files to do updates, which led to unpleasant implications.) Various other minor fixes, API tweaks, etc.
* 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
* Initial import of libarchive.kientzle2004-02-091-0/+109
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