aboutsummaryrefslogtreecommitdiff
path: root/lib/libarchive
Commit message (Collapse)AuthorAgeFilesLines
* MFC r187704: Fix ARCHIVE_EXTRACT_SPARSE handling in libarchive.Tim Kientzle2009-02-093-22/+305
| | | | | | | | | | Add a test to exercise this feature. This should fix --sparse/-S support in tar. Thanks to: Daichi GOTO Notes: svn path=/stable/7/; revision=188367
* MFC r185667,r185680,r185681: Overhaul the Rockridge optionTim Kientzle2008-12-083-153/+380
| | | | | | | | | | parsing and beef up the ISO9660 bidder. This makes the ISO reader a lot more robust when reading malformed input. Approved by: re Notes: svn path=/stable/7/; revision=185770
* MFC 182590,182778,182779,184109: Support for certainTim Kientzle2008-11-2810-115/+462
| | | | | | | | | | | | | | | | | | | | archive_entry attributes to be explicitly "unset". This fixes a number of issues: * Zip archives with "length at end" can now be extracted correctly, since the Zip extractor can simply mark the size as "unknown." * Extract-to-disk can now accurately handle cases with partial time information (e.g., mtime is known but not atime) * We get more accurate handling of different hardlink extraction cases; sometimes a hardlink entry has definitive size information and sometimes not. Approved by: re Notes: svn path=/stable/7/; revision=185408
* MFC r184038: Restore mtime *after* restoring ACLs. Otherwise,Tim Kientzle2008-10-233-4/+248
| | | | | | | | | | | | setting the ACL changes the mtime. (Plus a new test to exercise basic ACL restore logic.) PR: kern/128203 Submitted by: Udo Schweigert Approved by: re (Kostik Belousov) Notes: svn path=/stable/7/; revision=184195
* MFC r182838: Correct tar -xP so that it will follow symlinks toTim Kientzle2008-09-122-6/+90
| | | | | | | | | existing dirs. Approved by: re (Kostik Belousov) Notes: svn path=/stable/7/; revision=182956
* MFC r182587: If atime is missing, use time at which program startedTim Kientzle2008-09-062-7/+17
| | | | | | | | | instead of substituting mtime Approved by: re (Ken Smith) Notes: svn path=/stable/7/; revision=182811
* MFC r182360,r182470: If atime isn't specified, restore atime == mtime.Tim Kientzle2008-08-312-1/+11
| | | | | | | PR: bin/124915 Notes: svn path=/stable/7/; revision=182512
* MFC r182149: Alphabetize the list of tests.Tim Kientzle2008-08-271-4/+4
| | | | Notes: svn path=/stable/7/; revision=182235
* MFC r182102: Update the total archive bytes written when writing entriesTim Kientzle2008-08-271-0/+2
| | | | | | | to disk. (Used by cpio to generate proper block counts in -p mode.) Notes: svn path=/stable/7/; revision=182234
* MFC r182097: Permit restoring of path/.. if SECURE_NODOTDOT was not specified.Tim Kientzle2008-08-271-15/+3
| | | | | | | | | | | With SECURE_NODOTDOT, this isn't needed because we refuse to restore anything with '..' in the path. Without, we used to refuse path/.. as a special case (on the grounds that it was silly), but "cpio -p .." is a common and perfectly valid idiom that incidentally copies "." to "..". Notes: svn path=/stable/7/; revision=182230
* MFC r182093: Ignore NO_OVERWRITE_NEWER if the current object is a directory.Tim Kientzle2008-08-271-1/+5
| | | | | | | | | | | | | | Before this, the often-recommended incantation find -d . | cpio -p <target> fails to properly carry through dir metadata because each file copy implicitly creates the parent dir, which cpio subsequently refuses to overwrite. With this patch, the incantation works with or without the -d option to find because without it, there is no implicit dir creation, and with it, the subsequent dir restore will update the metadata on the dir. Notes: svn path=/stable/7/; revision=182228
* MFC r181542,r181555: Minor test suite fixup so that the test suiteTim Kientzle2008-08-256-3/+39
| | | | | | | | works against the libarchive 1.x API. Not needed by 7-STABLE, but it's nice to minimize the differences between 7-STABLE and CURRENT. Notes: svn path=/stable/7/; revision=182131
* MFC r181485 | kientzle | 2008-08-09 19:06:28 -0700 (Sat, 09 Aug 2008)Tim Kientzle2008-08-102-0/+6
| | | | | | | | > MfP4: Joerg Sonnenberger's fixes to make 'ar' and 'pax' writers > robust against multiple calls to their destroy() functions. Notes: svn path=/stable/7/; revision=181498
* MFC __dead2 markerTim Kientzle2008-08-101-1/+1
| | | | Notes: svn path=/stable/7/; revision=181495
* MFC removal of an unused variable.Tim Kientzle2008-08-101-2/+0
| | | | Notes: svn path=/stable/7/; revision=181494
* MFC missing $FreeBSD$ markers.Tim Kientzle2008-08-102-0/+2
| | | | Notes: svn path=/stable/7/; revision=181493
* MFC various corrections to the test suite Makefile.Tim Kientzle2008-08-101-6/+6
| | | | Notes: svn path=/stable/7/; revision=181492
* MFC r180027, r180028, r180122, r180123, r181489Tim Kientzle2008-08-103-11/+22
| | | | | | | | | | Cumulatively, these implement CRC32 validation when reading Zip archives and the test suite updates to ensure that CRC32 checking really will fail on a damaged entry and succeed on a valid one. Notes: svn path=/stable/7/; revision=181491
* Big MFC of libarchive 2.5.5.Tim Kientzle2008-08-1059-1129/+3959
| | | | Notes: svn path=/stable/7/; revision=181490
* MFC r179235 | cperciva | 2008-05-22 22:01:29 -0700 (Thu, 22 May 2008)Tim Kientzle2008-08-101-3/+7
| | | | | | | | | | | | | | > Check that lseek(2) succeeds and puts us where we expect. [1] > > While we're here, fix a long-standing bug in the handling of write(2) > errors: The API changed from "return # of bytes written" to "return > status code" almost 4 years ago, so instead of returning (-1) we need > to return ARCHIVE_FATAL. > > Found by: Coverity Prevent [1] Notes: svn path=/stable/7/; revision=181488
* MFC r179234 | cperciva | 2008-05-22 21:57:28 -0700 (Thu, 22 May 2008)Tim Kientzle2008-08-101-2/+1
| | | | | | | | | | > We only use the string "?rwxrwxrwx " once, so inline it rather than > declaring a variable which points to it. Aside from eliminating a > line of code and one level of unnecessary indirection, this eliminates > a false positive in Coverity. Notes: svn path=/stable/7/; revision=181487
* MFC r179125Tim Kientzle2008-08-101-0/+1
| | | | | | | | | | > r179125 | cperciva | 2008-05-19 11:06:48 -0700 (Mon, 19 May 2008) | 5 lines > Return ARCHIVE_FATAL if we can't allocate memory instead of going ahead and > dereferencing NULL. > Found by: Coverity Prevent Notes: svn path=/stable/7/; revision=181486
* Fix up mergeinfo to reflect the current status of this branch.Tim Kientzle2008-08-092-0/+2
| | | | | | | | | | stable/7/lib/libarchive was already almost identical to head/lib/libarchive@177777. This matches it up exactly (except that I declined to resurrect the .cvsignore file) and records that alignment in svn:mergeinfo. Notes: svn path=/stable/7/; revision=181483
* MFC: Numerous test updates.Tim Kientzle2008-05-2110-83/+338
| | | | Notes: svn path=/stable/7/; revision=179171
* MFC: New manpage links and turn on the compress write support.Tim Kientzle2008-05-211-0/+4
| | | | Notes: svn path=/stable/7/; revision=179170
* MFC: updates to the public API plus an attempt to straighten out versioning.Tim Kientzle2008-05-211-41/+38
| | | | Notes: svn path=/stable/7/; revision=179169
* MFC: some documentation corrections and updates.Tim Kientzle2008-05-215-28/+174
| | | | Notes: svn path=/stable/7/; revision=179168
* MFC: A number of interrelated changes that I'm too tired to teaseTim Kientzle2008-05-218-414/+716
| | | | | | | | apart into separate MFCs. These have all been in -CURRENT for quite some time. Notes: svn path=/stable/7/; revision=179167
* MFC: Some changes to 'ar' format support from Kai Wang.Tim Kientzle2008-05-213-42/+41
| | | | Notes: svn path=/stable/7/; revision=179165
* MFC: FreeBSD does have fstat() and libarchive should use it (itTim Kientzle2008-05-102-1/+3
| | | | | | | | reduces some races). But I need to fix a typo in the one use of fstat() first. <sigh> Notes: svn path=/stable/7/; revision=178934
* MFC: Eliminate a bunch of unused fields from the read structure.Tim Kientzle2008-05-101-46/+2
| | | | | | | | Most are write-specific values that are leftovers from when read and write used a shared structure. Notes: svn path=/stable/7/; revision=178908
* MFC: The read side doesn't use the 'nulls' convenience value, so getTim Kientzle2008-05-101-15/+0
| | | | | | | | rid of it. We also don't need to set the block size here, since we don't use it. Notes: svn path=/stable/7/; revision=178907
* MFC: Set the archive format code and name in the generic portionTim Kientzle2008-05-105-16/+16
| | | | | | | | | | | | of the archive structure, not the write-specific portion. (This is a bungle from back when the generic and write-specific portions were first separated and the write-specific part accidentally ended up with copies of some of the generic fields.) In particular, archive_format() and archive_format_name() now work correctly on write handles. Notes: svn path=/stable/7/; revision=178906
* MFC: Stop using ARCHIVE_DEFAULT_BYTES_PER_BLOCK to set the defaultTim Kientzle2008-05-101-1/+6
| | | | | | | | block size. The default setting here is arbitrary and shouldn't be published. Someday, we should be smarter about the default here. Notes: svn path=/stable/7/; revision=178905
* MFC: Add the useful archive_string_sprintf() function for internal use.Tim Kientzle2008-05-102-0/+13
| | | | Notes: svn path=/stable/7/; revision=178903
* MFC 1.25: Portability: on platforms that don't have timegm, don't haveTim Kientzle2008-05-101-5/+9
| | | | | | | | tm_gmtoff and can't reset the timezone to force mktime to use UTC, just give up and use unadorned mktime(). Notes: svn path=/stable/7/; revision=178902
* MFC 1.2: Minor portability improvement. Not every platformTim Kientzle2008-05-101-3/+3
| | | | | | | | has S_IXUSR, S_IXGRP, S_IXOTH defines, but the values never change, so just hardcode the constants. Notes: svn path=/stable/7/; revision=178901
* MFC: Include space for the trailing NUL byte.Tim Kientzle2008-05-101-1/+1
| | | | Notes: svn path=/stable/7/; revision=178899
* This commit was manufactured by cvs2svn to create branch 'RELENG_7'.cvs2svn2008-03-154-0/+767
| | | | Notes: svn path=/stable/7/; revision=177222
* MFC a number of minor edits and portability fixups.Tim Kientzle2008-03-1213-96/+173
| | | | | | | | This is mostly just to catch 7-STABLE up with -CURRENT before the next big round of changes. Notes: svn path=/stable/7/; revision=177079
* MFC: libarchive 2.4.12Tim Kientzle2008-02-1154-1167/+1428
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Formats are now only bid once per file, not once per entry (Affects archive_read.c, most format readers, internals manpage) * Correct tar/cpio history in libarchive_formats manpage * Avoid unnecessary copies in {write,read}_compression_none (significant performance boost for uncompressed archives!) * Protect against zero-length writes in gzip/bzip2 compressors * Tar reader: improve hardlink length heuristics, GNU tar --posix --sparse support, related fixes to SCHILY.realsize handling * Cpio reader: recover from sync errors * Cpio writer: pad symlinks properly in newc format * Ar writer: close out empty archive correctly * Zip reader: ignore PK00 header, code cleanups from des@ * Iso9660 reader: support device node entries * archive_write_disk: support hardlinks with bodies, enforce maximum file size * Reconnect progress callback from archive_read_extract() * New: archive_entry_strmode() * New: mtree reader * New: "linkresolver" makes it easier to do hardlink resolution * UUencode test reference files (be nice to CVS) * New test: exercise very large entries (2G up to 1T) in tar archives * New test: Detailed verification of cpio odc and newc formats * New test: Various strategies for restoring multiple links to a file * New tests: Various compatibility checks against gzip, zip, old tar, etc. * New test: cpio recovery from damaged archives * New test: mtree reading * Improved statistics reporting from test harness * Plus minor portability improvements Notes: svn path=/stable/7/; revision=176158
* This commit was manufactured by cvs2svn to create branch 'RELENG_7'.cvs2svn2008-02-092-0/+143
| | | | Notes: svn path=/stable/7/; revision=176125
* This commit was manufactured by cvs2svn to create branch 'RELENG_7'.cvs2svn2008-01-231-0/+211
| | | | Notes: svn path=/stable/7/; revision=175590
* This commit was manufactured by cvs2svn to create branch 'RELENG_7'.cvs2svn2008-01-1821-0/+4160
| | | | Notes: svn path=/stable/7/; revision=175424
* MFC: If "length at end" flag is specified, then a zero lengthTim Kientzle2007-12-081-1/+2
| | | | | | | | | at the beginning shouldn't be interpreted to mean an empty body. Approved by: re (Ken Smith) Notes: svn path=/stable/7/; revision=174439
* MFC 1.18: When skipping input data, request a minimum of 1 insteadTim Kientzle2007-11-021-1/+1
| | | | | | | | | | | | | | | | of the full request size. This avoids a 32-bit overflow problem skipping an exact multiple of 4GB and is faster anyway because it allows the underlying I/O framework to minimize copying. In particular, this fixes bsdtar failing to properly skip entries in uncompressed tar archives that are an exact multiple of 4GB. Approved by: re (Ken Smith) Notes: svn path=/stable/7/; revision=173277
* MFC 1.62: Fix reading of files that use pax 'size' attributeTim Kientzle2007-10-291-7/+21
| | | | | | | | | | | | | to store size. In particular, the pax 'size' attribute is required for any file over 8G. This seems to fix tar -cf - | tar -xf - when there are files over 8G in the heirarchy being copied. Approved by: re (Ken Smith) Notes: svn path=/stable/7/; revision=173131
* MFC: archive_write_set_format_cpio.c 1.12Tim Kientzle2007-10-212-2/+12
| | | | | | | | | | | | | MFC: archive_write_set_format_cpio_newc.c 1.2 Non-regular files should have zero-length bodies. libarchive flags this to clients by updating the entry description when it writes the header. Approved by: re (Ken Smith) Notes: svn path=/stable/7/; revision=172859
* MFC 1.15: When reading ZIP archives, non-regular files shouldTim Kientzle2007-10-181-0/+7
| | | | | | | | | | | | | | return EOF immediately on any attempts to read their data. (Previously, it would return a zero-length block, then EOF, which elicited bogus warnings from bsdtar.) Also, correct the EOF return to correctly identify EOF as part of an empty block at the correct offset. Approved by: re (Ken Smith) Notes: svn path=/stable/7/; revision=172736
* Fix the archive_write_data() function so it always returnsTim Kientzle2007-09-212-4/+86
| | | | | | | | | | | | | | | | number of bytes written, even when used to write files to disk. Extend the test suite to verify the correct return values for archive_write_data() and archive_write_data_block(). Thanks to: Bruce Mah, for stepping in promptly to back out the earlier broken version of this fix Thanks to: Colin Percival, for pointing out the correct fix MFC after: 5 days Approved by: re (ksmith) Pointy hat: \me Notes: svn path=/head/; revision=172267