summaryrefslogtreecommitdiffstats
path: root/lib/libarchive/archive_read_open_fd.c
Commit message (Collapse)AuthorAgeFilesLines
* Use contrib sources for building libarchive, tar and cpio.mm2011-12-221-190/+0
| | | | | | Make "make test" fully operational. MFC after: 2 weeks
* Retry reads that fail with EINTR. This fixes a problemkientzle2010-05-181-4/+8
| | | | with bsdtar failing on SIGINT.
* O_BINARY for Windows.kientzle2009-12-281-0/+9
|
* Merge r1052,r1055 from libarchive.googlecode.com:kientzle2009-04-271-0/+1
| | | | Clear the error flag on entry to a few more API functions.
* Don't use the open callback, which is deprecated (because it'skientzle2009-04-171-35/+24
| | | | | | never necessary). Also, simplify just a tad by delegating to read_open_fd() when we know the file descriptor, instead of duplicating that logic.
* Fix 'bsdtar -t' on tape drives. Libarchive uses thekientzle2007-06-261-2/+13
| | | | | | | | | | | | | 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).
* 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-2/+2
| | | | | | | | * 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/+16
| | | | | | | | | | | | | | * 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. ;-)
* Use 'skip' when ignoring data in tar archives. This dramaticallykientzle2006-07-301-3/+45
| | | | | | | | | | | | | | | | | | | | 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.
* If the attempt to open the archive fails (either the client openkientzle2006-01-171-1/+2
| | | | | | | | | | | | routine fails or the first read fails), invoke the client close routine immediately so the client can clean up. Also, don't store the client pointers in this case, so that the client close routine can't accidentally get called more than once. A minor style fix to archive_read_open_fd.c while I'm here. PR: 86453 Thanks to: Andrew Turner for reporting this and suggesting a fix.
* Add a lot of error checks, based on the patches provided by Dan Lukes.kientzle2005-09-211-0/+6
| | | | | | | Also fixes a memory leak reported by Andrew Turner. PR: bin/83476 Thanks to: Dan Lukes, Andrew Turner
* Refuse to extract an entry from an archive on top of the archive being read.kientzle2004-06-271-2/+11
| | | | (This is the converse of the "don't add an archive to itself".)
* 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-0/+93
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.
OpenPOWER on IntegriCloud