842 Commits
Author SHA1 Message Date
Martin Matuska be3e97ea86 bsdtar tests: add test_option_fflags 2017-02-26 01:39:08 +01:00
Martin Matuska 077245ae42 bsdtar manpage: be more precise what -p and --no-same-permissions does 2017-02-25 22:37:48 +01:00
Martin Matuska e46e8511f0 Do not archive NFSv4 ACLs on Mac OS X by default.
This avoids wrtiting ACLs to tar files twice. Preferred method is
via copyfile(3) (tar option --mac-metadata). If user wants to create
archives with portable NFSv4 ACLs only (SCHILY.acl.ace header with no
GUID data) the --acls and --no-mac-metadata options must be specified
on the command line.

In the manual page be more specific which types of ACLs are stored
with --acls and --mac-metadata options.
2017-02-24 03:19:50 +01:00
Martin Matuska 6127a37e01 tar: add new options to allow fine-tuning of --preserve-permissions
Allow enabling and disabling reading or writing of:
Access Control Lists (--acls, --no-acls)
Extended file flags (--fflags, --no-fflags)
Extended attributes (--xattrs, --no-xattrs)
Mac OS X metadata in AppleDouble (--mac-metadata, --no-mac-metadata)

Make --disable-copyfile an alias to --no-mac-metadata.
2017-02-24 02:19:28 +01:00
Martin Matuska 6a9dcf9fc4 tar: use option_flags bitfield for boolean options 2017-02-23 00:28:20 +01:00
Martin Matuska 52d5a14c21 test suite: use a single main test file for all tests 2017-02-21 21:10:49 +01:00
Pavel Raiskup 47ac1b5306 testsuite: allow 'dev' in version 2017-02-21 06:16:13 +01:00
Tim Kientzle cdd5f10188 Correctly report 0 compression when nothing has yet been written. 2017-02-18 19:55:21 -08:00
ngie 787a16d619 Merge branch 'master' into tar-coverity-fixes 2017-01-16 18:14:31 -08:00
Alexander Pyhalov 0f64fb3813 Fix two tests on Solaris if compiling with -m64 2017-01-15 02:28:58 +01:00
Martin Matuska 1e07342e86 Use uid 18 instead of 17 for test_option_uid_uname
Uid 17 is assigned on Solaris
2017-01-12 16:12:01 +01:00
Joerg Sonnenberger d7e5cbde87 Compute correct size for buffer. Avoid recomputation of lengths.
Based on Coverity reports from pull request #844.
2016-12-18 11:55:30 +01:00
Joerg Sonnenberger 7f6565656c Allocate memory precisely. Avoid recomputions of sizes.
Based on Coverity report from pull request #844.
2016-12-18 11:50:10 +01:00
Ngie Cooper 6f58462f7a Use malloc + sprintf instead of malloc + strncpy + strcpy
This will mute a `BUFFER_SIZE` complaint from Coverity and
simplifies the code.

Reported by:    Coverity
CID:            1009672-1009674
2016-12-13 20:09:36 -08:00
Ngie Cooper b7b12fad8d In the event the heap allocation fails after a successful allocation,
restore fmtbuff back to fmtbuff_stack, per the intent of the else
condition

Otherwise, there's a chance that fmtbuff used after the mbtowc call
is using an invalid buffer, as fmtbuff_heap has been already free'd.

Reported by:	Coverity
CID:		1006126
2016-12-13 20:05:58 -08:00
Tim Kientzle 54546be8a7 Merge pull request #807 from csanchezdll/issue696
Issue 696: ppc64le mache ckech failure
2016-12-11 09:09:21 -08:00
Ngie Cooper 8420751b23 Free testprog_ustar when done
Reported by:	Coverity
CID:		1355330
2016-12-10 17:16:46 -08:00
Ngie Cooper 067829f98b Free p (the memory allocated via slurpfile) when done with the contents
Reported by:	Coverity
CID:		1331627-1331630, 1355332, 1331634-1331645, 1331647, 1355331
2016-12-10 17:15:46 -08:00
Ngie Cooper 242f510fb0 Don't leak memory if returning from
assertion_file_contains_lines_any_order(..) early

Free memory consistently at the bottom of the function

Reported by:	Coverity
CID:		1331678
2016-12-10 16:32:16 -08:00
Ngie Cooper f1b1881dfe Don't leak the file descriptor pointed to by in if the first call to
fgets fails.

Reported by:	Coverity
CID:		1331677
2016-12-10 16:24:35 -08:00
Ngie Cooper e085430942 Don't overrun tmpdir buffer with sprintf
If progname is sufficiently large enough, it would overflow the `tmpdir`
buffer, causing an illegal memory access

Reported by:	Coverity
CID:	1331594
2016-12-10 16:22:10 -08:00
Ngie Cooper b7caec3e4c Increase the size of buff by 1 and adjust the readlink(2) call to
subtract the buffer len by 1 to account for the needed space for a
NUL terminator, as readlink isn't guaranteed to provide one

Reported by:	Coverity
CID:		1331293, 1332105
2016-12-10 16:15:18 -08:00
Graham Percival fa8dc4e93c Spelling fixes (#830)
* Spelling: previos -> previous

Sponsored by:	Tarsnap Backup Inc.

* Spelling: Preparre -> Prepare

Sponsored by:	Tarsnap Backup Inc.

* Spelling: Invalide -> Invalid

Sponsored by:	Tarsnap Backup Inc.

* Spelling: leagal -> legal

Sponsored by:	Tarsnap Backup Inc.

* Spelling: lengthe -> length

Sponsored by:	Tarsnap Backup Inc.

* Spelling: cotents -> contents

Sponsored by:	Tarsnap Backup Inc.

* Spelling: travesal -> traversal

Sponsored by:	Tarsnap Backup Inc.

* Spelling: functinos -> functions

Sponsored by:	Tarsnap Backup Inc.

* Spelling: particluar -> particular

Sponsored by:	Tarsnap Backup Inc.

* Spelling: uncapable -> incapable

Sponsored by:	Tarsnap Backup Inc.
2016-11-30 22:46:10 +01:00
Martin Matuska 256e52f073 Fix extracting hardlinks over symlinks
Closes #821
2016-11-29 22:34:07 +01:00
Tim Kientzle 92f9e74c00 Clarify some skipping messages 2016-10-23 20:10:57 -07:00
Tim Kientzle a7e130aa32 Make test output more verbose on Windows 2016-10-23 16:23:04 -07:00
Tim Kientzle b960225b84 Sync up the test harnesses, fix an "unused var" warning on Windows 2016-10-23 15:21:59 -07:00
Carlos Sánchez de La Lama b63fd0d96b Issue 696: ppc64le mache ckech failure
This issue is not ppc64le specific. I have experienced on my
4.4.22-gnu #1 SMP 1 i686 GNU/Linux. Might be dependant on kernel
version and/or machine load. POSIX says errors after posix_spawnp
returns can be signaled by child exitting with an 127 exit code.
2016-10-19 12:17:32 +02:00
Martin Matuska a217773968 Add test case for issue #794 2016-10-12 12:19:44 +02:00
Tim Kientzle a625b42f51 Issue #801: close the file descriptor when testing link counts
Thanks to Ed Maste for reporting this leak.
Found by: Coverity
2016-10-11 18:38:44 -07:00
Martin Matuska 024be27d1b Properly free and close when exiting write_hierarchy() on failed
archive_read_next_header2().

Fixes #794
2016-10-04 12:13:46 +02:00
Graham Percival 6d3ba9c0a0 Initialize subst rule->result pointer to NULL
This is not directly useful in libarchive at the present time, but
it might be in the future.  If a project which uses this code adds
an atexit(3) handler to clean up memory, and somebody runs:
    bsdtar somestring -t
then "omestring" will be interpreted as an (invalid) substitution
rule and call lafe_errc().  However, if the atexit() handler then
calls cleanup_substition(), it will try to free(rule->result)
which was not initialized.

Sponsored by:	Tarsnap Backup Inc.
2016-09-28 11:02:34 -07:00
Tim Kientzle c251dca85a Merge pull request #787 from praiskup/fix-umask
tests: fix testsuite for umask issues
2016-09-28 06:30:51 -07:00
Graham Percival 2623110256 Add chmod() after make_{dir,file} in test suites
This is the same change that
    38b3f516df
made to
    libarchive/test/main.c
, but now applied to:
    cat/test/main.c
    cpio/test/main.c
    tar/test/main.c

Sponsored by:	Tarsnap Backup Inc.
2016-09-26 12:50:29 -07:00
Graham Percival 0f14b0816b Add and use assertion_file_mode() in other tests
This adds the assertion_file_mode() function from
    libarchive/test/main.c
and applies it to
    cat/test/main.c
    cpio/test/main.c
    tar/test/main.c

Sponsored by:	Tarsnap Backup Inc.
2016-09-26 12:44:56 -07:00
Pavel Raiskup d9f50c7e57 tests: fix testsuite for umask issues
Reproducible with umask 0077.

Resolves: #782
2016-09-26 12:57:38 +02:00
Tim Kientzle e37b620fe8 Issue #767: Buffer overflow printing a filename
The safe_fprintf function attempts to ensure clean output for an
arbitrary sequence of bytes by doing a trial conversion of the
multibyte characters to wide characters -- if the resulting wide
character is printable then we pass through the corresponding bytes
unaltered, otherwise, we convert them to C-style ASCII escapes.

The stack trace in Issue #767 suggest that the 20-byte buffer
was getting overflowed trying to format a non-printable multibyte
character.  This should only happen if there is a valid multibyte
character of more than 5 bytes that was unprintable.  (Each byte
would get expanded to a four-charcter octal-style escape of the form
"\123" resulting in >20 characters for the >5 byte multibyte character.)

I've not been able to reproduce this, but have expanded the conversion
buffer to 128 bytes on the belief that no multibyte character set
has a single character of more than 32 bytes.
2016-08-21 10:57:20 -07:00
Tim Kientzle daf8a7bb54 Issue 720: Allow dashes in third-party version numbers 2016-07-20 20:27:45 -07:00
tpg 7774558308 add GNU compatible blocking-factor alias, add cpio long alias for dereference 2016-06-29 21:04:08 +02:00
Tim Kientzle 83c3e2e675 Issue 657: Allow up to 8k for the test root directory name 2016-06-02 20:17:13 -07:00
Tim Kientzle ba20a8b3b9 Issue 708: tar should fail if a named input file is missing
Tar was exiting with success if an input file named on the command
line was not present.

Includes tests for both bsdtar and bsdcpio to ensure this does
not regress.
2016-05-28 12:39:18 -07:00
Tim Kientzle 98ab8fb22a Sync up test harnesses 2016-04-29 21:49:34 -07:00
Tim Kientzle ebc67c17de Issue 695: check fwrite return value, sync up test harnesses 2016-04-28 19:44:20 -07:00
Tim Kientzle c917762d6d Issue 693: assert() wants a boolean, not a pointer 2016-04-27 23:27:43 -07:00
Tim Kientzle 4aede611b9 Issue 685: Just verify the body of the error message; ignore the program name 2016-04-27 23:05:19 -07:00
Tim Kientzle 8019776e5b Manpage updates 2016-04-10 18:32:13 -07:00
Bjoern Jacke 260ac70760 add vv option details in bsdtar man page 2016-02-05 17:53:53 +01:00
Bjoern Jacke 220d587cd6 bsdtar: add support for "vv" verbose style when writing archives 2016-02-05 17:53:53 +01:00
Bjoern Jacke f120226b1b bsdtar: also print preceding "x" when extracting in vv mode 2016-02-05 17:53:53 +01:00
Bjoern Jacke b1be9dd82b bsdtar: move list_item_verbose() into common util.c 2016-02-05 17:53:53 +01:00