summaryrefslogtreecommitdiffstats
path: root/lib/libarchive
Commit message (Collapse)AuthorAgeFilesLines
* Use an uncompressed test archive for gtar sparse format 1.0 format,kientzle2007-07-141-20/+6
| | | | | | | as that better exercises some internal read-combining logic than the compressed archive. Approved by: re (blanket, libarchive testing)
* Report each failed test once, but keep a count and report that countkientzle2007-07-143-22/+111
| | | | | | | if there was more than one. In particular, this simplifies test_tar_filenames.c, which has a tendency to be very noisy otherwise. Approved by: re (blanket, libarchive testing)
* Restore the 'break' that was inadvertently removed in 1.57 of this file.kientzle2007-07-141-0/+1
| | | | | | | Without this, hardlinks get returned as symlinks. Approved by: re (Ken Smith) MFC after: 2 days
* Extend the basic tar reading test to exercise most types ofkientzle2007-07-141-49/+388
| | | | | | entries. This doesn't cover everything yet, but it's a big improvement. Approved by: re (blanket, libarchive testing)
* Make the test for reading gtar sparse entries more robust;kientzle2007-07-131-35/+198
| | | | | | | | it now verifies that the returned blocks have the correct data at the correct file offsets, ignoring any null padding that may exist. Approved by: re (blanket, libarchive test suite)
* New test suite test_read_pax_truncated probes libarchivekientzle2007-07-132-0/+282
| | | | | | | behavior with truncated or damaged pax archives. This tests most of the cases covered by the recent security advisory. Approved by: re (blanket, libarchive test suite)
* New file "read_open_memory.c" is a custom variant ofkientzle2007-07-133-1/+153
| | | | | | | | | archive_read_open_memory.c that tries to test border cases. In particular, it copies over each returned block so that formats or decompressors that read past the end of a returned block will break. Approved by: re (blanket, libarchive test suite)
* Fix running individual tests via "libarchive_test <number> <number> ..."kientzle2007-07-131-1/+2
| | | | Approved by: re (blanket)
* Correct multiple security issues in how libarchive handles corruptcperciva2007-07-122-41/+104
| | | | | | | | tar archives, including a potentially exploitable buffer overflow. Approved by: re (kensmith, security blanket) Reviewed by: kientzle Security: FreeBSD-SA-07:05.libarchive
* Fix installworld: /usr/bin/printf isn't available then,kientzle2007-07-071-1/+3
| | | | | | | so use awk's printf for the formatting here instead. Pointy hat: Yours Truly Approved by: re
* Make test suite work with libarchive 1.3.1: Take advantage ofkientzle2007-07-0617-25/+289
| | | | | | | | | | | | | ARCHIVE_VERSION_STAMP to selectively disable tests that don't apply to that version; new "skipping()" function reports skipped tests; modify final summary to report component test failures and skips. Note: I don't currently intend to MFC the test suite itself; anyone interested should just checkout and use this version of the test suite, which should work for any library version. Approved by: re (Ken Smith, blanket)
* New "version stamp" simplifies determining the exact versionkientzle2007-07-064-23/+70
| | | | | | | | 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)
* Fix 'bsdtar -t' on tape drives. Libarchive uses thekientzle2007-06-263-12/+45
| | | | | | | | | | | | | 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
* Ouch. I partially screwed up the last commit bykientzle2007-06-221-1/+0
| | | | | | | enabling a test that's not ready yet. <sigh> Pointy hat: /me Approved by: re@
* Support for writing the 'newc' cpio format, plus a minimal test harnesskientzle2007-06-227-0/+393
| | | | | | | for the cpio formats. Thanks to: Rudolf Marek Approved by: re@
* Track whether the current read stream supports seek(). For now, wekientzle2007-06-182-0/+22
| | | | | | | 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.
* Make 'ar' write test a tad more portable.kientzle2007-06-131-3/+3
|
* Read support for the new GNU tar sparse formats added in gtar 1.15 andkientzle2007-06-133-84/+570
| | | | gtar 1.16.
* Add some options to libarchive_test:kientzle2007-06-131-12/+50
| | | | | -k: like make -k, try to keep going after errors. -q: quiet
* Fix a broken function declaration.kientzle2007-06-131-1/+1
|
* Options spring cleanup:sepotvin2007-06-131-1/+0
| | | | | | | | | | - Add and document the KVM and KVM_SUPPORT options that are needed for the ifmcstats(3) makefile - Garbage collect unused variables - Add missing inclusion of bsd.own.mk where needed Approved by: kan (mentor) Reviewed by: ru
* Don't lose leading '/' for pathnames exactly 101 bytes long.kientzle2007-06-112-8/+25
| | | | Also, update the test harness to exercise this case.
* libarchive 2.2.3kientzle2007-05-2973-1372/+3889
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * "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.
* Replace "sizeof(struct bucket[cache_size])" withcperciva2007-05-221-4/+4
| | | | | | | | "cache_size * sizeof(struct bucket)". The former is valid in C99 but can confuse earlier compilers, while the latter is a standard idiom which all C compilers understand. Approved by: kientzle
* Don't test for NULL when it is both unnecessary (the pointer is checkedcperciva2007-05-211-1/+1
| | | | | | | | against NULL when it is first allocated) and pointless (we've already dereferenced the pointer several times). Found by: Coverity Prevent(tm) CID: 3204
* Remove pointless code: Don't assign a value to a variable when we'recperciva2007-05-211-1/+0
| | | | | | | | | | | going to overwrite it with a new value a few lines later. Visual inspection of the surrounding code indicates that the code does what it's supposed to do; i.e., the pointless code wasn't supposed to be doing something other than what it was doing. CID: 3323 Found by: Coverity Prevent(tm)
* Don't forget to free a string allocated by strdup where necessary.cperciva2007-05-191-2/+9
| | | | | Found by: Coverity Prevent Coverity ID: CID 3132
* s/@VERSION@/@ARCHIVE_VERSION@/cperciva2007-05-022-3/+3
| | | | | | | This is a no-op as far as FreeBSD is concerned, but makes libarchive more autoconf-friendly. Approved by: kientzle
* Fix a memory leak in the uname/gname lookup cache.kientzle2007-04-201-11/+11
| | | | Thanks to: VMiklos
* In libarchive: Downgrade ARCHIVE_FATAL and ARCHIVE_FAILED errors whichcperciva2007-04-161-0/+6
| | | | | | | | | | | | | | | | occur on the write side of extracting a file to ARCHIVE_WARN errors when returning them from archive_read_extract. In bsdtar: Use the return code from archive_read_data_into_fd and archive_read_extract to determine whether we should continue trying to extract an archive after one of the entries fails. This commit makes extracting a truncated tarball complain once about the archive being truncated, instead of complaining twice (once when trying to extract an entry, and once when trying to seek to the next entry). Discussed with: kientzle
* Properly cleanup the UID/GID lookup data.kientzle2007-04-151-0/+4
|
* Don't free a NULL pointer.kientzle2007-04-151-1/+2
|
* Clean up a lot of memory leaks in the libarchive test harness.kientzle2007-04-1512-0/+29
|
* Thanks to Colin for catching my mixup. The original problem wasn'tkientzle2007-04-151-3/+8
| | | | suppressing the second error, it was failing to address the first.
* Consolidate numeric limit macros in one place; include themkientzle2007-04-156-49/+44
| | | | only on platforms that need them. FreeBSD doesn't.
* Pass through error message if any operation fails, not just the last one.kientzle2007-04-141-1/+1
|
* Overhaul of 'ar' support:kientzle2007-04-147-228/+235
| | | | | | | | | | | | | | | | | | | * use "AR_GNU" as the format name instead of AR_SVR4 (it's what everyone is going to call it anyway) * Simplify numeric parsing to unsigned (none of the numeric values should ever be negative); don't run off end of numeric fields. * Finish parsing the common header fields before the next I/O request (which might dump the contents) * Be smarter about format guessing and trimming filenames. * Most of the magic values are only used in one place, so just inline them. * Many more comments. * Be smarter about handling damaged entries; return something reasonable. * Call it a "filename table" instead of a "string table" * Update tests. Enable selection of 'ar', 'arbsd', and 'argnu' formats by name (this allows bsdtar to create ar format archives). The 'ar' writer still needs some work; it should reject entries that aren't regular files and should probably also strip leading paths from filenames.
* Invoke utime(2) properly. (It's only used on platformskientzle2007-04-141-2/+2
| | | | that lack utimes(2).)
* Fix the build by temporarily disabling 'ar' support untilkientzle2007-04-141-1/+0
| | | | I can clean it up.
* Fix the build.kientzle2007-04-142-2/+2
| | | | | | N.B. 'ar' format support is broken right now, it's not passing tests. If I can't find the problem soon, I'll back out the last commit.
* Fixes from Joerg Sonnenberger, reviewed by Kai Wang.kientzle2007-04-141-49/+81
|
* Conventionally, tar archives have always included a trailing '/'kientzle2007-04-145-74/+261
| | | | | | | | | | | | | for directories. bsdtar used to add this, but that recently got lost somehow. So now I'm adding it back in libarchive. The only odd part of doing this in libarchive: Adding a directory to a tar archive and then reading it back again can yield a different name. Add a test case to exercise some boundary conditions with tar filenames and ensure that trailing slashes are added to dir names only as necessary. Thanks to: Oliver Lehmann for bringing this regression to my attention.
* Portability: Don't use mkdtemp() when mkdir() will suffice.kientzle2007-04-141-2/+2
| | | | If we can't create the dir, just give up.
* More portability improvements from Martin Koeppe:kientzle2007-04-143-11/+75
| | | | | | conditionally use utime() when utimes() is not available; allow the most common wide-char functions to be replaced when local alternatives are lacking.
* Portability.kientzle2007-04-131-0/+2
|
* Now that libarchive is being built in more environments,kientzle2007-04-122-8/+6
| | | | | | factor out the platform-specific configuration header a bit more cleanly. Suggested by: Joerg Sonnenberger
* Make Lint happier.kientzle2007-04-122-2/+3
|
* Fix build on Solaris.kientzle2007-04-071-1/+1
|
* Enable 'ar' support; hook it up to the build andkientzle2007-04-073-2/+7
| | | | enable it with _read_support_format_all().
* Clarification: Point people to archive_read_data(), whichkientzle2007-04-071-1/+4
| | | | should be used instead of archive_read_data_into_buffer().
OpenPOWER on IntegriCloud