Commit Graph

409 Commits

Author SHA1 Message Date
Stephane E. Potvin
04031e9ae2 Options spring cleanup:
- 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
2007-06-13 02:08:04 +00:00
Tim Kientzle
8b63161182 Don't lose leading '/' for pathnames exactly 101 bytes long.
Also, update the test harness to exercise this case.
2007-06-11 05:17:30 +00:00
Tim Kientzle
b48b40f1f8 libarchive 2.2.3
* "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.
2007-05-29 01:00:21 +00:00
Colin Percival
a30eadfc15 Replace "sizeof(struct bucket[cache_size])" with
"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
2007-05-22 15:37:58 +00:00
Colin Percival
3662c7b8ad Don't test for NULL when it is both unnecessary (the pointer is checked
against NULL when it is first allocated) and pointless (we've already
dereferenced the pointer several times).

Found by:	Coverity Prevent(tm)
CID:		3204
2007-05-21 04:45:24 +00:00
Colin Percival
51bbfbd15c Remove pointless code: Don't assign a value to a variable when we're
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)
2007-05-21 04:22:38 +00:00
Colin Percival
a7e2f06359 Don't forget to free a string allocated by strdup where necessary.
Found by:	Coverity Prevent
Coverity ID:	CID 3132
2007-05-19 05:09:09 +00:00
Colin Percival
9fbf190fc5 s/@VERSION@/@ARCHIVE_VERSION@/
This is a no-op as far as FreeBSD is concerned, but makes libarchive
more autoconf-friendly.

Approved by:	kientzle
2007-05-02 05:29:55 +00:00
Tim Kientzle
f1a870981d Fix a memory leak in the uname/gname lookup cache.
Thanks to: VMiklos
2007-04-20 15:32:13 +00:00
Colin Percival
6fc0ea8474 In libarchive: Downgrade ARCHIVE_FATAL and ARCHIVE_FAILED errors which
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
2007-04-16 04:04:50 +00:00
Tim Kientzle
2a5449a7ca Properly cleanup the UID/GID lookup data. 2007-04-15 04:43:12 +00:00
Tim Kientzle
1eb296a82c Don't free a NULL pointer. 2007-04-15 04:42:52 +00:00
Tim Kientzle
0c3e4592a6 Clean up a lot of memory leaks in the libarchive test harness. 2007-04-15 04:30:02 +00:00
Tim Kientzle
edddd60899 Thanks to Colin for catching my mixup. The original problem wasn't
suppressing the second error, it was failing to address the first.
2007-04-15 01:01:20 +00:00
Tim Kientzle
f912fb118f Consolidate numeric limit macros in one place; include them
only on platforms that need them.  FreeBSD doesn't.
2007-04-15 00:53:38 +00:00
Tim Kientzle
b723fe5b61 Pass through error message if any operation fails, not just the last one. 2007-04-14 22:49:37 +00:00
Tim Kientzle
37320c7575 Overhaul of 'ar' support:
* 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.
2007-04-14 22:34:10 +00:00
Tim Kientzle
a6487829da Invoke utime(2) properly. (It's only used on platforms
that lack utimes(2).)
2007-04-14 22:20:31 +00:00
Tim Kientzle
5d214a14ad Fix the build by temporarily disabling 'ar' support until
I can clean it up.
2007-04-14 18:24:42 +00:00
Tim Kientzle
fac89d2743 Fix the build.
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.
2007-04-14 08:42:50 +00:00
Tim Kientzle
22ff6c7af3 Fixes from Joerg Sonnenberger, reviewed by Kai Wang. 2007-04-14 08:30:21 +00:00
Tim Kientzle
015f35775b Conventionally, tar archives have always included a trailing '/'
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.
2007-04-14 08:20:31 +00:00
Tim Kientzle
76aa565c72 Portability: Don't use mkdtemp() when mkdir() will suffice.
If we can't create the dir, just give up.
2007-04-14 05:17:06 +00:00
Tim Kientzle
1df7aefccf More portability improvements from Martin Koeppe:
conditionally use utime() when utimes() is not available;
allow the most common wide-char functions to be replaced
when local alternatives are lacking.
2007-04-14 02:37:22 +00:00
Tim Kientzle
260c3399c8 Portability. 2007-04-13 16:07:25 +00:00
Tim Kientzle
da7bcba2e8 Now that libarchive is being built in more environments,
factor out the platform-specific configuration header a bit
more cleanly.
Suggested by: Joerg Sonnenberger
2007-04-12 04:44:21 +00:00
Tim Kientzle
782a032689 Make Lint happier. 2007-04-12 04:42:57 +00:00
Tim Kientzle
2db6c18909 Fix build on Solaris. 2007-04-07 19:35:02 +00:00
Tim Kientzle
94451fa8a0 Enable 'ar' support; hook it up to the build and
enable it with _read_support_format_all().
2007-04-07 05:54:23 +00:00
Tim Kientzle
06d581da80 Clarification: Point people to archive_read_data(), which
should be used instead of archive_read_data_into_buffer().
2007-04-07 05:53:11 +00:00
Colin Percival
e95f7ff4ee When copying data from one archive to another, only set the error
message in the reader to the error message from the writer if the
error which occurred was in the writer.  This avoids error messages
of "Empty error message" when extracting truncated archives.
2007-04-07 03:37:59 +00:00
Colin Percival
ceb38a3142 Move archive_read_data_into_buffer into archive_read.c, simplify its
implementation, and mark it as deprecated.  It will be removed entirely
in libarchive 3.0 (in FreeBSD 8.0?) but there's no reason for anyone to
use it instead of archive_read_data.

Approved by:	kientzle
2007-04-05 15:51:19 +00:00
Tim Kientzle
8c338614ac More corrections from Joerg Sonnenberger. 2007-04-05 05:22:13 +00:00
Tim Kientzle
fe95f8fde6 Style fixes from Joerg Sonnenberger: use correct types,
spell lint(1) comments correctly.
2007-04-05 05:20:13 +00:00
Tim Kientzle
72654d08e1 From Joerg Sonnenberger: Fix a number of style gaffes,
including type puns and avoidable casts.
2007-04-05 05:18:16 +00:00
Tim Kientzle
e44ad922b4 Wordsmithing. 2007-04-05 05:07:53 +00:00
Colin Percival
41948c2530 Parse SCHILY.dev and SCHILY.ino fields. These are ignored when extracting
files, but used during archive creation.  This change unbreaks
# tar -cf rcp.tar /bin/rcp
# tar -cf rcp-copy.tar @rcp.tar
# cmp rcp.tar rcp-copy.tar
2007-04-03 23:53:55 +00:00
Tim Kientzle
dedbe8ed70 'ar' format support for libarchive, contributed by Kai Wang. 2007-04-03 05:34:36 +00:00
Colin Percival
eeb83a6572 Now that there is always a compression-layer skip function available,
skip over the end-of-entry padding instead of reading and discarding
it.

Considering that tar files normally have a block size of 10kB, this
isn't likely to avoid reading any data, but at least it makes the code
simpler and clearer.
2007-04-02 04:21:22 +00:00
Tim Kientzle
7045ea1dde Fix type-punned pointer, minor style fixes.
Thanks to: Joerg Sonnenberger
2007-04-02 00:41:37 +00:00
Tim Kientzle
ce45c68d0c Remove unused variable; use consistent types.
Thanks to: Joerg Sonnenberger
2007-04-02 00:34:36 +00:00
Tim Kientzle
e086d708ff Be consistent: file flags are unsigned bitmaps.
Thanks to: Joerg Sonnenberger
2007-04-02 00:32:03 +00:00
Tim Kientzle
0acc551509 Don't compare a signed char to 0xFF.
Thanks to: Joerg Sonnenberger
2007-04-02 00:29:52 +00:00
Tim Kientzle
96e31e81ff Avoid a potential overflow when 'skip' is larger than a pointer.
Thanks to: Joerg Sonnenberger
2007-04-02 00:25:11 +00:00
Tim Kientzle
25d4e0e5ab Style fix: Use the correct type for 'bytes_to_write'.
Thanks to: Joerg Sonnenberger
2007-04-02 00:21:46 +00:00
Tim Kientzle
b94f39cecc Style: bare "unsigned" is deprecated, use "unsigned int" instead.
Thanks to: Joerg Sonnenberger
2007-04-02 00:15:45 +00:00
Tim Kientzle
7d71430110 Remove some unused fields from archive_read internal structure.
(Left over from when read and write used to share this structure.)
2007-04-02 00:11:54 +00:00
Colin Percival
5998aba99e Provide a dummy compression-layer skip function which just reads data and
discards it, for use when the compression layer code doesn't know how to
skip data (e.g., everything other than the "none" compressor).  This makes
format level code simpler because that code can now assume that the
compression layer always knows how to skip and will always skip exactly
the requested number of bytes.

Discussed with:	kientzle (3 months ago)
2007-03-31 22:59:43 +00:00
Tim Kientzle
e2d97e54d0 Notice when mkdir() fails.
Don't change permissions on an existing dir unless _EXTRACT_PERM
is requested.

In particular, bsdtar -x should not edit mode of existing dirs
now; bsdtar -xp will.
2007-03-24 05:02:16 +00:00
Tim Kientzle
7fa9cd7871 Fix compile error when libbz2 is unavailable. 2007-03-24 03:23:26 +00:00
Colin Percival
f2d18f3112 Don't forget to increment the raw_position (bytes written) counter, even
when operating in non-buffered mode.

Pointy hat to:	cperciva
MFC after:	3 days
2007-03-17 14:59:04 +00:00
Tim Kientzle
22976ba40a When ARCHIVE_EXTRACT_UNLINK is requested:
* Only try to remove the existing item if we're not restoring a directory.
  * If unlink fails, try rmdir next.
This should fix the broken --unlink option in bsdtar.

Thanks again to: Kris Kennaway, for beating up bsdtar on pointyhat.
2007-03-13 06:04:24 +00:00
Tim Kientzle
2304493774 Libarchive 2.0.23:
* The ACL formatter was mis-formatting entries which had a
     user/group ID but no name.  Make the parser tolerant of
     these, so that old archives can be correctly restored;
     fix the formatter to generate correct entries.
   * Fix overwrite detection by introducing a new "FAILED" return
     code that indicates the current entry cannot be continued
     but the archive as a whole is still sound.
   * Header cleanup:  Remove some unused headers, add some that
     are required with new Linux systems.
2007-03-11 10:29:52 +00:00
Tim Kientzle
d4c6c416dc New tests for system-independent ACL support.
These tests verify that archive_entry objects can store and return
ACL data and that pax format archives can read and write ACL
information.  These do not (yet) test that ACL data is read or
written to disk correctly.  (And hence would not have caught the
recent snafu about ACL read-from-disk being turned off.)
2007-03-08 06:09:27 +00:00
Tim Kientzle
19dd89364c Distinguish between the end of ACL data and an error in pulling
ACL data from the archive entry.  This doesn't impact
archive_read_extract or archive_write_disk since they only
check for != ARCHIVE_OK when calling this function.  (Though
they should be more careful.)
2007-03-08 06:07:07 +00:00
Tim Kientzle
f81da3e584 libarchive 2.0
* libarchive_test program exercises many of the core features
  * Refactored old "read_extract" into new "archive_write_disk", which
    uses archive_write methods to put entries onto disk.  In particular,
    you can now use archive_write_disk to create objects on disk
    without having an archive available.
  * Pushed some security checks from bsdtar down into libarchive, where
    they can be better optimized.
  * Rearchitected the logic for creating objects on disk to reduce
    the number of system calls.  Several common cases now use a
    minimum number of system calls.
  * Virtualized some internal interfaces to provide a clearer separation
    of read and write handling and make it simpler to override key
    methods.
  * New "empty" format reader.
  * Corrected return types (this ABI breakage required the "2.0" version bump)
  * Many bug fixes.
2007-03-03 07:37:37 +00:00
Tim Kientzle
03bb132ddc Force the umask to something predictable while creating objects
on disk.  In particular, this fixes tar -xp restore of mode bits.
2007-03-02 16:44:58 +00:00
Tim Kientzle
6fccc5ecd4 Because the buffer gets released immediately, I need to
copy the symlink target name, not just copy the reference.
This problem sometimes caused crashes when extracting
symlinks from ISO9660 images.

Thanks to: Diego "Flameeyes" Pettenò
2007-03-01 06:22:34 +00:00
Colin Percival
a16b1c1fd9 If (a == NULL), don't dereference (a) to record an error message. [1]
Fallout from changing the skip API to use off_t instead of size_t: Print
the skip length using %jd and cast to (intmax_t) instead of %d / (int),
and if ARCHIVE_API_VERSION >= 2, allow the client skipper to be called
for requests longer than SSIZE_MAX. [2]

Approved by:	kientzle
Pointy hats to:	kientzle [1], cperciva [2]
MFC after:	3 days
2007-02-05 16:30:40 +00:00
Tim Kientzle
a9490c597b Add support for a new archive format "empty" that reads empty files. 2007-02-01 06:18:17 +00:00
Tim Kientzle
2a53b50a2c Correct the int->text conversion. <sigh>
MFC after: 3 days
2007-01-13 03:30:14 +00:00
Tim Kientzle
63165a380d Fix the copyright notice; it was always intended to be
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
2007-01-09 08:05:56 +00:00
Tim Kientzle
435c077c33 Special case to support hard-coded configuration for building on Windows. 2007-01-07 21:32:25 +00:00
Colin Percival
a0b84e7498 Change the client skipper API to use off_t instead of size_t/ssize_t; but
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).
2007-01-05 10:48:18 +00:00
Colin Percival
3c3619cdad Convert compression_skip from taking a size_t skip length request and
returning the length skipped in a ssize_t to using off_t for both.  This
does not break any A[BP]Is, since compression_skip is entirely internal
to libarchive.

If a skip request is > SSIZE_MAX, don't pass it down to the client layer
skip function, since those still uses size_t / ssize_t.  Instead, just
read the data and throw it away.

With this commit, libarchive/bsdtar should now successfully skip archive
entries of >2GB on 32-bit systems, but does so slower than necessary.
The performance will improve with a future A[BP]I breaking commit which
makes client layer skip functions use off_t.

Discussed with:	kientzle
MFC after:	1 week
2007-01-04 12:45:00 +00:00
Colin Percival
b1fa343fae Rewrite and simplify archive_read_format_tar_skip. Compression-layer skip
functions are required to skip the requested distance, so we can avoid
lots of bookkeeping which would otherwise be necessary.

Reviewed by:	kientzle
MFC after:	1 week
2007-01-03 21:47:35 +00:00
Colin Percival
29d7c2fce5 Quiet a compiler warning where (off_t + size_t) has a different sign
from (off_t).

Submitted by:	delphij
2007-01-03 20:01:44 +00:00
Colin Percival
dbc258608e Insert zero-padding between sparse blocks in archive_read_data(). This
fixes "tar -c @foo.tar" where "foo.tar" contains sparse entries.

MFC after:	1 week
2007-01-03 13:16:59 +00:00
Colin Percival
9d8f7dccb3 Correct spelling of "accommodate", "guarantee", "guaranteed", "guard",
"return", "ridiculous", and "success".

MFC after:	3 days
2006-12-28 05:21:48 +00:00
Tim Kientzle
0a4794d3a4 Minor refactoring; move the FreeBSD-specific config info into
config_freebsd.h.  archive_platform.h decides which config file
to bring in and uses some of those selectors to define wrapper
macros and other compatibility glue.
2006-12-08 06:13:49 +00:00
Tim Kientzle
5af1711729 Argh. Restore a stat() call that was erroneously removed.
Thanks to: WATANABE, Kazuo
Pointy hat: me, from the handy dispenser I keep nearby.
2006-12-04 08:01:53 +00:00
Tim Kientzle
a6fac34b43 Improve support for large ISOs:
* Correct a signed/unsigned problem that broke handling of files >2G.
   * Implement "skip" support for much faster "tar -t".

Thanks to: Robert Sciuk for sending me a DVD that illustrated the first problem
2006-11-27 16:30:32 +00:00
Tim Kientzle
24d698ea89 Bump the libarchive version number, correct the shell hackery to break
the full version down into major/minor values.
2006-11-26 19:09:42 +00:00
Tim Kientzle
dc46be1cbf Write-blocking cleanup, largely thanks to Colin Percival (cperciva@).
* If write block size is zero, don't block at all.
     This supports the unusual requirement of applications
     that need "no-delay" writes.
   * Expose _write_finish_entry() to give such applications more
     control over write boundaries.  (Normal applications do not
     need this, as entries are completed automatically.)
   * Correct the type of write callbacks; this is a minor API
     change that does not affect the ABI.
   * Correct the error handling in _write_next_header() around
     completing the previous entry.
   * Correct the documentation for block-size markers:  Remove
     docs for the long-defunct _read_set_block_size(); document
     all of the write block size manipulators.

MFC after: 14 days
2006-11-26 19:00:50 +00:00
Tim Kientzle
43baed1581 Unbreak libarchive on arm. Two parts of libarchive relied on a
traditional shortcut of defining on-disk layouts using structures of
character arrays. Unfortunately, as recently discussed on cvs-all@,
this usage is not actually sanctioned by the standards and
specifically fails on GCC/arm (unless your data structures happen to
be "naturally aligned").

The new code defines offsets/sizes for data fields and accesses
them using explicit pointer arithmetic, instead of casting to
a structure and accessing structure fields.  In particular,
the new code is now clean with WARNS=6 on arm.

MFC after: 14 days
2006-11-26 05:39:28 +00:00
Tim Kientzle
97fc4d2db7 Connect four new files to the build.
PR: bin/86742
2006-11-24 16:35:54 +00:00
Tim Kientzle
6770b130f1 Fill in a couple of missing casts: clarify one narrowing conversion
and correct the use of unary minus with an unsigned value.  (The unary
minus here is actually being used as a bitwise operation, which is
unusual enough to deserve a clarifying cast.)
2006-11-24 05:48:04 +00:00
Tim Kientzle
4f27e91611 A few minor clarifications and corrections. 2006-11-24 05:41:16 +00:00
Tim Kientzle
b4e244d1a3 A few minor corrections to the libarchive.3 overview page. 2006-11-24 05:37:38 +00:00
Tim Kientzle
73a2505465 Document the new _open_FILE() and _open_memory() interfaces.
PR: bin/86742
2006-11-24 05:34:23 +00:00
Tim Kientzle
13e2d5bcd5 New hooks for reading/writing archives to/from a FILE * or
an in-memory buffer.

PR: bin/86742
2006-11-24 02:00:48 +00:00
Tim Kientzle
af6513d3ea Officially rename archive_{read,write}_open_file() to
archive_{read,write}_open_filename():
   * Update Makefile to build the files using the new name.
   * Update docs to document the new names, mentioning the
old ones as "deprecated synonyms."
   * The old filenames will be reconnected to the build soon;
I'll soon recyce those files for a slightly different purpose.
2006-11-20 16:48:04 +00:00
Tim Kientzle
5468bdb0da Add archive_write_open_filename()/archive_read_open_filename() as
synonyms for archive_write_open_file()/archive_read_open_file().
The new names are much clearer.
2006-11-15 05:33:38 +00:00
Tim Kientzle
38c56af195 Style: Use the correct type for a sizeof() variable. 2006-11-15 05:20:14 +00:00
Tim Kientzle
ca743d5c67 Change the internal API for writing data to an entry; make the
internal format-specific functions return the same as the public
function, so that the public API layer doesn't have to guess the
correct return value.  This addresses an obscure problem that occurs
when someone tries to write more data than the size of the entry (as
indicated in the entry header).  In this case, the return value from
archive_write_data() was incorrect, reflecting the requested write
rather than the amount actually written.

MFC after: 15 days
2006-11-15 05:14:20 +00:00
Tim Kientzle
fb1856eabd No change in functionality, but fill in a missing error
message when reading a truncated tar archive.
2006-11-13 16:50:18 +00:00
Tim Kientzle
71f3ec709d These files no longer use internal APIs, so no longer need to include
archive_private.h.
2006-11-13 00:29:57 +00:00
Tim Kientzle
b2ba9b4e04 Minor cleanup of the standard read/write I/O modules:
* 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
2006-11-13 00:26:45 +00:00
Tim Kientzle
c3b11d8213 Correctly handle writing very large blocks (>1M) through to a disk
file.  This doesn't happen in normal use, because the file I/O and
decompression layers only pass through smaller blocks.  It can happen
with custom read functions that block I/O in larger blocks.
2006-11-12 23:45:40 +00:00
Tim Kientzle
aa1eeda578 Portability and style fixes:
* 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.  ;-)
2006-11-10 06:39:46 +00:00
Simon L. B. Nielsen
91c158a34e Fix infinite loop in corrupt archives handling in libarchive(3).
Reported by:	rink
Submitted by:	kientzle
Security:	FreeBSD-SA-06:24.libarchive
2006-11-08 14:03:50 +00:00
Tim Kientzle
8a4b2112a2 Eliminate documentation references to a non-existent function. 2006-11-06 00:28:46 +00:00
Tim Kientzle
a2b1e869b7 Computing SHLIB_MAJOR is not a good idea. It's really a FreeBSD
system value that has no real relation to the libarchive version.
(Except, of course, that any ABI breakage will force both to be
incremented.)
2006-11-06 00:24:57 +00:00
Tim Kientzle
a5261c3117 Remove an unused declaration. 2006-11-06 00:16:40 +00:00
Tim Kientzle
011a0a0432 Performance: If the dir mode requested is "reasonable", then just
restore it directly and skip chmod() during the post-extract fixup.
In particular, bsdtar -xm now completely skips the post-extract fixup
for directories, which produces a noticable speedup in that case.
2006-10-04 02:08:04 +00:00
Ruslan Ermilov
a73a3ab56b Markup fixes. 2006-09-17 21:27:35 +00:00
Tim Kientzle
c12a9d810e Some minor corrections:
* Expose functions for setting the "skip file" dev/ino information
  * Expose functions for setting/querying the block size on reads
  * Correctly propagate errors out of archive_read_close/archive_write_close
  * Update manpage with information about new functions
2006-09-05 05:59:46 +00:00
Tim Kientzle
02a97525ef When skipping data, track the position in the bytestream correctly.
Without this, tar -r breaks badly; new entries overwrite the
middle of the archive instead of being added at the end.

Thanks to: Chris Spiegel
2006-08-29 04:59:25 +00:00
Tim Kientzle
225ade520e If skip_file_dev and skip_file_ino haven't been set (are still == 0),
then don't use them for testing for a recursive add.

Thanks to: Spencer Minear
MFC after: 7 days
2006-08-01 05:31:29 +00:00
Tim Kientzle
4dabd2811a Conditionally include sys/mkdev.h on platforms (such as Solaris) that need it.
Thanks to: VMiklos
2006-07-30 18:33:20 +00:00