Commit Graph

575 Commits

Author SHA1 Message Date
kientzle
aa26df08af Merge r282 from libarchive.googlecode.com: Close multiple filters
by walking the filter list in archive_read_close().
2009-03-03 03:33:25 +00:00
kientzle
7382504863 Merge r272 from libarchive.googlecode.com: Fix building on MSVC6. 2009-03-03 03:28:09 +00:00
kientzle
8211ee6057 Permit ` as a pad character in the filename table.
This seems to fix the devel/zziplib port, which distributes
its man pages in an ar archive.
2009-02-01 02:33:02 +00:00
kientzle
bd35a42312 Fix ARCHIVE_EXTRACT_SPARSE handling in libarchive.
Add a test to exercise this feature.
This should fix --sparse/-S support in tar.

Thanks to:      Daichi GOTO
MFC after:	1 week
2009-01-26 05:44:40 +00:00
kientzle
6db44bd9b7 Merge-from-Googlecode r419
In archive_write_disk:  If archive_write_header() fails to create
the file, that's a failure and should return ARCHIVE_FAILED.
Metadata restore failures still return ARCHIVE_WARN, because
that's non-critical.  Fix test_write_disk_secure test to
verify the correct return code in one case; add test_write_disk_failures
to do another very simple test of restore failure.

This should fix cpio coredumping when it tries to restore to
a write-protected directory.

Thanks to: Giorgos Keramidas
MFC after: 30 days
2009-01-21 06:55:27 +00:00
kientzle
5307e1d148 "The first part is just to give more info, the latter part fixes
an error to read files past the 32bit byte offset, for instance
on DVDs."

Submitted by:	phk@
MFC after:	10 days
2009-01-13 04:56:41 +00:00
kientzle
7afd406b93 Don't try to read the next Gzip header after we reach the
end of the compressed stream.  This is desirable behavior,
but the implementation here is very broken and causes strange
problems, so disable it for now.

Thanks to Simon L. Nielsen for reporting this problem.
2009-01-01 02:29:57 +00:00
kientzle
76e4e96ff0 If conversion from UTF8 fails, don't mark Unicode text as available.
Submitted by:	Michihiro NAKAJIMA
MFC after:	30 days
2008-12-23 05:01:43 +00:00
kientzle
6bd8962c99 Teach get_refdir() about FreeBSD's /usr/obj convention.
In development, I run libarchive_test frequently by hand
and it gets tedious having to specify a suitable -r path
all of the time.
2008-12-21 00:13:50 +00:00
kientzle
6a06481400 Fill in a missing const 2008-12-17 19:05:58 +00:00
kientzle
ae2468f691 Exit earlier on failure in this test. 2008-12-17 19:05:25 +00:00
kientzle
474c42e7c8 Once the test has failed, exit before the segfault. 2008-12-17 19:05:00 +00:00
kientzle
33d241da27 Update the ar write test to give more detailed information about failures. 2008-12-17 19:03:44 +00:00
kientzle
c27e8b4cf5 Clarify an 'ar' error message. 2008-12-17 19:02:42 +00:00
kientzle
8900544198 Obey the TMPDIR, TMP, TEMP, or TEMPDIR environment variables
when choosing a scratch directory for the tests.  Fallback
to "/tmp", of course.
2008-12-08 17:22:44 +00:00
kientzle
0464cbbb30 New tests:
* support for bzip2 file with multiple concatenated bzip2 streams
 * support for bzip2 file with junk after bzip2 stream
 * support for gzip file with junk after gzip stream
 * "fuzz" tester randomly modifies a bunch of input files in order to try
   to crash libarchive (this found an amusing hang in the ISO9660 code
   when trying to read images that advertised a zero blocksize).

This test is implemented, but commented out for now:
 * support for gzip file with multiple concatenated gzip streams
2008-12-06 07:08:08 +00:00
kientzle
fe88ebbf1c Strip ";1" and trailing "." from ISO9660 entries.
This seems a better match for people's expectations.
2008-12-06 06:57:45 +00:00
kientzle
10711278cc General improvements to Rockridge parsing and ISO9660 format detection. 2008-12-06 06:55:07 +00:00
kientzle
6a6f3afd42 Conditionalize a bunch of debugging messages; this also
eliminates what should be the only remaining stdio dependency.
2008-12-06 06:50:09 +00:00
kientzle
e59163f249 MfP4: Big read filter refactoring.
This is an attempt to eliminate a lot of redundant
code from the read ("decompression") filters by
changing them to juggle arbitrary-sized blocks
and consolidate reblocking code at a single point
in archive_read.c.

Along the way, I've changed the internal read/consume
API used by the format handlers to a slightly
different style originally suggested by des@.  It
does seem to simplify a lot of common cases.

The most dramatic change is, of course, to
archive_read_support_compression_none(), which
has just evaporated into a no-op as the blocking
code this used to hold has all been moved up
a level.

There's at least one more big round of refactoring
yet to come before the individual filters are as
straightforward as I think they should be...
2008-12-06 06:45:15 +00:00
kientzle
01e9b693cc Style: tabs after #define 2008-12-06 06:23:37 +00:00
kientzle
15ffc05b52 Use GCC-specific dead function markers only when using GCC. 2008-12-06 06:20:21 +00:00
kientzle
b5c70ed6df Structure declarations can't be dllexported. 2008-12-06 06:18:46 +00:00
kientzle
52442c2b5f Style fixes:
* Wrap long declarations to fit 80 chars
 * #undef macros that shouldn't be exported
 * Organize the version-dependent conditionals a
   bit more consistently

Speculative:
 * libarchive 3.0 will (eventually) use int64_t
   instead of off_t.  This is an attempt to avoid
   some the headaches caused by Linux LFS.  (I'll
   still have to do ugly things for the struct stat
   references in archive_entry.h, of course.)
2008-12-06 06:17:18 +00:00
kientzle
cc9ad7c8d5 A couple of portability fixes from Joerg Sonnenberger 2008-12-06 06:12:24 +00:00
kientzle
df16f92191 Recover after test failure. 2008-12-06 06:02:26 +00:00
kientzle
73e2e03a0e Style: skipping() function correctly counts this as a skipped test. 2008-12-06 06:01:50 +00:00
kientzle
1cdf4f2cb2 Style improvements. 2008-12-06 06:00:52 +00:00
kientzle
06166eead9 Better reporting of test failures. 2008-12-06 05:59:46 +00:00
kientzle
c9d6a73af2 Recover from a test failure here. 2008-12-06 05:58:24 +00:00
kientzle
9bd8cf4e76 New internal archive_string_concat utility function. 2008-12-06 05:56:43 +00:00
kientzle
fa92961e89 Minor portability: Declare 'r' only within the conditional
block where it's used; S_ISLNK is more portable than S_ISLINK.
2008-12-06 05:55:46 +00:00
kientzle
f7c489d836 Windows build now uses PLATFORM_CONFIG_H macro, so we can eliminate the
special case for it.
2008-12-06 05:53:05 +00:00
kientzle
cb9f366909 2 is more portable than STDERR_FILENO 2008-12-06 05:52:01 +00:00
kientzle
9aed2614cc When running on a filesystem that lacks ACL support,
just SKIP the test, don't report a test failure.
2008-11-17 21:06:17 +00:00
kientzle
b93042ab7d Correct the documented declaration of the archive_write_callback to
match the code.

PR:		docs/128089
Submitted by:	Mel
MFC after:	3 days
2008-11-01 19:11:21 +00:00
des
d9ae813ea1 Move va_end() up 2008-10-21 12:10:30 +00:00
kientzle
24084253f7 If we don't know the file size, leave the file size unset.
If it's not a regular file, don't return any data, even if the size is unknown.

Update the Zip test with a hand-tweaked Zip archive that has a
directory (with length-at-end set), a regular file without
length-at-end set, and a regular file with length-at-end set and a bad
CRC.  Update the test code to verify that the file size is unset
for the regular file with length-at-end.

MFC after:	7 days
2008-10-21 05:08:35 +00:00
kientzle
88da8906fe Add test to verify ACL restores on FreeBSD, verify kern/128203 (mtime
restore fails if ACL provided), apply patch from kern/128203, and verify fix.

PR:		kern/128203
Submitted by:	Udo Schweigert
MFC after:	3 days
2008-10-19 00:18:44 +00:00
kientzle
e2204b1f39 Style: Mark private data 'static', correct an old comment.
MFC after:	3 days
2008-10-19 00:13:57 +00:00
kientzle
18256ca193 Verify high-res birthtime support on FreeBSD.
MFC after:	30 days
2008-09-30 04:13:21 +00:00
kientzle
1f6b640a75 MfP4: restore birth time data to disk + more thorough tests for
time restore to disk.

MFC after:	30 days
2008-09-30 04:02:36 +00:00
kientzle
c7ce068f95 MfP4: Store/read birthtime data in pax format.
Submitted by:	Pedro Giffuni
MFC after:	30 days
2008-09-30 03:57:07 +00:00
kientzle
6902e811f6 MfP4: Support for storing birthtime in archive_entry objects.
Submitted by:	Pedro Giffuni
MFC after:	30 days
2008-09-30 03:53:03 +00:00
kientzle
46af6c4ecf MfP4: Generalize int64_t in the public headers to support compilers
which have a 64-bit integer type but don't provide standard C99 definitions.
2008-09-18 04:19:06 +00:00
kientzle
97219c55ce Trying to distinguish different "versions" of mtree files was a silly idea.
Submitted by:	Joerg Sonnenberger
2008-09-18 04:13:36 +00:00
kientzle
c575680569 Choose a flag-handling strategy based on platform capabilities
rather than on platform.
2008-09-14 05:51:25 +00:00
kientzle
f86ac1c574 Portability: Don't use symbolic constants when the values are more
standard than the names are.  Remove some trailing whitespace.
2008-09-12 05:33:00 +00:00
kientzle
ccdf5b420c Portability: Not everyone is lucky enough to have ftruncate() 2008-09-12 04:08:11 +00:00
kientzle
96223dee11 Portability: Support platforms that lack (struct stat).st_blksize or SSIZE_MAX
Of course, FreeBSD has both.
2008-09-12 04:03:34 +00:00