This change introduces support for building on AIX via CMake. `gcc`
warning options are mapped to equivalent options in the `xlc` suite
where possible. The compiler is overridden to be `xlc_r` instead of
`cc` for thread-safe compilation and linking.
Signed-off-by: Eric N. Vander Weele <ericvw@gmail.com>
Tim Kientzle [Sun, 3 Apr 2016 18:03:22 +0000 (11:03 -0700)]
Issue 550: Fix out-of-bounds read in mtree.
The mtree parser scanned from the end of the string to identify
the filename when the filename is the last element of the line.
If the filename was the entire line, the logic would scan back
to before the start of the string.
The revised logic scans from the beginning of the string
and remembers the last separator position to locate the
trailing filename.
Andrew Gregory [Fri, 15 Jan 2016 07:39:41 +0000 (02:39 -0500)]
Skip root directory symlink check
The first time check_symlinks is called on an absolute path it will use
the entry pathname directly, blanking the leading slash. This leads to
calling lstat on an empty string, which returns ENOENT, terminating the
loop early and falsely marking the path as safe.
Andrew Gregory [Fri, 15 Jan 2016 07:40:00 +0000 (02:40 -0500)]
Restore modified path after lstat
check_symlinks is intended to check each component of a path, but failed
to restore the stripped trailing components after each iteration,
leaving a NUL byte in the middle of the path.
Tim Kientzle [Sun, 21 Feb 2016 20:34:57 +0000 (12:34 -0800)]
Fix for issue #623.
Apparently, people have come to expect that the following
is sufficient to get bit-for-bit identical output from tar:
* Same filenames
* Same contents
* Same uid, gid
* Same mtime (forced via "touch -t <timestamp>")
* Sorting entries
Bsdtar's "restricted pax" format violated this by including
ctime, atime, and birthtime (which are not updated by
'touch -t). So we should only emit those additional time
values in the full pax format.
People who are really serious about generating bit-for-bit
identical archives should really build their own command-line
interface: You can still use libarchive to build the output,
but your custom CLI could sort the entries and strip everything
except a bare minimum of basic metadata.
Dynamically determine supported compiler flags during configure
Some compilers (e.g., `xlc` on AIX) don't support GCC compiler flags.
This change dynamically tests for supported `COMMON_FLAGS`, which get
appended to `CFLAGS`.
Signed-off-by: Eric N. Vander Weele <ericvw@gmail.com>
Tim Kientzle [Sun, 14 Feb 2016 05:52:24 +0000 (21:52 -0800)]
Issue #659: Fix xar parsing of archives with appleextended ACLs
The parser treated the <appleextended> tag as both known and
unknown, leaving the parser in a state that prevented it
from reading any further attributes. Depending on the
order of attributes, this could result in a file with no
name, for instance.
Nate Rosenblum [Fri, 5 Feb 2016 17:15:14 +0000 (09:15 -0800)]
Make assertions explicit in sparse tests
Instead of trying to special-case sparse data vs dense data detection
in verify_sparse_file (by resetting the `data_blocks` if no holes are
found), make the expected number of data blocks an explicit parameter.
Simplifies a subsequently introduced test case; no functional changes.
Nate Rosenblum [Fri, 5 Feb 2016 14:28:58 +0000 (06:28 -0800)]
Fix sparse tests with holes at the end
Sparse file creation in test_sparse_basic failed to create holes at
the end of files. These tests don't presently verify the existence of
holes at the end (they are concerned only with the sparse data block
entries), but this change ensures that the input file matches the
expected hole/data layout.
Tim Kientzle [Mon, 1 Feb 2016 05:43:23 +0000 (21:43 -0800)]
Read very large RAR headers incrementally
Formerly, libarchive tried to read the entire header into
memory at once, which created problems for malformed RAR
files with 4GB header sizes. This was causing occasional
crashes of the test suite on memory-limited systems.
Tim Kientzle [Tue, 19 Jan 2016 13:32:56 +0000 (05:32 -0800)]
Fix nettle library probe
= Only use it if we can find the library *and* the headers
= When probing the library, try to link a function that's
actually in the library (not 'main')
Sean Farley [Sun, 3 Jan 2016 21:42:00 +0000 (16:42 -0500)]
Apply global flag in substitution
Add loop to move through a path name looking for additional matches if
the global flag is provided for a substitution. The loop breaks when no
more matches are found for the rule. Previously, the global flag would
end up advancing to the next rule instead of searching farther into the
path for another match.