Tim Kientzle
485698c170
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
Tim Kientzle
0373bf6531
A couple of portability fixes from Joerg Sonnenberger
2008-12-06 06:12:24 +00:00
Tim Kientzle
605fc11462
Recover after test failure.
2008-12-06 06:02:26 +00:00
Tim Kientzle
796b668980
Style: skipping() function correctly counts this as a skipped test.
2008-12-06 06:01:50 +00:00
Tim Kientzle
f1bcf83200
Style improvements.
2008-12-06 06:00:52 +00:00
Tim Kientzle
39bb5e0dd0
Better reporting of test failures.
2008-12-06 05:59:46 +00:00
Tim Kientzle
23fb0d7a7c
Recover from a test failure here.
2008-12-06 05:58:24 +00:00
Tim Kientzle
0a68927a88
New internal archive_string_concat utility function.
2008-12-06 05:56:43 +00:00
Tim Kientzle
fe7350cb22
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
Tim Kientzle
b55ef4a75a
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
Tim Kientzle
a8d0992f23
2 is more portable than STDERR_FILENO
2008-12-06 05:52:01 +00:00
Tim Kientzle
9fe9800cb5
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
Tim Kientzle
92ab0af8a3
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
Dag-Erling Smørgrav
c1f91a825f
Move va_end() up
2008-10-21 12:10:30 +00:00
Tim Kientzle
ee8a341ef4
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
Tim Kientzle
758dfd70db
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
Tim Kientzle
d34dca65fa
Style: Mark private data 'static', correct an old comment.
...
MFC after: 3 days
2008-10-19 00:13:57 +00:00
Tim Kientzle
b2d4ddad82
Verify high-res birthtime support on FreeBSD.
...
MFC after: 30 days
2008-09-30 04:13:21 +00:00
Tim Kientzle
f70105fb18
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
Tim Kientzle
155524db13
MfP4: Store/read birthtime data in pax format.
...
Submitted by: Pedro Giffuni
MFC after: 30 days
2008-09-30 03:57:07 +00:00
Tim Kientzle
8b18fa965d
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
Tim Kientzle
c42f5c226a
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
Tim Kientzle
a370f3ca73
Trying to distinguish different "versions" of mtree files was a silly idea.
...
Submitted by: Joerg Sonnenberger
2008-09-18 04:13:36 +00:00
Tim Kientzle
29a23c776a
Choose a flag-handling strategy based on platform capabilities
...
rather than on platform.
2008-09-14 05:51:25 +00:00
Tim Kientzle
1074aa240c
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
Tim Kientzle
a2854491c4
Portability: Not everyone is lucky enough to have ftruncate()
2008-09-12 04:08:11 +00:00
Tim Kientzle
220265229d
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
Tim Kientzle
6d35d9a6e9
Windows compatibility: The stub replacement for compression_program
...
(which always returns an error when invoked) needs its prototype.
2008-09-12 03:53:54 +00:00
Tim Kientzle
a2a72fd640
Fix a type-aliasing problem in the libarchive test suite,
...
restore WARNS=6.
2008-09-08 00:58:12 +00:00
Tim Kientzle
fb7ec956eb
Correct a leaking archive_entry in the test suite.
2008-09-07 23:59:27 +00:00
Tim Kientzle
7480311f87
Correct the comments here.
...
PR: bin/126849
MFC after: 3 days
2008-09-07 06:15:45 +00:00
Tim Kientzle
11663004bd
When restoring a directory, allow symlinks to be followed. The full
...
logic here gets a little complex, but the net effect is that the
SECURE_SYMLINKS flag will prevent us from ever following a symlink.
Without it, we'll only follow symlinks to dirs. bsdtar specifies
SECURE_SYMLINKS by default, suppresses it for -P.
I've also beefed up the write_disk_secure test to verify this
behavior.
PR: bin/126849
2008-09-07 05:22:33 +00:00
Tim Kientzle
11b4b8458c
The link resolver now unsets the size to mark a hardlink
...
with no body instead of setting it to zero.
2008-09-05 06:15:25 +00:00
Tim Kientzle
a0bfb8ae3e
MfP4: Handle entries with unset size properly: Regular files with
...
unspecified size are "unlimited" (required by Zip reader, which
sometimes does not know the uncompressed size of an entry until it
gets to the end). Also, hardlinks with unspecified (or zero) size do
not overwrite the data on disk nor do they set metadata. This is
compatible with GNU tar and NetBSD pax behavior.
2008-09-05 06:13:11 +00:00
Tim Kientzle
e20d272f0a
MfP4: Use the set/unset tracking to determine when mtime or atime
...
is unavailable. Use start_time as a substitute when one is missing;
if both are missing, skip the call to {f,l,}utime{s,}() entirely.
2008-09-05 05:55:49 +00:00
Tim Kientzle
1b42ff4cd6
Markup fix.
...
MFC after: 3 days
2008-09-04 05:22:00 +00:00
Tim Kientzle
0c35edadaa
Style: Use ARCHIVE_VERSION_NUMBER to conditionalize tests on
...
the particular libarchive version being tested instead of the
deprecated ARCHIVE_API_VERSION and ARCHIVE_VERSION_STAMP macros.
2008-09-01 05:38:33 +00:00
Tim Kientzle
32364a7ddb
MfP4: set/unset tracking for atime, ctime, mtime, and size fields.
...
This generalizes the existing set/unset tracking for hardlink/symlink
fields and extends it to cover non-string fields. Eventually, this
will be further extended to cover most fields.
In particular, this is needed to correctly detect when time fields
are missing (for example, reading ustar archives doesn't set atime or
ctime) for proper time restore and is helpful when trying to determine
whether to overwrite data when restoring hardlinks.
This commit updates the tests but not the docs.
2008-09-01 04:54:29 +00:00
Tim Kientzle
c7715560f1
Sort the list of format names.
2008-09-01 02:50:53 +00:00
Tim Kientzle
e32c65cb17
Use the "start_time" (time at which the restore process began)
...
to fill in a missing atime instead of substituting mtime.
PR: bin/124915
2008-09-01 02:50:24 +00:00
Tim Kientzle
9ea6421090
New mtree writer, thanks to Joerg Sonnenberger.
...
Obtained from: Joerg Sonnenberger
2008-08-31 07:21:46 +00:00
Tim Kientzle
7584fa8aa4
Joerg Sonnenberger's improvements to the shar writer.
...
Significant performance improvements, better quoting of file names, etc.
2008-08-31 07:10:40 +00:00
Tim Kientzle
5dc843b27b
Make libarchive_test a little smarter about trying to find
...
its reference files when you don't specify -r. It now checks
a couple of likely nearby directories to see if any of them
have a particular known file.
2008-08-31 07:06:02 +00:00
Tim Kientzle
cec048ddf0
When atime wasn't specified, it should get set == mtime.
...
This is much stronger than just asserting that it's not zero.
2008-08-30 05:31:23 +00:00
Tim Kientzle
9cfec77e7e
If no atime was specified (for example, when extracting from ustar
...
archives), set atime == mtime. Before this, atime would get restored
to 0.
2008-08-28 06:40:22 +00:00
Tim Kientzle
39056f55e3
Alphabetize the list of tests.
2008-08-25 06:08:22 +00:00
Tim Kientzle
3269dc16fd
Update the total archive byte counters when writing entries to disk using
...
archive_write_disk.
Update cpio to use this to emit block counts in -p mode.
Update cpio tests to verify these block counts.
2008-08-24 06:21:00 +00:00
Tim Kientzle
a705ee2bcd
Remove the stillborn attempt to cleanup tests as well as the build dir.
2008-08-24 05:54:28 +00:00
Tim Kientzle
b9364a48e5
Fail copying path/.. only if SECURE_NODOTDOT was specified.
...
Since we already warn for any '..' elements in that case,
the extra "lastdotdot" tracking turns out to be unnecessary.
PR: bin/124924
2008-08-24 05:42:22 +00:00
Tim Kientzle
8d14bd8cc2
Fix the cpio bug tested for by r182092 of usr.bin/cpio/test.
...
Since various 'find' incantations can emit container directories
in various orders, we cannot refuse to update a dir because it's
apparently the same age.
MFC after: 3 days
2008-08-24 05:01:01 +00:00