Qt/QML edition

This commit is contained in:
Floris Bos 2020-03-04 16:55:40 +01:00
commit d7b361ba44
2168 changed files with 721948 additions and 0 deletions

View file

@ -0,0 +1,323 @@
############################################
#
# How to build libarchive_test
#
############################################
IF(ENABLE_TEST)
SET(libarchive_test_SOURCES
../../test_utils/test_utils.c
../../test_utils/test_main.c
read_open_memory.c
test.h
test_acl_nfs4.c
test_acl_pax.c
test_acl_platform_nfs4.c
test_acl_platform_posix1e.c
test_acl_posix1e.c
test_acl_text.c
test_archive_api_feature.c
test_archive_clear_error.c
test_archive_cmdline.c
test_archive_digest.c
test_archive_getdate.c
test_archive_match_owner.c
test_archive_match_path.c
test_archive_match_time.c
test_archive_pathmatch.c
test_archive_read_add_passphrase.c
test_archive_read_close_twice.c
test_archive_read_close_twice_open_fd.c
test_archive_read_close_twice_open_filename.c
test_archive_read_multiple_data_objects.c
test_archive_read_next_header_empty.c
test_archive_read_next_header_raw.c
test_archive_read_open2.c
test_archive_read_set_filter_option.c
test_archive_read_set_format_option.c
test_archive_read_set_option.c
test_archive_read_set_options.c
test_archive_read_support.c
test_archive_set_error.c
test_archive_string.c
test_archive_string_conversion.c
test_archive_write_add_filter_by_name.c
test_archive_write_set_filter_option.c
test_archive_write_set_format_by_name.c
test_archive_write_set_format_filter_by_ext.c
test_archive_write_set_format_option.c
test_archive_write_set_option.c
test_archive_write_set_options.c
test_archive_write_set_passphrase.c
test_bad_fd.c
test_compat_bzip2.c
test_compat_cpio.c
test_compat_gtar.c
test_compat_gzip.c
test_compat_lz4.c
test_compat_lzip.c
test_compat_lzma.c
test_compat_lzop.c
test_compat_mac.c
test_compat_perl_archive_tar.c
test_compat_plexus_archiver_tar.c
test_compat_solaris_pax_sparse.c
test_compat_solaris_tar_acl.c
test_compat_star_acl.c
test_compat_tar_hardlink.c
test_compat_uudecode.c
test_compat_uudecode_large.c
test_compat_xz.c
test_compat_zip.c
test_compat_zstd.c
test_empty_write.c
test_entry.c
test_entry_strmode.c
test_extattr_freebsd.c
test_filter_count.c
test_fuzz.c
test_gnutar_filename_encoding.c
test_link_resolver.c
test_open_failure.c
test_open_fd.c
test_open_file.c
test_open_filename.c
test_pax_filename_encoding.c
test_pax_xattr_header.c
test_read_data_large.c
test_read_disk.c
test_read_disk_directory_traversals.c
test_read_disk_entry_from_file.c
test_read_extract.c
test_read_file_nonexistent.c
test_read_filter_compress.c
test_read_filter_grzip.c
test_read_filter_lrzip.c
test_read_filter_lzop.c
test_read_filter_lzop_multiple_parts.c
test_read_filter_program.c
test_read_filter_program_signature.c
test_read_filter_uudecode.c
test_read_format_7zip.c
test_read_format_7zip_encryption_data.c
test_read_format_7zip_encryption_header.c
test_read_format_7zip_encryption_partially.c
test_read_format_7zip_malformed.c
test_read_format_7zip_packinfo_digests.c
test_read_format_ar.c
test_read_format_cab.c
test_read_format_cab_filename.c
test_read_format_cpio_afio.c
test_read_format_cpio_bin.c
test_read_format_cpio_bin_Z.c
test_read_format_cpio_bin_be.c
test_read_format_cpio_bin_bz2.c
test_read_format_cpio_bin_gz.c
test_read_format_cpio_bin_le.c
test_read_format_cpio_bin_lzip.c
test_read_format_cpio_bin_lzma.c
test_read_format_cpio_bin_xz.c
test_read_format_cpio_filename.c
test_read_format_cpio_odc.c
test_read_format_cpio_svr4_bzip2_rpm.c
test_read_format_cpio_svr4_gzip.c
test_read_format_cpio_svr4_gzip_rpm.c
test_read_format_cpio_svr4c_Z.c
test_read_format_empty.c
test_read_format_gtar_filename.c
test_read_format_gtar_gz.c
test_read_format_gtar_lzma.c
test_read_format_gtar_sparse.c
test_read_format_gtar_sparse_skip_entry.c
test_read_format_iso_Z.c
test_read_format_iso_multi_extent.c
test_read_format_iso_xorriso.c
test_read_format_isojoliet_bz2.c
test_read_format_isojoliet_long.c
test_read_format_isojoliet_rr.c
test_read_format_isojoliet_versioned.c
test_read_format_isorr_bz2.c
test_read_format_isorr_ce.c
test_read_format_isorr_new_bz2.c
test_read_format_isorr_rr_moved.c
test_read_format_isozisofs_bz2.c
test_read_format_lha.c
test_read_format_lha_bugfix_0.c
test_read_format_lha_filename.c
test_read_format_lha_filename_utf16.c
test_read_format_mtree.c
test_read_format_mtree_crash747.c
test_read_format_pax_bz2.c
test_read_format_rar.c
test_read_format_rar_encryption_data.c
test_read_format_rar_encryption_header.c
test_read_format_rar_encryption_partially.c
test_read_format_rar_invalid1.c
test_read_format_rar5.c
test_read_format_raw.c
test_read_format_tar.c
test_read_format_tar_concatenated.c
test_read_format_tar_empty_filename.c
test_read_format_tar_empty_with_gnulabel.c
test_read_format_tar_empty_pax.c
test_read_format_tar_filename.c
test_read_format_tbz.c
test_read_format_tgz.c
test_read_format_tlz.c
test_read_format_txz.c
test_read_format_tz.c
test_read_format_ustar_filename.c
test_read_format_warc.c
test_read_format_xar.c
test_read_format_zip.c
test_read_format_zip_7075_utf8_paths.c
test_read_format_zip_comment_stored.c
test_read_format_zip_encryption_data.c
test_read_format_zip_encryption_header.c
test_read_format_zip_encryption_partially.c
test_read_format_zip_extra_padding.c
test_read_format_zip_filename.c
test_read_format_zip_high_compression.c
test_read_format_zip_jar.c
test_read_format_zip_mac_metadata.c
test_read_format_zip_malformed.c
test_read_format_zip_msdos.c
test_read_format_zip_nested.c
test_read_format_zip_nofiletype.c
test_read_format_zip_padded.c
test_read_format_zip_sfx.c
test_read_format_zip_traditional_encryption_data.c
test_read_format_zip_winzip_aes.c
test_read_format_zip_winzip_aes_large.c
test_read_format_zip_zip64.c
test_read_format_zip_with_invalid_traditional_eocd.c
test_read_large.c
test_read_pax_schily_xattr.c
test_read_pax_truncated.c
test_read_position.c
test_read_set_format.c
test_read_too_many_filters.c
test_read_truncated.c
test_read_truncated_filter.c
test_sparse_basic.c
test_tar_filenames.c
test_tar_large.c
test_ustar_filename_encoding.c
test_ustar_filenames.c
test_warn_missing_hardlink_target.c
test_write_disk.c
test_write_disk_appledouble.c
test_write_disk_failures.c
test_write_disk_hardlink.c
test_write_disk_hfs_compression.c
test_write_disk_lookup.c
test_write_disk_mac_metadata.c
test_write_disk_no_hfs_compression.c
test_write_disk_perms.c
test_write_disk_secure.c
test_write_disk_secure744.c
test_write_disk_secure745.c
test_write_disk_secure746.c
test_write_disk_sparse.c
test_write_disk_symlink.c
test_write_disk_times.c
test_write_filter_b64encode.c
test_write_filter_bzip2.c
test_write_filter_compress.c
test_write_filter_gzip.c
test_write_filter_gzip_timestamp.c
test_write_filter_lrzip.c
test_write_filter_lz4.c
test_write_filter_lzip.c
test_write_filter_lzma.c
test_write_filter_lzop.c
test_write_filter_program.c
test_write_filter_uuencode.c
test_write_filter_xz.c
test_write_filter_zstd.c
test_write_format_7zip.c
test_write_format_7zip_empty.c
test_write_format_7zip_large.c
test_write_format_ar.c
test_write_format_cpio.c
test_write_format_cpio_empty.c
test_write_format_cpio_newc.c
test_write_format_cpio_odc.c
test_write_format_gnutar.c
test_write_format_gnutar_filenames.c
test_write_format_iso9660.c
test_write_format_iso9660_boot.c
test_write_format_iso9660_empty.c
test_write_format_iso9660_filename.c
test_write_format_iso9660_zisofs.c
test_write_format_mtree.c
test_write_format_mtree_absolute_path.c
test_write_format_mtree_classic.c
test_write_format_mtree_classic_indent.c
test_write_format_mtree_fflags.c
test_write_format_mtree_no_separator.c
test_write_format_mtree_quoted_filename.c
test_write_format_pax.c
test_write_format_raw.c
test_write_format_raw_b64.c
test_write_format_shar_empty.c
test_write_format_tar.c
test_write_format_tar_empty.c
test_write_format_tar_sparse.c
test_write_format_tar_ustar.c
test_write_format_tar_v7tar.c
test_write_format_warc.c
test_write_format_warc_empty.c
test_write_format_xar.c
test_write_format_xar_empty.c
test_write_format_zip.c
test_write_format_zip_compression_store.c
test_write_format_zip_empty.c
test_write_format_zip_empty_zip64.c
test_write_format_zip_file.c
test_write_format_zip_file_zip64.c
test_write_format_zip_large.c
test_write_format_zip_zip64.c
test_write_open_memory.c
test_write_read_format_zip.c
test_xattr_platform.c
test_zip_filename_encoding.c
)
#
# Register target
#
ADD_EXECUTABLE(libarchive_test ${libarchive_test_SOURCES})
TARGET_LINK_LIBRARIES(libarchive_test archive_static ${ADDITIONAL_LIBS})
SET_PROPERTY(TARGET libarchive_test PROPERTY COMPILE_DEFINITIONS
LIBARCHIVE_STATIC LIST_H)
#
# Generate list.h by grepping DEFINE_TEST() lines out of the C sources.
#
GENERATE_LIST_H(${CMAKE_CURRENT_BINARY_DIR}/list.h
${CMAKE_CURRENT_LIST_FILE} ${libarchive_test_SOURCES})
SET_PROPERTY(DIRECTORY APPEND PROPERTY INCLUDE_DIRECTORIES
${CMAKE_CURRENT_BINARY_DIR})
# list.h has a line DEFINE_TEST(testname) for every
# test. We can use that to define the tests for cmake by
# defining a DEFINE_TEST macro and reading list.h in.
MACRO (DEFINE_TEST _testname)
ADD_TEST(
NAME libarchive_${_testname}
COMMAND libarchive_test -vv
-r ${CMAKE_CURRENT_SOURCE_DIR}
${_testname})
ENDMACRO (DEFINE_TEST _testname)
INCLUDE(${CMAKE_CURRENT_BINARY_DIR}/list.h)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/test_utils)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/libarchive/test)
# Experimental new test handling
ADD_CUSTOM_TARGET(run_libarchive_test
COMMAND libarchive_test -r ${CMAKE_CURRENT_SOURCE_DIR} -vv)
ADD_DEPENDENCIES(run_all_tests run_libarchive_test)
ENDIF(ENABLE_TEST)

View file

@ -0,0 +1,63 @@
$FreeBSD: src/lib/libarchive/test/README,v 1.3 2008/01/01 22:28:04 kientzle Exp $
This is the test harness for libarchive.
It compiles into a single program "libarchive_test" that is intended
to exercise as much of the library as possible. It is, of course,
very much a work in progress.
Each test is a function named test_foo in a file named test_foo.c.
Note that the file name is the same as the function name.
Each file must start with this line:
#include "test.h"
The test function must be declared with a line of this form
DEFINE_TEST(test_foo)
Nothing else should appear on that line.
When you add a test, please update the top-level Makefile.am and the
CMakeLists.txt in this directory to add your file to the list of
tests. The Makefile and main.c use various macro trickery to
automatically collect a list of test functions to be invoked.
Each test function can rely on the following:
* The current directory will be a freshly-created empty directory
suitable for that test. (The top-level main() creates a
directory for each separate test and chdir()s to that directory
before running the test.)
* The test function should use assert(), assertA() and similar macros
defined in test.h. If you need to add new macros of this form, feel
free to do so. The current macro set includes assertEqualInt() and
assertEqualString() that print out additional detail about their
arguments if the assertion does fail. 'A' versions also accept
a struct archive * and display any error message from there on
failure.
* You are encouraged to document each assertion with a failure() call
just before the assert. The failure() function is a printf-like
function whose text is displayed only if the assertion fails. It
can be used to display additional information relevant to the failure:
failure("The data read from file %s did not match the data written to that file.", filename);
assert(strcmp(buff1, buff2) == 0);
* Tests are encouraged to be economical with their memory and disk usage,
though this is not essential. The test is occasionally run under
a memory debugger to try to locate memory leaks in the library;
as a result, tests should be careful to release any memory they
allocate.
* Disable tests on specific platforms as necessary. Please avoid
using config.h to adjust feature requirements, as I want the tests
to also serve as a check on the configure process. The following
form is usually more appropriate:
#if !defined(__PLATFORM) && !defined(__Platform2__)
assert(xxxx)
#endif

View file

@ -0,0 +1,569 @@
DEFINE_TEST(test_acl_nfs4)
DEFINE_TEST(test_acl_pax_posix1e)
DEFINE_TEST(test_acl_pax_nfs4)
DEFINE_TEST(test_acl_platform_nfs4)
DEFINE_TEST(test_acl_platform_posix1e_restore)
DEFINE_TEST(test_acl_platform_posix1e_read)
DEFINE_TEST(test_acl_posix1e)
DEFINE_TEST(test_acl_from_text)
DEFINE_TEST(test_acl_to_text)
DEFINE_TEST(test_archive_api_feature)
DEFINE_TEST(test_archive_clear_error)
DEFINE_TEST(test_archive_cmdline)
DEFINE_TEST(test_archive_md5)
DEFINE_TEST(test_archive_rmd160)
DEFINE_TEST(test_archive_sha1)
DEFINE_TEST(test_archive_sha256)
DEFINE_TEST(test_archive_sha384)
DEFINE_TEST(test_archive_sha512)
DEFINE_TEST(test_archive_getdate)
DEFINE_TEST(test_archive_match_owner)
DEFINE_TEST(test_archive_match_path)
DEFINE_TEST(test_archive_match_time)
DEFINE_TEST(test_archive_pathmatch)
DEFINE_TEST(test_archive_read_add_passphrase)
DEFINE_TEST(test_archive_read_add_passphrase_incorrect_sequance)
DEFINE_TEST(test_archive_read_add_passphrase_single)
DEFINE_TEST(test_archive_read_add_passphrase_multiple)
DEFINE_TEST(test_archive_read_add_passphrase_set_callback1)
DEFINE_TEST(test_archive_read_add_passphrase_set_callback2)
DEFINE_TEST(test_archive_read_add_passphrase_set_callback3)
DEFINE_TEST(test_archive_read_add_passphrase_multiple_with_callback)
DEFINE_TEST(test_archive_read_add_passphrase_multiple_with_callback2)
DEFINE_TEST(test_archive_read_close_twice)
DEFINE_TEST(test_archive_read_close_twice_open_fd)
DEFINE_TEST(test_archive_read_close_twice_open_filename)
DEFINE_TEST(test_archive_read_multiple_data_objects)
DEFINE_TEST(test_archive_read_next_header_empty)
DEFINE_TEST(test_archive_read_next_header_raw)
DEFINE_TEST(test_archive_read_open2)
DEFINE_TEST(test_archive_read_set_filter_option)
DEFINE_TEST(test_archive_read_set_format_option)
DEFINE_TEST(test_archive_read_set_option)
DEFINE_TEST(test_archive_read_set_options)
DEFINE_TEST(test_archive_read_support)
DEFINE_TEST(test_archive_set_error)
DEFINE_TEST(test_archive_string)
DEFINE_TEST(test_archive_string_sort)
DEFINE_TEST(test_archive_string_conversion)
DEFINE_TEST(test_archive_write_add_filter_by_name_b64encode)
DEFINE_TEST(test_archive_write_add_filter_by_name_bzip2)
DEFINE_TEST(test_archive_write_add_filter_by_name_compress)
DEFINE_TEST(test_archive_write_add_filter_by_name_grzip)
DEFINE_TEST(test_archive_write_add_filter_by_name_gzip)
DEFINE_TEST(test_archive_write_add_filter_by_name_lrzip)
DEFINE_TEST(test_archive_write_add_filter_by_name_lz4)
DEFINE_TEST(test_archive_write_add_filter_by_name_lzip)
DEFINE_TEST(test_archive_write_add_filter_by_name_lzma)
DEFINE_TEST(test_archive_write_add_filter_by_name_lzop)
DEFINE_TEST(test_archive_write_add_filter_by_name_uuencode)
DEFINE_TEST(test_archive_write_add_filter_by_name_xz)
DEFINE_TEST(test_archive_write_add_filter_by_name_zstd)
DEFINE_TEST(test_archive_write_set_filter_option)
DEFINE_TEST(test_archive_write_set_format_by_name_7zip)
DEFINE_TEST(test_archive_write_set_format_by_name_ar)
DEFINE_TEST(test_archive_write_set_format_by_name_arbsd)
DEFINE_TEST(test_archive_write_set_format_by_name_argnu)
DEFINE_TEST(test_archive_write_set_format_by_name_arsvr4)
DEFINE_TEST(test_archive_write_set_format_by_name_bsdtar)
DEFINE_TEST(test_archive_write_set_format_by_name_cd9660)
DEFINE_TEST(test_archive_write_set_format_by_name_cpio)
DEFINE_TEST(test_archive_write_set_format_by_name_gnutar)
DEFINE_TEST(test_archive_write_set_format_by_name_iso)
DEFINE_TEST(test_archive_write_set_format_by_name_iso9660)
DEFINE_TEST(test_archive_write_set_format_by_name_mtree)
DEFINE_TEST(test_archive_write_set_format_by_name_mtree_classic)
DEFINE_TEST(test_archive_write_set_format_by_name_newc)
DEFINE_TEST(test_archive_write_set_format_by_name_odc)
DEFINE_TEST(test_archive_write_set_format_by_name_oldtar)
DEFINE_TEST(test_archive_write_set_format_by_name_pax)
DEFINE_TEST(test_archive_write_set_format_by_name_paxr)
DEFINE_TEST(test_archive_write_set_format_by_name_posix)
DEFINE_TEST(test_archive_write_set_format_by_name_rpax)
DEFINE_TEST(test_archive_write_set_format_by_name_shar)
DEFINE_TEST(test_archive_write_set_format_by_name_shardump)
DEFINE_TEST(test_archive_write_set_format_by_name_ustar)
DEFINE_TEST(test_archive_write_set_format_by_name_v7tar)
DEFINE_TEST(test_archive_write_set_format_by_name_v7)
DEFINE_TEST(test_archive_write_set_format_by_name_warc)
DEFINE_TEST(test_archive_write_set_format_by_name_xar)
DEFINE_TEST(test_archive_write_set_format_by_name_zip)
DEFINE_TEST(test_archive_write_set_format_filter_by_ext_7zip)
DEFINE_TEST(test_archive_write_set_format_filter_by_ext_zip)
DEFINE_TEST(test_archive_write_set_format_filter_by_ext_jar)
DEFINE_TEST(test_archive_write_set_format_filter_by_ext_a)
DEFINE_TEST(test_archive_write_set_format_filter_by_ext_ar)
DEFINE_TEST(test_archive_write_set_format_filter_by_ext_cpio)
DEFINE_TEST(test_archive_write_set_format_filter_by_ext_iso)
DEFINE_TEST(test_archive_write_set_format_filter_by_ext_tar)
DEFINE_TEST(test_archive_write_set_format_filter_by_ext_tar_gz)
DEFINE_TEST(test_archive_write_set_format_filter_by_ext_tar_bz2)
DEFINE_TEST(test_archive_write_set_format_filter_by_ext_tar_xz)
DEFINE_TEST(test_archive_write_set_format_filter_by_no_ext_def_zip)
DEFINE_TEST(test_archive_write_set_format_filter_by_ext_tar_bz2_def_zip)
DEFINE_TEST(test_archive_write_set_format_option)
DEFINE_TEST(test_archive_write_set_option)
DEFINE_TEST(test_archive_write_set_options)
DEFINE_TEST(test_archive_write_set_passphrase)
DEFINE_TEST(test_archive_write_set_passphrase_callback)
DEFINE_TEST(test_bad_fd)
DEFINE_TEST(test_compat_bzip2)
DEFINE_TEST(test_compat_cpio)
DEFINE_TEST(test_compat_gtar)
DEFINE_TEST(test_compat_gzip)
DEFINE_TEST(test_compat_lz4)
DEFINE_TEST(test_compat_lzip)
DEFINE_TEST(test_compat_lzma)
DEFINE_TEST(test_compat_lzop)
DEFINE_TEST(test_compat_mac)
DEFINE_TEST(test_compat_perl_archive_tar)
DEFINE_TEST(test_compat_plexus_archiver_tar)
DEFINE_TEST(test_compat_solaris_pax_sparse)
DEFINE_TEST(test_compat_solaris_tar_acl)
DEFINE_TEST(test_compat_star_acl_posix1e)
DEFINE_TEST(test_compat_star_acl_nfs4)
DEFINE_TEST(test_compat_tar_hardlink)
DEFINE_TEST(test_compat_uudecode)
DEFINE_TEST(test_compat_uudecode_large)
DEFINE_TEST(test_compat_xz)
DEFINE_TEST(test_compat_zip_1)
DEFINE_TEST(test_compat_zip_2)
DEFINE_TEST(test_compat_zip_3)
DEFINE_TEST(test_compat_zip_4)
DEFINE_TEST(test_compat_zip_5)
DEFINE_TEST(test_compat_zip_6)
DEFINE_TEST(test_compat_zip_7)
DEFINE_TEST(test_compat_zip_8)
DEFINE_TEST(test_compat_zstd)
DEFINE_TEST(test_empty_write)
DEFINE_TEST(test_entry)
DEFINE_TEST(test_entry_strmode)
DEFINE_TEST(test_extattr_freebsd)
DEFINE_TEST(test_filter_count)
DEFINE_TEST(test_fuzz_ar)
DEFINE_TEST(test_fuzz_cab)
DEFINE_TEST(test_fuzz_cpio)
DEFINE_TEST(test_fuzz_iso9660)
DEFINE_TEST(test_fuzz_lzh)
DEFINE_TEST(test_fuzz_mtree)
DEFINE_TEST(test_fuzz_rar)
DEFINE_TEST(test_fuzz_tar)
DEFINE_TEST(test_fuzz_zip)
DEFINE_TEST(test_gnutar_filename_encoding_UTF8_CP866)
DEFINE_TEST(test_gnutar_filename_encoding_KOI8R_UTF8)
DEFINE_TEST(test_gnutar_filename_encoding_KOI8R_CP866)
DEFINE_TEST(test_gnutar_filename_encoding_CP1251_UTF8)
DEFINE_TEST(test_gnutar_filename_encoding_ru_RU_CP1251)
DEFINE_TEST(test_gnutar_filename_encoding_Russian_Russia)
DEFINE_TEST(test_gnutar_filename_encoding_EUCJP_UTF8)
DEFINE_TEST(test_gnutar_filename_encoding_EUCJP_CP932)
DEFINE_TEST(test_gnutar_filename_encoding_CP932_UTF8)
DEFINE_TEST(test_link_resolver)
DEFINE_TEST(test_open_failure)
DEFINE_TEST(test_open_fd)
DEFINE_TEST(test_open_file)
DEFINE_TEST(test_open_filename)
DEFINE_TEST(test_pax_filename_encoding_KOI8R)
DEFINE_TEST(test_pax_filename_encoding_CP1251)
DEFINE_TEST(test_pax_filename_encoding_EUCJP)
DEFINE_TEST(test_pax_filename_encoding_CP932)
DEFINE_TEST(test_pax_filename_encoding_KOI8R_BINARY)
DEFINE_TEST(test_pax_filename_encoding_KOI8R_CP1251)
DEFINE_TEST(test_pax_filename_encoding)
DEFINE_TEST(test_pax_xattr_header)
DEFINE_TEST(test_read_data_large)
DEFINE_TEST(test_read_disk)
DEFINE_TEST(test_read_disk_directory_traversals)
DEFINE_TEST(test_read_disk_entry_from_file)
DEFINE_TEST(test_read_extract)
DEFINE_TEST(test_read_file_nonexistent)
DEFINE_TEST(test_read_filter_compress_truncated)
DEFINE_TEST(test_read_filter_compress_empty2)
DEFINE_TEST(test_read_filter_compress_invalid)
DEFINE_TEST(test_read_filter_grzip)
DEFINE_TEST(test_read_filter_lrzip)
DEFINE_TEST(test_read_filter_lzop)
DEFINE_TEST(test_read_filter_lzop_multiple_parts)
DEFINE_TEST(test_read_filter_program)
DEFINE_TEST(test_read_filter_program_signature)
DEFINE_TEST(test_read_filter_uudecode)
DEFINE_TEST(test_read_filter_uudecode_base64)
DEFINE_TEST(test_read_format_7zip)
DEFINE_TEST(test_read_format_7zip_bzip2)
DEFINE_TEST(test_read_format_7zip_from_fd)
DEFINE_TEST(test_read_format_7zip_copy)
DEFINE_TEST(test_read_format_7zip_deflate)
DEFINE_TEST(test_read_format_7zip_empty)
DEFINE_TEST(test_read_format_7zip_lzma1)
DEFINE_TEST(test_read_format_7zip_lzma2)
DEFINE_TEST(test_read_format_7zip_ppmd)
DEFINE_TEST(test_read_format_7zip_encryption_data)
DEFINE_TEST(test_read_format_7zip_encryption_header)
DEFINE_TEST(test_read_format_7zip_encryption_partially)
DEFINE_TEST(test_read_format_7zip_malformed)
DEFINE_TEST(test_read_format_7zip_packinfo_digests)
DEFINE_TEST(test_read_format_ar)
DEFINE_TEST(test_read_format_cab)
DEFINE_TEST(test_read_format_cab_filename)
DEFINE_TEST(test_read_format_cpio_afio)
DEFINE_TEST(test_read_format_cpio_bin)
DEFINE_TEST(test_read_format_cpio_bin_Z)
DEFINE_TEST(test_read_format_cpio_bin_be)
DEFINE_TEST(test_read_format_cpio_bin_bz2)
DEFINE_TEST(test_read_format_cpio_bin_gz)
DEFINE_TEST(test_read_format_cpio_bin_le)
DEFINE_TEST(test_read_format_cpio_bin_lzip)
DEFINE_TEST(test_read_format_cpio_bin_lzma)
DEFINE_TEST(test_read_format_cpio_bin_xz)
DEFINE_TEST(test_read_format_cpio_filename_eucJP_UTF8)
DEFINE_TEST(test_read_format_cpio_filename_UTF8_eucJP)
DEFINE_TEST(test_read_format_cpio_filename_UTF8_UTF8_jp)
DEFINE_TEST(test_read_format_cpio_filename_CP866_KOI8R)
DEFINE_TEST(test_read_format_cpio_filename_CP866_UTF8)
DEFINE_TEST(test_read_format_cpio_filename_KOI8R_CP866)
DEFINE_TEST(test_read_format_cpio_filename_KOI8R_UTF8)
DEFINE_TEST(test_read_format_cpio_filename_UTF8_KOI8R)
DEFINE_TEST(test_read_format_cpio_filename_UTF8_CP866)
DEFINE_TEST(test_read_format_cpio_filename_UTF8_UTF8_ru)
DEFINE_TEST(test_read_format_cpio_filename_eucJP_CP932)
DEFINE_TEST(test_read_format_cpio_filename_UTF8_CP932)
DEFINE_TEST(test_read_format_cpio_filename_CP866_CP1251)
DEFINE_TEST(test_read_format_cpio_filename_CP866_CP1251_win)
DEFINE_TEST(test_read_format_cpio_filename_KOI8R_CP1251)
DEFINE_TEST(test_read_format_cpio_filename_UTF8_CP1251)
DEFINE_TEST(test_read_format_cpio_odc)
DEFINE_TEST(test_read_format_cpio_svr4_bzip2_rpm)
DEFINE_TEST(test_read_format_cpio_svr4_gzip)
DEFINE_TEST(test_read_format_cpio_svr4_gzip_rpm)
DEFINE_TEST(test_read_format_cpio_svr4c_Z)
DEFINE_TEST(test_read_format_empty)
DEFINE_TEST(test_read_format_gtar_filename_eucJP_UTF8)
DEFINE_TEST(test_read_format_gtar_filename_CP866_KOI8R)
DEFINE_TEST(test_read_format_gtar_filename_CP866_UTF8)
DEFINE_TEST(test_read_format_gtar_filename_KOI8R_CP866)
DEFINE_TEST(test_read_format_gtar_filename_KOI8R_UTF8)
DEFINE_TEST(test_read_format_gtar_filename_eucJP_CP932)
DEFINE_TEST(test_read_format_gtar_filename_CP866_CP1251)
DEFINE_TEST(test_read_format_gtar_filename_CP866_CP1251_win)
DEFINE_TEST(test_read_format_gtar_filename_KOI8R_CP1251)
DEFINE_TEST(test_read_format_gtar_gz)
DEFINE_TEST(test_read_format_gtar_lzma)
DEFINE_TEST(test_read_format_gtar_sparse)
DEFINE_TEST(test_read_format_gtar_sparse_skip_entry)
DEFINE_TEST(test_read_format_iso_Z)
DEFINE_TEST(test_read_format_iso_multi_extent)
DEFINE_TEST(test_read_format_iso_xorriso)
DEFINE_TEST(test_read_format_isojoliet_bz2)
DEFINE_TEST(test_read_format_isojoliet_long)
DEFINE_TEST(test_read_format_isojoliet_rr)
DEFINE_TEST(test_read_format_isojoliet_versioned)
DEFINE_TEST(test_read_format_isorr_bz2)
DEFINE_TEST(test_read_format_isorr_ce)
DEFINE_TEST(test_read_format_isorr_new_bz2)
DEFINE_TEST(test_read_format_isorr_rr_moved)
DEFINE_TEST(test_read_format_isozisofs_bz2)
DEFINE_TEST(test_read_format_lha)
DEFINE_TEST(test_read_format_lha_bugfix_0)
DEFINE_TEST(test_read_format_lha_filename)
DEFINE_TEST(test_read_format_lha_filename_UTF16)
DEFINE_TEST(test_read_format_mtree)
DEFINE_TEST(test_read_format_mtree_filenames_only)
DEFINE_TEST(test_read_format_mtree_nochange)
DEFINE_TEST(test_read_format_mtree_nomagic_v1_form)
DEFINE_TEST(test_read_format_mtree_nomagic_v2_form)
DEFINE_TEST(test_read_format_mtree_nomagic_v2_netbsd_form)
DEFINE_TEST(test_read_format_mtree_nonexistent_contents_file)
DEFINE_TEST(test_read_format_mtree_noprint)
DEFINE_TEST(test_read_format_mtree_crash747)
DEFINE_TEST(test_read_format_pax_bz2)
DEFINE_TEST(test_read_format_rar_set_format)
DEFINE_TEST(test_read_format_rar_basic)
DEFINE_TEST(test_read_format_rar_subblock)
DEFINE_TEST(test_read_format_rar_noeof)
DEFINE_TEST(test_read_format_rar_unicode_UTF8)
DEFINE_TEST(test_read_format_rar_unicode_CP932)
DEFINE_TEST(test_read_format_rar_compress_normal)
DEFINE_TEST(test_read_format_rar_multi_lzss_blocks)
DEFINE_TEST(test_read_format_rar_compress_best)
DEFINE_TEST(test_read_format_rar_ppmd_lzss_conversion)
DEFINE_TEST(test_read_format_rar_binary)
DEFINE_TEST(test_read_format_rar_windows)
DEFINE_TEST(test_read_format_rar_multivolume)
DEFINE_TEST(test_read_format_rar_multivolume_skip)
DEFINE_TEST(test_read_format_rar_sfx)
DEFINE_TEST(test_read_format_rar_multivolume_stored_file)
DEFINE_TEST(test_read_format_rar_multivolume_stored_file_skip)
DEFINE_TEST(test_read_format_rar_multivolume_seek_data)
DEFINE_TEST(test_read_format_rar_multivolume_seek_multiple_files)
DEFINE_TEST(test_read_format_rar_multivolume_uncompressed_files)
DEFINE_TEST(test_read_format_rar_ppmd_use_after_free)
DEFINE_TEST(test_read_format_rar_ppmd_use_after_free2)
DEFINE_TEST(test_read_format_rar5_set_format)
DEFINE_TEST(test_read_format_rar5_stored)
DEFINE_TEST(test_read_format_rar5_compressed)
DEFINE_TEST(test_read_format_rar5_multiple_files)
DEFINE_TEST(test_read_format_rar5_multiple_files_solid)
DEFINE_TEST(test_read_format_rar5_multiarchive_skip_all)
DEFINE_TEST(test_read_format_rar5_multiarchive_skip_all_but_first)
DEFINE_TEST(test_read_format_rar5_multiarchive_skip_all_but_second)
DEFINE_TEST(test_read_format_rar5_blake2)
DEFINE_TEST(test_read_format_rar5_arm_filter)
DEFINE_TEST(test_read_format_rar5_stored_skip_all)
DEFINE_TEST(test_read_format_rar5_stored_skip_in_part)
DEFINE_TEST(test_read_format_rar5_stored_skip_all_but_first)
DEFINE_TEST(test_read_format_rar5_stored_skip_all_in_part)
DEFINE_TEST(test_read_format_rar5_multiarchive_solid_extr_all)
DEFINE_TEST(test_read_format_rar5_multiarchive_solid_skip_all)
DEFINE_TEST(test_read_format_rar5_multiarchive_solid_skip_all_but_first)
DEFINE_TEST(test_read_format_rar5_multiarchive_solid_skip_all_but_scnd)
DEFINE_TEST(test_read_format_rar5_multiarchive_solid_skip_all_but_third)
DEFINE_TEST(test_read_format_rar5_multiarchive_solid_skip_all_but_last)
DEFINE_TEST(test_read_format_rar5_solid_skip_all)
DEFINE_TEST(test_read_format_rar5_solid_skip_all_but_first)
DEFINE_TEST(test_read_format_rar5_solid_skip_all_but_second)
DEFINE_TEST(test_read_format_rar5_solid_skip_all_but_last)
DEFINE_TEST(test_read_format_rar5_extract_win32)
DEFINE_TEST(test_read_format_rar5_block_by_block)
DEFINE_TEST(test_read_format_rar5_owner)
DEFINE_TEST(test_read_format_rar5_symlink)
DEFINE_TEST(test_read_format_rar5_hardlink)
DEFINE_TEST(test_read_format_rar5_extra_field_version)
DEFINE_TEST(test_read_format_rar5_readtables_overflow)
DEFINE_TEST(test_read_format_rar5_leftshift1)
DEFINE_TEST(test_read_format_rar5_leftshift2)
DEFINE_TEST(test_read_format_rar5_truncated_huff)
DEFINE_TEST(test_read_format_rar5_invalid_dict_reference)
DEFINE_TEST(test_read_format_rar5_distance_overflow)
DEFINE_TEST(test_read_format_rar5_nonempty_dir_stream)
DEFINE_TEST(test_read_format_rar5_fileattr)
DEFINE_TEST(test_read_format_rar5_different_window_size)
DEFINE_TEST(test_read_format_rar5_arm_filter_on_window_boundary)
DEFINE_TEST(test_read_format_rar5_different_solid_window_size)
DEFINE_TEST(test_read_format_rar5_different_winsize_on_merge)
DEFINE_TEST(test_read_format_rar5_block_size_is_too_small)
DEFINE_TEST(test_read_format_rar_encryption_data)
DEFINE_TEST(test_read_format_rar_encryption_header)
DEFINE_TEST(test_read_format_rar_encryption_partially)
DEFINE_TEST(test_read_format_rar_invalid1)
DEFINE_TEST(test_read_format_raw)
DEFINE_TEST(test_read_format_tar)
DEFINE_TEST(test_read_format_tar_concatenated)
DEFINE_TEST(test_read_format_tar_empty_filename)
DEFINE_TEST(test_read_format_tar_empty_pax)
DEFINE_TEST(test_read_format_tar_empty_with_gnulabel)
DEFINE_TEST(test_read_format_tar_filename)
DEFINE_TEST(test_read_format_tbz)
DEFINE_TEST(test_read_format_tgz)
DEFINE_TEST(test_read_format_tlz)
DEFINE_TEST(test_read_format_txz)
DEFINE_TEST(test_read_format_tz)
DEFINE_TEST(test_read_format_ustar_filename)
DEFINE_TEST(test_read_format_warc)
DEFINE_TEST(test_read_format_xar)
DEFINE_TEST(test_read_format_zip)
DEFINE_TEST(test_read_format_zip_ppmd_one_file)
DEFINE_TEST(test_read_format_zip_ppmd_one_file_blockread)
DEFINE_TEST(test_read_format_zip_ppmd_multi)
DEFINE_TEST(test_read_format_zip_ppmd_multi_blockread)
DEFINE_TEST(test_read_format_zip_lzma_one_file)
DEFINE_TEST(test_read_format_zip_lzma_one_file_blockread)
DEFINE_TEST(test_read_format_zip_lzma_multi)
DEFINE_TEST(test_read_format_zip_lzma_multi_blockread)
DEFINE_TEST(test_read_format_zip_bzip2_one_file)
DEFINE_TEST(test_read_format_zip_bzip2_one_file_blockread)
DEFINE_TEST(test_read_format_zip_bzip2_multi)
DEFINE_TEST(test_read_format_zip_bzip2_multi_blockread)
DEFINE_TEST(test_read_format_zip_xz_multi)
DEFINE_TEST(test_read_format_zip_xz_multi_blockread)
DEFINE_TEST(test_read_format_zip_ppmd8_crash_1)
DEFINE_TEST(test_read_format_zip_bz2_hang_on_invalid)
DEFINE_TEST(test_read_format_zip_ppmd8_crash_2)
DEFINE_TEST(test_read_format_zip_lzma_alone_leak)
DEFINE_TEST(test_read_format_zip_utf8_paths)
DEFINE_TEST(test_read_format_zip_comment_stored)
DEFINE_TEST(test_read_format_zip_encryption_data)
DEFINE_TEST(test_read_format_zip_encryption_header)
DEFINE_TEST(test_read_format_zip_encryption_partially)
DEFINE_TEST(test_read_format_zip_extra_padding)
DEFINE_TEST(test_read_format_zip_filename_CP932_eucJP)
DEFINE_TEST(test_read_format_zip_filename_CP932_UTF8)
DEFINE_TEST(test_read_format_zip_filename_UTF8_eucJP)
DEFINE_TEST(test_read_format_zip_filename_UTF8_UTF8)
DEFINE_TEST(test_read_format_zip_filename_CP866_KOI8R)
DEFINE_TEST(test_read_format_zip_filename_CP866_UTF8)
DEFINE_TEST(test_read_format_zip_filename_KOI8R_CP866)
DEFINE_TEST(test_read_format_zip_filename_KOI8R_UTF8)
DEFINE_TEST(test_read_format_zip_filename_UTF8_KOI8R)
DEFINE_TEST(test_read_format_zip_filename_UTF8_CP866)
DEFINE_TEST(test_read_format_zip_filename_UTF8_UTF8_ru)
DEFINE_TEST(test_read_format_zip_filename_CP932_CP932)
DEFINE_TEST(test_read_format_zip_filename_UTF8_CP932)
DEFINE_TEST(test_read_format_zip_filename_CP866_CP1251)
DEFINE_TEST(test_read_format_zip_filename_CP866_CP1251_win)
DEFINE_TEST(test_read_format_zip_filename_KOI8R_CP1251)
DEFINE_TEST(test_read_format_zip_filename_UTF8_CP1251)
DEFINE_TEST(test_read_format_zip_filename_KOI8R_UTF8_2)
DEFINE_TEST(test_read_format_zip_high_compression)
DEFINE_TEST(test_read_format_zip_high_compression2)
DEFINE_TEST(test_read_format_zip_jar)
DEFINE_TEST(test_read_format_zip_mac_metadata)
DEFINE_TEST(test_read_format_zip_malformed)
DEFINE_TEST(test_read_format_zip_msdos)
DEFINE_TEST(test_read_format_zip_nested)
DEFINE_TEST(test_read_format_zip_nofiletype)
DEFINE_TEST(test_read_format_zip_padded1)
DEFINE_TEST(test_read_format_zip_padded2)
DEFINE_TEST(test_read_format_zip_padded3)
DEFINE_TEST(test_read_format_zip_sfx)
DEFINE_TEST(test_read_format_zip_traditional_encryption_data)
DEFINE_TEST(test_read_format_zip_winzip_aes128)
DEFINE_TEST(test_read_format_zip_winzip_aes256)
DEFINE_TEST(test_read_format_zip_winzip_aes256_stored)
DEFINE_TEST(test_read_format_zip_winzip_aes256_large)
DEFINE_TEST(test_read_format_zip_with_invalid_traditional_eocd)
DEFINE_TEST(test_read_format_zip_zip64a)
DEFINE_TEST(test_read_format_zip_zip64b)
DEFINE_TEST(test_read_large)
DEFINE_TEST(test_schily_xattr_pax)
DEFINE_TEST(test_read_pax_truncated)
DEFINE_TEST(test_read_position)
DEFINE_TEST(test_read_set_format)
DEFINE_TEST(test_read_set_wrong_format)
DEFINE_TEST(test_read_append_filter)
DEFINE_TEST(test_read_append_wrong_filter)
DEFINE_TEST(test_read_append_filter_program)
DEFINE_TEST(test_read_append_filter_wrong_program)
DEFINE_TEST(test_read_too_many_filters)
DEFINE_TEST(test_read_truncated)
DEFINE_TEST(test_read_truncated_filter_bzip2)
DEFINE_TEST(test_read_truncated_filter_compress)
DEFINE_TEST(test_read_truncated_filter_gzip)
DEFINE_TEST(test_read_truncated_filter_lzip)
DEFINE_TEST(test_read_truncated_filter_lzma)
DEFINE_TEST(test_read_truncated_filter_lzop)
DEFINE_TEST(test_read_truncated_filter_xz)
DEFINE_TEST(test_sparse_basic)
DEFINE_TEST(test_fully_sparse_files)
DEFINE_TEST(test_tar_filenames)
DEFINE_TEST(test_tar_large)
DEFINE_TEST(test_ustar_filename_encoding_UTF8_CP866)
DEFINE_TEST(test_ustar_filename_encoding_KOI8R_UTF8)
DEFINE_TEST(test_ustar_filename_encoding_KOI8R_CP866)
DEFINE_TEST(test_ustar_filename_encoding_CP1251_UTF8)
DEFINE_TEST(test_ustar_filename_encoding_ru_RU_CP1251)
DEFINE_TEST(test_ustar_filename_encoding_Russian_Russia)
DEFINE_TEST(test_ustar_filename_encoding_EUCJP_UTF8)
DEFINE_TEST(test_ustar_filename_encoding_EUCJP_CP932)
DEFINE_TEST(test_ustar_filename_encoding_CP932_UTF8)
DEFINE_TEST(test_ustar_filenames)
DEFINE_TEST(test_warn_missing_hardlink_target)
DEFINE_TEST(test_write_disk)
DEFINE_TEST(test_write_disk_appledouble)
DEFINE_TEST(test_write_disk_failures)
DEFINE_TEST(test_write_disk_hardlink)
DEFINE_TEST(test_write_disk_hfs_compression)
DEFINE_TEST(test_write_disk_lookup)
DEFINE_TEST(test_write_disk_mac_metadata)
DEFINE_TEST(test_write_disk_no_hfs_compression)
DEFINE_TEST(test_write_disk_perms)
DEFINE_TEST(test_write_disk_secure)
DEFINE_TEST(test_write_disk_secure744)
DEFINE_TEST(test_write_disk_secure745)
DEFINE_TEST(test_write_disk_secure746a)
DEFINE_TEST(test_write_disk_secure746b)
DEFINE_TEST(test_write_disk_sparse)
DEFINE_TEST(test_write_disk_symlink)
DEFINE_TEST(test_write_disk_times)
DEFINE_TEST(test_write_filter_b64encode)
DEFINE_TEST(test_write_filter_bzip2)
DEFINE_TEST(test_write_filter_compress)
DEFINE_TEST(test_write_filter_gzip)
DEFINE_TEST(test_write_filter_gzip_timestamp)
DEFINE_TEST(test_write_filter_lrzip)
DEFINE_TEST(test_write_filter_lz4)
DEFINE_TEST(test_write_filter_lz4_disable_stream_checksum)
DEFINE_TEST(test_write_filter_lz4_enable_block_checksum)
DEFINE_TEST(test_write_filter_lz4_block_size_4)
DEFINE_TEST(test_write_filter_lz4_block_size_5)
DEFINE_TEST(test_write_filter_lz4_block_size_6)
DEFINE_TEST(test_write_filter_lz4_block_dependence)
DEFINE_TEST(test_write_filter_lzip)
DEFINE_TEST(test_write_filter_lzma)
DEFINE_TEST(test_write_filter_lzop)
DEFINE_TEST(test_write_filter_program)
DEFINE_TEST(test_write_filter_uuencode)
DEFINE_TEST(test_write_filter_xz)
DEFINE_TEST(test_write_filter_zstd)
DEFINE_TEST(test_write_format_7zip)
DEFINE_TEST(test_write_format_7zip_basic_bzip2)
DEFINE_TEST(test_write_format_7zip_basic_copy)
DEFINE_TEST(test_write_format_7zip_basic_deflate)
DEFINE_TEST(test_write_format_7zip_basic_lzma1)
DEFINE_TEST(test_write_format_7zip_basic_lzma2)
DEFINE_TEST(test_write_format_7zip_basic_ppmd)
DEFINE_TEST(test_write_format_7zip_empty_archive)
DEFINE_TEST(test_write_format_7zip_empty_files)
DEFINE_TEST(test_write_format_7zip_large_bzip2)
DEFINE_TEST(test_write_format_7zip_large_copy)
DEFINE_TEST(test_write_format_7zip_large_deflate)
DEFINE_TEST(test_write_format_7zip_large_lzma1)
DEFINE_TEST(test_write_format_7zip_large_lzma2)
DEFINE_TEST(test_write_format_7zip_large_ppmd)
DEFINE_TEST(test_write_format_ar)
DEFINE_TEST(test_write_format_cpio)
DEFINE_TEST(test_write_format_cpio_empty)
DEFINE_TEST(test_write_format_cpio_newc)
DEFINE_TEST(test_write_format_cpio_odc)
DEFINE_TEST(test_write_format_gnutar)
DEFINE_TEST(test_write_format_gnutar_filenames)
DEFINE_TEST(test_write_format_gnutar_linknames)
DEFINE_TEST(test_write_format_iso9660)
DEFINE_TEST(test_write_format_iso9660_boot)
DEFINE_TEST(test_write_format_iso9660_empty)
DEFINE_TEST(test_write_format_iso9660_filename)
DEFINE_TEST(test_write_format_iso9660_zisofs)
DEFINE_TEST(test_write_format_mtree)
DEFINE_TEST(test_write_format_mtree_no_leading_dotslash)
DEFINE_TEST(test_write_format_mtree_absolute_path)
DEFINE_TEST(test_write_format_mtree_classic)
DEFINE_TEST(test_write_format_mtree_classic_indent)
DEFINE_TEST(test_write_format_mtree_fflags)
DEFINE_TEST(test_write_format_mtree_no_separator)
DEFINE_TEST(test_write_format_mtree_quoted_filename)
DEFINE_TEST(test_write_format_pax)
DEFINE_TEST(test_write_format_raw)
DEFINE_TEST(test_write_format_raw_b64)
DEFINE_TEST(test_write_format_shar_empty)
DEFINE_TEST(test_write_format_tar)
DEFINE_TEST(test_write_format_tar_empty)
DEFINE_TEST(test_write_format_tar_sparse)
DEFINE_TEST(test_write_format_tar_ustar)
DEFINE_TEST(test_write_format_tar_v7tar)
DEFINE_TEST(test_write_format_warc)
DEFINE_TEST(test_write_format_warc_empty)
DEFINE_TEST(test_write_format_xar)
DEFINE_TEST(test_write_format_xar_empty)
DEFINE_TEST(test_write_format_zip)
DEFINE_TEST(test_write_format_zip64)
DEFINE_TEST(test_write_format_zip_traditional_pkware_encryption)
DEFINE_TEST(test_write_format_zip_winzip_aes128_encryption)
DEFINE_TEST(test_write_format_zip_winzip_aes256_encryption)
DEFINE_TEST(test_write_format_zip_compression_store)
DEFINE_TEST(test_write_format_zip_empty)
DEFINE_TEST(test_write_format_zip_empty_zip64)
DEFINE_TEST(test_write_format_zip_file)
DEFINE_TEST(test_write_format_zip_file_zip64)
DEFINE_TEST(test_write_format_zip_large)
DEFINE_TEST(test_write_format_zip_zip64_oversize)
DEFINE_TEST(test_write_open_memory)
DEFINE_TEST(test_write_read_format_zip)
DEFINE_TEST(test_write_read_format_zip_improved_streaming)
DEFINE_TEST(test_write_read_format_zip64)
DEFINE_TEST(test_write_read_format_zip64_improved_streaming)
DEFINE_TEST(test_xattr_platform)
DEFINE_TEST(test_zip_filename_encoding_UTF8)
DEFINE_TEST(test_zip_filename_encoding_KOI8R)
DEFINE_TEST(test_zip_filename_encoding_ru_RU_CP1251)
DEFINE_TEST(test_zip_filename_encoding_Russian_Russia)
DEFINE_TEST(test_zip_filename_encoding_EUCJP)
DEFINE_TEST(test_zip_filename_encoding_CP932)

View file

@ -0,0 +1,222 @@
/*-
* Copyright (c) 2003-2007 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD: head/lib/libarchive/test/read_open_memory.c 191183 2009-04-17 01:06:31Z kientzle $");
#include <errno.h>
#include <stdlib.h>
#include <string.h>
/*
* Read an archive from a block of memory.
*
* This is identical to archive_read_open_memory(), except
* that it goes out of its way to be a little bit unpleasant,
* in order to better test the libarchive internals.
*/
struct read_memory_data {
const unsigned char *start;
const unsigned char *p;
const unsigned char *end;
size_t read_size;
size_t copy_buff_size;
size_t copy_buff_offset;
char *copy_buff;
};
static int memory_read_close(struct archive *, void *);
static int memory_read_open(struct archive *, void *);
static int64_t memory_read_seek(struct archive *, void *, int64_t request, int whence);
static int64_t memory_read_skip(struct archive *, void *, int64_t request);
static ssize_t memory_read(struct archive *, void *, const void **buff);
static int read_open_memory_internal(struct archive *a, const void *buff,
size_t size, size_t read_size, int fullapi);
int
read_open_memory(struct archive *a, const void *buff, size_t size, size_t read_size)
{
return read_open_memory_internal(a, buff, size, read_size, 2);
}
/*
* As above, but don't register any optional part of the API, to verify
* that internals work correctly with just the minimal entry points.
*/
int
read_open_memory_minimal(struct archive *a, const void *buff, size_t size, size_t read_size)
{
return read_open_memory_internal(a, buff, size, read_size, 1);
}
/*
* Include a seek callback as well.
*/
int
read_open_memory_seek(struct archive *a, const void *buff, size_t size, size_t read_size)
{
return read_open_memory_internal(a, buff, size, read_size, 3);
}
static int
read_open_memory_internal(struct archive *a, const void *buff,
size_t size, size_t read_size, int level)
{
struct read_memory_data *mine = NULL;
switch (level) {
case 3:
archive_read_set_seek_callback(a, memory_read_seek);
__LA_FALLTHROUGH;
case 2:
archive_read_set_open_callback(a, memory_read_open);
archive_read_set_skip_callback(a, memory_read_skip);
__LA_FALLTHROUGH;
case 1:
mine = malloc(sizeof(*mine));
if (mine == NULL) {
archive_set_error(a, ENOMEM, "No memory");
return (ARCHIVE_FATAL);
}
memset(mine, 0, sizeof(*mine));
mine->start = mine->p = (const unsigned char *)buff;
mine->end = mine->start + size;
mine->read_size = read_size;
mine->copy_buff_offset = 32;
mine->copy_buff_size = read_size + mine->copy_buff_offset * 2;
mine->copy_buff = malloc(mine->copy_buff_size);
memset(mine->copy_buff, 0xA5, mine->copy_buff_size);
archive_read_set_read_callback(a, memory_read);
archive_read_set_close_callback(a, memory_read_close);
archive_read_set_callback_data(a, mine);
}
return archive_read_open1(a);
}
/*
* There's nothing to open.
*/
static int
memory_read_open(struct archive *a, void *client_data)
{
(void)a; /* UNUSED */
(void)client_data; /* UNUSED */
return (ARCHIVE_OK);
}
/*
* In order to exercise libarchive's internal read-combining logic,
* we deliberately copy data for each read to a separate buffer.
* That way, code that runs off the end of the provided data
* will screw up.
*/
static ssize_t
memory_read(struct archive *a, void *client_data, const void **buff)
{
struct read_memory_data *mine = (struct read_memory_data *)client_data;
ssize_t size;
(void)a; /* UNUSED */
size = mine->end - mine->p;
if (size < 0) {
buff = NULL;
return 0;
}
if ((size_t)size > mine->read_size)
size = mine->read_size;
else
memset(mine->copy_buff, 0xA5, mine->copy_buff_size);
memcpy(mine->copy_buff + mine->copy_buff_offset, mine->p, size);
*buff = mine->copy_buff + mine->copy_buff_offset;
mine->p += size;
return ((ssize_t)size);
}
/*
* How mean can a skip() routine be? Let's try to find out.
*/
static int64_t
memory_read_skip(struct archive *a, void *client_data, int64_t skip)
{
struct read_memory_data *mine = (struct read_memory_data *)client_data;
(void)a; /* UNUSED */
/* We can't skip by more than is available. */
if ((off_t)skip > (off_t)(mine->end - mine->p))
skip = mine->end - mine->p;
/* Always do small skips by prime amounts. */
if (skip > 71)
skip = 71;
mine->p += skip;
return (skip);
}
/*
*/
static int64_t
memory_read_seek(struct archive *a, void *client_data, int64_t offset, int whence)
{
struct read_memory_data *mine = (struct read_memory_data *)client_data;
(void)a; /* UNUSED */
switch (whence) {
case SEEK_SET:
mine->p = mine->start + offset;
break;
case SEEK_END:
mine->p = mine->end + offset;
break;
case SEEK_CUR:
mine->p += offset;
break;
}
if (mine->p < mine->start) {
mine->p = mine->start;
return ARCHIVE_FAILED;
}
if (mine->p > mine->end) {
mine->p = mine->end;
return ARCHIVE_FAILED;
}
return (mine->p - mine->start);
}
/*
* Close is just cleaning up our one small bit of data.
*/
static int
memory_read_close(struct archive *a, void *client_data)
{
struct read_memory_data *mine = (struct read_memory_data *)client_data;
(void)a; /* UNUSED */
if (mine != NULL)
free(mine->copy_buff);
free(mine);
return (ARCHIVE_OK);
}

View file

@ -0,0 +1,42 @@
/*
* Copyright (c) 2003-2017 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/* Every test program should #include "test.h" as the first thing. */
#define KNOWNREF "test_compat_gtar_1.tar.uu"
#define ENVBASE "LIBARCHIVE" /* Prefix for environment variables. */
#undef PROGRAM /* Testing a library, not a program. */
#define LIBRARY "libarchive"
#define EXTRA_DUMP(x) archive_error_string((struct archive *)(x))
#define EXTRA_ERRNO(x) archive_errno((struct archive *)(x))
#define EXTRA_VERSION archive_version_details()
#if defined(__GNUC__) && (__GNUC__ >= 7)
#define __LA_FALLTHROUGH __attribute__((fallthrough))
#else
#define __LA_FALLTHROUGH
#endif
#include "test_common.h"

View file

@ -0,0 +1,208 @@
/*-
* Copyright (c) 2003-2010 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD$");
/*
* Exercise the system-independent portion of the ACL support.
* Check that archive_entry objects can save and restore NFS4 ACL data.
*
* This should work on all systems, regardless of whether local
* filesystems support ACLs or not.
*/
static struct archive_test_acl_t acls1[] = {
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_EXECUTE,
ARCHIVE_ENTRY_ACL_USER_OBJ, -1, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_DENY, ARCHIVE_ENTRY_ACL_READ_DATA,
ARCHIVE_ENTRY_ACL_USER, 77, "user77" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_READ_DATA,
ARCHIVE_ENTRY_ACL_GROUP_OBJ, -1, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_DENY, ARCHIVE_ENTRY_ACL_WRITE_DATA,
ARCHIVE_ENTRY_ACL_EVERYONE, -1, "" },
};
static struct archive_test_acl_t acls2[] = {
/* An entry for each type. */
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW, 0,
ARCHIVE_ENTRY_ACL_USER, 108, "user108" },
{ ARCHIVE_ENTRY_ACL_TYPE_DENY, 0,
ARCHIVE_ENTRY_ACL_USER, 109, "user109" },
{ ARCHIVE_ENTRY_ACL_TYPE_AUDIT, 0,
ARCHIVE_ENTRY_ACL_USER, 110, "user110" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALARM, 0,
ARCHIVE_ENTRY_ACL_USER, 111, "user111" },
/* An entry for each permission. */
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_EXECUTE,
ARCHIVE_ENTRY_ACL_USER, 112, "user112" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_READ_DATA,
ARCHIVE_ENTRY_ACL_USER, 113, "user113" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_LIST_DIRECTORY,
ARCHIVE_ENTRY_ACL_USER, 114, "user114" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_WRITE_DATA,
ARCHIVE_ENTRY_ACL_USER, 115, "user115" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_ADD_FILE,
ARCHIVE_ENTRY_ACL_USER, 116, "user116" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_APPEND_DATA,
ARCHIVE_ENTRY_ACL_USER, 117, "user117" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY,
ARCHIVE_ENTRY_ACL_USER, 118, "user118" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS,
ARCHIVE_ENTRY_ACL_USER, 119, "user119" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS,
ARCHIVE_ENTRY_ACL_USER, 120, "user120" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_DELETE_CHILD,
ARCHIVE_ENTRY_ACL_USER, 121, "user121" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES,
ARCHIVE_ENTRY_ACL_USER, 122, "user122" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES,
ARCHIVE_ENTRY_ACL_USER, 123, "user123" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_DELETE,
ARCHIVE_ENTRY_ACL_USER, 124, "user124" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_READ_ACL,
ARCHIVE_ENTRY_ACL_USER, 125, "user125" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_WRITE_ACL,
ARCHIVE_ENTRY_ACL_USER, 126, "user126" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_WRITE_OWNER,
ARCHIVE_ENTRY_ACL_USER, 127, "user127" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
ARCHIVE_ENTRY_ACL_USER, 128, "user128" },
/* One entry with each inheritance value. */
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
ARCHIVE_ENTRY_ACL_READ_DATA | ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT,
ARCHIVE_ENTRY_ACL_USER, 129, "user129" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
ARCHIVE_ENTRY_ACL_READ_DATA | ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT,
ARCHIVE_ENTRY_ACL_USER, 130, "user130" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
ARCHIVE_ENTRY_ACL_READ_DATA | ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT,
ARCHIVE_ENTRY_ACL_USER, 131, "user131" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
ARCHIVE_ENTRY_ACL_READ_DATA | ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY,
ARCHIVE_ENTRY_ACL_USER, 132, "user132" },
{ ARCHIVE_ENTRY_ACL_TYPE_AUDIT,
ARCHIVE_ENTRY_ACL_READ_DATA | ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS,
ARCHIVE_ENTRY_ACL_USER, 133, "user133" },
{ ARCHIVE_ENTRY_ACL_TYPE_AUDIT,
ARCHIVE_ENTRY_ACL_READ_DATA | ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS,
ARCHIVE_ENTRY_ACL_USER, 134, "user134" },
/* One entry for each qualifier. */
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_EXECUTE,
ARCHIVE_ENTRY_ACL_USER, 135, "user135" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_EXECUTE,
ARCHIVE_ENTRY_ACL_USER_OBJ, -1, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_EXECUTE,
ARCHIVE_ENTRY_ACL_GROUP, 136, "group136" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_EXECUTE,
ARCHIVE_ENTRY_ACL_GROUP_OBJ, -1, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_EXECUTE,
ARCHIVE_ENTRY_ACL_EVERYONE, -1, "" },
};
/*
* Entries that should be rejected when we attempt to set them
* on an ACL that already has NFS4 entries.
*/
static struct archive_test_acl_t acls_bad[] = {
/* POSIX.1e ACL types */
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_EXECUTE,
ARCHIVE_ENTRY_ACL_USER, 78, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, ARCHIVE_ENTRY_ACL_EXECUTE,
ARCHIVE_ENTRY_ACL_USER, 78, "" },
/* POSIX.1e tags */
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_EXECUTE,
ARCHIVE_ENTRY_ACL_OTHER, -1, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_EXECUTE,
ARCHIVE_ENTRY_ACL_MASK, -1, "" },
/* POSIX.1e permissions */
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_EVERYONE, -1, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_WRITE,
ARCHIVE_ENTRY_ACL_EVERYONE, -1, "" },
};
DEFINE_TEST(test_acl_nfs4)
{
struct archive_entry *ae;
int i;
/* Create a simple archive_entry. */
assert((ae = archive_entry_new()) != NULL);
archive_entry_set_pathname(ae, "file");
archive_entry_set_mode(ae, S_IFREG | 0777);
/* Store and read back some basic ACL entries. */
assertEntrySetAcls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]));
/* Check that entry contains only NFSv4 types */
assert((archive_entry_acl_types(ae) &
ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) == 0);
assert((archive_entry_acl_types(ae) &
ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0);
assertEqualInt(4,
archive_entry_acl_reset(ae, ARCHIVE_ENTRY_ACL_TYPE_NFS4));
assertEntryCompareAcls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]),
ARCHIVE_ENTRY_ACL_TYPE_NFS4, 0);
/* A more extensive set of ACLs. */
assertEntrySetAcls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]));
assertEqualInt(32,
archive_entry_acl_reset(ae, ARCHIVE_ENTRY_ACL_TYPE_NFS4));
assertEntryCompareAcls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]),
ARCHIVE_ENTRY_ACL_TYPE_NFS4, 0);
/*
* Check that clearing ACLs gets rid of them all by repeating
* the first test.
*/
assertEntrySetAcls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]));
failure("Basic ACLs shouldn't be stored as extended ACLs");
assertEqualInt(4,
archive_entry_acl_reset(ae, ARCHIVE_ENTRY_ACL_TYPE_NFS4));
/*
* Different types of malformed ACL entries that should
* fail when added to existing NFS4 ACLs.
*/
assertEntrySetAcls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]));
for (i = 0; i < (int)(sizeof(acls_bad)/sizeof(acls_bad[0])); ++i) {
struct archive_test_acl_t *p = &acls_bad[i];
failure("Malformed ACL test #%d", i);
assertEqualInt(ARCHIVE_FAILED,
archive_entry_acl_add_entry(ae,
p->type, p->permset, p->tag, p->qual, p->name));
failure("Malformed ACL test #%d", i);
assertEqualInt(32,
archive_entry_acl_reset(ae,
ARCHIVE_ENTRY_ACL_TYPE_NFS4));
}
archive_entry_free(ae);
}

View file

@ -0,0 +1,415 @@
/*-
* Copyright (c) 2003-2007 Tim Kientzle
* Copyright (c) 2016 Martin Matuska
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD$");
/*
* Exercise the system-independent portion of the ACL support.
* Check that pax archive can save and restore POSIX.1e ACL data.
*
* This should work on all systems, regardless of whether local
* filesystems support ACLs or not.
*/
static unsigned char buff[16384];
static struct archive_test_acl_t acls0[] = {
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_EXECUTE,
ARCHIVE_ENTRY_ACL_USER_OBJ, 0, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_GROUP_OBJ, 0, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_WRITE,
ARCHIVE_ENTRY_ACL_OTHER, 0, "" },
};
static struct archive_test_acl_t acls1[] = {
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_EXECUTE,
ARCHIVE_ENTRY_ACL_USER_OBJ, -1, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_USER, 77, "user77" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_GROUP_OBJ, -1, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_WRITE,
ARCHIVE_ENTRY_ACL_OTHER, -1, "" },
};
static struct archive_test_acl_t acls2[] = {
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_EXECUTE | ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_USER_OBJ, -1, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_USER, 77, "user77" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0,
ARCHIVE_ENTRY_ACL_USER, 78, "user78" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_GROUP_OBJ, -1, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0007,
ARCHIVE_ENTRY_ACL_GROUP, 78, "group78" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_WRITE | ARCHIVE_ENTRY_ACL_EXECUTE,
ARCHIVE_ENTRY_ACL_OTHER, -1, "" },
};
static struct archive_test_acl_t acls3[] = {
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
ARCHIVE_ENTRY_ACL_READ_DATA |
ARCHIVE_ENTRY_ACL_WRITE_DATA |
ARCHIVE_ENTRY_ACL_EXECUTE |
ARCHIVE_ENTRY_ACL_APPEND_DATA |
ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_READ_ACL |
ARCHIVE_ENTRY_ACL_WRITE_ACL |
ARCHIVE_ENTRY_ACL_WRITE_OWNER |
ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
ARCHIVE_ENTRY_ACL_USER_OBJ, 0, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
ARCHIVE_ENTRY_ACL_READ_DATA |
ARCHIVE_ENTRY_ACL_WRITE_DATA |
ARCHIVE_ENTRY_ACL_APPEND_DATA |
ARCHIVE_ENTRY_ACL_READ_ACL |
ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_READ_ACL |
ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
ARCHIVE_ENTRY_ACL_GROUP_OBJ, 0, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
ARCHIVE_ENTRY_ACL_READ_DATA |
ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_READ_ACL |
ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
ARCHIVE_ENTRY_ACL_EVERYONE, 0, "" },
};
static struct archive_test_acl_t acls4[] = {
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
ARCHIVE_ENTRY_ACL_READ_DATA |
ARCHIVE_ENTRY_ACL_WRITE_DATA |
ARCHIVE_ENTRY_ACL_APPEND_DATA |
ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_READ_ACL |
ARCHIVE_ENTRY_ACL_WRITE_ACL |
ARCHIVE_ENTRY_ACL_WRITE_OWNER |
ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
ARCHIVE_ENTRY_ACL_USER_OBJ, 0, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
ARCHIVE_ENTRY_ACL_READ_DATA |
ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_READ_ACL |
ARCHIVE_ENTRY_ACL_SYNCHRONIZE |
ARCHIVE_ENTRY_ACL_ENTRY_INHERITED,
ARCHIVE_ENTRY_ACL_USER, 77, "user77" },
{ ARCHIVE_ENTRY_ACL_TYPE_DENY,
ARCHIVE_ENTRY_ACL_READ_DATA |
ARCHIVE_ENTRY_ACL_WRITE_DATA |
ARCHIVE_ENTRY_ACL_EXECUTE,
ARCHIVE_ENTRY_ACL_USER, 78, "user78" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
ARCHIVE_ENTRY_ACL_READ_DATA |
ARCHIVE_ENTRY_ACL_WRITE_DATA |
ARCHIVE_ENTRY_ACL_APPEND_DATA |
ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_READ_ACL |
ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
ARCHIVE_ENTRY_ACL_GROUP_OBJ, 0, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_DENY,
ARCHIVE_ENTRY_ACL_WRITE_DATA |
ARCHIVE_ENTRY_ACL_APPEND_DATA |
ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_WRITE_ACL |
ARCHIVE_ENTRY_ACL_WRITE_OWNER,
ARCHIVE_ENTRY_ACL_GROUP, 78, "group78" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
ARCHIVE_ENTRY_ACL_READ_DATA |
ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_READ_ACL |
ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
ARCHIVE_ENTRY_ACL_EVERYONE, 0, "" },
};
static struct archive_test_acl_t acls5[] = {
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
ARCHIVE_ENTRY_ACL_READ_DATA |
ARCHIVE_ENTRY_ACL_WRITE_DATA |
ARCHIVE_ENTRY_ACL_EXECUTE |
ARCHIVE_ENTRY_ACL_APPEND_DATA |
ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_READ_ACL |
ARCHIVE_ENTRY_ACL_WRITE_ACL |
ARCHIVE_ENTRY_ACL_WRITE_OWNER |
ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
ARCHIVE_ENTRY_ACL_USER_OBJ, 0, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
ARCHIVE_ENTRY_ACL_READ_DATA |
ARCHIVE_ENTRY_ACL_WRITE_DATA |
ARCHIVE_ENTRY_ACL_APPEND_DATA |
ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_READ_ACL |
ARCHIVE_ENTRY_ACL_WRITE_OWNER |
ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
ARCHIVE_ENTRY_ACL_USER, 77, "user77" },
{ ARCHIVE_ENTRY_ACL_TYPE_AUDIT,
ARCHIVE_ENTRY_ACL_WRITE_DATA |
ARCHIVE_ENTRY_ACL_APPEND_DATA |
ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS,
ARCHIVE_ENTRY_ACL_USER, 77, "user77" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
ARCHIVE_ENTRY_ACL_READ_DATA |
ARCHIVE_ENTRY_ACL_WRITE_DATA |
ARCHIVE_ENTRY_ACL_APPEND_DATA |
ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_READ_ACL |
ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
ARCHIVE_ENTRY_ACL_GROUP_OBJ, 0, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALARM,
ARCHIVE_ENTRY_ACL_READ_DATA |
ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_READ_ACL |
ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS,
ARCHIVE_ENTRY_ACL_GROUP, 78, "group78" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
ARCHIVE_ENTRY_ACL_READ_DATA |
ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_READ_ACL |
ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
ARCHIVE_ENTRY_ACL_EVERYONE, 0, "" },
};
DEFINE_TEST(test_acl_pax_posix1e)
{
struct archive *a;
struct archive_entry *ae;
size_t used;
FILE *f;
void *reference;
size_t reference_size;
/* Write an archive to memory. */
assert(NULL != (a = archive_write_new()));
assertA(0 == archive_write_set_format_pax(a));
assertA(0 == archive_write_add_filter_none(a));
assertA(0 == archive_write_set_bytes_per_block(a, 1));
assertA(0 == archive_write_set_bytes_in_last_block(a, 1));
assertA(0 == archive_write_open_memory(a, buff, sizeof(buff), &used));
/* Write a series of files to the archive with different ACL info. */
/* Create a simple archive_entry. */
assert((ae = archive_entry_new()) != NULL);
archive_entry_set_pathname(ae, "file");
archive_entry_set_mode(ae, S_IFREG | 0777);
/* Basic owner/owning group should just update mode bits. */
assertEntrySetAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]));
assertA(0 == archive_write_header(a, ae));
/* With any extended ACL entry, we should read back a full set. */
assertEntrySetAcls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]));
assertA(0 == archive_write_header(a, ae));
/* A more extensive set of ACLs. */
assertEntrySetAcls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]));
assertA(0 == archive_write_header(a, ae));
/*
* Check that clearing ACLs gets rid of them all by repeating
* the first test.
*/
assertEntrySetAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]));
assertA(0 == archive_write_header(a, ae));
archive_entry_free(ae);
/* Close out the archive. */
assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a));
assertEqualInt(ARCHIVE_OK, archive_write_free(a));
/* Write out the data we generated to a file for manual inspection. */
assert(NULL != (f = fopen("testout", "wb")));
assertEqualInt(used, (size_t)fwrite(buff, 1, (unsigned int)used, f));
fclose(f);
/* Write out the reference data to a file for manual inspection. */
extract_reference_file("test_acl_pax_posix1e.tar");
reference = slurpfile(&reference_size, "test_acl_pax_posix1e.tar");
/* Assert that the generated data matches the built-in reference data.*/
failure("Generated pax archive does not match reference; compare 'testout' to 'test_acl_pax_posix1e.tar' reference file.");
assertEqualMem(buff, reference, reference_size);
failure("Generated pax archive does not match reference; compare 'testout' to 'test_acl_pax_posix1e.tar' reference file.");
assertEqualInt((int)used, reference_size);
free(reference);
/* Read back each entry and check that the ACL data is right. */
assert(NULL != (a = archive_read_new()));
assertA(0 == archive_read_support_format_all(a));
assertA(0 == archive_read_support_filter_all(a));
assertA(0 == archive_read_open_memory(a, buff, used));
/* First item has no ACLs */
assertA(0 == archive_read_next_header(a, &ae));
failure("Basic ACLs shouldn't be stored as extended ACLs");
assert(0 == archive_entry_acl_reset(ae, ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
failure("Basic ACLs should set mode to 0142, not %04o",
archive_entry_mode(ae)&0777);
assert((archive_entry_mode(ae) & 0777) == 0142);
/* Second item has a few ACLs */
assertA(0 == archive_read_next_header(a, &ae));
failure("One extended ACL should flag all ACLs to be returned.");
assert(4 == archive_entry_acl_reset(ae, ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
assertEntryCompareAcls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]),
ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0142);
failure("Basic ACLs should set mode to 0142, not %04o",
archive_entry_mode(ae)&0777);
assert((archive_entry_mode(ae) & 0777) == 0142);
/* Third item has pretty extensive ACLs */
assertA(0 == archive_read_next_header(a, &ae));
assertEqualInt(6, archive_entry_acl_reset(ae,
ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
assertEntryCompareAcls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]),
ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0543);
failure("Basic ACLs should set mode to 0543, not %04o",
archive_entry_mode(ae)&0777);
assert((archive_entry_mode(ae) & 0777) == 0543);
/* Fourth item has no ACLs */
assertA(0 == archive_read_next_header(a, &ae));
failure("Basic ACLs shouldn't be stored as extended ACLs");
assert(0 == archive_entry_acl_reset(ae, ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
failure("Basic ACLs should set mode to 0142, not %04o",
archive_entry_mode(ae)&0777);
assert((archive_entry_mode(ae) & 0777) == 0142);
/* Close the archive. */
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}
DEFINE_TEST(test_acl_pax_nfs4)
{
struct archive *a;
struct archive_entry *ae;
size_t used;
FILE *f;
void *reference;
size_t reference_size;
/* Write an archive to memory. */
assert(NULL != (a = archive_write_new()));
assertA(0 == archive_write_set_format_pax(a));
assertA(0 == archive_write_add_filter_none(a));
assertA(0 == archive_write_set_bytes_per_block(a, 1));
assertA(0 == archive_write_set_bytes_in_last_block(a, 1));
assertA(0 == archive_write_open_memory(a, buff, sizeof(buff), &used));
/* Write a series of files to the archive with different ACL info. */
/* Create a simple archive_entry. */
assert((ae = archive_entry_new()) != NULL);
archive_entry_set_pathname(ae, "file");
archive_entry_set_mode(ae, S_IFREG | 0777);
/* NFS4 ACLs mirroring 0754 file mode */
assertEntrySetAcls(ae, acls3, sizeof(acls3)/sizeof(acls3[0]));
assertA(0 == archive_write_header(a, ae));
/* A more extensive set of NFS4 ACLs. */
assertEntrySetAcls(ae, acls4, sizeof(acls4)/sizeof(acls4[0]));
assertA(0 == archive_write_header(a, ae));
/* Set with special (audit, alarm) NFS4 ACLs. */
assertEntrySetAcls(ae, acls5, sizeof(acls5)/sizeof(acls5[0]));
assertA(0 == archive_write_header(a, ae));
archive_entry_free(ae);
/* Close out the archive. */
assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a));
assertEqualInt(ARCHIVE_OK, archive_write_free(a));
/* Write out the data we generated to a file for manual inspection. */
assert(NULL != (f = fopen("testout", "wb")));
assertEqualInt(used, (size_t)fwrite(buff, 1, (unsigned int)used, f));
fclose(f);
/* Write out the reference data to a file for manual inspection. */
extract_reference_file("test_acl_pax_nfs4.tar");
reference = slurpfile(&reference_size, "test_acl_pax_nfs4.tar");
/* Assert that the generated data matches the built-in reference data.*/
failure("Generated pax archive does not match reference; compare 'testout' to 'test_acl_pax_nfs4.tar' reference file.");
assertEqualMem(buff, reference, reference_size);
failure("Generated pax archive does not match reference; compare 'testout' to 'test_acl_pax_nfs4.tar' reference file.");
assertEqualInt((int)used, reference_size);
free(reference);
/* Read back each entry and check that the ACL data is right. */
assert(NULL != (a = archive_read_new()));
assertA(0 == archive_read_support_format_all(a));
assertA(0 == archive_read_support_filter_all(a));
assertA(0 == archive_read_open_memory(a, buff, used));
/* First item has NFS4 ACLs mirroring file mode */
assertA(0 == archive_read_next_header(a, &ae));
assertEqualInt(3, archive_entry_acl_reset(ae,
ARCHIVE_ENTRY_ACL_TYPE_ALLOW));
assertEntryCompareAcls(ae, acls3, sizeof(acls3)/sizeof(acls3[0]),
ARCHIVE_ENTRY_ACL_TYPE_ALLOW, 0);
/* Second item has has more fine-grained NFS4 ACLs */
assertA(0 == archive_read_next_header(a, &ae));
assertEqualInt(6, archive_entry_acl_reset(ae,
ARCHIVE_ENTRY_ACL_TYPE_NFS4));
assertEntryCompareAcls(ae, acls4, sizeof(acls4)/sizeof(acls4[0]),
ARCHIVE_ENTRY_ACL_TYPE_NFS4, 0);
/* Third item has has audit and alarm NFS4 ACLs */
assertA(0 == archive_read_next_header(a, &ae));
assertEqualInt(6, archive_entry_acl_reset(ae,
ARCHIVE_ENTRY_ACL_TYPE_NFS4));
assertEntryCompareAcls(ae, acls5, sizeof(acls5)/sizeof(acls5[0]),
ARCHIVE_ENTRY_ACL_TYPE_NFS4, 0);
/* Close the archive. */
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}

View file

@ -0,0 +1,129 @@
begin 644 test_acl_pax_nfs4.tar
M4&%X2&5A9&5R+V9I;&4`````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````#`P,#<W-R``,#`P,#`P(``P,#`P,#`@`#`P,#`P,#`P,3,R
M(#`P,#`P,#`P,#`P(#`Q,C`P,P`@>```````````````````````````````
M````````````````````````````````````````````````````````````
M``````````````````````````````````````````!U<W1A<@`P,```````
M````````````````````````````````````````````````````````````
M```````````````````P,#`P,#`@`#`P,#`P,"``````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M```````````````````````Y,"!30TA)3%DN86-L+F%C93UO=VYE<D`Z<G=X
M<&%!4E=C0V]S.CIA;&QO=RQG<F]U<$`Z<G=P85)C<SHZ86QL;W<L979E<GEO
M;F5`.G)A4F-S.CIA;&QO=PH`````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````````````````````````````````````&9I;&4`````````
M````````````````````````````````````````````````````````````
M```````````````````````````````````````````````````````````P
M,#`W-S<@`#`P,#`P,"``,#`P,#`P(``P,#`P,#`P,#`P,"`P,#`P,#`P,#`P
M,"`P,3`P,C0`(#``````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````=7-T87(`,#``````````````````````
M````````````````````````````````````````````````````````````
M````,#`P,#`P(``P,#`P,#`@````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````4&%X2&5A9&5R+V9I;&4`````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````````````#`P,#<W-R``,#`P,#`P(``P,#`P,#`@`#`P,#`P
M,#`P,C4V(#`P,#`P,#`P,#`P(#`Q,C`Q,@`@>```````````````````````
M````````````````````````````````````````````````````````````
M``````````````````````````````````````````````````!U<W1A<@`P
M,```````````````````````````````````````````````````````````
M```````````````````````````P,#`P,#`@`#`P,#`P,"``````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M```````````````````````````````Q-S0@4T-(24Q9+F%C;"YA8V4];W=N
M97)`.G)W<&%!4E=C0V]S.CIA;&QO=RQU<V5R.G5S97(W-SIR85)C<SI).F%L
M;&]W.C<W+'5S97(Z=7-E<C<X.G)W>#HZ9&5N>3HW."QG<F]U<$`Z<G=P85)C
M<SHZ86QL;W<L9W)O=7`Z9W)O=7`W.#IW<$%70V\Z.F1E;GDZ-S@L979E<GEO
M;F5`.G)A4F-S.CIA;&QO=PH`````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````````````````````````````````````````````&9I;&4`
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M```````P,#`W-S<@`#`P,#`P,"``,#`P,#`P(``P,#`P,#`P,#`P,"`P,#`P
M,#`P,#`P,"`P,3`P,C0`(#``````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````=7-T87(`,#``````````````
M````````````````````````````````````````````````````````````
M````````````,#`P,#`P(``P,#`P,#`@````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````4&%X2&5A9&5R+V9I;&4`````````````````````````
M````````````````````````````````````````````````````````````
M`````````````````````````````#`P,#<W-R``,#`P,#`P(``P,#`P,#`@
M`#`P,#`P,#`P,C8R(#`P,#`P,#`P,#`P(#`Q,C`P-P`@>```````````````
M````````````````````````````````````````````````````````````
M``````````````````````````````````````````````````````````!U
M<W1A<@`P,```````````````````````````````````````````````````
M```````````````````````````````````P,#`P,#`@`#`P,#`P,"``````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M```````````````````````````````````````Q-S@@4T-(24Q9+F%C;"YA
M8V4];W=N97)`.G)W>'!A05)78T-O<SHZ86QL;W<L=7-E<CIU<V5R-S<Z<G=P
M85)C;W,Z.F%L;&]W.C<W+'5S97(Z=7-E<C<W.G=P.E,Z875D:70Z-S<L9W)O
M=7!`.G)W<&%28W,Z.F%L;&]W+&=R;W5P.F=R;W5P-S@Z<F%28SI&.F%L87)M
M.C<X+&5V97)Y;VYE0#IR85)C<SHZ86QL;W<*````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`&9I;&4`````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M```````````````P,#`W-S<@`#`P,#`P,"``,#`P,#`P(``P,#`P,#`P,#`P
M,"`P,#`P,#`P,#`P,"`P,3`P,C0`(#``````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````=7-T87(`,#``````
M````````````````````````````````````````````````````````````
M````````````````````,#`P,#`P(``P,#`P,#`@````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
'````````````
`
end

View file

@ -0,0 +1,117 @@
begin 644 test_acl_pax_posix1e.tar
M9FEL90``````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````#`P,#$T,B``,#`P,#`P(``P,#`P,#`@`#`P,#`P,#`P,#`P
M(#`P,#`P,#`P,#`P(#`Q,#`P-@`@,```````````````````````````````
M````````````````````````````````````````````````````````````
M``````````````````````````````````````````!U<W1A<@`P,```````
M````````````````````````````````````````````````````````````
M```````````````````P,#`P,#`@`#`P,#`P,"``````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M``````````````````````!087A(96%D97(O9FEL90``````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````,#`P,30R(``P,#`P,#`@`#`P
M,#`P,"``,#`P,#`P,#`Q,3`@,#`P,#`P,#`P,#`@,#$Q-S8Q`"!X````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````'5S=&%R`#`P````````````````````````````````````````````
M`````````````````````````````````````````#`P,#`P,"``,#`P,#`P
M(```````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````````````````````````````````````#<R(%-#2$E,62YA
M8VPN86-C97-S/75S97(Z.BTM>"QG<F]U<#HZ<BTM+&]T:&5R.CHM=RTL=7-E
M<CIU<V5R-S<Z<BTM.C<W"@``````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````9FEL90``````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````````````#`P,#$T,B``,#`P,#`P(``P,#`P,#`@`#`P,#`P
M,#`P,#`P(#`P,#`P,#`P,#`P(#`Q,#`P-@`@,```````````````````````
M````````````````````````````````````````````````````````````
M``````````````````````````````````````````````````!U<W1A<@`P
M,```````````````````````````````````````````````````````````
M```````````````````````````P,#`P,#`@`#`P,#`P,"``````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M``````````````````````````````!087A(96%D97(O9FEL90``````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````,#`P-30S(``P,#`P
M,#`@`#`P,#`P,"``,#`P,#`P,#`Q-C$@,#`P,#`P,#`P,#`@,#$Q-S<T`"!X
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````'5S=&%R`#`P````````````````````````````````````
M`````````````````````````````````````````````````#`P,#`P,"``
M,#`P,#`P(```````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````````````````````````````````````````````#$Q,R!3
M0TA)3%DN86-L+F%C8V5S<SUU<V5R.CIR+7@L9W)O=7`Z.G(M+2QO=&AE<CHZ
M+7=X+'5S97(Z=7-E<C<W.G(M+3HW-RQU<V5R.G5S97(W.#HM+2TZ-S@L9W)O
M=7`Z9W)O=7`W.#IR=W@Z-S@*````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````9FEL90``````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````````````````````#`P,#4T,R``,#`P,#`P(``P,#`P,#`@
M`#`P,#`P,#`P,#`P(#`P,#`P,#`P,#`P(#`Q,#`Q,P`@,```````````````
M````````````````````````````````````````````````````````````
M``````````````````````````````````````````````````````````!U
M<W1A<@`P,```````````````````````````````````````````````````
M```````````````````````````````````P,#`P,#`@`#`P,#`P,"``````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M``````````````````````````````````````!F:6QE````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````,#`P,30R
M(``P,#`P,#`@`#`P,#`P,"``,#`P,#`P,#`P,#`@,#`P,#`P,#`P,#`@,#$P
M,#`V`"`P````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````````````'5S=&%R`#`P````````````````````````````
M`````````````````````````````````````````````````````````#`P
M,#`P,"``,#`P,#`P(```````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
C````````````````````````````````````````````````
`
end

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,606 @@
/*-
* Copyright (c) 2003-2008 Tim Kientzle
* Copyright (c) 2017 Martin Matuska
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD: head/lib/libarchive/test/test_acl_freebsd.c 189427 2009-03-06 04:21:23Z kientzle $");
#if ARCHIVE_ACL_POSIX1E
#include <sys/acl.h>
#if HAVE_ACL_GET_PERM
#include <acl/libacl.h>
#define ACL_GET_PERM acl_get_perm
#elif HAVE_ACL_GET_PERM_NP
#define ACL_GET_PERM acl_get_perm_np
#endif
static struct archive_test_acl_t acls2[] = {
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_EXECUTE | ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_USER_OBJ, -1, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_USER, 77, "user77" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0,
ARCHIVE_ENTRY_ACL_USER, 78, "user78" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_GROUP_OBJ, -1, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0007,
ARCHIVE_ENTRY_ACL_GROUP, 78, "group78" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS,
ARCHIVE_ENTRY_ACL_WRITE | ARCHIVE_ENTRY_ACL_EXECUTE,
ARCHIVE_ENTRY_ACL_OTHER, -1, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS,
ARCHIVE_ENTRY_ACL_WRITE | ARCHIVE_ENTRY_ACL_READ | ARCHIVE_ENTRY_ACL_EXECUTE,
ARCHIVE_ENTRY_ACL_MASK, -1, "" },
};
static int
#if ARCHIVE_ACL_SUNOS
acl_entry_get_perm(aclent_t *aclent)
#else
acl_entry_get_perm(acl_entry_t aclent)
#endif
{
int permset = 0;
#if ARCHIVE_ACL_FREEBSD || ARCHIVE_ACL_LIBACL
acl_permset_t opaque_ps;
#endif
#if ARCHIVE_ACL_SUNOS
if (aclent->a_perm & 1)
permset |= ARCHIVE_ENTRY_ACL_EXECUTE;
if (aclent->a_perm & 2)
permset |= ARCHIVE_ENTRY_ACL_WRITE;
if (aclent->a_perm & 4)
permset |= ARCHIVE_ENTRY_ACL_READ;
#else
/* translate the silly opaque permset to a bitmap */
acl_get_permset(aclent, &opaque_ps);
if (ACL_GET_PERM(opaque_ps, ACL_EXECUTE))
permset |= ARCHIVE_ENTRY_ACL_EXECUTE;
if (ACL_GET_PERM(opaque_ps, ACL_WRITE))
permset |= ARCHIVE_ENTRY_ACL_WRITE;
if (ACL_GET_PERM(opaque_ps, ACL_READ))
permset |= ARCHIVE_ENTRY_ACL_READ;
#endif
return permset;
}
#if 0
static int
acl_get_specific_entry(acl_t acl, acl_tag_t requested_tag_type, int requested_tag) {
int entry_id = ACL_FIRST_ENTRY;
acl_entry_t acl_entry;
acl_tag_t acl_tag_type;
while (1 == acl_get_entry(acl, entry_id, &acl_entry)) {
/* After the first time... */
entry_id = ACL_NEXT_ENTRY;
/* If this matches, return perm mask */
acl_get_tag_type(acl_entry, &acl_tag_type);
if (acl_tag_type == requested_tag_type) {
switch (acl_tag_type) {
case ACL_USER_OBJ:
if ((uid_t)requested_tag == *(uid_t *)(acl_get_qualifier(acl_entry))) {
return acl_entry_get_perm(acl_entry);
}
break;
case ACL_GROUP_OBJ:
if ((gid_t)requested_tag == *(gid_t *)(acl_get_qualifier(acl_entry))) {
return acl_entry_get_perm(acl_entry);
}
break;
case ACL_USER:
case ACL_GROUP:
case ACL_OTHER:
return acl_entry_get_perm(acl_entry);
default:
failure("Unexpected ACL tag type");
assert(0);
}
}
}
return -1;
}
#endif
#if ARCHIVE_ACL_SUNOS
static int
acl_match(aclent_t *aclent, struct archive_test_acl_t *myacl)
{
if (myacl->permset != acl_entry_get_perm(aclent))
return (0);
switch (aclent->a_type) {
case DEF_USER_OBJ:
case USER_OBJ:
if (myacl->tag != ARCHIVE_ENTRY_ACL_USER_OBJ) return (0);
break;
if (myacl->tag != ARCHIVE_ENTRY_ACL_USER)
return (0);
if ((uid_t)myacl->qual != aclent->a_id)
return (0);
break;
case DEF_GROUP_OBJ:
case GROUP_OBJ:
if (myacl->tag != ARCHIVE_ENTRY_ACL_GROUP_OBJ) return (0);
break;
case DEF_GROUP:
case GROUP:
if (myacl->tag != ARCHIVE_ENTRY_ACL_GROUP)
return (0);
if ((gid_t)myacl->qual != aclent->a_id)
return (0);
break;
case DEF_CLASS_OBJ:
case CLASS_OBJ:
if (myacl->tag != ARCHIVE_ENTRY_ACL_MASK) return (0);
break;
case DEF_OTHER_OBJ:
case OTHER_OBJ:
if (myacl->tag != ARCHIVE_ENTRY_ACL_OTHER) return (0);
break;
}
return (1);
}
#else /* ARCHIVE_ACL_FREEBSD || ARCHIVE_ACL_LIBACL */
static int
acl_match(acl_entry_t aclent, struct archive_test_acl_t *myacl)
{
gid_t g, *gp;
uid_t u, *up;
acl_tag_t tag_type;
if (myacl->permset != acl_entry_get_perm(aclent))
return (0);
acl_get_tag_type(aclent, &tag_type);
switch (tag_type) {
case ACL_USER_OBJ:
if (myacl->tag != ARCHIVE_ENTRY_ACL_USER_OBJ) return (0);
break;
case ACL_USER:
if (myacl->tag != ARCHIVE_ENTRY_ACL_USER)
return (0);
up = acl_get_qualifier(aclent);
u = *up;
acl_free(up);
if ((uid_t)myacl->qual != u)
return (0);
break;
case ACL_GROUP_OBJ:
if (myacl->tag != ARCHIVE_ENTRY_ACL_GROUP_OBJ) return (0);
break;
case ACL_GROUP:
if (myacl->tag != ARCHIVE_ENTRY_ACL_GROUP)
return (0);
gp = acl_get_qualifier(aclent);
g = *gp;
acl_free(gp);
if ((gid_t)myacl->qual != g)
return (0);
break;
case ACL_MASK:
if (myacl->tag != ARCHIVE_ENTRY_ACL_MASK) return (0);
break;
case ACL_OTHER:
if (myacl->tag != ARCHIVE_ENTRY_ACL_OTHER) return (0);
break;
}
return (1);
}
#endif
static void
compare_acls(
#if ARCHIVE_ACL_SUNOS
void *aclp, int aclcnt,
#else
acl_t acl,
#endif
struct archive_test_acl_t *myacls, int n)
{
int *marker;
int matched;
int i;
#if ARCHIVE_ACL_SUNOS
int e;
aclent_t *acl_entry;
#else
int entry_id = ACL_FIRST_ENTRY;
acl_entry_t acl_entry;
#endif
/* Count ACL entries in myacls array and allocate an indirect array. */
marker = malloc(sizeof(marker[0]) * n);
if (marker == NULL)
return;
for (i = 0; i < n; i++)
marker[i] = i;
/*
* Iterate over acls in system acl object, try to match each
* one with an item in the myacls array.
*/
#if ARCHIVE_ACL_SUNOS
for(e = 0; e < aclcnt; e++) {
acl_entry = &((aclent_t *)aclp)[e];
#else
while (1 == acl_get_entry(acl, entry_id, &acl_entry)) {
/* After the first time... */
entry_id = ACL_NEXT_ENTRY;
#endif
/* Search for a matching entry (tag and qualifier) */
for (i = 0, matched = 0; i < n && !matched; i++) {
if (acl_match(acl_entry, &myacls[marker[i]])) {
/* We found a match; remove it. */
marker[i] = marker[n - 1];
n--;
matched = 1;
}
}
/* TODO: Print out more details in this case. */
failure("ACL entry on file that shouldn't be there");
assert(matched == 1);
}
/* Dump entries in the myacls array that weren't in the system acl. */
for (i = 0; i < n; ++i) {
failure(" ACL entry missing from file: "
"type=%#010x,permset=%#010x,tag=%d,qual=%d,name=``%s''\n",
myacls[marker[i]].type, myacls[marker[i]].permset,
myacls[marker[i]].tag, myacls[marker[i]].qual,
myacls[marker[i]].name);
assert(0); /* Record this as a failure. */
}
free(marker);
}
#endif
/*
* Verify ACL restore-to-disk. This test is Platform-specific.
*/
DEFINE_TEST(test_acl_platform_posix1e_restore)
{
#if !ARCHIVE_ACL_POSIX1E
skipping("POSIX.1e ACLs are not supported on this platform");
#else /* ARCHIVE_ACL_POSIX1E */
struct stat st;
struct archive *a;
struct archive_entry *ae;
#if ARCHIVE_ACL_SUNOS
void *aclp;
int aclcnt;
#else
acl_t acl;
#endif
assertMakeFile("pretest", 0644, "a");
if (setTestAcl("pretest") != ARCHIVE_TEST_ACL_TYPE_POSIX1E) {
skipping("POSIX.1e ACLs are not writable on this filesystem");
return;
}
/* Create a write-to-disk object. */
assert(NULL != (a = archive_write_disk_new()));
archive_write_disk_set_options(a,
ARCHIVE_EXTRACT_TIME | ARCHIVE_EXTRACT_PERM | ARCHIVE_EXTRACT_ACL);
/* Populate an archive entry with some metadata, including ACL info */
ae = archive_entry_new();
assert(ae != NULL);
archive_entry_set_pathname(ae, "test0");
archive_entry_set_mtime(ae, 123456, 7890);
archive_entry_set_size(ae, 0);
assertEntrySetAcls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]));
assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae));
archive_entry_free(ae);
/* Close the archive. */
assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a));
assertEqualInt(ARCHIVE_OK, archive_write_free(a));
/* Verify the data on disk. */
assertEqualInt(0, stat("test0", &st));
assertEqualInt(st.st_mtime, 123456);
#if ARCHIVE_ACL_SUNOS
aclp = sunacl_get(GETACL, &aclcnt, 0, "test0");
failure("acl(): errno = %d (%s)", errno, strerror(errno));
assert(aclp != NULL);
#else
acl = acl_get_file("test0", ACL_TYPE_ACCESS);
failure("acl_get_file(): errno = %d (%s)", errno, strerror(errno));
assert(acl != (acl_t)NULL);
#endif
#if ARCHIVE_ACL_SUNOS
compare_acls(aclp, aclcnt, acls2, sizeof(acls2)/sizeof(acls2[0]));
free(aclp);
aclp = NULL;
#else
compare_acls(acl, acls2, sizeof(acls2)/sizeof(acls2[0]));
acl_free(acl);
#endif
#endif /* ARCHIVE_ACL_POSIX1E */
}
/*
* Verify ACL read-from-disk. This test is Platform-specific.
*/
DEFINE_TEST(test_acl_platform_posix1e_read)
{
#if !ARCHIVE_ACL_POSIX1E
skipping("POSIX.1e ACLs are not supported on this platform");
#else /* ARCHIVE_ACL_POSIX1E */
struct archive *a;
struct archive_entry *ae;
int n, fd, flags, dflags;
char *func, *acl_text;
const char *acl1_text, *acl2_text, *acl3_text;
#if ARCHIVE_ACL_SUNOS
void *aclp;
int aclcnt;
#else
acl_t acl1, acl2, acl3;
#endif
/*
* Manually construct a directory and two files with
* different ACLs. This also serves to verify that ACLs
* are supported on the local filesystem.
*/
/* Create a test file f1 with acl1 */
#if ARCHIVE_ACL_SUNOS
acl1_text = "user::rwx,"
"group::rwx,"
"other:rwx,"
"user:1:rw-,"
"group:15:r-x,"
"mask:rwx";
aclent_t aclp1[] = {
{ USER_OBJ, -1, 4 | 2 | 1 },
{ USER, 1, 4 | 2 },
{ GROUP_OBJ, -1, 4 | 2 | 1 },
{ GROUP, 15, 4 | 1 },
{ CLASS_OBJ, -1, 4 | 2 | 1 },
{ OTHER_OBJ, -1, 4 | 2 | 1 }
};
#else
acl1_text = "user::rwx\n"
"group::rwx\n"
"other::rwx\n"
"user:1:rw-\n"
"group:15:r-x\n"
"mask::rwx";
acl1 = acl_from_text(acl1_text);
failure("acl_from_text(): errno = %d (%s)", errno, strerror(errno));
assert((void *)acl1 != NULL);
#endif
fd = open("f1", O_WRONLY | O_CREAT | O_EXCL, 0777);
failure("Could not create test file?!");
if (!assert(fd >= 0)) {
#if !ARCHIVE_ACL_SUNOS
acl_free(acl1);
#endif
return;
}
#if ARCHIVE_ACL_SUNOS
/* Check if Solaris filesystem supports POSIX.1e ACLs */
aclp = sunacl_get(GETACL, &aclcnt, fd, NULL);
if (aclp == 0)
close(fd);
if (errno == ENOSYS || errno == ENOTSUP) {
skipping("POSIX.1e ACLs are not supported on this filesystem");
return;
}
failure("facl(): errno = %d (%s)", errno, strerror(errno));
assert(aclp != NULL);
func = "facl()";
n = facl(fd, SETACL, (int)(sizeof(aclp1)/sizeof(aclp1[0])), aclp1);
#else
func = "acl_set_fd()";
n = acl_set_fd(fd, acl1);
#endif
#if !ARCHIVE_ACL_SUNOS
acl_free(acl1);
#endif
if (n != 0) {
#if ARCHIVE_ACL_SUNOS
if (errno == ENOSYS || errno == ENOTSUP)
#else
if (errno == EOPNOTSUPP || errno == EINVAL)
#endif
{
close(fd);
skipping("POSIX.1e ACLs are not supported on this filesystem");
return;
}
}
failure("%s: errno = %d (%s)", func, errno, strerror(errno));
assertEqualInt(0, n);
close(fd);
assertMakeDir("d", 0700);
/*
* Create file d/f1 with acl2
*
* This differs from acl1 in the u:1: and g:15: permissions.
*
* This file deliberately has the same name but a different ACL.
* Github Issue #777 explains how libarchive's directory traversal
* did not always correctly enter directories before attempting
* to read ACLs, resulting in reading the ACL from a like-named
* file in the wrong directory.
*/
#if ARCHIVE_ACL_SUNOS
acl2_text = "user::rwx,"
"group::rwx,"
"other:---,"
"user:1:r--,"
"group:15:r--,"
"mask:rwx";
aclent_t aclp2[] = {
{ USER_OBJ, -1, 4 | 2 | 1 },
{ USER, 1, 4 },
{ GROUP_OBJ, -1, 4 | 2 | 1},
{ GROUP, 15, 4 },
{ CLASS_OBJ, -1, 4 | 2 | 1},
{ OTHER_OBJ, -1, 0 }
};
#else
acl2_text = "user::rwx\n"
"group::rwx\n"
"other::---\n"
"user:1:r--\n"
"group:15:r--\n"
"mask::rwx";
acl2 = acl_from_text(acl2_text);
failure("acl_from_text(): errno = %d (%s)", errno, strerror(errno));
assert((void *)acl2 != NULL);
#endif
fd = open("d/f1", O_WRONLY | O_CREAT | O_EXCL, 0777);
failure("Could not create test file?!");
if (!assert(fd >= 0)) {
#if !ARCHIVE_ACL_SUNOS
acl_free(acl2);
#endif
return;
}
#if ARCHIVE_ACL_SUNOS
func = "facl()";
n = facl(fd, SETACL, (int)(sizeof(aclp2) / sizeof(aclp2[0])), aclp2);
#else
func = "acl_set_fd()";
n = acl_set_fd(fd, acl2);
acl_free(acl2);
#endif
if (n != 0)
close(fd);
failure("%s: errno = %d (%s)", func, errno, strerror(errno));
assertEqualInt(0, n);
close(fd);
/* Create nested directory d2 with default ACLs */
assertMakeDir("d/d2", 0755);
#if ARCHIVE_ACL_SUNOS
acl3_text = "user::rwx,"
"group::r-x,"
"other:r-x,"
"user:2:r--,"
"group:16:-w-,"
"mask:rwx,"
"default:user::rwx,"
"default:user:1:r--,"
"default:group::r-x,"
"default:group:15:r--,"
"default:mask:rwx,"
"default:other:r-x";
aclent_t aclp3[] = {
{ USER_OBJ, -1, 4 | 2 | 1 },
{ USER, 2, 4 },
{ GROUP_OBJ, -1, 4 | 1 },
{ GROUP, 16, 2 },
{ CLASS_OBJ, -1, 4 | 2 | 1 },
{ OTHER_OBJ, -1, 4 | 1 },
{ USER_OBJ | ACL_DEFAULT, -1, 4 | 2 | 1 },
{ USER | ACL_DEFAULT, 1, 4 },
{ GROUP_OBJ | ACL_DEFAULT, -1, 4 | 1 },
{ GROUP | ACL_DEFAULT, 15, 4 },
{ CLASS_OBJ | ACL_DEFAULT, -1, 4 | 2 | 1},
{ OTHER_OBJ | ACL_DEFAULT, -1, 4 | 1 }
};
#else
acl3_text = "user::rwx\n"
"user:1:r--\n"
"group::r-x\n"
"group:15:r--\n"
"mask::rwx\n"
"other::r-x";
acl3 = acl_from_text(acl3_text);
failure("acl_from_text(): errno = %d (%s)", errno, strerror(errno));
assert((void *)acl3 != NULL);
#endif
#if ARCHIVE_ACL_SUNOS
func = "acl()";
n = acl("d/d2", SETACL, (int)(sizeof(aclp3) / sizeof(aclp3[0])), aclp3);
#else
func = "acl_set_file()";
n = acl_set_file("d/d2", ACL_TYPE_DEFAULT, acl3);
acl_free(acl3);
#endif
failure("%s: errno = %d (%s)", func, errno, strerror(errno));
assertEqualInt(0, n);
/* Create a read-from-disk object. */
assert(NULL != (a = archive_read_disk_new()));
assertEqualIntA(a, ARCHIVE_OK, archive_read_disk_open(a, "."));
assert(NULL != (ae = archive_entry_new()));
#if ARCHIVE_ACL_SUNOS
flags = ARCHIVE_ENTRY_ACL_TYPE_POSIX1E
| ARCHIVE_ENTRY_ACL_STYLE_SEPARATOR_COMMA
| ARCHIVE_ENTRY_ACL_STYLE_SOLARIS;
dflags = flags;
#else
flags = ARCHIVE_ENTRY_ACL_TYPE_ACCESS;
dflags = ARCHIVE_ENTRY_ACL_TYPE_DEFAULT;
#endif
/* Walk the dir until we see both of the files */
while (ARCHIVE_OK == archive_read_next_header2(a, ae)) {
archive_read_disk_descend(a);
if (strcmp(archive_entry_pathname(ae), "./f1") == 0) {
acl_text = archive_entry_acl_to_text(ae, NULL, flags);
assertEqualString(acl_text, acl1_text);
free(acl_text);
} else if (strcmp(archive_entry_pathname(ae), "./d/f1") == 0) {
acl_text = archive_entry_acl_to_text(ae, NULL, flags);
assertEqualString(acl_text, acl2_text);
free(acl_text);
} else if (strcmp(archive_entry_pathname(ae), "./d/d2") == 0) {
acl_text = archive_entry_acl_to_text(ae, NULL, dflags);
assertEqualString(acl_text, acl3_text);
free(acl_text);
}
}
archive_entry_free(ae);
assertEqualInt(ARCHIVE_OK, archive_free(a));
#endif /* ARCHIVE_ACL_POSIX1E */
}

View file

@ -0,0 +1,180 @@
/*-
* Copyright (c) 2003-2007 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD: src/lib/libarchive/test/test_acl_basic.c,v 1.6 2008/10/19 00:13:57 kientzle Exp $");
/*
* Exercise the system-independent portion of the ACL support.
* Check that archive_entry objects can save and restore POSIX.1e-style
* ACL data.
*
* This should work on all systems, regardless of whether local
* filesystems support ACLs or not.
*/
static struct archive_test_acl_t acls0[] = {
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_EXECUTE,
ARCHIVE_ENTRY_ACL_USER_OBJ, 0, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_GROUP_OBJ, 0, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_WRITE,
ARCHIVE_ENTRY_ACL_OTHER, 0, "" },
};
static struct archive_test_acl_t acls1[] = {
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_EXECUTE,
ARCHIVE_ENTRY_ACL_USER_OBJ, -1, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_USER, 77, "user77" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_GROUP_OBJ, -1, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_WRITE,
ARCHIVE_ENTRY_ACL_OTHER, -1, "" },
};
static struct archive_test_acl_t acls2[] = {
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_EXECUTE | ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_USER_OBJ, -1, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_USER, 77, "user77" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0,
ARCHIVE_ENTRY_ACL_USER, 78, "user78" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_GROUP_OBJ, -1, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0007,
ARCHIVE_ENTRY_ACL_GROUP, 78, "group78" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_WRITE | ARCHIVE_ENTRY_ACL_EXECUTE,
ARCHIVE_ENTRY_ACL_OTHER, -1, "" },
};
/*
* NFS4 entry types; attempts to set these on top of POSIX.1e
* attributes should fail.
*/
static struct archive_test_acl_t acls_nfs4[] = {
/* NFS4 types */
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_USER, 78, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_DENY, ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_USER, 78, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_AUDIT, ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_USER, 78, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALARM, ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_USER, 78, "" },
/* NFS4 tags */
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_EVERYONE, -1, "" },
/* NFS4 inheritance markers */
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS,
ARCHIVE_ENTRY_ACL_READ | ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT,
ARCHIVE_ENTRY_ACL_USER, 79, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS,
ARCHIVE_ENTRY_ACL_READ | ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT,
ARCHIVE_ENTRY_ACL_USER_OBJ, -1, "" },
};
DEFINE_TEST(test_acl_posix1e)
{
struct archive_entry *ae;
int i;
/* Create a simple archive_entry. */
assert((ae = archive_entry_new()) != NULL);
archive_entry_set_pathname(ae, "file");
archive_entry_set_mode(ae, S_IFREG | 0777);
/* Basic owner/owning group should just update mode bits. */
/*
* Note: This features of libarchive's ACL implementation
* shouldn't be relied on and should probably be removed. It
* was done to identify trivial ACLs so we could avoid
* triggering unnecessary extensions. It's better to identify
* trivial ACLs at the point they are being read from disk.
*/
assertEntrySetAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]));
failure("Basic ACLs shouldn't be stored as extended ACLs");
assert(0 == archive_entry_acl_reset(ae, ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
failure("Basic ACLs should set mode to 0142, not %04o",
archive_entry_mode(ae)&0777);
assert((archive_entry_mode(ae) & 0777) == 0142);
/* With any extended ACL entry, we should read back a full set. */
assertEntrySetAcls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]));
failure("One extended ACL should flag all ACLs to be returned.");
/* Check that entry contains only POSIX.1e types */
assert((archive_entry_acl_types(ae) &
ARCHIVE_ENTRY_ACL_TYPE_NFS4) == 0);
assert((archive_entry_acl_types(ae) &
ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) != 0);
assert(4 == archive_entry_acl_reset(ae, ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
assertEntryCompareAcls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]),
ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0142);
failure("Basic ACLs should set mode to 0142, not %04o",
archive_entry_mode(ae)&0777);
assert((archive_entry_mode(ae) & 0777) == 0142);
/* A more extensive set of ACLs. */
assertEntrySetAcls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]));
assertEqualInt(6, archive_entry_acl_reset(ae, ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
assertEntryCompareAcls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]),
ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0543);
failure("Basic ACLs should set mode to 0543, not %04o",
archive_entry_mode(ae)&0777);
assert((archive_entry_mode(ae) & 0777) == 0543);
/*
* Check that clearing ACLs gets rid of them all by repeating
* the first test.
*/
assertEntrySetAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]));
failure("Basic ACLs shouldn't be stored as extended ACLs");
assert(0 == archive_entry_acl_reset(ae, ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
failure("Basic ACLs should set mode to 0142, not %04o",
archive_entry_mode(ae)&0777);
assert((archive_entry_mode(ae) & 0777) == 0142);
/*
* Different types of malformed ACL entries that should
* fail when added to existing POSIX.1e ACLs.
*/
assertEntrySetAcls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]));
for (i = 0; i < (int)(sizeof(acls_nfs4)/sizeof(acls_nfs4[0])); ++i) {
struct archive_test_acl_t *p = &acls_nfs4[i];
failure("Malformed ACL test #%d", i);
assertEqualInt(ARCHIVE_FAILED,
archive_entry_acl_add_entry(ae,
p->type, p->permset, p->tag, p->qual, p->name));
assertEqualInt(6,
archive_entry_acl_reset(ae,
ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
}
archive_entry_free(ae);
}

View file

@ -0,0 +1,473 @@
/*-
* Copyright (c) 2016 Martin Matuska
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD$");
/*
* Test converting ACLs to text, both wide and non-wide
*
* This should work on all systems, regardless of whether local
* filesystems support ACLs or not.
*/
static struct archive_test_acl_t acls0[] = {
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS,
ARCHIVE_ENTRY_ACL_EXECUTE |
ARCHIVE_ENTRY_ACL_READ |
ARCHIVE_ENTRY_ACL_WRITE,
ARCHIVE_ENTRY_ACL_USER_OBJ, -1, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS,
ARCHIVE_ENTRY_ACL_EXECUTE |
ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_USER, 100, "user100" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0,
ARCHIVE_ENTRY_ACL_USER, 1000, "user1000" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS,
ARCHIVE_ENTRY_ACL_EXECUTE |
ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_GROUP_OBJ, -1, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS,
ARCHIVE_ENTRY_ACL_EXECUTE |
ARCHIVE_ENTRY_ACL_READ |
ARCHIVE_ENTRY_ACL_WRITE,
ARCHIVE_ENTRY_ACL_GROUP, 78, "group78" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS,
ARCHIVE_ENTRY_ACL_READ |
ARCHIVE_ENTRY_ACL_EXECUTE,
ARCHIVE_ENTRY_ACL_OTHER, -1, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT,
ARCHIVE_ENTRY_ACL_EXECUTE |
ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_USER_OBJ, -1, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT,
ARCHIVE_ENTRY_ACL_EXECUTE |
ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_GROUP_OBJ, -1, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, 0,
ARCHIVE_ENTRY_ACL_OTHER, -1, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT,
ARCHIVE_ENTRY_ACL_EXECUTE |
ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_USER, 101, "user101"},
{ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT,
ARCHIVE_ENTRY_ACL_EXECUTE,
ARCHIVE_ENTRY_ACL_GROUP, 79, "group79" },
};
static struct archive_test_acl_t acls1[] = {
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
ARCHIVE_ENTRY_ACL_READ_DATA |
ARCHIVE_ENTRY_ACL_WRITE_DATA |
ARCHIVE_ENTRY_ACL_APPEND_DATA |
ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_READ_ACL |
ARCHIVE_ENTRY_ACL_WRITE_OWNER,
ARCHIVE_ENTRY_ACL_USER, 77, "user77" },
{ ARCHIVE_ENTRY_ACL_TYPE_DENY,
ARCHIVE_ENTRY_ACL_WRITE_DATA |
ARCHIVE_ENTRY_ACL_APPEND_DATA |
ARCHIVE_ENTRY_ACL_DELETE_CHILD |
ARCHIVE_ENTRY_ACL_DELETE |
ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT |
ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT |
ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY |
ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT,
ARCHIVE_ENTRY_ACL_USER, 101, "user101" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
ARCHIVE_ENTRY_ACL_READ_DATA |
ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_READ_ACL |
ARCHIVE_ENTRY_ACL_ENTRY_INHERITED,
ARCHIVE_ENTRY_ACL_GROUP, 78, "group78" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
ARCHIVE_ENTRY_ACL_READ_DATA |
ARCHIVE_ENTRY_ACL_WRITE_DATA |
ARCHIVE_ENTRY_ACL_EXECUTE |
ARCHIVE_ENTRY_ACL_APPEND_DATA |
ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_READ_ACL |
ARCHIVE_ENTRY_ACL_WRITE_ACL |
ARCHIVE_ENTRY_ACL_WRITE_OWNER,
ARCHIVE_ENTRY_ACL_USER_OBJ, 0, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
ARCHIVE_ENTRY_ACL_READ_DATA |
ARCHIVE_ENTRY_ACL_WRITE_DATA |
ARCHIVE_ENTRY_ACL_APPEND_DATA |
ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_READ_ACL,
ARCHIVE_ENTRY_ACL_GROUP_OBJ, 0, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
ARCHIVE_ENTRY_ACL_READ_DATA |
ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_READ_ACL |
ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
ARCHIVE_ENTRY_ACL_EVERYONE, 0, "" },
};
const char* acltext[] = {
"user::rwx\n"
"group::r-x\n"
"other::r-x\n"
"user:user100:r-x\n"
"user:user1000:---\n"
"group:group78:rwx\n"
"default:user::r-x\n"
"default:group::r-x\n"
"default:other::---\n"
"default:user:user101:r-x\n"
"default:group:group79:--x",
"user::rwx\n"
"group::r-x\n"
"other::r-x\n"
"user:user100:r-x:100\n"
"user:user1000:---:1000\n"
"group:group78:rwx:78\n"
"default:user::r-x\n"
"default:group::r-x\n"
"default:other::---\n"
"default:user:user101:r-x:101\n"
"default:group:group79:--x:79",
"u::rwx\n"
"g::r-x\n"
"o::r-x\n"
"u:user100:r-x:100\n"
"u:user1000:---:1000\n"
"g:group78:rwx:78\n"
"d:user::r-x\n"
"d:group::r-x\n"
"d:other::---\n"
"d:user:user101:r-x:101\n"
"d:group:group79:--x:79",
"user::rwx\n"
"group::r-x\n"
"other::r-x\n"
"user:user100:r-x\n"
"user:user1000:---\n"
"group:group78:rwx",
"user::rwx,"
"group::r-x,"
"other::r-x,"
"user:user100:r-x,"
"user:user1000:---,"
"group:group78:rwx",
"user::rwx\n"
"group::r-x\n"
"other::r-x\n"
"user:user100:r-x:100\n"
"user:user1000:---:1000\n"
"group:group78:rwx:78",
"user::r-x\n"
"group::r-x\n"
"other::---\n"
"user:user101:r-x\n"
"group:group79:--x",
"user::r-x\n"
"group::r-x\n"
"other::---\n"
"user:user101:r-x:101\n"
"group:group79:--x:79",
"default:user::r-x\n"
"default:group::r-x\n"
"default:other::---\n"
"default:user:user101:r-x\n"
"default:group:group79:--x",
"user:user77:rw-p--a-R-c-o-:-------:allow\n"
"user:user101:-w-pdD--------:fdin---:deny\n"
"group:group78:r-----a-R-c---:------I:allow\n"
"owner@:rwxp--aARWcCo-:-------:allow\n"
"group@:rw-p--a-R-c---:-------:allow\n"
"everyone@:r-----a-R-c--s:-------:allow",
"user:user77:rw-p--a-R-c-o-:-------:allow:77\n"
"user:user101:-w-pdD--------:fdin---:deny:101\n"
"group:group78:r-----a-R-c---:------I:allow:78\n"
"owner@:rwxp--aARWcCo-:-------:allow\n"
"group@:rw-p--a-R-c---:-------:allow\n"
"everyone@:r-----a-R-c--s:-------:allow",
"user:user77:rwpaRco::allow:77\n"
"user:user101:wpdD:fdin:deny:101\n"
"group:group78:raRc:I:allow:78\n"
"owner@:rwxpaARWcCo::allow\n"
"group@:rwpaRc::allow\n"
"everyone@:raRcs::allow"
};
static wchar_t *
convert_s_to_ws(const char *s)
{
size_t len;
wchar_t *ws = NULL;
if (s != NULL) {
len = strlen(s) + 1;
ws = malloc(len * sizeof(wchar_t));
assert(mbstowcs(ws, s, len) != (size_t)-1);
}
return (ws);
}
static void
compare_acl_text(struct archive_entry *ae, int flags, const char *s)
{
char *text;
wchar_t *wtext;
wchar_t *ws;
ssize_t slen;
ws = convert_s_to_ws(s);
text = archive_entry_acl_to_text(ae, &slen, flags);
assertEqualString(text, s);
if (text != NULL)
assertEqualInt(strlen(text), slen);
wtext = archive_entry_acl_to_text_w(ae, &slen, flags);
assertEqualWString(wtext, ws);
if (wtext != NULL) {
assertEqualInt(wcslen(wtext), slen);
}
free(text);
free(wtext);
free(ws);
}
DEFINE_TEST(test_acl_from_text)
{
struct archive_entry *ae;
wchar_t *ws = NULL;
/* Create an empty archive_entry. */
assert((ae = archive_entry_new()) != NULL);
/* 1a. Read POSIX.1e access ACLs from text */
assertEqualInt(ARCHIVE_OK,
archive_entry_acl_from_text(ae, acltext[5],
ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
assertEntryCompareAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]),
ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0755);
assertEqualInt(6, archive_entry_acl_reset(ae,
ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
/* 1b. Now read POSIX.1e default ACLs and append them */
assertEqualInt(ARCHIVE_OK,
archive_entry_acl_from_text(ae, acltext[7],
ARCHIVE_ENTRY_ACL_TYPE_DEFAULT));
assertEntryCompareAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]),
ARCHIVE_ENTRY_ACL_TYPE_POSIX1E, 0755);
assertEqualInt(11, archive_entry_acl_reset(ae,
ARCHIVE_ENTRY_ACL_TYPE_POSIX1E));
archive_entry_acl_clear(ae);
/* 1a and 1b with wide strings */
ws = convert_s_to_ws(acltext[5]);
assertEqualInt(ARCHIVE_OK,
archive_entry_acl_from_text_w(ae, ws,
ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
assertEntryCompareAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]),
ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0755);
assertEqualInt(6, archive_entry_acl_reset(ae,
ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
free(ws);
ws = convert_s_to_ws(acltext[7]);
assertEqualInt(ARCHIVE_OK,
archive_entry_acl_from_text_w(ae, ws,
ARCHIVE_ENTRY_ACL_TYPE_DEFAULT));
assertEntryCompareAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]),
ARCHIVE_ENTRY_ACL_TYPE_POSIX1E, 0755);
assertEqualInt(11, archive_entry_acl_reset(ae,
ARCHIVE_ENTRY_ACL_TYPE_POSIX1E));
archive_entry_acl_clear(ae);
/* 2. Read POSIX.1e default ACLs from text */
assertEqualInt(ARCHIVE_OK,
archive_entry_acl_from_text(ae, acltext[7],
ARCHIVE_ENTRY_ACL_TYPE_DEFAULT));
assertEntryCompareAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]),
ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, 0);
assertEqualInt(5, archive_entry_acl_reset(ae,
ARCHIVE_ENTRY_ACL_TYPE_DEFAULT));
archive_entry_acl_clear(ae);
/* ws is still acltext[7] */
assertEqualInt(ARCHIVE_OK,
archive_entry_acl_from_text_w(ae, ws,
ARCHIVE_ENTRY_ACL_TYPE_DEFAULT));
assertEntryCompareAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]),
ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, 0);
assertEqualInt(5, archive_entry_acl_reset(ae,
ARCHIVE_ENTRY_ACL_TYPE_DEFAULT));
archive_entry_acl_clear(ae);
/* 3. Read POSIX.1e access and default ACLs from text */
assertEqualInt(ARCHIVE_OK,
archive_entry_acl_from_text(ae, acltext[1],
ARCHIVE_ENTRY_ACL_TYPE_POSIX1E));
assertEntryCompareAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]),
ARCHIVE_ENTRY_ACL_TYPE_POSIX1E, 0755);
assertEqualInt(11, archive_entry_acl_reset(ae,
ARCHIVE_ENTRY_ACL_TYPE_POSIX1E));
archive_entry_acl_clear(ae);
free(ws);
ws = convert_s_to_ws(acltext[1]);
assertEqualInt(ARCHIVE_OK,
archive_entry_acl_from_text_w(ae, ws,
ARCHIVE_ENTRY_ACL_TYPE_POSIX1E));
assertEntryCompareAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]),
ARCHIVE_ENTRY_ACL_TYPE_POSIX1E, 0755);
assertEqualInt(11, archive_entry_acl_reset(ae,
ARCHIVE_ENTRY_ACL_TYPE_POSIX1E));
archive_entry_acl_clear(ae);
/* 4. Read POSIX.1e access and default ACLs from text (short form) */
assertEqualInt(ARCHIVE_OK,
archive_entry_acl_from_text(ae, acltext[2],
ARCHIVE_ENTRY_ACL_TYPE_POSIX1E));
assertEntryCompareAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]),
ARCHIVE_ENTRY_ACL_TYPE_POSIX1E, 0755);
assertEqualInt(11, archive_entry_acl_reset(ae,
ARCHIVE_ENTRY_ACL_TYPE_POSIX1E));
archive_entry_acl_clear(ae);
free(ws);
ws = convert_s_to_ws(acltext[2]);
assertEqualInt(ARCHIVE_OK,
archive_entry_acl_from_text_w(ae, ws,
ARCHIVE_ENTRY_ACL_TYPE_POSIX1E));
assertEntryCompareAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]),
ARCHIVE_ENTRY_ACL_TYPE_POSIX1E, 0755);
assertEqualInt(11, archive_entry_acl_reset(ae,
ARCHIVE_ENTRY_ACL_TYPE_POSIX1E));
archive_entry_acl_clear(ae);
/* 5. Read NFSv4 ACLs from text */
assertEqualInt(ARCHIVE_OK,
archive_entry_acl_from_text(ae, acltext[10],
ARCHIVE_ENTRY_ACL_TYPE_NFS4));
assertEntryCompareAcls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]),
ARCHIVE_ENTRY_ACL_TYPE_NFS4, 0);
assertEqualInt(6, archive_entry_acl_reset(ae,
ARCHIVE_ENTRY_ACL_TYPE_NFS4));
archive_entry_acl_clear(ae);
free(ws);
ws = convert_s_to_ws(acltext[10]);
assertEqualInt(ARCHIVE_OK,
archive_entry_acl_from_text_w(ae, ws,
ARCHIVE_ENTRY_ACL_TYPE_NFS4));
assertEntryCompareAcls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]),
ARCHIVE_ENTRY_ACL_TYPE_NFS4, 0);
assertEqualInt(6, archive_entry_acl_reset(ae,
ARCHIVE_ENTRY_ACL_TYPE_NFS4));
archive_entry_acl_clear(ae);
free(ws);
archive_entry_free(ae);
}
DEFINE_TEST(test_acl_to_text)
{
struct archive_entry *ae;
/* Create an empty archive_entry. */
assert((ae = archive_entry_new()) != NULL);
/* Write POSIX.1e ACLs */
assertEntrySetAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]));
/* No flags should give output like getfacl(1) on linux */
compare_acl_text(ae, 0, acltext[0]);
/* This should give the same output as previous test */
compare_acl_text(ae, ARCHIVE_ENTRY_ACL_TYPE_ACCESS |
ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, acltext[0]);
/* This should give the same output as previous two tests */
compare_acl_text(ae, ARCHIVE_ENTRY_ACL_TYPE_ACCESS |
ARCHIVE_ENTRY_ACL_TYPE_DEFAULT |
ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT, acltext[0]);
/* POSIX.1e access and default ACLs with appended ID */
compare_acl_text(ae, ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID, acltext[1]);
/* POSIX.1e access acls only, like getfacl(1) on FreeBSD */
compare_acl_text(ae, ARCHIVE_ENTRY_ACL_TYPE_ACCESS, acltext[3]);
/* POSIX.1e access acls separated with comma */
compare_acl_text(ae, ARCHIVE_ENTRY_ACL_TYPE_ACCESS |
ARCHIVE_ENTRY_ACL_STYLE_SEPARATOR_COMMA,
acltext[4]);
/* POSIX.1e access acls with appended user or group ID */
compare_acl_text(ae, ARCHIVE_ENTRY_ACL_TYPE_ACCESS |
ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID, acltext[5]);
/* POSIX.1e default acls */
compare_acl_text(ae, ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, acltext[6]);
/* POSIX.1e default acls with appended user or group ID */
compare_acl_text(ae, ARCHIVE_ENTRY_ACL_TYPE_DEFAULT |
ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID, acltext[7]);
/* POSIX.1e default acls prefixed with default: */
compare_acl_text(ae, ARCHIVE_ENTRY_ACL_TYPE_DEFAULT |
ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT, acltext[8]);
/* Write NFSv4 ACLs */
assertEntrySetAcls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]));
/* NFSv4 ACLs like getfacl(1) on FreeBSD */
compare_acl_text(ae, 0, acltext[9]);
/* NFSv4 ACLs like "getfacl -i" on FreeBSD */
compare_acl_text(ae, ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID, acltext[10]);
/* NFSv4 ACLs like "getfacl -i" on FreeBSD with stripped minus chars */
compare_acl_text(ae, ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID |
ARCHIVE_ENTRY_ACL_STYLE_COMPACT, acltext[11]);
archive_entry_free(ae);
}

View file

@ -0,0 +1,54 @@
/*-
* Copyright (c) 2003-2007 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD: src/lib/libarchive/test/test_archive_api_feature.c,v 1.5 2008/05/26 17:00:24 kientzle Exp $");
DEFINE_TEST(test_archive_api_feature)
{
char buff[128];
const char *p;
/* This is the (hopefully) final versioning API. */
assertEqualInt(ARCHIVE_VERSION_NUMBER, archive_version_number());
sprintf(buff, "libarchive %d.%d.%d",
archive_version_number() / 1000000,
(archive_version_number() / 1000) % 1000,
archive_version_number() % 1000);
failure("Version string is: %s, computed is: %s",
archive_version_string(), buff);
assertEqualMem(buff, archive_version_string(), strlen(buff));
if (strlen(buff) < strlen(archive_version_string())) {
p = archive_version_string() + strlen(buff);
failure("Version string is: %s", archive_version_string());
if (p[0] == 'd'&& p[1] == 'e' && p[2] == 'v')
p += 3;
else {
assert(*p == 'a' || *p == 'b' || *p == 'c' || *p == 'd');
++p;
}
failure("Version string is: %s", archive_version_string());
assert(*p == '\0');
}
}

View file

@ -0,0 +1,42 @@
/*-
* Copyright (c) 2003-2010 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD$");
DEFINE_TEST(test_archive_clear_error)
{
struct archive* a = archive_read_new();
archive_set_error(a, 12, "abcdefgh");
assertEqualInt(12, archive_errno(a));
assertEqualString("abcdefgh", archive_error_string(a));
archive_clear_error(a);
assertEqualInt(0, archive_errno(a));
assertEqualString(NULL, archive_error_string(a));
archive_read_free(a);
}

View file

@ -0,0 +1,141 @@
/*-
* Copyright (c) 2012 Michihiro NAKAJIMA
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD$");
#define __LIBARCHIVE_TEST
#include "archive_cmdline_private.h"
DEFINE_TEST(test_archive_cmdline)
{
struct archive_cmdline *cl;
/* Command name only. */
assert((cl = __archive_cmdline_allocate()) != NULL);
if (cl == NULL)
return;
assertEqualInt(ARCHIVE_OK, __archive_cmdline_parse(cl, "gzip"));
assertEqualInt(1, cl->argc);
assertEqualString("gzip", cl->path);
assertEqualString("gzip", cl->argv[0]);
assertEqualInt(ARCHIVE_OK, __archive_cmdline_free(cl));
assert((cl = __archive_cmdline_allocate()) != NULL);
if (cl == NULL)
return;
assertEqualInt(ARCHIVE_OK, __archive_cmdline_parse(cl, "gzip "));
assertEqualInt(1, cl->argc);
failure("path should not include a space character");
assertEqualString("gzip", cl->path);
failure("arg0 should not include a space character");
assertEqualString("gzip", cl->argv[0]);
assertEqualInt(ARCHIVE_OK, __archive_cmdline_free(cl));
assert((cl = __archive_cmdline_allocate()) != NULL);
if (cl == NULL)
return;
assertEqualInt(ARCHIVE_OK, __archive_cmdline_parse(cl,
"/usr/bin/gzip "));
assertEqualInt(1, cl->argc);
failure("path should be a full path");
assertEqualString("/usr/bin/gzip", cl->path);
failure("arg0 should not be a full path");
assertEqualString("gzip", cl->argv[0]);
assertEqualInt(ARCHIVE_OK, __archive_cmdline_free(cl));
/* A command line includes space character. */
assert((cl = __archive_cmdline_allocate()) != NULL);
if (cl == NULL)
return;
assertEqualInt(ARCHIVE_OK, __archive_cmdline_parse(cl, "\"gzip \""));
assertEqualInt(1, cl->argc);
failure("path should include a space character");
assertEqualString("gzip ", cl->path);
failure("arg0 should include a space character");
assertEqualString("gzip ", cl->argv[0]);
assertEqualInt(ARCHIVE_OK, __archive_cmdline_free(cl));
/* A command line includes space character: pattern 2.*/
assert((cl = __archive_cmdline_allocate()) != NULL);
if (cl == NULL)
return;
assertEqualInt(ARCHIVE_OK, __archive_cmdline_parse(cl, "\"gzip \"x"));
assertEqualInt(1, cl->argc);
failure("path should include a space character");
assertEqualString("gzip x", cl->path);
failure("arg0 should include a space character");
assertEqualString("gzip x", cl->argv[0]);
assertEqualInt(ARCHIVE_OK, __archive_cmdline_free(cl));
/* A command line includes space character: pattern 3.*/
assert((cl = __archive_cmdline_allocate()) != NULL);
if (cl == NULL)
return;
assertEqualInt(ARCHIVE_OK, __archive_cmdline_parse(cl,
"\"gzip \"x\" s \""));
assertEqualInt(1, cl->argc);
failure("path should include a space character");
assertEqualString("gzip x s ", cl->path);
failure("arg0 should include a space character");
assertEqualString("gzip x s ", cl->argv[0]);
assertEqualInt(ARCHIVE_OK, __archive_cmdline_free(cl));
/* A command line includes space character: pattern 4.*/
assert((cl = __archive_cmdline_allocate()) != NULL);
if (cl == NULL)
return;
assertEqualInt(ARCHIVE_OK, __archive_cmdline_parse(cl,
"\"gzip\\\" \""));
assertEqualInt(1, cl->argc);
failure("path should include a space character");
assertEqualString("gzip\" ", cl->path);
failure("arg0 should include a space character");
assertEqualString("gzip\" ", cl->argv[0]);
assertEqualInt(ARCHIVE_OK, __archive_cmdline_free(cl));
/* A command name with a argument. */
assert((cl = __archive_cmdline_allocate()) != NULL);
if (cl == NULL)
return;
assertEqualInt(ARCHIVE_OK, __archive_cmdline_parse(cl, "gzip -d"));
assertEqualInt(2, cl->argc);
assertEqualString("gzip", cl->path);
assertEqualString("gzip", cl->argv[0]);
assertEqualString("-d", cl->argv[1]);
assertEqualInt(ARCHIVE_OK, __archive_cmdline_free(cl));
/* A command name with two arguments. */
assert((cl = __archive_cmdline_allocate()) != NULL);
if (cl == NULL)
return;
assertEqualInt(ARCHIVE_OK, __archive_cmdline_parse(cl, "gzip -d -q"));
assertEqualInt(3, cl->argc);
assertEqualString("gzip", cl->path);
assertEqualString("gzip", cl->argv[0]);
assertEqualString("-d", cl->argv[1]);
assertEqualString("-q", cl->argv[2]);
assertEqualInt(ARCHIVE_OK, __archive_cmdline_free(cl));
}

View file

@ -0,0 +1,145 @@
/*-
* Copyright (c) 2003-2007 Tim Kientzle
* Copyright (c) 2011 Andres Mejia
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
/* Sanity test of internal digest functionality */
#define __LIBARCHIVE_BUILD 1
#include "archive_digest_private.h"
DEFINE_TEST(test_archive_md5)
{
archive_md5_ctx ctx;
unsigned char buf[] = "";
unsigned char md[16];
unsigned char actualmd[] = "\x93\xb8\x85\xad\xfe\x0d\xa0\x89"
"\xcd\xf6\x34\x90\x4f\xd5\x9f\x71";
if (ARCHIVE_OK != archive_md5_init(&ctx)) {
skipping("This platform does not support MD5");
return;
}
assertEqualInt(ARCHIVE_OK, archive_md5_update(&ctx, buf, sizeof(buf)));
assertEqualInt(ARCHIVE_OK, archive_md5_final(&ctx, md));
assertEqualMem(md, actualmd, sizeof(md));
}
DEFINE_TEST(test_archive_rmd160)
{
archive_rmd160_ctx ctx;
unsigned char buf[] = "";
unsigned char md[20];
unsigned char actualmd[] = "\xc8\x1b\x94\x93\x34\x20\x22\x1a\x7a\xc0"
"\x04\xa9\x02\x42\xd8\xb1\xd3\xe5\x07\x0d";
if (ARCHIVE_OK != archive_rmd160_init(&ctx)) {
skipping("This platform does not support RMD160");
return;
}
assertEqualInt(ARCHIVE_OK, archive_rmd160_update(&ctx, buf, sizeof(buf)));
assertEqualInt(ARCHIVE_OK, archive_rmd160_final(&ctx, md));
assertEqualMem(md, actualmd, sizeof(md));
}
DEFINE_TEST(test_archive_sha1)
{
archive_sha1_ctx ctx;
unsigned char buf[] = "";
unsigned char md[20];
unsigned char actualmd[] = "\x5b\xa9\x3c\x9d\xb0\xcf\xf9\x3f\x52\xb5"
"\x21\xd7\x42\x0e\x43\xf6\xed\xa2\x78\x4f";
if (ARCHIVE_OK != archive_sha1_init(&ctx)) {
skipping("This platform does not support SHA1");
return;
}
assertEqualInt(ARCHIVE_OK, archive_sha1_update(&ctx, buf, sizeof(buf)));
assertEqualInt(ARCHIVE_OK, archive_sha1_final(&ctx, md));
assertEqualMem(md, actualmd, sizeof(md));
}
DEFINE_TEST(test_archive_sha256)
{
archive_sha256_ctx ctx;
unsigned char buf[] = "";
unsigned char md[32];
unsigned char actualmd[] = "\x6e\x34\x0b\x9c\xff\xb3\x7a\x98"
"\x9c\xa5\x44\xe6\xbb\x78\x0a\x2c"
"\x78\x90\x1d\x3f\xb3\x37\x38\x76"
"\x85\x11\xa3\x06\x17\xaf\xa0\x1d";
if (ARCHIVE_OK != archive_sha256_init(&ctx)) {
skipping("This platform does not support SHA256");
return;
}
assertEqualInt(ARCHIVE_OK, archive_sha256_update(&ctx, buf, sizeof(buf)));
assertEqualInt(ARCHIVE_OK, archive_sha256_final(&ctx, md));
assertEqualMem(md, actualmd, sizeof(md));
}
DEFINE_TEST(test_archive_sha384)
{
archive_sha384_ctx ctx;
unsigned char buf[] = "";
unsigned char md[48];
unsigned char actualmd[] = "\xbe\xc0\x21\xb4\xf3\x68\xe3\x06"
"\x91\x34\xe0\x12\xc2\xb4\x30\x70"
"\x83\xd3\xa9\xbd\xd2\x06\xe2\x4e"
"\x5f\x0d\x86\xe1\x3d\x66\x36\x65"
"\x59\x33\xec\x2b\x41\x34\x65\x96"
"\x68\x17\xa9\xc2\x08\xa1\x17\x17";
if (ARCHIVE_OK != archive_sha384_init(&ctx)) {
skipping("This platform does not support SHA384");
return;
}
assertEqualInt(ARCHIVE_OK, archive_sha384_update(&ctx, buf, sizeof(buf)));
assertEqualInt(ARCHIVE_OK, archive_sha384_final(&ctx, md));
assertEqualMem(md, actualmd, sizeof(md));
}
DEFINE_TEST(test_archive_sha512)
{
archive_sha512_ctx ctx;
unsigned char buf[] = "";
unsigned char md[64];
unsigned char actualmd[] = "\xb8\x24\x4d\x02\x89\x81\xd6\x93"
"\xaf\x7b\x45\x6a\xf8\xef\xa4\xca"
"\xd6\x3d\x28\x2e\x19\xff\x14\x94"
"\x2c\x24\x6e\x50\xd9\x35\x1d\x22"
"\x70\x4a\x80\x2a\x71\xc3\x58\x0b"
"\x63\x70\xde\x4c\xeb\x29\x3c\x32"
"\x4a\x84\x23\x34\x25\x57\xd4\xe5"
"\xc3\x84\x38\xf0\xe3\x69\x10\xee";
if (ARCHIVE_OK != archive_sha512_init(&ctx)) {
skipping("This platform does not support SHA512");
return;
}
assertEqualInt(ARCHIVE_OK, archive_sha512_update(&ctx, buf, sizeof(buf)));
assertEqualInt(ARCHIVE_OK, archive_sha512_final(&ctx, md));
assertEqualMem(md, actualmd, sizeof(md));
}

View file

@ -0,0 +1,89 @@
/*-
* Copyright (c) 2003-2007 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD$");
#include <time.h>
#define __LIBARCHIVE_BUILD 1
#include "archive_getdate.h"
/*
* Verify that the getdate() function works.
*/
#define get_date __archive_get_date
DEFINE_TEST(test_archive_getdate)
{
time_t now = time(NULL);
assertEqualInt(get_date(now, "Jan 1, 1970 UTC"), 0);
assertEqualInt(get_date(now, "7:12:18-0530 4 May 1983"), 420900138);
assertEqualInt(get_date(now, "2004/01/29 513 mest"), 1075345980);
assertEqualInt(get_date(now, "99/02/17 7pm utc"), 919278000);
assertEqualInt(get_date(now, "02/17/99 7:11am est"), 919253460);
assertEqualInt(get_date(now, "now - 2 hours"),
get_date(now, "2 hours ago"));
assertEqualInt(get_date(now, "2 hours ago"),
get_date(now, "+2 hours ago"));
assertEqualInt(get_date(now, "now - 2 hours"),
get_date(now, "-2 hours"));
/* It's important that we handle ctime() format. */
assertEqualInt(get_date(now, "Sun Feb 22 17:38:26 PST 2009"),
1235353106);
/* Basic relative offsets. */
/* If we use the actual current time as the reference, then
* these tests break around DST changes, so it's actually
* important to use a specific reference time here. */
assertEqualInt(get_date(0, "tomorrow"), 24 * 60 * 60);
assertEqualInt(get_date(0, "yesterday"), - 24 * 60 * 60);
assertEqualInt(get_date(0, "now + 1 hour"), 60 * 60);
assertEqualInt(get_date(0, "now + 1 hour + 1 minute"), 60 * 60 + 60);
/* Repeat the above for a different start time. */
now = 1231113600; /* Jan 5, 2009 00:00 UTC */
assertEqualInt(get_date(0, "Jan 5, 2009 00:00 UTC"), now);
assertEqualInt(get_date(now, "tomorrow"), now + 24 * 60 * 60);
assertEqualInt(get_date(now, "yesterday"), now - 24 * 60 * 60);
assertEqualInt(get_date(now, "now + 1 hour"), now + 60 * 60);
assertEqualInt(get_date(now, "now + 1 hour + 1 minute"),
now + 60 * 60 + 60);
assertEqualInt(get_date(now, "tomorrow 5:16am UTC"),
now + 24 * 60 * 60 + 5 * 60 * 60 + 16 * 60);
assertEqualInt(get_date(now, "UTC 5:16am tomorrow"),
now + 24 * 60 * 60 + 5 * 60 * 60 + 16 * 60);
/* Jan 5, 2009 was a Monday. */
assertEqualInt(get_date(now, "monday UTC"), now);
assertEqualInt(get_date(now, "sunday UTC"), now + 6 * 24 * 60 * 60);
assertEqualInt(get_date(now, "tuesday UTC"), now + 24 * 60 * 60);
/* "next tuesday" is one week after "tuesday" */
assertEqualInt(get_date(now, "UTC next tuesday"),
now + 8 * 24 * 60 * 60);
/* "last tuesday" is one week before "tuesday" */
assertEqualInt(get_date(now, "last tuesday UTC"),
now - 6 * 24 * 60 * 60);
/* TODO: Lots more tests here. */
}

View file

@ -0,0 +1,289 @@
/*-
* Copyright (c) 2012 Michihiro NAKAJIMA
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD$");
static void
test_uid(void)
{
struct archive_entry *ae;
struct archive *m;
if (!assert((m = archive_match_new()) != NULL))
return;
if (!assert((ae = archive_entry_new()) != NULL)) {
archive_match_free(m);
return;
}
assertEqualIntA(m, 0, archive_match_include_uid(m, 1000));
assertEqualIntA(m, 0, archive_match_include_uid(m, 1002));
archive_entry_set_uid(ae, 0);
failure("uid 0 should be excluded");
assertEqualInt(1, archive_match_owner_excluded(m, ae));
assertEqualInt(1, archive_match_excluded(m, ae));
archive_entry_set_uid(ae, 1000);
failure("uid 1000 should not be excluded");
assertEqualInt(0, archive_match_owner_excluded(m, ae));
assertEqualInt(0, archive_match_excluded(m, ae));
archive_entry_set_uid(ae, 1001);
failure("uid 1001 should be excluded");
assertEqualInt(1, archive_match_owner_excluded(m, ae));
assertEqualInt(1, archive_match_excluded(m, ae));
archive_entry_set_uid(ae, 1002);
failure("uid 1002 should not be excluded");
assertEqualInt(0, archive_match_owner_excluded(m, ae));
assertEqualInt(0, archive_match_excluded(m, ae));
archive_entry_set_uid(ae, 1003);
failure("uid 1003 should be excluded");
assertEqualInt(1, archive_match_owner_excluded(m, ae));
assertEqualInt(1, archive_match_excluded(m, ae));
/* Clean up. */
archive_entry_free(ae);
archive_match_free(m);
}
static void
test_gid(void)
{
struct archive_entry *ae;
struct archive *m;
if (!assert((m = archive_match_new()) != NULL))
return;
if (!assert((ae = archive_entry_new()) != NULL)) {
archive_match_free(m);
return;
}
assertEqualIntA(m, 0, archive_match_include_gid(m, 1000));
assertEqualIntA(m, 0, archive_match_include_gid(m, 1002));
archive_entry_set_gid(ae, 0);
failure("uid 0 should be excluded");
assertEqualInt(1, archive_match_owner_excluded(m, ae));
assertEqualInt(1, archive_match_excluded(m, ae));
archive_entry_set_gid(ae, 1000);
failure("uid 1000 should not be excluded");
assertEqualInt(0, archive_match_owner_excluded(m, ae));
assertEqualInt(0, archive_match_excluded(m, ae));
archive_entry_set_gid(ae, 1001);
failure("uid 1001 should be excluded");
assertEqualInt(1, archive_match_owner_excluded(m, ae));
assertEqualInt(1, archive_match_excluded(m, ae));
archive_entry_set_gid(ae, 1002);
failure("uid 1002 should not be excluded");
assertEqualInt(0, archive_match_owner_excluded(m, ae));
assertEqualInt(0, archive_match_excluded(m, ae));
archive_entry_set_gid(ae, 1003);
failure("uid 1003 should be excluded");
assertEqualInt(1, archive_match_owner_excluded(m, ae));
assertEqualInt(1, archive_match_excluded(m, ae));
/* Clean up. */
archive_entry_free(ae);
archive_match_free(m);
}
static void
test_uname_mbs(void)
{
struct archive_entry *ae;
struct archive *m;
if (!assert((m = archive_match_new()) != NULL))
return;
if (!assert((ae = archive_entry_new()) != NULL)) {
archive_match_free(m);
return;
}
assertEqualIntA(m, 0, archive_match_include_uname(m, "foo"));
assertEqualIntA(m, 0, archive_match_include_uname(m, "bar"));
archive_entry_copy_uname(ae, "unknown");
failure("User 'unknown' should be excluded");
assertEqualInt(1, archive_match_owner_excluded(m, ae));
assertEqualInt(1, archive_match_excluded(m, ae));
archive_entry_copy_uname(ae, "foo");
failure("User 'foo' should not be excluded");
assertEqualInt(0, archive_match_owner_excluded(m, ae));
assertEqualInt(0, archive_match_excluded(m, ae));
archive_entry_copy_uname(ae, "foo1");
failure("User 'foo1' should be excluded");
assertEqualInt(1, archive_match_owner_excluded(m, ae));
assertEqualInt(1, archive_match_excluded(m, ae));
archive_entry_copy_uname(ae, "bar");
failure("User 'bar' should not be excluded");
assertEqualInt(0, archive_match_owner_excluded(m, ae));
assertEqualInt(0, archive_match_excluded(m, ae));
archive_entry_copy_uname(ae, "bar1");
failure("User 'bar1' should be excluded");
assertEqualInt(1, archive_match_owner_excluded(m, ae));
assertEqualInt(1, archive_match_excluded(m, ae));
/* Clean up. */
archive_entry_free(ae);
archive_match_free(m);
}
static void
test_uname_wcs(void)
{
struct archive_entry *ae;
struct archive *m;
if (!assert((m = archive_match_new()) != NULL))
return;
if (!assert((ae = archive_entry_new()) != NULL)) {
archive_match_free(m);
return;
}
assertEqualIntA(m, 0, archive_match_include_uname_w(m, L"foo"));
assertEqualIntA(m, 0, archive_match_include_uname_w(m, L"bar"));
archive_entry_copy_uname_w(ae, L"unknown");
failure("User 'unknown' should be excluded");
assertEqualInt(1, archive_match_owner_excluded(m, ae));
assertEqualInt(1, archive_match_excluded(m, ae));
archive_entry_copy_uname_w(ae, L"foo");
failure("User 'foo' should not be excluded");
assertEqualInt(0, archive_match_owner_excluded(m, ae));
assertEqualInt(0, archive_match_excluded(m, ae));
archive_entry_copy_uname_w(ae, L"foo1");
failure("User 'foo1' should be excluded");
assertEqualInt(1, archive_match_owner_excluded(m, ae));
assertEqualInt(1, archive_match_excluded(m, ae));
archive_entry_copy_uname_w(ae, L"bar");
failure("User 'bar' should not be excluded");
assertEqualInt(0, archive_match_owner_excluded(m, ae));
assertEqualInt(0, archive_match_excluded(m, ae));
archive_entry_copy_uname_w(ae, L"bar1");
failure("User 'bar1' should be excluded");
assertEqualInt(1, archive_match_owner_excluded(m, ae));
assertEqualInt(1, archive_match_excluded(m, ae));
/* Clean up. */
archive_entry_free(ae);
archive_match_free(m);
}
static void
test_gname_mbs(void)
{
struct archive_entry *ae;
struct archive *m;
if (!assert((m = archive_match_new()) != NULL))
return;
if (!assert((ae = archive_entry_new()) != NULL)) {
archive_match_free(m);
return;
}
assertEqualIntA(m, 0, archive_match_include_gname(m, "foo"));
assertEqualIntA(m, 0, archive_match_include_gname(m, "bar"));
archive_entry_copy_gname(ae, "unknown");
failure("Group 'unknown' should be excluded");
assertEqualInt(1, archive_match_owner_excluded(m, ae));
assertEqualInt(1, archive_match_excluded(m, ae));
archive_entry_copy_gname(ae, "foo");
failure("Group 'foo' should not be excluded");
assertEqualInt(0, archive_match_owner_excluded(m, ae));
assertEqualInt(0, archive_match_excluded(m, ae));
archive_entry_copy_gname(ae, "foo1");
failure("Group 'foo1' should be excluded");
assertEqualInt(1, archive_match_owner_excluded(m, ae));
assertEqualInt(1, archive_match_excluded(m, ae));
archive_entry_copy_gname(ae, "bar");
failure("Group 'bar' should not be excluded");
assertEqualInt(0, archive_match_owner_excluded(m, ae));
assertEqualInt(0, archive_match_excluded(m, ae));
archive_entry_copy_gname(ae, "bar1");
failure("Group 'bar1' should be excluded");
assertEqualInt(1, archive_match_owner_excluded(m, ae));
assertEqualInt(1, archive_match_excluded(m, ae));
/* Clean up. */
archive_entry_free(ae);
archive_match_free(m);
}
static void
test_gname_wcs(void)
{
struct archive_entry *ae;
struct archive *m;
if (!assert((m = archive_match_new()) != NULL))
return;
if (!assert((ae = archive_entry_new()) != NULL)) {
archive_match_free(m);
return;
}
assertEqualIntA(m, 0, archive_match_include_gname_w(m, L"foo"));
assertEqualIntA(m, 0, archive_match_include_gname_w(m, L"bar"));
archive_entry_copy_gname_w(ae, L"unknown");
failure("Group 'unknown' should be excluded");
assertEqualInt(1, archive_match_owner_excluded(m, ae));
assertEqualInt(1, archive_match_excluded(m, ae));
archive_entry_copy_gname_w(ae, L"foo");
failure("Group 'foo' should not be excluded");
assertEqualInt(0, archive_match_owner_excluded(m, ae));
assertEqualInt(0, archive_match_excluded(m, ae));
archive_entry_copy_gname_w(ae, L"foo1");
failure("Group 'foo1' should be excluded");
assertEqualInt(1, archive_match_owner_excluded(m, ae));
assertEqualInt(1, archive_match_excluded(m, ae));
archive_entry_copy_gname_w(ae, L"bar");
failure("Group 'bar' should not be excluded");
assertEqualInt(0, archive_match_owner_excluded(m, ae));
assertEqualInt(0, archive_match_excluded(m, ae));
archive_entry_copy_gname_w(ae, L"bar1");
failure("Group 'bar1' should be excluded");
assertEqualInt(1, archive_match_owner_excluded(m, ae));
assertEqualInt(1, archive_match_excluded(m, ae));
/* Clean up. */
archive_entry_free(ae);
archive_match_free(m);
}
DEFINE_TEST(test_archive_match_owner)
{
test_uid();
test_gid();
test_uname_mbs();
test_uname_wcs();
test_gname_mbs();
test_gname_wcs();
}

View file

@ -0,0 +1,450 @@
/*-
* Copyright (c) 2012 Michihiro NAKAJIMA
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD$");
static void
test_exclusion_mbs(void)
{
struct archive_entry *ae;
struct archive *m;
if (!assert((m = archive_match_new()) != NULL))
return;
if (!assert((ae = archive_entry_new()) != NULL)) {
archive_match_free(m);
return;
}
/* Test for pattern "^aa*" */
assertEqualIntA(m, 0, archive_match_exclude_pattern(m, "^aa*"));
/* Test with 'aa1234', which should be excluded. */
archive_entry_copy_pathname(ae, "aa1234");
failure("'aa1234' should be excluded");
assertEqualInt(1, archive_match_path_excluded(m, ae));
assertEqualInt(1, archive_match_excluded(m, ae));
archive_entry_clear(ae);
archive_entry_copy_pathname_w(ae, L"aa1234");
failure("'aa1234' should be excluded");
assertEqualInt(1, archive_match_path_excluded(m, ae));
assertEqualInt(1, archive_match_excluded(m, ae));
/* Test with 'a1234', which should not be excluded. */
archive_entry_copy_pathname(ae, "a1234");
failure("'a1234' should not be excluded");
assertEqualInt(0, archive_match_path_excluded(m, ae));
assertEqualInt(0, archive_match_excluded(m, ae));
archive_entry_clear(ae);
archive_entry_copy_pathname_w(ae, L"a1234");
failure("'a1234' should not be excluded");
assertEqualInt(0, archive_match_path_excluded(m, ae));
assertEqualInt(0, archive_match_excluded(m, ae));
/* Clean up. */
archive_entry_free(ae);
archive_match_free(m);
}
static void
test_exclusion_wcs(void)
{
struct archive_entry *ae;
struct archive *m;
if (!assert((m = archive_match_new()) != NULL))
return;
if (!assert((ae = archive_entry_new()) != NULL)) {
archive_match_free(m);
return;
}
/* Test for pattern "^aa*" */
assertEqualIntA(m, 0, archive_match_exclude_pattern_w(m, L"^aa*"));
/* Test with 'aa1234', which should be excluded. */
archive_entry_copy_pathname(ae, "aa1234");
failure("'aa1234' should be excluded");
assertEqualInt(1, archive_match_path_excluded(m, ae));
assertEqualInt(1, archive_match_excluded(m, ae));
archive_entry_clear(ae);
archive_entry_copy_pathname_w(ae, L"aa1234");
failure("'aa1234' should be excluded");
assertEqualInt(1, archive_match_path_excluded(m, ae));
assertEqualInt(1, archive_match_excluded(m, ae));
/* Test with 'a1234', which should not be excluded. */
archive_entry_copy_pathname(ae, "a1234");
failure("'a1234' should not be excluded");
assertEqualInt(0, archive_match_path_excluded(m, ae));
assertEqualInt(0, archive_match_excluded(m, ae));
archive_entry_clear(ae);
archive_entry_copy_pathname_w(ae, L"a1234");
failure("'a1234' should not be excluded");
assertEqualInt(0, archive_match_path_excluded(m, ae));
assertEqualInt(0, archive_match_excluded(m, ae));
/* Clean up. */
archive_entry_free(ae);
archive_match_free(m);
}
static void
exclusion_from_file(struct archive *m)
{
struct archive_entry *ae;
if (!assert((ae = archive_entry_new()) != NULL)) {
archive_match_free(m);
return;
}
/* Test with 'first', which should not be excluded. */
archive_entry_copy_pathname(ae, "first");
failure("'first' should not be excluded");
assertEqualInt(0, archive_match_path_excluded(m, ae));
assertEqualInt(0, archive_match_excluded(m, ae));
archive_entry_clear(ae);
archive_entry_copy_pathname_w(ae, L"first");
failure("'first' should not be excluded");
assertEqualInt(0, archive_match_path_excluded(m, ae));
assertEqualInt(0, archive_match_excluded(m, ae));
/* Test with 'second', which should be excluded. */
archive_entry_copy_pathname(ae, "second");
failure("'second' should be excluded");
assertEqualInt(1, archive_match_path_excluded(m, ae));
assertEqualInt(1, archive_match_excluded(m, ae));
archive_entry_clear(ae);
archive_entry_copy_pathname_w(ae, L"second");
failure("'second' should be excluded");
assertEqualInt(1, archive_match_path_excluded(m, ae));
assertEqualInt(1, archive_match_excluded(m, ae));
/* Test with 'third', which should not be excluded. */
archive_entry_copy_pathname(ae, "third");
failure("'third' should not be excluded");
assertEqualInt(0, archive_match_path_excluded(m, ae));
assertEqualInt(0, archive_match_excluded(m, ae));
archive_entry_clear(ae);
archive_entry_copy_pathname_w(ae, L"third");
failure("'third' should not be excluded");
assertEqualInt(0, archive_match_path_excluded(m, ae));
assertEqualInt(0, archive_match_excluded(m, ae));
/* Test with 'four', which should be excluded. */
archive_entry_copy_pathname(ae, "four");
failure("'four' should be excluded");
assertEqualInt(1, archive_match_path_excluded(m, ae));
assertEqualInt(1, archive_match_excluded(m, ae));
archive_entry_clear(ae);
archive_entry_copy_pathname_w(ae, L"four");
failure("'four' should be excluded");
assertEqualInt(1, archive_match_path_excluded(m, ae));
assertEqualInt(1, archive_match_excluded(m, ae));
/* Clean up. */
archive_entry_free(ae);
}
static void
test_exclusion_from_file_mbs(void)
{
struct archive *m;
/* Test1: read exclusion patterns from file */
if (!assert((m = archive_match_new()) != NULL))
return;
assertEqualIntA(m, 0,
archive_match_exclude_pattern_from_file(m, "exclusion", 0));
exclusion_from_file(m);
/* Clean up. */
archive_match_free(m);
/* Test2: read exclusion patterns in a null separator from file */
if (!assert((m = archive_match_new()) != NULL))
return;
/* Test for pattern reading from file */
assertEqualIntA(m, 0,
archive_match_exclude_pattern_from_file(m, "exclusion_null", 1));
exclusion_from_file(m);
/* Clean up. */
archive_match_free(m);
}
static void
test_exclusion_from_file_wcs(void)
{
struct archive *m;
/* Test1: read exclusion patterns from file */
if (!assert((m = archive_match_new()) != NULL))
return;
assertEqualIntA(m, 0,
archive_match_exclude_pattern_from_file_w(m, L"exclusion", 0));
exclusion_from_file(m);
/* Clean up. */
archive_match_free(m);
/* Test2: read exclusion patterns in a null separator from file */
if (!assert((m = archive_match_new()) != NULL))
return;
/* Test for pattern reading from file */
assertEqualIntA(m, 0,
archive_match_exclude_pattern_from_file_w(m, L"exclusion_null", 1));
exclusion_from_file(m);
/* Clean up. */
archive_match_free(m);
}
static void
test_inclusion_mbs(void)
{
struct archive_entry *ae;
struct archive *m;
const char *mp;
if (!assert((m = archive_match_new()) != NULL))
return;
if (!assert((ae = archive_entry_new()) != NULL)) {
archive_match_free(m);
return;
}
/* Test for pattern "^aa*" */
assertEqualIntA(m, 0, archive_match_include_pattern(m, "^aa*"));
/* Test with 'aa1234', which should not be excluded. */
archive_entry_copy_pathname(ae, "aa1234");
failure("'aa1234' should not be excluded");
assertEqualInt(0, archive_match_path_excluded(m, ae));
assertEqualInt(0, archive_match_excluded(m, ae));
archive_entry_clear(ae);
archive_entry_copy_pathname_w(ae, L"aa1234");
failure("'aa1234' should not be excluded");
assertEqualInt(0, archive_match_path_excluded(m, ae));
assertEqualInt(0, archive_match_excluded(m, ae));
/* Test with 'a1234', which should be excluded. */
archive_entry_copy_pathname(ae, "a1234");
failure("'a1234' should be excluded");
assertEqualInt(1, archive_match_path_excluded(m, ae));
assertEqualInt(1, archive_match_excluded(m, ae));
archive_entry_clear(ae);
archive_entry_copy_pathname_w(ae, L"a1234");
failure("'a1234' should be excluded");
assertEqualInt(1, archive_match_path_excluded(m, ae));
assertEqualInt(1, archive_match_excluded(m, ae));
/* Verify unmatched_inclusions. */
assertEqualInt(0, archive_match_path_unmatched_inclusions(m));
assertEqualIntA(m, ARCHIVE_EOF,
archive_match_path_unmatched_inclusions_next(m, &mp));
/* Clean up. */
archive_entry_free(ae);
archive_match_free(m);
}
static void
test_inclusion_wcs(void)
{
struct archive_entry *ae;
struct archive *m;
const char *mp;
if (!assert((m = archive_match_new()) != NULL))
return;
if (!assert((ae = archive_entry_new()) != NULL)) {
archive_match_free(m);
return;
}
/* Test for pattern "^aa*" */
assertEqualIntA(m, 0, archive_match_include_pattern_w(m, L"^aa*"));
/* Test with 'aa1234', which should not be excluded. */
archive_entry_copy_pathname(ae, "aa1234");
failure("'aa1234' should not be excluded");
assertEqualInt(0, archive_match_path_excluded(m, ae));
assertEqualInt(0, archive_match_excluded(m, ae));
archive_entry_clear(ae);
archive_entry_copy_pathname_w(ae, L"aa1234");
failure("'aa1234' should not be excluded");
assertEqualInt(0, archive_match_path_excluded(m, ae));
assertEqualInt(0, archive_match_excluded(m, ae));
/* Test with 'a1234', which should be excluded. */
archive_entry_copy_pathname(ae, "a1234");
failure("'a1234' should be excluded");
assertEqualInt(1, archive_match_path_excluded(m, ae));
assertEqualInt(1, archive_match_excluded(m, ae));
archive_entry_clear(ae);
archive_entry_copy_pathname_w(ae, L"a1234");
failure("'a1234' should be excluded");
assertEqualInt(1, archive_match_path_excluded(m, ae));
assertEqualInt(1, archive_match_excluded(m, ae));
/* Verify unmatched_inclusions. */
assertEqualInt(0, archive_match_path_unmatched_inclusions(m));
assertEqualIntA(m, ARCHIVE_EOF,
archive_match_path_unmatched_inclusions_next(m, &mp));
/* Clean up. */
archive_entry_free(ae);
archive_match_free(m);
}
static void
test_inclusion_from_file_mbs(void)
{
struct archive *m;
/* Test1: read inclusion patterns from file */
if (!assert((m = archive_match_new()) != NULL))
return;
assertEqualIntA(m, 0,
archive_match_include_pattern_from_file(m, "inclusion", 0));
exclusion_from_file(m);
/* Clean up. */
archive_match_free(m);
/* Test2: read inclusion patterns in a null separator from file */
if (!assert((m = archive_match_new()) != NULL))
return;
assertEqualIntA(m, 0,
archive_match_include_pattern_from_file(m, "inclusion_null", 1));
exclusion_from_file(m);
/* Clean up. */
archive_match_free(m);
}
static void
test_inclusion_from_file_wcs(void)
{
struct archive *m;
/* Test1: read inclusion patterns from file */
if (!assert((m = archive_match_new()) != NULL))
return;
/* Test for pattern reading from file */
assertEqualIntA(m, 0,
archive_match_include_pattern_from_file_w(m, L"inclusion", 0));
exclusion_from_file(m);
/* Clean up. */
archive_match_free(m);
/* Test2: read inclusion patterns in a null separator from file */
if (!assert((m = archive_match_new()) != NULL))
return;
/* Test for pattern reading from file */
assertEqualIntA(m, 0,
archive_match_include_pattern_from_file_w(m, L"inclusion_null", 1));
exclusion_from_file(m);
/* Clean up. */
archive_match_free(m);
}
static void
test_exclusion_and_inclusion(void)
{
struct archive_entry *ae;
struct archive *m;
const char *mp;
const wchar_t *wp;
if (!assert((m = archive_match_new()) != NULL))
return;
if (!assert((ae = archive_entry_new()) != NULL)) {
archive_match_free(m);
return;
}
assertEqualIntA(m, 0, archive_match_exclude_pattern(m, "^aaa*"));
assertEqualIntA(m, 0, archive_match_include_pattern_w(m, L"^aa*"));
assertEqualIntA(m, 0, archive_match_include_pattern(m, "^a1*"));
/* Test with 'aa1234', which should not be excluded. */
archive_entry_copy_pathname(ae, "aa1234");
failure("'aa1234' should not be excluded");
assertEqualInt(0, archive_match_path_excluded(m, ae));
assertEqualInt(0, archive_match_excluded(m, ae));
archive_entry_clear(ae);
archive_entry_copy_pathname_w(ae, L"aa1234");
failure("'aa1234' should not be excluded");
assertEqualInt(0, archive_match_path_excluded(m, ae));
assertEqualInt(0, archive_match_excluded(m, ae));
/* Test with 'aaa1234', which should be excluded. */
archive_entry_copy_pathname(ae, "aaa1234");
failure("'aaa1234' should be excluded");
assertEqualInt(1, archive_match_path_excluded(m, ae));
assertEqualInt(1, archive_match_excluded(m, ae));
archive_entry_clear(ae);
archive_entry_copy_pathname_w(ae, L"aaa1234");
failure("'aaa1234' should be excluded");
assertEqualInt(1, archive_match_path_excluded(m, ae));
assertEqualInt(1, archive_match_excluded(m, ae));
/* Verify unmatched_inclusions. */
assertEqualInt(1, archive_match_path_unmatched_inclusions(m));
/* Verify unmatched inclusion patterns. */
assertEqualIntA(m, ARCHIVE_OK,
archive_match_path_unmatched_inclusions_next(m, &mp));
assertEqualString("^a1*", mp);
assertEqualIntA(m, ARCHIVE_EOF,
archive_match_path_unmatched_inclusions_next(m, &mp));
/* Verify unmatched inclusion patterns again in Wide-Char. */
assertEqualIntA(m, ARCHIVE_OK,
archive_match_path_unmatched_inclusions_next_w(m, &wp));
assertEqualWString(L"^a1*", wp);
assertEqualIntA(m, ARCHIVE_EOF,
archive_match_path_unmatched_inclusions_next_w(m, &wp));
/* Clean up. */
archive_entry_free(ae);
archive_match_free(m);
}
DEFINE_TEST(test_archive_match_path)
{
/* Make exclusion sample files which contain exclusion patterns. */
assertMakeFile("exclusion", 0666, "second\nfour\n");
assertMakeBinFile("exclusion_null", 0666, 12, "second\0four\0");
/* Make inclusion sample files which contain inclusion patterns. */
assertMakeFile("inclusion", 0666, "first\nthird\n");
assertMakeBinFile("inclusion_null", 0666, 12, "first\0third\0");
test_exclusion_mbs();
test_exclusion_wcs();
test_exclusion_from_file_mbs();
test_exclusion_from_file_wcs();
test_inclusion_mbs();
test_inclusion_wcs();
test_inclusion_from_file_mbs();
test_inclusion_from_file_wcs();
test_exclusion_and_inclusion();
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,285 @@
/*-
* Copyright (c) 2003-2007 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD$");
#define __LIBARCHIVE_TEST
#include "archive_pathmatch.h"
/*
* Verify that the pattern matcher implements the wildcard logic specified
* in SUSv2 for the cpio command. This is essentially the
* shell glob syntax:
* * - matches any sequence of chars, including '/'
* ? - matches any single char, including '/'
* [...] - matches any of a set of chars, '-' specifies a range,
* initial '!' is undefined
*
* The specification in SUSv2 is a bit incomplete, I assume the following:
* Trailing '-' in [...] is not special.
*
* TODO: Figure out if there's a good way to extend this to handle
* Windows paths that use '\' as a path separator. <sigh>
*/
DEFINE_TEST(test_archive_pathmatch)
{
assertEqualInt(1, archive_pathmatch("a/b/c", "a/b/c", 0));
assertEqualInt(0, archive_pathmatch("a/b/", "a/b/c", 0));
assertEqualInt(0, archive_pathmatch("a/b", "a/b/c", 0));
assertEqualInt(0, archive_pathmatch("a/b/c", "a/b/", 0));
assertEqualInt(0, archive_pathmatch("a/b/c", "a/b", 0));
/* Empty pattern only matches empty string. */
assertEqualInt(1, archive_pathmatch("","", 0));
assertEqualInt(0, archive_pathmatch("","a", 0));
assertEqualInt(1, archive_pathmatch("*","", 0));
assertEqualInt(1, archive_pathmatch("*","a", 0));
assertEqualInt(1, archive_pathmatch("*","abcd", 0));
/* SUSv2: * matches / */
assertEqualInt(1, archive_pathmatch("*","abcd/efgh/ijkl", 0));
assertEqualInt(1, archive_pathmatch("abcd*efgh/ijkl","abcd/efgh/ijkl", 0));
assertEqualInt(1, archive_pathmatch("abcd***efgh/ijkl","abcd/efgh/ijkl", 0));
assertEqualInt(1, archive_pathmatch("abcd***/efgh/ijkl","abcd/efgh/ijkl", 0));
assertEqualInt(0, archive_pathmatch("?", "", 0));
assertEqualInt(0, archive_pathmatch("?", "\0", 0));
assertEqualInt(1, archive_pathmatch("?", "a", 0));
assertEqualInt(0, archive_pathmatch("?", "ab", 0));
assertEqualInt(1, archive_pathmatch("?", ".", 0));
assertEqualInt(1, archive_pathmatch("?", "?", 0));
assertEqualInt(1, archive_pathmatch("a", "a", 0));
assertEqualInt(0, archive_pathmatch("a", "ab", 0));
assertEqualInt(0, archive_pathmatch("a", "ab", 0));
assertEqualInt(1, archive_pathmatch("a?c", "abc", 0));
/* SUSv2: ? matches / */
assertEqualInt(1, archive_pathmatch("a?c", "a/c", 0));
assertEqualInt(1, archive_pathmatch("a?*c*", "a/c", 0));
assertEqualInt(1, archive_pathmatch("*a*", "a/c", 0));
assertEqualInt(1, archive_pathmatch("*a*", "/a/c", 0));
assertEqualInt(1, archive_pathmatch("*a*", "defaaaaaaa", 0));
assertEqualInt(0, archive_pathmatch("a*", "defghi", 0));
assertEqualInt(0, archive_pathmatch("*a*", "defghi", 0));
/* Character classes */
assertEqualInt(1, archive_pathmatch("abc[def", "abc[def", 0));
assertEqualInt(0, archive_pathmatch("abc[def]", "abc[def", 0));
assertEqualInt(0, archive_pathmatch("abc[def", "abcd", 0));
assertEqualInt(1, archive_pathmatch("abc[def]", "abcd", 0));
assertEqualInt(1, archive_pathmatch("abc[def]", "abce", 0));
assertEqualInt(1, archive_pathmatch("abc[def]", "abcf", 0));
assertEqualInt(0, archive_pathmatch("abc[def]", "abcg", 0));
assertEqualInt(1, archive_pathmatch("abc[d*f]", "abcd", 0));
assertEqualInt(1, archive_pathmatch("abc[d*f]", "abc*", 0));
assertEqualInt(0, archive_pathmatch("abc[d*f]", "abcdefghi", 0));
assertEqualInt(0, archive_pathmatch("abc[d*", "abcdefghi", 0));
assertEqualInt(1, archive_pathmatch("abc[d*", "abc[defghi", 0));
assertEqualInt(1, archive_pathmatch("abc[d-f]", "abcd", 0));
assertEqualInt(1, archive_pathmatch("abc[d-f]", "abce", 0));
assertEqualInt(1, archive_pathmatch("abc[d-f]", "abcf", 0));
assertEqualInt(0, archive_pathmatch("abc[d-f]", "abcg", 0));
assertEqualInt(0, archive_pathmatch("abc[d-fh-k]", "abca", 0));
assertEqualInt(1, archive_pathmatch("abc[d-fh-k]", "abcd", 0));
assertEqualInt(1, archive_pathmatch("abc[d-fh-k]", "abce", 0));
assertEqualInt(1, archive_pathmatch("abc[d-fh-k]", "abcf", 0));
assertEqualInt(0, archive_pathmatch("abc[d-fh-k]", "abcg", 0));
assertEqualInt(1, archive_pathmatch("abc[d-fh-k]", "abch", 0));
assertEqualInt(1, archive_pathmatch("abc[d-fh-k]", "abci", 0));
assertEqualInt(1, archive_pathmatch("abc[d-fh-k]", "abcj", 0));
assertEqualInt(1, archive_pathmatch("abc[d-fh-k]", "abck", 0));
assertEqualInt(0, archive_pathmatch("abc[d-fh-k]", "abcl", 0));
assertEqualInt(0, archive_pathmatch("abc[d-fh-k]", "abc-", 0));
/* [] matches nothing, [!] is the same as ? */
assertEqualInt(0, archive_pathmatch("abc[]efg", "abcdefg", 0));
assertEqualInt(0, archive_pathmatch("abc[]efg", "abcqefg", 0));
assertEqualInt(0, archive_pathmatch("abc[]efg", "abcefg", 0));
assertEqualInt(1, archive_pathmatch("abc[!]efg", "abcdefg", 0));
assertEqualInt(1, archive_pathmatch("abc[!]efg", "abcqefg", 0));
assertEqualInt(0, archive_pathmatch("abc[!]efg", "abcefg", 0));
/* I assume: Trailing '-' is non-special. */
assertEqualInt(0, archive_pathmatch("abc[d-fh-]", "abcl", 0));
assertEqualInt(1, archive_pathmatch("abc[d-fh-]", "abch", 0));
assertEqualInt(1, archive_pathmatch("abc[d-fh-]", "abc-", 0));
assertEqualInt(1, archive_pathmatch("abc[d-fh-]", "abc-", 0));
/* ']' can be backslash-quoted within a character class. */
assertEqualInt(1, archive_pathmatch("abc[\\]]", "abc]", 0));
assertEqualInt(1, archive_pathmatch("abc[\\]d]", "abc]", 0));
assertEqualInt(1, archive_pathmatch("abc[\\]d]", "abcd", 0));
assertEqualInt(1, archive_pathmatch("abc[d\\]]", "abc]", 0));
assertEqualInt(1, archive_pathmatch("abc[d\\]]", "abcd", 0));
assertEqualInt(1, archive_pathmatch("abc[d]e]", "abcde]", 0));
assertEqualInt(1, archive_pathmatch("abc[d\\]e]", "abc]", 0));
assertEqualInt(0, archive_pathmatch("abc[d\\]e]", "abcd]e", 0));
assertEqualInt(0, archive_pathmatch("abc[d]e]", "abc]", 0));
/* backslash-quoted chars can appear as either end of a range. */
assertEqualInt(1, archive_pathmatch("abc[\\d-f]gh", "abcegh", 0));
assertEqualInt(0, archive_pathmatch("abc[\\d-f]gh", "abcggh", 0));
assertEqualInt(0, archive_pathmatch("abc[\\d-f]gh", "abc\\gh", 0));
assertEqualInt(1, archive_pathmatch("abc[d-\\f]gh", "abcegh", 0));
assertEqualInt(1, archive_pathmatch("abc[\\d-\\f]gh", "abcegh", 0));
assertEqualInt(1, archive_pathmatch("abc[\\d-\\f]gh", "abcegh", 0));
/* backslash-quoted '-' isn't special. */
assertEqualInt(0, archive_pathmatch("abc[d\\-f]gh", "abcegh", 0));
assertEqualInt(1, archive_pathmatch("abc[d\\-f]gh", "abc-gh", 0));
/* Leading '!' negates a character class. */
assertEqualInt(0, archive_pathmatch("abc[!d]", "abcd", 0));
assertEqualInt(1, archive_pathmatch("abc[!d]", "abce", 0));
assertEqualInt(1, archive_pathmatch("abc[!d]", "abcc", 0));
assertEqualInt(0, archive_pathmatch("abc[!d-z]", "abcq", 0));
assertEqualInt(1, archive_pathmatch("abc[!d-gi-z]", "abch", 0));
assertEqualInt(1, archive_pathmatch("abc[!fgijkl]", "abch", 0));
assertEqualInt(0, archive_pathmatch("abc[!fghijkl]", "abch", 0));
/* Backslash quotes next character. */
assertEqualInt(0, archive_pathmatch("abc\\[def]", "abc\\d", 0));
assertEqualInt(1, archive_pathmatch("abc\\[def]", "abc[def]", 0));
assertEqualInt(0, archive_pathmatch("abc\\\\[def]", "abc[def]", 0));
assertEqualInt(0, archive_pathmatch("abc\\\\[def]", "abc\\[def]", 0));
assertEqualInt(1, archive_pathmatch("abc\\\\[def]", "abc\\d", 0));
assertEqualInt(1, archive_pathmatch("abcd\\", "abcd\\", 0));
assertEqualInt(0, archive_pathmatch("abcd\\", "abcd\\[", 0));
assertEqualInt(0, archive_pathmatch("abcd\\", "abcde", 0));
assertEqualInt(0, archive_pathmatch("abcd\\[", "abcd\\", 0));
/*
* Because '.' and '/' have special meanings, we can
* identify many equivalent paths even if they're expressed
* differently. (But quoting a character with '\\' suppresses
* special meanings!)
*/
assertEqualInt(0, archive_pathmatch("a/b/", "a/bc", 0));
assertEqualInt(1, archive_pathmatch("a/./b", "a/b", 0));
assertEqualInt(0, archive_pathmatch("a\\/./b", "a/b", 0));
assertEqualInt(0, archive_pathmatch("a/\\./b", "a/b", 0));
assertEqualInt(0, archive_pathmatch("a/.\\/b", "a/b", 0));
assertEqualInt(0, archive_pathmatch("a\\/\\.\\/b", "a/b", 0));
assertEqualInt(1, archive_pathmatch("./abc/./def/", "abc/def/", 0));
assertEqualInt(1, archive_pathmatch("abc/def", "./././abc/./def", 0));
assertEqualInt(1, archive_pathmatch("abc/def/././//", "./././abc/./def/", 0));
assertEqualInt(1, archive_pathmatch(".////abc/.//def", "./././abc/./def", 0));
assertEqualInt(1, archive_pathmatch("./abc?def/", "abc/def/", 0));
failure("\"?./\" is not the same as \"/./\"");
assertEqualInt(0, archive_pathmatch("./abc?./def/", "abc/def/", 0));
failure("Trailing '/' should match no trailing '/'");
assertEqualInt(1, archive_pathmatch("./abc/./def/", "abc/def", 0));
failure("Trailing '/./' is still the same directory.");
assertEqualInt(1, archive_pathmatch("./abc/./def/./", "abc/def", 0));
failure("Trailing '/.' is still the same directory.");
assertEqualInt(1, archive_pathmatch("./abc/./def/.", "abc/def", 0));
assertEqualInt(1, archive_pathmatch("./abc/./def", "abc/def/", 0));
failure("Trailing '/./' is still the same directory.");
assertEqualInt(1, archive_pathmatch("./abc/./def", "abc/def/./", 0));
failure("Trailing '/.' is still the same directory.");
assertEqualInt(1, archive_pathmatch("./abc*/./def", "abc/def/.", 0));
/* Matches not anchored at beginning. */
assertEqualInt(0,
archive_pathmatch("bcd", "abcd", PATHMATCH_NO_ANCHOR_START));
assertEqualInt(1,
archive_pathmatch("abcd", "abcd", PATHMATCH_NO_ANCHOR_START));
assertEqualInt(0,
archive_pathmatch("^bcd", "abcd", PATHMATCH_NO_ANCHOR_START));
assertEqualInt(1,
archive_pathmatch("b/c/d", "a/b/c/d", PATHMATCH_NO_ANCHOR_START));
assertEqualInt(0,
archive_pathmatch("^b/c/d", "a/b/c/d", PATHMATCH_NO_ANCHOR_START));
assertEqualInt(0,
archive_pathmatch("/b/c/d", "a/b/c/d", PATHMATCH_NO_ANCHOR_START));
assertEqualInt(0,
archive_pathmatch("a/b/c", "a/b/c/d", PATHMATCH_NO_ANCHOR_START));
assertEqualInt(1,
archive_pathmatch("a/b/c/d", "a/b/c/d", PATHMATCH_NO_ANCHOR_START));
assertEqualInt(0,
archive_pathmatch("b/c", "a/b/c/d", PATHMATCH_NO_ANCHOR_START));
assertEqualInt(0,
archive_pathmatch("^b/c", "a/b/c/d", PATHMATCH_NO_ANCHOR_START));
assertEqualInt(1,
archive_pathmatch("b/c/d", "a/b/c/d", PATHMATCH_NO_ANCHOR_START));
assertEqualInt(1,
archive_pathmatch("b/c/d", "/a/b/c/d", PATHMATCH_NO_ANCHOR_START));
/* Matches not anchored at end. */
assertEqualInt(0,
archive_pathmatch("bcd", "abcd", PATHMATCH_NO_ANCHOR_END));
assertEqualInt(1,
archive_pathmatch("abcd", "abcd", PATHMATCH_NO_ANCHOR_END));
assertEqualInt(1,
archive_pathmatch("abcd", "abcd/", PATHMATCH_NO_ANCHOR_END));
assertEqualInt(1,
archive_pathmatch("abcd", "abcd/.", PATHMATCH_NO_ANCHOR_END));
assertEqualInt(0,
archive_pathmatch("abc", "abcd", PATHMATCH_NO_ANCHOR_END));
assertEqualInt(1,
archive_pathmatch("a/b/c", "a/b/c/d", PATHMATCH_NO_ANCHOR_END));
assertEqualInt(0,
archive_pathmatch("a/b/c$", "a/b/c/d", PATHMATCH_NO_ANCHOR_END));
assertEqualInt(1,
archive_pathmatch("a/b/c$", "a/b/c", PATHMATCH_NO_ANCHOR_END));
assertEqualInt(1,
archive_pathmatch("a/b/c$", "a/b/c/", PATHMATCH_NO_ANCHOR_END));
assertEqualInt(1,
archive_pathmatch("a/b/c/", "a/b/c/d", PATHMATCH_NO_ANCHOR_END));
assertEqualInt(0,
archive_pathmatch("a/b/c/$", "a/b/c/d", PATHMATCH_NO_ANCHOR_END));
assertEqualInt(1,
archive_pathmatch("a/b/c/$", "a/b/c/", PATHMATCH_NO_ANCHOR_END));
assertEqualInt(1,
archive_pathmatch("a/b/c/$", "a/b/c", PATHMATCH_NO_ANCHOR_END));
assertEqualInt(0,
archive_pathmatch("b/c", "a/b/c/d", PATHMATCH_NO_ANCHOR_END));
/* Matches not anchored at either end. */
assertEqualInt(1,
archive_pathmatch("b/c", "a/b/c/d", PATHMATCH_NO_ANCHOR_START | PATHMATCH_NO_ANCHOR_END));
assertEqualInt(0,
archive_pathmatch("/b/c", "a/b/c/d", PATHMATCH_NO_ANCHOR_START | PATHMATCH_NO_ANCHOR_END));
assertEqualInt(0,
archive_pathmatch("/a/b/c", "a/b/c/d", PATHMATCH_NO_ANCHOR_START | PATHMATCH_NO_ANCHOR_END));
assertEqualInt(1,
archive_pathmatch("/a/b/c", "/a/b/c/d", PATHMATCH_NO_ANCHOR_START | PATHMATCH_NO_ANCHOR_END));
assertEqualInt(0,
archive_pathmatch("/a/b/c$", "a/b/c/d", PATHMATCH_NO_ANCHOR_START | PATHMATCH_NO_ANCHOR_END));
assertEqualInt(0,
archive_pathmatch("/a/b/c/d$", "a/b/c/d", PATHMATCH_NO_ANCHOR_START | PATHMATCH_NO_ANCHOR_END));
assertEqualInt(0,
archive_pathmatch("/a/b/c/d$", "/a/b/c/d/e", PATHMATCH_NO_ANCHOR_START | PATHMATCH_NO_ANCHOR_END));
assertEqualInt(1,
archive_pathmatch("/a/b/c/d$", "/a/b/c/d", PATHMATCH_NO_ANCHOR_START | PATHMATCH_NO_ANCHOR_END));
assertEqualInt(1,
archive_pathmatch("^a/b/c", "a/b/c/d", PATHMATCH_NO_ANCHOR_START | PATHMATCH_NO_ANCHOR_END));
assertEqualInt(0,
archive_pathmatch("^a/b/c$", "a/b/c/d", PATHMATCH_NO_ANCHOR_START | PATHMATCH_NO_ANCHOR_END));
assertEqualInt(0,
archive_pathmatch("a/b/c$", "a/b/c/d", PATHMATCH_NO_ANCHOR_START | PATHMATCH_NO_ANCHOR_END));
assertEqualInt(1,
archive_pathmatch("b/c/d$", "a/b/c/d", PATHMATCH_NO_ANCHOR_START | PATHMATCH_NO_ANCHOR_END));
}

View file

@ -0,0 +1,260 @@
/*-
* Copyright (c) 2011 Tim Kientzle
* Copyright (c) 2014 Michihiro NAKAJIMA
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD$");
struct archive_read;
extern void __archive_read_reset_passphrase(struct archive_read *);
extern const char * __archive_read_next_passphrase(struct archive_read *);
static void
test(int pristine)
{
struct archive* a = archive_read_new();
if (!pristine) {
archive_read_support_filter_all(a);
archive_read_support_format_all(a);
}
assertEqualInt(ARCHIVE_OK, archive_read_add_passphrase(a, "pass1"));
/* An empty passphrase cannot be accepted. */
assertEqualInt(ARCHIVE_FAILED, archive_read_add_passphrase(a, ""));
/* NULL passphrases cannot be accepted. */
assertEqualInt(ARCHIVE_FAILED, archive_read_add_passphrase(a, NULL));
archive_read_free(a);
}
DEFINE_TEST(test_archive_read_add_passphrase)
{
test(1);
test(0);
}
DEFINE_TEST(test_archive_read_add_passphrase_incorrect_sequance)
{
struct archive* a = archive_read_new();
struct archive_read *ar = (struct archive_read *)a;
assertEqualInt(ARCHIVE_OK, archive_read_add_passphrase(a, "pass1"));
/* No call of __archive_read_reset_passphrase() leads to
* get NULL even if a user has passed a passphrases. */
assertEqualString(NULL, __archive_read_next_passphrase(ar));
archive_read_free(a);
}
DEFINE_TEST(test_archive_read_add_passphrase_single)
{
struct archive* a = archive_read_new();
struct archive_read *ar = (struct archive_read *)a;
assertEqualInt(ARCHIVE_OK, archive_read_add_passphrase(a, "pass1"));
__archive_read_reset_passphrase(ar);
/* Fist call, we should get "pass1" as a passphrase. */
assertEqualString("pass1", __archive_read_next_passphrase(ar));
/* Second call, we should get NULL which means all the passphrases
* are passed already. */
assertEqualString(NULL, __archive_read_next_passphrase(ar));
archive_read_free(a);
}
DEFINE_TEST(test_archive_read_add_passphrase_multiple)
{
struct archive* a = archive_read_new();
struct archive_read *ar = (struct archive_read *)a;
assertEqualInt(ARCHIVE_OK, archive_read_add_passphrase(a, "pass1"));
assertEqualInt(ARCHIVE_OK, archive_read_add_passphrase(a, "pass2"));
__archive_read_reset_passphrase(ar);
/* Fist call, we should get "pass1" as a passphrase. */
assertEqualString("pass1", __archive_read_next_passphrase(ar));
/* Second call, we should get "pass2" as a passphrase. */
assertEqualString("pass2", __archive_read_next_passphrase(ar));
/* Third call, we should get NULL which means all the passphrases
* are passed already. */
assertEqualString(NULL, __archive_read_next_passphrase(ar));
archive_read_free(a);
}
static const char *
callback1(struct archive *a, void *_client_data)
{
(void)a; /* UNUSED */
(void)_client_data; /* UNUSED */
return ("passCallBack");
}
DEFINE_TEST(test_archive_read_add_passphrase_set_callback1)
{
struct archive* a = archive_read_new();
struct archive_read *ar = (struct archive_read *)a;
assertEqualInt(ARCHIVE_OK,
archive_read_set_passphrase_callback(a, NULL, callback1));
__archive_read_reset_passphrase(ar);
/* Fist call, we should get "passCallBack" as a passphrase. */
assertEqualString("passCallBack", __archive_read_next_passphrase(ar));
/* Second call, we still get "passCallBack" as a passphrase. */
assertEqualString("passCallBack", __archive_read_next_passphrase(ar));
archive_read_free(a);
/* Without __archive_read_reset_passphrase call, the callback
* should work fine. */
a = archive_read_new();
ar = (struct archive_read *)a;
assertEqualInt(ARCHIVE_OK,
archive_read_set_passphrase_callback(a, NULL, callback1));
/* Fist call, we should get "passCallBack" as a passphrase. */
assertEqualString("passCallBack", __archive_read_next_passphrase(ar));
/* Second call, we still get "passCallBack" as a passphrase. */
assertEqualString("passCallBack", __archive_read_next_passphrase(ar));
archive_read_free(a);
}
static const char *
callback2(struct archive *a, void *_client_data)
{
int *cd = (int *)_client_data;
(void)a; /* UNUSED */
if (*cd == 0) {
*cd = 1;
return ("passCallBack");
}
return (NULL);
}
DEFINE_TEST(test_archive_read_add_passphrase_set_callback2)
{
struct archive* a = archive_read_new();
struct archive_read *ar = (struct archive_read *)a;
int client_data = 0;
assertEqualInt(ARCHIVE_OK,
archive_read_set_passphrase_callback(a, &client_data, callback2));
__archive_read_reset_passphrase(ar);
/* Fist call, we should get "passCallBack" as a passphrase. */
assertEqualString("passCallBack", __archive_read_next_passphrase(ar));
/* Second call, we should get NULL which means all the passphrases
* are passed already. */
assertEqualString(NULL, __archive_read_next_passphrase(ar));
archive_read_free(a);
}
DEFINE_TEST(test_archive_read_add_passphrase_set_callback3)
{
struct archive* a = archive_read_new();
struct archive_read *ar = (struct archive_read *)a;
int client_data = 0;
assertEqualInt(ARCHIVE_OK,
archive_read_set_passphrase_callback(a, &client_data, callback2));
__archive_read_reset_passphrase(ar);
/* Fist call, we should get "passCallBack" as a passphrase. */
assertEqualString("passCallBack", __archive_read_next_passphrase(ar));
__archive_read_reset_passphrase(ar);
/* After reset passphrase, we should get "passCallBack" passphrase. */
assertEqualString("passCallBack", __archive_read_next_passphrase(ar));
/* Second call, we should get NULL which means all the passphrases
* are passed already. */
assertEqualString(NULL, __archive_read_next_passphrase(ar));
archive_read_free(a);
}
DEFINE_TEST(test_archive_read_add_passphrase_multiple_with_callback)
{
struct archive* a = archive_read_new();
struct archive_read *ar = (struct archive_read *)a;
int client_data = 0;
assertEqualInt(ARCHIVE_OK, archive_read_add_passphrase(a, "pass1"));
assertEqualInt(ARCHIVE_OK, archive_read_add_passphrase(a, "pass2"));
assertEqualInt(ARCHIVE_OK,
archive_read_set_passphrase_callback(a, &client_data, callback2));
__archive_read_reset_passphrase(ar);
/* Fist call, we should get "pass1" as a passphrase. */
assertEqualString("pass1", __archive_read_next_passphrase(ar));
/* Second call, we should get "pass2" as a passphrase. */
assertEqualString("pass2", __archive_read_next_passphrase(ar));
/* Third call, we should get "passCallBack" as a passphrase. */
assertEqualString("passCallBack", __archive_read_next_passphrase(ar));
/* Fourth call, we should get NULL which means all the passphrases
* are passed already. */
assertEqualString(NULL, __archive_read_next_passphrase(ar));
archive_read_free(a);
}
DEFINE_TEST(test_archive_read_add_passphrase_multiple_with_callback2)
{
struct archive* a = archive_read_new();
struct archive_read *ar = (struct archive_read *)a;
int client_data = 0;
assertEqualInt(ARCHIVE_OK, archive_read_add_passphrase(a, "pass1"));
assertEqualInt(ARCHIVE_OK, archive_read_add_passphrase(a, "pass2"));
assertEqualInt(ARCHIVE_OK,
archive_read_set_passphrase_callback(a, &client_data, callback2));
__archive_read_reset_passphrase(ar);
/* Fist call, we should get "pass1" as a passphrase. */
assertEqualString("pass1", __archive_read_next_passphrase(ar));
/* Second call, we should get "pass2" as a passphrase. */
assertEqualString("pass2", __archive_read_next_passphrase(ar));
/* Third call, we should get "passCallBack" as a passphrase. */
assertEqualString("passCallBack", __archive_read_next_passphrase(ar));
__archive_read_reset_passphrase(ar);
/* After reset passphrase, we should get "passCallBack" passphrase. */
assertEqualString("passCallBack", __archive_read_next_passphrase(ar));
/* Second call, we should get "pass1" as a passphrase. */
assertEqualString("pass1", __archive_read_next_passphrase(ar));
/* Third call, we should get "passCallBack" as a passphrase. */
assertEqualString("pass2", __archive_read_next_passphrase(ar));
/* Fourth call, we should get NULL which means all the passphrases
* are passed already. */
assertEqualString(NULL, __archive_read_next_passphrase(ar));
archive_read_free(a);
}

View file

@ -0,0 +1,43 @@
/*-
* Copyright (c) 2003-2010 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD$");
DEFINE_TEST(test_archive_read_close_twice)
{
struct archive* a = archive_read_new();
assertEqualInt(0, archive_read_close(a));
assertEqualInt(0, archive_errno(a));
assertEqualString(NULL, archive_error_string(a));
assertEqualInt(0, archive_read_close(a));
assertEqualInt(0, archive_errno(a));
assertEqualString(NULL, archive_error_string(a));
archive_read_free(a);
}

View file

@ -0,0 +1,47 @@
/*-
* Copyright (c) 2011 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD$");
DEFINE_TEST(test_archive_read_close_twice_open_fd)
{
struct archive* a = archive_read_new();
assertEqualInt(ARCHIVE_OK, archive_read_support_format_empty(a));
assertEqualInt(ARCHIVE_OK, archive_read_open_fd(a, 0, 0));
assertEqualInt(0, archive_errno(a));
assertEqualString(NULL, archive_error_string(a));
assertEqualInt(ARCHIVE_OK, archive_read_close(a));
assertEqualInt(0, archive_errno(a));
assertEqualString(NULL, archive_error_string(a));
assertEqualInt(ARCHIVE_OK, archive_read_close(a));
assertEqualInt(0, archive_errno(a));
assertEqualString(NULL, archive_error_string(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}

View file

@ -0,0 +1,49 @@
/*-
* Copyright (c) 2011 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD$");
DEFINE_TEST(test_archive_read_close_twice_open_filename)
{
const char *filename = "empty.file";
struct archive* a = archive_read_new();
assertMakeFile(filename, 0644, "");
assertEqualInt(ARCHIVE_OK, archive_read_support_format_empty(a));
assertEqualInt(ARCHIVE_OK, archive_read_open_filename(a, filename, 0));
assertEqualInt(0, archive_errno(a));
assertEqualString(NULL, archive_error_string(a));
assertEqualInt(ARCHIVE_OK, archive_read_close(a));
assertEqualInt(0, archive_errno(a));
assertEqualString(NULL, archive_error_string(a));
assertEqualInt(ARCHIVE_OK, archive_read_close(a));
assertEqualInt(0, archive_errno(a));
assertEqualString(NULL, archive_error_string(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}

View file

@ -0,0 +1,372 @@
/*-
* Copyright (c) 2011 Tim Kientzle
* Copyright (c) 2011-2012 Andres Mejia
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD$");
#if defined(_WIN32) && !defined(__CYGWIN__)
#define open _open
#define close _close
#define read _read
#if !defined(__BORLANDC__)
#ifdef lseek
#undef lseek
#endif
#define lseek(f, o, w) _lseek(f, (long)(o), (int)(w))
#endif
#endif
static void
test_splitted_file(void)
{
char buff[64];
static const char *reffiles[] =
{
"test_read_splitted_rar_aa",
"test_read_splitted_rar_ab",
"test_read_splitted_rar_ac",
"test_read_splitted_rar_ad",
NULL
};
const char test_txt[] = "test text document\r\n";
int size = sizeof(test_txt)-1;
struct archive_entry *ae;
struct archive *a;
extract_reference_files(reffiles);
assert((a = archive_read_new()) != NULL);
assertA(0 == archive_read_support_filter_all(a));
assertA(0 == archive_read_support_format_all(a));
assertA(0 == archive_read_open_filenames(a, reffiles, 10240));
/* First header. */
assertA(0 == archive_read_next_header(a, &ae));
assertEqualString("test.txt", archive_entry_pathname(ae));
assertA((int)archive_entry_mtime(ae));
assertA((int)archive_entry_ctime(ae));
assertA((int)archive_entry_atime(ae));
assertEqualInt(20, archive_entry_size(ae));
assertEqualInt(33188, archive_entry_mode(ae));
assertA(size == archive_read_data(a, buff, size));
assertEqualMem(buff, test_txt, size);
/* Second header. */
assertA(0 == archive_read_next_header(a, &ae));
assertEqualString("testlink", archive_entry_pathname(ae));
assertA((int)archive_entry_mtime(ae));
assertA((int)archive_entry_ctime(ae));
assertA((int)archive_entry_atime(ae));
assertEqualInt(0, archive_entry_size(ae));
assertEqualInt(41471, archive_entry_mode(ae));
assertEqualString("test.txt", archive_entry_symlink(ae));
assertEqualIntA(a, 0, archive_read_data(a, buff, sizeof(buff)));
/* Third header. */
assertA(0 == archive_read_next_header(a, &ae));
assertEqualString("testdir/test.txt", archive_entry_pathname(ae));
assertA((int)archive_entry_mtime(ae));
assertA((int)archive_entry_ctime(ae));
assertA((int)archive_entry_atime(ae));
assertEqualInt(20, archive_entry_size(ae));
assertEqualInt(33188, archive_entry_mode(ae));
assertA(size == archive_read_data(a, buff, size));
assertEqualMem(buff, test_txt, size);
/* Fourth header. */
assertA(0 == archive_read_next_header(a, &ae));
assertEqualString("testdir", archive_entry_pathname(ae));
assertA((int)archive_entry_mtime(ae));
assertA((int)archive_entry_ctime(ae));
assertA((int)archive_entry_atime(ae));
assertEqualInt(0, archive_entry_size(ae));
assertEqualInt(16877, archive_entry_mode(ae));
/* Fifth header. */
assertA(0 == archive_read_next_header(a, &ae));
assertEqualString("testemptydir", archive_entry_pathname(ae));
assertA((int)archive_entry_mtime(ae));
assertA((int)archive_entry_ctime(ae));
assertA((int)archive_entry_atime(ae));
assertEqualInt(0, archive_entry_size(ae));
assertEqualInt(16877, archive_entry_mode(ae));
/* Test EOF */
assertA(1 == archive_read_next_header(a, &ae));
assertEqualInt(5, archive_file_count(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}
static void
test_large_splitted_file(void)
{
static const char *reffiles[] =
{
"test_read_large_splitted_rar_aa",
"test_read_large_splitted_rar_ab",
"test_read_large_splitted_rar_ac",
"test_read_large_splitted_rar_ad",
"test_read_large_splitted_rar_ae",
NULL
};
const char test_txt[] = "gin-bottom: 0in\"><BR>\n</P>\n</BODY>\n</HTML>";
int size = 241647978, offset = 0;
char buff[64];
struct archive_entry *ae;
struct archive *a;
extract_reference_files(reffiles);
assert((a = archive_read_new()) != NULL);
assertA(0 == archive_read_support_filter_all(a));
assertA(0 == archive_read_support_format_all(a));
assertA(0 == archive_read_open_filenames(a, reffiles, 10240));
/* First header. */
assertA(0 == archive_read_next_header(a, &ae));
assertEqualString("ppmd_lzss_conversion_test.txt",
archive_entry_pathname(ae));
assertA((int)archive_entry_mtime(ae));
assertA((int)archive_entry_ctime(ae));
assertA((int)archive_entry_atime(ae));
assertEqualInt(size, archive_entry_size(ae));
assertEqualInt(33188, archive_entry_mode(ae));
while (offset + (int)sizeof(buff) < size)
{
assertA(sizeof(buff) == archive_read_data(a, buff, sizeof(buff)));
offset += sizeof(buff);
}
assertA(size - offset == archive_read_data(a, buff, size - offset));
assertEqualMem(buff, test_txt, size - offset);
/* Test EOF */
assertA(1 == archive_read_next_header(a, &ae));
assertEqualInt(1, archive_file_count(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}
#define BLOCK_SIZE 10240
struct mydata {
char *filename;
void *buffer;
int fd;
};
static int
file_open(struct archive *a, void *data)
{
struct mydata *mydata = (struct mydata *)data;
(void)a;
if (mydata->fd < 0)
{
mydata->fd = open(mydata->filename, O_RDONLY | O_BINARY);
if (mydata->fd >= 0)
{
if ((mydata->buffer = (void*)calloc(1, BLOCK_SIZE)) == NULL)
return (ARCHIVE_FAILED);
}
}
return (ARCHIVE_OK);
}
static ssize_t
file_read(struct archive *a, void *data, const void **buff)
{
struct mydata *mydata = (struct mydata *)data;
(void)a;
*buff = mydata->buffer;
return read(mydata->fd, mydata->buffer, BLOCK_SIZE);
}
static int64_t
file_skip(struct archive *a, void *data, int64_t request)
{
struct mydata *mydata = (struct mydata *)data;
int64_t result = lseek(mydata->fd, SEEK_CUR, request);
if (result >= 0)
return result;
archive_set_error(a, errno, "Error seeking in '%s'", mydata->filename);
return -1;
}
static int
file_switch(struct archive *a, void *data1, void *data2)
{
struct mydata *mydata1 = (struct mydata *)data1;
struct mydata *mydata2 = (struct mydata *)data2;
int r = (ARCHIVE_OK);
(void)a;
if (mydata1 && mydata1->fd >= 0)
{
close(mydata1->fd);
free(mydata1->buffer);
mydata1->buffer = NULL;
mydata1->fd = -1;
}
if (mydata2)
{
r = file_open(a, mydata2);
}
return (r);
}
static int
file_close(struct archive *a, void *data)
{
struct mydata *mydata = (struct mydata *)data;
if (mydata == NULL)
return (ARCHIVE_FATAL);
file_switch(a, mydata, NULL);
free(mydata->filename);
free(mydata);
return (ARCHIVE_OK);
}
static int64_t
file_seek(struct archive *a, void *data, int64_t request, int whence)
{
struct mydata *mine = (struct mydata *)data;
int64_t r;
(void)a;
r = lseek(mine->fd, request, whence);
if (r >= 0)
return r;
return (ARCHIVE_FATAL);
}
static void
test_customized_multiple_data_objects(void)
{
char buff[64];
static const char *reffiles[] =
{
"test_read_splitted_rar_aa",
"test_read_splitted_rar_ab",
"test_read_splitted_rar_ac",
"test_read_splitted_rar_ad",
NULL
};
const char test_txt[] = "test text document\r\n";
int size = sizeof(test_txt)-1;
struct archive_entry *ae;
struct archive *a;
struct mydata *mydata;
const char *filename = *reffiles;
int i;
extract_reference_files(reffiles);
assert((a = archive_read_new()) != NULL);
assertA(0 == archive_read_support_filter_all(a));
assertA(0 == archive_read_support_format_all(a));
for (i = 0; filename != NULL;)
{
assert((mydata = (struct mydata *)calloc(1, sizeof(*mydata))) != NULL);
if (mydata == NULL) {
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
return;
}
assert((mydata->filename =
(char *)calloc(1, strlen(filename) + 1)) != NULL);
if (mydata->filename == NULL) {
free(mydata);
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
return;
}
strcpy(mydata->filename, filename);
mydata->fd = -1;
filename = reffiles[++i];
assertA(0 == archive_read_append_callback_data(a, mydata));
}
assertA(0 == archive_read_set_open_callback(a, file_open));
assertA(0 == archive_read_set_read_callback(a, file_read));
assertA(0 == archive_read_set_skip_callback(a, file_skip));
assertA(0 == archive_read_set_close_callback(a, file_close));
assertA(0 == archive_read_set_switch_callback(a, file_switch));
assertA(0 == archive_read_set_seek_callback(a, file_seek));
assertA(0 == archive_read_open1(a));
/* First header. */
assertA(0 == archive_read_next_header(a, &ae));
assertEqualString("test.txt", archive_entry_pathname(ae));
assertA((int)archive_entry_mtime(ae));
assertA((int)archive_entry_ctime(ae));
assertA((int)archive_entry_atime(ae));
assertEqualInt(20, archive_entry_size(ae));
assertEqualInt(33188, archive_entry_mode(ae));
assertA(size == archive_read_data(a, buff, size));
assertEqualMem(buff, test_txt, size);
/* Second header. */
assertA(0 == archive_read_next_header(a, &ae));
assertEqualString("testlink", archive_entry_pathname(ae));
assertA((int)archive_entry_mtime(ae));
assertA((int)archive_entry_ctime(ae));
assertA((int)archive_entry_atime(ae));
assertEqualInt(0, archive_entry_size(ae));
assertEqualInt(41471, archive_entry_mode(ae));
assertEqualString("test.txt", archive_entry_symlink(ae));
assertEqualIntA(a, 0, archive_read_data(a, buff, sizeof(buff)));
/* Third header. */
assertA(0 == archive_read_next_header(a, &ae));
assertEqualString("testdir/test.txt", archive_entry_pathname(ae));
assertA((int)archive_entry_mtime(ae));
assertA((int)archive_entry_ctime(ae));
assertA((int)archive_entry_atime(ae));
assertEqualInt(20, archive_entry_size(ae));
assertEqualInt(33188, archive_entry_mode(ae));
assertA(size == archive_read_data(a, buff, size));
assertEqualMem(buff, test_txt, size);
/* Fourth header. */
assertA(0 == archive_read_next_header(a, &ae));
assertEqualString("testdir", archive_entry_pathname(ae));
assertA((int)archive_entry_mtime(ae));
assertA((int)archive_entry_ctime(ae));
assertA((int)archive_entry_atime(ae));
assertEqualInt(0, archive_entry_size(ae));
assertEqualInt(16877, archive_entry_mode(ae));
/* Fifth header. */
assertA(0 == archive_read_next_header(a, &ae));
assertEqualString("testemptydir", archive_entry_pathname(ae));
assertA((int)archive_entry_mtime(ae));
assertA((int)archive_entry_ctime(ae));
assertA((int)archive_entry_atime(ae));
assertEqualInt(0, archive_entry_size(ae));
assertEqualInt(16877, archive_entry_mode(ae));
/* Test EOF */
assertA(1 == archive_read_next_header(a, &ae));
assertEqualInt(5, archive_file_count(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}
DEFINE_TEST(test_archive_read_multiple_data_objects)
{
test_splitted_file();
test_large_splitted_file();
test_customized_multiple_data_objects();
}

View file

@ -0,0 +1,111 @@
/*-
* Copyright (c) 2003-2011 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD$");
static void
test_empty_file1(void)
{
struct archive* a = archive_read_new();
/* Try opening an empty file with the raw handler. */
assertEqualInt(ARCHIVE_OK, archive_read_support_format_raw(a));
assertEqualInt(0, archive_errno(a));
assertEqualString(NULL, archive_error_string(a));
/* Raw handler doesn't support empty files. */
assertEqualInt(ARCHIVE_FATAL, archive_read_open_filename(a, "emptyfile", 0));
assert(NULL != archive_error_string(a));
archive_read_free(a);
}
static void
test_empty_file2(void)
{
struct archive* a = archive_read_new();
struct archive_entry* e;
/* Try opening an empty file with raw and empty handlers. */
assertEqualInt(ARCHIVE_OK, archive_read_support_format_raw(a));
assertEqualInt(ARCHIVE_OK, archive_read_support_format_empty(a));
assertEqualInt(0, archive_errno(a));
assertEqualString(NULL, archive_error_string(a));
assertEqualInt(ARCHIVE_OK, archive_read_open_filename(a, "emptyfile", 0));
assertEqualInt(0, archive_errno(a));
assertEqualString(NULL, archive_error_string(a));
assertEqualInt(ARCHIVE_EOF, archive_read_next_header(a, &e));
assertEqualInt(0, archive_errno(a));
assertEqualString(NULL, archive_error_string(a));
archive_read_free(a);
}
static void
test_empty_tarfile(void)
{
struct archive* a = archive_read_new();
struct archive_entry* e;
/* Try opening an empty file with raw and empty handlers. */
assertEqualInt(ARCHIVE_OK, archive_read_support_format_tar(a));
assertEqualInt(0, archive_errno(a));
assertEqualString(NULL, archive_error_string(a));
assertEqualInt(ARCHIVE_OK, archive_read_open_filename(a, "empty.tar", 0));
assertEqualInt(0, archive_errno(a));
assertEqualString(NULL, archive_error_string(a));
assertEqualInt(ARCHIVE_EOF, archive_read_next_header(a, &e));
assertEqualInt(0, archive_errno(a));
assertEqualString(NULL, archive_error_string(a));
archive_read_free(a);
}
/* 512 zero bytes. */
static char nulls[512];
DEFINE_TEST(test_archive_read_next_header_empty)
{
FILE *f;
/* Create an empty file. */
f = fopen("emptyfile", "wb");
fclose(f);
/* Create a file with 512 zero bytes. */
f = fopen("empty.tar", "wb");
assertEqualInt(512, fwrite(nulls, 1, 512, f));
fclose(f);
test_empty_file1();
test_empty_file2();
test_empty_tarfile();
}

View file

@ -0,0 +1,65 @@
/*-
* Copyright (c) 2011 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD$");
#define DATA "random garbage for testing purposes"
static const char data[sizeof(DATA)] = DATA;
static void
test(int skip_explicitely)
{
struct archive* a = archive_read_new();
struct archive_entry* e;
assertEqualInt(ARCHIVE_OK, archive_read_support_format_raw(a));
assertEqualInt(0, archive_errno(a));
assertEqualString(NULL, archive_error_string(a));
assertEqualInt(ARCHIVE_OK, archive_read_open_memory(a,
(void *)(uintptr_t) data, sizeof(data)));
assertEqualString(NULL, archive_error_string(a));
assertEqualInt(ARCHIVE_OK, archive_read_next_header(a, &e));
assertEqualInt(0, archive_errno(a));
assertEqualString(NULL, archive_error_string(a));
if (skip_explicitely)
assertEqualInt(ARCHIVE_OK, archive_read_data_skip(a));
assertEqualInt(ARCHIVE_EOF, archive_read_next_header(a, &e));
assertEqualInt(0, archive_errno(a));
assertEqualString(NULL, archive_error_string(a));
archive_read_free(a);
}
DEFINE_TEST(test_archive_read_next_header_raw)
{
test(1);
test(0);
}

View file

@ -0,0 +1,109 @@
/*-
* Copyright (c) 2011 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD$");
static int
open_cb(struct archive *a, void *client)
{
(void)a; /* UNUSED */
(void)client; /* UNUSED */
return 0;
}
static ssize_t
read_cb(struct archive *a, void *client, const void **buff)
{
(void)a; /* UNUSED */
(void)client; /* UNUSED */
(void)buff; /* UNUSED */
return (ssize_t)0;
}
static int64_t
skip_cb(struct archive *a, void *client, int64_t request)
{
(void)a; /* UNUSED */
(void)client; /* UNUSED */
(void)request; /* UNUSED */
return (int64_t)0;
}
static int
close_cb(struct archive *a, void *client)
{
(void)a; /* UNUSED */
(void)client; /* UNUSED */
return 0;
}
static void
test(int formatted, archive_open_callback *o, archive_read_callback *r,
archive_skip_callback *s, archive_close_callback *c,
int rv, const char *msg)
{
struct archive* a = archive_read_new();
if (formatted)
assertEqualInt(ARCHIVE_OK,
archive_read_support_format_empty(a));
assertEqualInt(rv,
archive_read_open2(a, NULL, o, r, s, c));
assertEqualString(msg, archive_error_string(a));
archive_read_free(a);
}
DEFINE_TEST(test_archive_read_open2)
{
const char *no_reader =
"No reader function provided to archive_read_open";
const char *no_formats = "No formats registered";
test(1, NULL, NULL, NULL, NULL,
ARCHIVE_FATAL, no_reader);
test(1, open_cb, NULL, NULL, NULL,
ARCHIVE_FATAL, no_reader);
test(1, open_cb, read_cb, NULL, NULL,
ARCHIVE_OK, NULL);
test(1, open_cb, read_cb, skip_cb, NULL,
ARCHIVE_OK, NULL);
test(1, open_cb, read_cb, skip_cb, close_cb,
ARCHIVE_OK, NULL);
test(1, NULL, read_cb, skip_cb, close_cb,
ARCHIVE_OK, NULL);
test(1, open_cb, read_cb, skip_cb, NULL,
ARCHIVE_OK, NULL);
test(1, NULL, read_cb, skip_cb, NULL,
ARCHIVE_OK, NULL);
test(1, NULL, read_cb, NULL, NULL,
ARCHIVE_OK, NULL);
test(0, NULL, NULL, NULL, NULL,
ARCHIVE_FATAL, no_reader);
test(0, open_cb, NULL, NULL, NULL,
ARCHIVE_FATAL, no_reader);
test(0, open_cb, read_cb, NULL, NULL,
ARCHIVE_FATAL, no_formats);
test(0, open_cb, read_cb, skip_cb, NULL,
ARCHIVE_FATAL, no_formats);
test(0, open_cb, read_cb, skip_cb, close_cb,
ARCHIVE_FATAL, no_formats);
}

View file

@ -0,0 +1,55 @@
/*-
* Copyright (c) 2011 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD$");
#define should(__a, __code, __m, __o, __v) \
assertEqualInt(__code, archive_read_set_filter_option(__a, __m, __o, __v))
static void
test(int pristine)
{
struct archive* a = archive_read_new();
if (!pristine)
archive_read_support_filter_all(a);
should(a, ARCHIVE_OK, NULL, NULL, NULL);
should(a, ARCHIVE_OK, "", "", "");
should(a, ARCHIVE_FAILED, NULL, "fubar", NULL);
should(a, ARCHIVE_FAILED, NULL, "fubar", "snafu");
should(a, ARCHIVE_FAILED, "fubar", "snafu", NULL);
should(a, ARCHIVE_FAILED, "fubar", "snafu", "betcha");
archive_read_free(a);
}
DEFINE_TEST(test_archive_read_set_filter_option)
{
test(1);
test(0);
}

View file

@ -0,0 +1,67 @@
/*-
* Copyright (c) 2011 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD$");
#define should(__a, __code, __m, __o, __v) \
assertEqualInt(__code, archive_read_set_format_option(__a, __m, __o, __v))
static void
test(int pristine)
{
struct archive* a = archive_read_new();
int known_option_rv = pristine ? ARCHIVE_FAILED : ARCHIVE_OK;
if (!pristine)
archive_read_support_format_all(a);
/* NULL and "" denote `no option', so they're ok no matter
* what, if any, formats are registered */
should(a, ARCHIVE_OK, NULL, NULL, NULL);
should(a, ARCHIVE_OK, "", "", "");
/* unknown modules and options */
should(a, ARCHIVE_FAILED, "fubar", "snafu", NULL);
should(a, ARCHIVE_FAILED, "fubar", "snafu", "betcha");
/* unknown modules and options */
should(a, ARCHIVE_FAILED, NULL, "snafu", NULL);
should(a, ARCHIVE_FAILED, NULL, "snafu", "betcha");
/* ARCHIVE_OK with iso9660 loaded, ARCHIVE_WARN otherwise */
should(a, known_option_rv, "iso9660", "joliet", NULL);
should(a, known_option_rv, "iso9660", "joliet", NULL);
should(a, known_option_rv, NULL, "joliet", NULL);
should(a, known_option_rv, NULL, "joliet", NULL);
archive_read_free(a);
}
DEFINE_TEST(test_archive_read_set_format_option)
{
test(1);
test(0);
}

View file

@ -0,0 +1,69 @@
/*-
* Copyright (c) 2011 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD$");
#define should(__a, __code, __m, __o, __v) \
assertEqualInt(__code, archive_read_set_option(__a, __m, __o, __v))
static void
test(int pristine)
{
struct archive* a = archive_read_new();
int known_option_rv = pristine ? ARCHIVE_FAILED : ARCHIVE_OK;
if (!pristine) {
archive_read_support_filter_all(a);
archive_read_support_format_all(a);
}
/* NULL and "" denote `no option', so they're ok no matter
* what, if any, formats are registered */
should(a, ARCHIVE_OK, NULL, NULL, NULL);
should(a, ARCHIVE_OK, "", "", "");
/* unknown modules and options */
should(a, ARCHIVE_FAILED, "fubar", "snafu", NULL);
should(a, ARCHIVE_FAILED, "fubar", "snafu", "betcha");
/* unknown modules and options */
should(a, ARCHIVE_FAILED, NULL, "snafu", NULL);
should(a, ARCHIVE_FAILED, NULL, "snafu", "betcha");
/* ARCHIVE_OK with iso9660 loaded, ARCHIVE_WARN otherwise */
should(a, known_option_rv, "iso9660", "joliet", NULL);
should(a, known_option_rv, "iso9660", "joliet", NULL);
should(a, known_option_rv, NULL, "joliet", NULL);
should(a, known_option_rv, NULL, "joliet", NULL);
archive_read_free(a);
}
DEFINE_TEST(test_archive_read_set_option)
{
test(1);
test(0);
}

View file

@ -0,0 +1,126 @@
/*-
* Copyright (c) 2011 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD$");
#define should(__a, __code, __opts) \
assertEqualInt(__code, archive_read_set_options(__a, __opts))
static void
test(int pristine)
{
struct archive* a = archive_read_new();
int halfempty_options_rv = pristine ? ARCHIVE_FAILED : ARCHIVE_OK;
int known_option_rv = pristine ? ARCHIVE_FAILED : ARCHIVE_OK;
if (!pristine) {
archive_read_support_filter_all(a);
archive_read_support_format_all(a);
}
/* NULL and "" denote `no option', so they're ok no matter
* what, if any, formats are registered */
should(a, ARCHIVE_OK, NULL);
should(a, ARCHIVE_OK, "");
/* unknown modules and options */
should(a, ARCHIVE_FAILED, "fubar:snafu");
assertEqualString("Unknown module name: `fubar'",
archive_error_string(a));
should(a, ARCHIVE_FAILED, "fubar:snafu=betcha");
assertEqualString("Unknown module name: `fubar'",
archive_error_string(a));
/* unknown modules and options */
should(a, ARCHIVE_FAILED, "snafu");
assertEqualString("Undefined option: `snafu'",
archive_error_string(a));
should(a, ARCHIVE_FAILED, "snafu=betcha");
assertEqualString("Undefined option: `snafu'",
archive_error_string(a));
/* ARCHIVE_OK with iso9660 loaded, ARCHIVE_FAILED otherwise */
should(a, known_option_rv, "iso9660:joliet");
if (pristine) {
assertEqualString("Unknown module name: `iso9660'",
archive_error_string(a));
}
should(a, known_option_rv, "iso9660:joliet");
if (pristine) {
assertEqualString("Unknown module name: `iso9660'",
archive_error_string(a));
}
should(a, known_option_rv, "joliet");
if (pristine) {
assertEqualString("Undefined option: `joliet'",
archive_error_string(a));
}
should(a, known_option_rv, "!joliet");
if (pristine) {
assertEqualString("Undefined option: `joliet'",
archive_error_string(a));
}
should(a, ARCHIVE_OK, ",");
should(a, ARCHIVE_OK, ",,");
should(a, halfempty_options_rv, ",joliet");
if (pristine) {
assertEqualString("Undefined option: `joliet'",
archive_error_string(a));
}
should(a, halfempty_options_rv, "joliet,");
if (pristine) {
assertEqualString("Undefined option: `joliet'",
archive_error_string(a));
}
should(a, ARCHIVE_FAILED, "joliet,snafu");
if (pristine) {
assertEqualString("Undefined option: `joliet'",
archive_error_string(a));
} else {
assertEqualString("Undefined option: `snafu'",
archive_error_string(a));
}
should(a, ARCHIVE_FAILED, "iso9660:snafu");
if (pristine) {
assertEqualString("Unknown module name: `iso9660'",
archive_error_string(a));
} else {
assertEqualString("Undefined option: `iso9660:snafu'",
archive_error_string(a));
}
archive_read_free(a);
}
DEFINE_TEST(test_archive_read_set_options)
{
test(1);
test(0);
}

View file

@ -0,0 +1,98 @@
/*-
* Copyright (c) 2011 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD$");
/*
* Verify that the various archive_read_support_* functions
* return appropriate errors when invoked on the wrong kind of
* archive handle.
*/
typedef struct archive *constructor(void);
typedef int enabler(struct archive *);
typedef int destructor(struct archive *);
static void
test_success(constructor new_, enabler enable_, destructor free_)
{
struct archive *a = new_();
int result = enable_(a);
if (result == ARCHIVE_WARN) {
assert(NULL != archive_error_string(a));
assertEqualIntA(a, -1, archive_errno(a));
} else {
assertEqualIntA(a, ARCHIVE_OK, result);
assert(NULL == archive_error_string(a));
assertEqualIntA(a, 0, archive_errno(a));
}
free_(a);
}
static void
test_failure(constructor new_, enabler enable_, destructor free_)
{
struct archive *a = new_();
assertEqualIntA(a, ARCHIVE_FATAL, enable_(a));
assert(NULL != archive_error_string(a));
assertEqualIntA(a, -1, archive_errno(a));
free_(a);
}
static void
test_filter_or_format(enabler enable)
{
test_success(archive_read_new, enable, archive_read_free);
test_failure(archive_write_new, enable, archive_write_free);
test_failure(archive_read_disk_new, enable, archive_read_free);
test_failure(archive_write_disk_new, enable, archive_write_free);
}
DEFINE_TEST(test_archive_read_support)
{
test_filter_or_format(archive_read_support_format_7zip);
test_filter_or_format(archive_read_support_format_all);
test_filter_or_format(archive_read_support_format_ar);
test_filter_or_format(archive_read_support_format_cab);
test_filter_or_format(archive_read_support_format_cpio);
test_filter_or_format(archive_read_support_format_empty);
test_filter_or_format(archive_read_support_format_iso9660);
test_filter_or_format(archive_read_support_format_lha);
test_filter_or_format(archive_read_support_format_mtree);
test_filter_or_format(archive_read_support_format_tar);
test_filter_or_format(archive_read_support_format_xar);
test_filter_or_format(archive_read_support_format_zip);
test_filter_or_format(archive_read_support_filter_all);
test_filter_or_format(archive_read_support_filter_bzip2);
test_filter_or_format(archive_read_support_filter_compress);
test_filter_or_format(archive_read_support_filter_gzip);
test_filter_or_format(archive_read_support_filter_lzip);
test_filter_or_format(archive_read_support_filter_lzma);
test_filter_or_format(archive_read_support_filter_none);
test_filter_or_format(archive_read_support_filter_rpm);
test_filter_or_format(archive_read_support_filter_uu);
test_filter_or_format(archive_read_support_filter_xz);
}

View file

@ -0,0 +1,51 @@
/*-
* Copyright (c) 2011 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD$");
static void
test(struct archive *a, int code, const char *msg)
{
archive_set_error(a, code, "%s", msg);
assertEqualInt(code, archive_errno(a));
assertEqualString(msg, archive_error_string(a));
}
DEFINE_TEST(test_archive_set_error)
{
struct archive* a = archive_read_new();
/* unlike printf("%s", NULL),
* archive_set_error(a, code, "%s", NULL)
* segfaults, so it's not tested here */
test(a, 12, "abcdefgh");
test(a, 0, "123456");
test(a, -1, "tuvw");
test(a, 34, "XYZ");
archive_read_free(a);
}

View file

@ -0,0 +1,431 @@
/*-
* Copyright (c) 2011 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD$");
#define __LIBARCHIVE_TEST
#include "archive_string.h"
#define EXTENT 32
#define assertStringSizes(strlen, buflen, as) \
assertEqualInt(strlen, (as).length); \
assertEqualInt(buflen, (as).buffer_length);
#define assertExactString(strlen, buflen, data, as) \
do { \
assertStringSizes(strlen, buflen, as); \
assertEqualString(data, (as).s); \
} while (0)
#define assertNonNULLString(strlen, buflen, as) \
do { \
assertStringSizes(strlen, buflen, as); \
assert(NULL != (as).s); \
} while (0)
static void
test_archive_string_ensure(void)
{
struct archive_string s;
archive_string_init(&s);
assertExactString(0, 0, NULL, s);
/* single-extent allocation */
assert(&s == archive_string_ensure(&s, 5));
assertNonNULLString(0, EXTENT, s);
/* what happens around extent boundaries? */
assert(&s == archive_string_ensure(&s, EXTENT - 1));
assertNonNULLString(0, EXTENT, s);
assert(&s == archive_string_ensure(&s, EXTENT));
assertNonNULLString(0, EXTENT, s);
assert(&s == archive_string_ensure(&s, EXTENT + 1));
assertNonNULLString(0, 2 * EXTENT, s);
archive_string_free(&s);
}
static void
test_archive_strcat(void)
{
struct archive_string s;
archive_string_init(&s);
assertExactString(0, 0, NULL, s);
/* null target, empty source */
assert(&s == archive_strcat(&s, ""));
assertExactString(0, EXTENT, "", s);
/* empty target, empty source */
assert(&s == archive_strcat(&s, ""));
assertExactString(0, EXTENT, "", s);
/* empty target, non-empty source */
assert(&s == archive_strcat(&s, "fubar"));
assertExactString(5, EXTENT, "fubar", s);
/* non-empty target, non-empty source */
assert(&s == archive_strcat(&s, "baz"));
assertExactString(8, EXTENT, "fubarbaz", s);
archive_string_free(&s);
}
static void
test_archive_strappend_char(void)
{
struct archive_string s;
archive_string_init(&s);
assertExactString(0, 0, NULL, s);
/* null target */
archive_strappend_char(&s, 'X');
assertExactString(1, EXTENT, "X", s);
/* non-empty target */
archive_strappend_char(&s, 'Y');
assertExactString(2, EXTENT, "XY", s);
archive_string_free(&s);
}
/* archive_strnXXX() tests focus on length handling.
* other behaviors are tested by proxy through archive_strXXX()
*/
static void
test_archive_strncat(void)
{
struct archive_string s;
archive_string_init(&s);
assertExactString(0, 0, NULL, s);
/* perfect length */
assert(&s == archive_strncat(&s, "snafu", 5));
assertExactString(5, EXTENT, "snafu", s);
/* short read */
assert(&s == archive_strncat(&s, "barbazqux", 3));
assertExactString(8, EXTENT, "snafubar", s);
/* long read is ok too! */
assert(&s == archive_strncat(&s, "snafu", 8));
assertExactString(13, EXTENT, "snafubarsnafu", s);
archive_string_free(&s);
}
static void
test_archive_strncpy(void)
{
struct archive_string s;
archive_string_init(&s);
assertExactString(0, 0, NULL, s);
/* perfect length */
assert(&s == archive_strncpy(&s, "fubar", 5));
assertExactString(5, EXTENT, "fubar", s);
/* short read */
assert(&s == archive_strncpy(&s, "snafubar", 5));
assertExactString(5, EXTENT, "snafu", s);
/* long read is ok too! */
assert(&s == archive_strncpy(&s, "snafu", 8));
assertExactString(5, EXTENT, "snafu", s);
archive_string_free(&s);
}
static void
test_archive_strcpy(void)
{
struct archive_string s;
archive_string_init(&s);
assertExactString(0, 0, NULL, s);
/* null target */
assert(&s == archive_strcpy(&s, "snafu"));
assertExactString(5, EXTENT, "snafu", s);
/* dirty target */
assert(&s == archive_strcpy(&s, "foo"));
assertExactString(3, EXTENT, "foo", s);
/* dirty target, empty source */
assert(&s == archive_strcpy(&s, ""));
assertExactString(0, EXTENT, "", s);
archive_string_free(&s);
}
static void
test_archive_string_concat(void)
{
struct archive_string s, t, u, v;
archive_string_init(&s);
assertExactString(0, 0, NULL, s);
archive_string_init(&t);
assertExactString(0, 0, NULL, t);
archive_string_init(&u);
assertExactString(0, 0, NULL, u);
archive_string_init(&v);
assertExactString(0, 0, NULL, v);
/* null target, null source */
archive_string_concat(&t, &s);
assertExactString(0, 0, NULL, s);
assertExactString(0, EXTENT, "", t);
/* null target, empty source */
assert(&s == archive_strcpy(&s, ""));
archive_string_concat(&u, &s);
assertExactString(0, EXTENT, "", s);
assertExactString(0, EXTENT, "", u);
/* null target, non-empty source */
assert(&s == archive_strcpy(&s, "foo"));
archive_string_concat(&v, &s);
assertExactString(3, EXTENT, "foo", s);
assertExactString(3, EXTENT, "foo", v);
/* empty target, empty source */
assert(&s == archive_strcpy(&s, ""));
assert(&t == archive_strcpy(&t, ""));
archive_string_concat(&t, &s);
assertExactString(0, EXTENT, "", s);
assertExactString(0, EXTENT, "", t);
/* empty target, non-empty source */
assert(&s == archive_strcpy(&s, "snafu"));
assert(&t == archive_strcpy(&t, ""));
archive_string_concat(&t, &s);
assertExactString(5, EXTENT, "snafu", s);
assertExactString(5, EXTENT, "snafu", t);
archive_string_free(&v);
archive_string_free(&u);
archive_string_free(&t);
archive_string_free(&s);
}
static void
test_archive_string_copy(void)
{
struct archive_string s, t, u, v;
archive_string_init(&s);
assertExactString(0, 0, NULL, s);
archive_string_init(&t);
assertExactString(0, 0, NULL, t);
archive_string_init(&u);
assertExactString(0, 0, NULL, u);
archive_string_init(&v);
assertExactString(0, 0, NULL, v);
/* null target, null source */
archive_string_copy(&t, &s);
assertExactString(0, 0, NULL, s);
assertExactString(0, EXTENT, "", t);
/* null target, empty source */
archive_string_copy(&u, &t);
assertExactString(0, EXTENT, "", t);
assertExactString(0, EXTENT, "", u);
/* empty target, empty source */
archive_string_copy(&u, &t);
assertExactString(0, EXTENT, "", t);
assertExactString(0, EXTENT, "", u);
/* null target, non-empty source */
assert(NULL != archive_strcpy(&s, "snafubar"));
assertExactString(8, EXTENT, "snafubar", s);
archive_string_copy(&v, &s);
assertExactString(8, EXTENT, "snafubar", s);
assertExactString(8, EXTENT, "snafubar", v);
/* empty target, non-empty source */
assertExactString(0, EXTENT, "", t);
archive_string_copy(&t, &s);
assertExactString(8, EXTENT, "snafubar", s);
assertExactString(8, EXTENT, "snafubar", t);
/* non-empty target, non-empty source */
assert(NULL != archive_strcpy(&s, "fubar"));
assertExactString(5, EXTENT, "fubar", s);
archive_string_copy(&t, &s);
assertExactString(5, EXTENT, "fubar", s);
assertExactString(5, EXTENT, "fubar", t);
archive_string_free(&v);
archive_string_free(&u);
archive_string_free(&t);
archive_string_free(&s);
}
static void
test_archive_string_sprintf(void)
{
struct archive_string s;
#define S16 "0123456789abcdef"
#define S32 S16 S16
#define S64 S32 S32
#define S128 S64 S64
const char *s32 = S32;
const char *s33 = S32 "0";
const char *s64 = S64;
const char *s65 = S64 "0";
const char *s128 = S128;
const char *s129 = S128 "0";
#undef S16
#undef S32
#undef S64
#undef S128
archive_string_init(&s);
assertExactString(0, 0, NULL, s);
archive_string_sprintf(&s, "%s", "");
assertExactString(0, 2 * EXTENT, "", s);
archive_string_empty(&s);
archive_string_sprintf(&s, "%s", s32);
assertExactString(32, 2 * EXTENT, s32, s);
archive_string_empty(&s);
archive_string_sprintf(&s, "%s", s33);
assertExactString(33, 2 * EXTENT, s33, s);
archive_string_empty(&s);
archive_string_sprintf(&s, "%s", s64);
assertExactString(64, 4 * EXTENT, s64, s);
archive_string_empty(&s);
archive_string_sprintf(&s, "%s", s65);
assertExactString(65, 4 * EXTENT, s65, s);
archive_string_empty(&s);
archive_string_sprintf(&s, "%s", s128);
assertExactString(128, 8 * EXTENT, s128, s);
archive_string_empty(&s);
archive_string_sprintf(&s, "%s", s129);
assertExactString(129, 8 * EXTENT, s129, s);
archive_string_empty(&s);
archive_string_sprintf(&s, "%d", 1234567890);
assertExactString(10, 8 * EXTENT, "1234567890", s);
archive_string_free(&s);
}
DEFINE_TEST(test_archive_string)
{
test_archive_string_ensure();
test_archive_strcat();
test_archive_strappend_char();
test_archive_strncat();
test_archive_strncpy();
test_archive_strcpy();
test_archive_string_concat();
test_archive_string_copy();
test_archive_string_sprintf();
}
static const char *strings[] =
{
"dir/path",
"dir/path2",
"dir/path3",
"dir/path4",
"dir/path5",
"dir/path6",
"dir/path7",
"dir/path8",
"dir/path9",
"dir/subdir/path",
"dir/subdir/path2",
"dir/subdir/path3",
"dir/subdir/path4",
"dir/subdir/path5",
"dir/subdir/path6",
"dir/subdir/path7",
"dir/subdir/path8",
"dir/subdir/path9",
"dir2/path",
"dir2/path2",
"dir2/path3",
"dir2/path4",
"dir2/path5",
"dir2/path6",
"dir2/path7",
"dir2/path8",
"dir2/path9",
NULL
};
DEFINE_TEST(test_archive_string_sort)
{
unsigned int i, j, size;
char **test_strings, *tmp;
srand((unsigned int)time(NULL));
size = sizeof(strings) / sizeof(char *);
assert((test_strings = (char **)calloc(1, sizeof(strings))) != NULL);
for (i = 0; i < (size - 1); i++)
assert((test_strings[i] = strdup(strings[i])) != NULL);
/* Shuffle the test strings */
for (i = 0; i < (size - 1); i++)
{
j = rand() % ((size - 1) - i);
j += i;
tmp = test_strings[i];
test_strings[i] = test_strings[j];
test_strings[j] = tmp;
}
/* Sort and test */
assertEqualInt(ARCHIVE_OK, archive_utility_string_sort(test_strings));
for (i = 0; i < (size - 1); i++)
assertEqualString(test_strings[i], strings[i]);
for (i = 0; i < (size - 1); i++)
free(test_strings[i]);
free(test_strings);
}

View file

@ -0,0 +1,810 @@
/*-
* Copyright (c) 2011-2012 Michihiro NAKAJIMA
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD$");
#include <locale.h>
#define __LIBARCHIVE_TEST
#include "archive_string.h"
/*
Execute the following to rebuild the data for this program:
tail -n +36 test_archive_string_conversion.c | /bin/sh
#
# This requires http://unicode.org/Public/6.0.0/ucd/NormalizationTest.txt
#
if="NormalizationTest.txt"
if [ ! -f ${if} ]; then
echo "Not found: \"${if}\""
exit 0
fi
of=test_archive_string_conversion.txt.Z
echo "\$FreeBSD\$" > ${of}.uu
awk -F ';' '$0 ~/^[0-9A-F]+/ {printf "%s;%s\n", $2, $3}' ${if} | compress | uuencode ${of} >> ${of}.uu
exit 1
*/
static int
unicode_to_utf8(char *p, uint32_t uc)
{
char *_p = p;
/* Translate code point to UTF8 */
if (uc <= 0x7f) {
*p++ = (char)uc;
} else if (uc <= 0x7ff) {
*p++ = 0xc0 | ((uc >> 6) & 0x1f);
*p++ = 0x80 | (uc & 0x3f);
} else if (uc <= 0xffff) {
*p++ = 0xe0 | ((uc >> 12) & 0x0f);
*p++ = 0x80 | ((uc >> 6) & 0x3f);
*p++ = 0x80 | (uc & 0x3f);
} else {
*p++ = 0xf0 | ((uc >> 18) & 0x07);
*p++ = 0x80 | ((uc >> 12) & 0x3f);
*p++ = 0x80 | ((uc >> 6) & 0x3f);
*p++ = 0x80 | (uc & 0x3f);
}
return ((int)(p - _p));
}
static void
archive_be16enc(void *pp, uint16_t u)
{
unsigned char *p = (unsigned char *)pp;
p[0] = (u >> 8) & 0xff;
p[1] = u & 0xff;
}
static int
unicode_to_utf16be(char *p, uint32_t uc)
{
char *utf16 = p;
if (uc > 0xffff) {
/* We have a code point that won't fit into a
* wchar_t; convert it to a surrogate pair. */
uc -= 0x10000;
archive_be16enc(utf16, ((uc >> 10) & 0x3ff) + 0xD800);
archive_be16enc(utf16+2, (uc & 0x3ff) + 0xDC00);
return (4);
} else {
archive_be16enc(utf16, uc);
return (2);
}
}
static void
archive_le16enc(void *pp, uint16_t u)
{
unsigned char *p = (unsigned char *)pp;
p[0] = u & 0xff;
p[1] = (u >> 8) & 0xff;
}
static size_t
unicode_to_utf16le(char *p, uint32_t uc)
{
char *utf16 = p;
if (uc > 0xffff) {
/* We have a code point that won't fit into a
* wchar_t; convert it to a surrogate pair. */
uc -= 0x10000;
archive_le16enc(utf16, ((uc >> 10) & 0x3ff) + 0xD800);
archive_le16enc(utf16+2, (uc & 0x3ff) + 0xDC00);
return (4);
} else {
archive_le16enc(utf16, uc);
return (2);
}
}
static int
wc_size(void)
{
return (sizeof(wchar_t));
}
static int
unicode_to_wc(wchar_t *wp, uint32_t uc)
{
if (wc_size() == 4) {
*wp = (wchar_t)uc;
return (1);
}
if (uc > 0xffff) {
/* We have a code point that won't fit into a
* wchar_t; convert it to a surrogate pair. */
uc -= 0x10000;
*wp++ = (wchar_t)(((uc >> 10) & 0x3ff) + 0xD800);
*wp = (wchar_t)((uc & 0x3ff) + 0xDC00);
return (2);
} else {
*wp = (wchar_t)uc;
return (1);
}
}
/*
* Note: U+2000 - U+2FFF, U+F900 - U+FAFF and U+2F800 - U+2FAFF are not
* converted to NFD on Mac OS.
* see also http://developer.apple.com/library/mac/#qa/qa2001/qa1173.html
*/
static int
scan_unicode_pattern(char *out, wchar_t *wout, char *u16be, char *u16le,
const char *pattern, int mac_nfd)
{
unsigned uc = 0;
const char *p = pattern;
char *op = out;
wchar_t *owp = wout;
char *op16be = u16be;
char *op16le = u16le;
int ret = 0;
for (;;) {
if (*p >= '0' && *p <= '9')
uc = (uc << 4) + (*p - '0');
else if (*p >= 'A' && *p <= 'F')
uc = (uc << 4) + (*p - 'A' + 0x0a);
else {
if (mac_nfd && op == out) {
/*
* These are not converted to NFD on Mac OS.
* U+2000 - U+2FFF
* U+F900 - U+FAFF
* U+2F800 - U+2FAFF
*/
switch (uc) {
case 0x2194: case 0x219A: case 0x219B:
case 0x21AE: case 0x21CD: case 0x21CE:
case 0x21CF: case 0x2204: case 0x2209:
case 0x220C: case 0x2224: case 0x2226:
case 0x2241: case 0x2244: case 0x2247:
case 0x2249: case 0x2260: case 0x2262:
case 0x226D: case 0x226E: case 0x226F:
case 0x2270: case 0x2271: case 0x2274:
case 0x2275: case 0x2276: case 0x2278:
case 0x2279: case 0x227A: case 0x227B:
case 0x2280: case 0x2281: case 0x2284:
case 0x2285: case 0x2288: case 0x2289:
case 0x22AC: case 0x22AD: case 0x22AE:
case 0x22AF: case 0x22E0: case 0x22E1:
case 0x22E2: case 0x22E3: case 0x22EA:
case 0x22EB: case 0x22EC: case 0x22ED:
/*
* Those code points are not converted to
* NFD on Mac OS. I do not know the reason
* because it is undocumented.
* NFC NFD
* 1109A ==> 11099 110BA
* 1109C ==> 1109B 110BA
* 110AB ==> 110A5 110BA
*/
case 0x1109A: case 0x1109C: case 0x110AB:
ret = 1;
break;
}
}
op16be += unicode_to_utf16be(op16be, uc);
op16le += unicode_to_utf16le(op16le, uc);
owp += unicode_to_wc(owp, uc);
op += unicode_to_utf8(op, uc);
if (!*p) {
*op16be++ = 0;
*op16be = 0;
*op16le++ = 0;
*op16le = 0;
*owp = L'\0';
*op = '\0';
break;
}
uc = 0;
}
p++;
}
return (ret);
}
static int
is_wc_unicode(void)
{
#if defined(_WIN32) && !defined(__CYGWIN__)
return (1);
#else
return (0);
#endif
}
/*
* A conversion test that we correctly normalize UTF-8 and UTF-16BE characters.
* On Mac OS, the characters to be Form D.
* On other platforms, the characters to be Form C.
*/
static void
test_archive_string_normalization_nfc(const char *testdata)
{
struct archive *a, *a2;
struct archive_string utf8;
struct archive_mstring mstr;
struct archive_string_conv *f_sconv8, *t_sconv8;
struct archive_string_conv *f_sconv16be, *f_sconv16le;
FILE *fp;
char buff[512];
int line = 0;
int locale_is_utf8, wc_is_unicode;
int sconv_opt = SCONV_SET_OPT_NORMALIZATION_C;
locale_is_utf8 = (NULL != setlocale(LC_ALL, "en_US.UTF-8"));
wc_is_unicode = is_wc_unicode();
/* If it doesn't exist, just warn and return. */
if (!locale_is_utf8 && !wc_is_unicode) {
skipping("A test of string normalization for NFC requires "
"a suitable locale; en_US.UTF-8 not available on this "
"system");
return;
}
archive_string_init(&utf8);
memset(&mstr, 0, sizeof(mstr));
/*
* Create string conversion objects.
*/
assert((a = archive_read_new()) != NULL);
assertA(NULL != (f_sconv8 =
archive_string_conversion_from_charset(a, "UTF-8", 0)));
assertA(NULL != (f_sconv16be =
archive_string_conversion_from_charset(a, "UTF-16BE", 0)));
assertA(NULL != (f_sconv16le =
archive_string_conversion_from_charset(a, "UTF-16LE", 0)));
assert((a2 = archive_write_new()) != NULL);
assertA(NULL != (t_sconv8 =
archive_string_conversion_to_charset(a2, "UTF-8", 0)));
if (f_sconv8 == NULL || f_sconv16be == NULL || f_sconv16le == NULL ||
t_sconv8 == NULL) {
/* We cannot continue this test. */
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
return;
}
archive_string_conversion_set_opt(f_sconv8, sconv_opt);
archive_string_conversion_set_opt(f_sconv16be, sconv_opt);
archive_string_conversion_set_opt(f_sconv16le, sconv_opt);
archive_string_conversion_set_opt(t_sconv8, sconv_opt);
/* Open a test pattern file. */
assert((fp = fopen(testdata, "r")) != NULL);
/*
* Read test data.
* Test data format:
* <NFC Unicode pattern> ';' <NFD Unicode pattern> '\n'
* Unicode pattern format:
* [0-9A-F]{4,5}([ ][0-9A-F]{4,5}){0,}
*/
while (fgets(buff, sizeof(buff), fp) != NULL) {
char nfc[80], nfd[80];
char utf8_nfc[80], utf8_nfd[80];
char utf16be_nfc[80], utf16be_nfd[80];
char utf16le_nfc[80], utf16le_nfd[80];
wchar_t wc_nfc[40], wc_nfd[40];
char *e, *p;
const wchar_t *wp;
const char *mp;
size_t mplen;
line++;
if (buff[0] == '#')
continue;
p = strchr(buff, ';');
if (p == NULL)
continue;
*p++ = '\0';
/* Copy an NFC pattern */
strncpy(nfc, buff, sizeof(nfc)-1);
nfc[sizeof(nfc)-1] = '\0';
e = p;
p = strchr(p, '\n');
if (p == NULL)
continue;
*p = '\0';
/* Copy an NFD pattern */
strncpy(nfd, e, sizeof(nfd)-1);
nfd[sizeof(nfd)-1] = '\0';
/*
* Get an NFC patterns.
*/
scan_unicode_pattern(utf8_nfc, wc_nfc, utf16be_nfc, utf16le_nfc,
nfc, 0);
/*
* Get an NFD patterns.
*/
scan_unicode_pattern(utf8_nfd, wc_nfd, utf16be_nfd, utf16le_nfd,
nfd, 0);
if (locale_is_utf8) {
/*
* Normalize an NFD string for import.
*/
assertEqualInt(0, archive_strcpy_l(
&utf8, utf8_nfd, f_sconv8));
failure("NFD(%s) should be converted to NFC(%s):%d",
nfd, nfc, line);
assertEqualUTF8String(utf8_nfc, utf8.s);
/*
* Normalize an NFC string for import.
*/
assertEqualInt(0, archive_strcpy_l(
&utf8, utf8_nfc, f_sconv8));
failure("NFC(%s) should not be any changed:%d",
nfc, line);
assertEqualUTF8String(utf8_nfc, utf8.s);
/*
* Copy an NFC string for export.
*/
assertEqualInt(0, archive_strcpy_l(
&utf8, utf8_nfc, t_sconv8));
failure("NFC(%s) should not be any changed:%d",
nfc, line);
assertEqualUTF8String(utf8_nfc, utf8.s);
/*
* Normalize an NFD string in UTF-16BE for import.
*/
assertEqualInt(0, archive_strncpy_l(
&utf8, utf16be_nfd, 100000, f_sconv16be));
failure("NFD(%s) should be converted to NFC(%s):%d",
nfd, nfc, line);
assertEqualUTF8String(utf8_nfc, utf8.s);
/*
* Normalize an NFD string in UTF-16LE for import.
*/
assertEqualInt(0, archive_strncpy_l(
&utf8, utf16le_nfd, 100000, f_sconv16le));
failure("NFD(%s) should be converted to NFC(%s):%d",
nfd, nfc, line);
assertEqualUTF8String(utf8_nfc, utf8.s);
}
/*
* Test for archive_mstring interface.
* In specific, Windows platform UTF-16BE is directly
* converted to/from wide-character to avoid the effect of
* current locale since windows platform cannot make
* locale UTF-8.
*/
if (locale_is_utf8 || wc_is_unicode) {
/*
* Normalize an NFD string in UTF-8 for import.
*/
assertEqualInt(0, archive_mstring_copy_mbs_len_l(
&mstr, utf8_nfd, 100000, f_sconv8));
assertEqualInt(0,
archive_mstring_get_wcs(a, &mstr, &wp));
failure("UTF-8 NFD(%s) should be converted "
"to WCS NFC(%s):%d", nfd, nfc, line);
assertEqualWString(wc_nfc, wp);
/*
* Normalize an NFD string in UTF-16BE for import.
*/
assertEqualInt(0, archive_mstring_copy_mbs_len_l(
&mstr, utf16be_nfd, 100000, f_sconv16be));
assertEqualInt(0,
archive_mstring_get_wcs(a, &mstr, &wp));
failure("UTF-8 NFD(%s) should be converted "
"to WCS NFC(%s):%d", nfd, nfc, line);
assertEqualWString(wc_nfc, wp);
/*
* Normalize an NFD string in UTF-16LE for import.
*/
assertEqualInt(0, archive_mstring_copy_mbs_len_l(
&mstr, utf16le_nfd, 100000, f_sconv16le));
assertEqualInt(0,
archive_mstring_get_wcs(a, &mstr, &wp));
failure("UTF-8 NFD(%s) should be converted "
"to WCS NFC(%s):%d", nfd, nfc, line);
assertEqualWString(wc_nfc, wp);
/*
* Copy an NFC wide-string for export.
*/
assertEqualInt(0,
archive_mstring_copy_wcs(&mstr, wc_nfc));
assertEqualInt(0, archive_mstring_get_mbs_l(
&mstr, &mp, &mplen, t_sconv8));
failure("WCS NFC(%s) should be UTF-8 NFC:%d"
,nfc, line);
assertEqualUTF8String(utf8_nfc, mp);
}
}
archive_string_free(&utf8);
archive_mstring_clean(&mstr);
fclose(fp);
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
assertEqualInt(ARCHIVE_OK, archive_write_free(a2));
}
static void
test_archive_string_normalization_mac_nfd(const char *testdata)
{
struct archive *a, *a2;
struct archive_string utf8;
struct archive_mstring mstr;
struct archive_string_conv *f_sconv8, *t_sconv8;
struct archive_string_conv *f_sconv16be, *f_sconv16le;
FILE *fp;
char buff[512];
int line = 0;
int locale_is_utf8, wc_is_unicode;
int sconv_opt = SCONV_SET_OPT_NORMALIZATION_D;
locale_is_utf8 = (NULL != setlocale(LC_ALL, "en_US.UTF-8"));
wc_is_unicode = is_wc_unicode();
/* If it doesn't exist, just warn and return. */
if (!locale_is_utf8 && !wc_is_unicode) {
skipping("A test of string normalization for NFD requires "
"a suitable locale; en_US.UTF-8 not available on this "
"system");
return;
}
archive_string_init(&utf8);
memset(&mstr, 0, sizeof(mstr));
/*
* Create string conversion objects.
*/
assert((a = archive_read_new()) != NULL);
assertA(NULL != (f_sconv8 =
archive_string_conversion_from_charset(a, "UTF-8", 0)));
assertA(NULL != (f_sconv16be =
archive_string_conversion_from_charset(a, "UTF-16BE", 0)));
assertA(NULL != (f_sconv16le =
archive_string_conversion_from_charset(a, "UTF-16LE", 0)));
assert((a2 = archive_write_new()) != NULL);
assertA(NULL != (t_sconv8 =
archive_string_conversion_to_charset(a2, "UTF-8", 0)));
if (f_sconv8 == NULL || f_sconv16be == NULL || f_sconv16le == NULL ||
t_sconv8 == NULL) {
/* We cannot continue this test. */
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
return;
}
archive_string_conversion_set_opt(f_sconv8, sconv_opt);
archive_string_conversion_set_opt(f_sconv16be, sconv_opt);
archive_string_conversion_set_opt(f_sconv16le, sconv_opt);
archive_string_conversion_set_opt(t_sconv8, sconv_opt);
/* Open a test pattern file. */
assert((fp = fopen(testdata, "r")) != NULL);
/*
* Read test data.
* Test data format:
* <NFC Unicode pattern> ';' <NFD Unicode pattern> '\n'
* Unicode pattern format:
* [0-9A-F]{4,5}([ ][0-9A-F]{4,5}){0,}
*/
while (fgets(buff, sizeof(buff), fp) != NULL) {
char nfc[80], nfd[80];
char utf8_nfc[80], utf8_nfd[80];
char utf16be_nfc[80], utf16be_nfd[80];
char utf16le_nfc[80], utf16le_nfd[80];
wchar_t wc_nfc[40], wc_nfd[40];
char *e, *p;
const wchar_t *wp;
const char *mp;
size_t mplen;
int should_be_nfc;
line++;
if (buff[0] == '#')
continue;
p = strchr(buff, ';');
if (p == NULL)
continue;
*p++ = '\0';
/* Copy an NFC pattern */
strncpy(nfc, buff, sizeof(nfc)-1);
nfc[sizeof(nfc)-1] = '\0';
e = p;
p = strchr(p, '\n');
if (p == NULL)
continue;
*p = '\0';
/* Copy an NFD pattern */
strncpy(nfd, e, sizeof(nfd)-1);
nfd[sizeof(nfd)-1] = '\0';
/*
* Get an NFC patterns.
*/
should_be_nfc = scan_unicode_pattern(utf8_nfc, wc_nfc,
utf16be_nfc, utf16le_nfc, nfc, 1);
/*
* Get an NFD patterns.
*/
scan_unicode_pattern(utf8_nfd, wc_nfd, utf16be_nfd, utf16le_nfd,
nfd, 0);
if (locale_is_utf8) {
/*
* Normalize an NFC string for import.
*/
assertEqualInt(0, archive_strcpy_l(
&utf8, utf8_nfc, f_sconv8));
if (should_be_nfc) {
failure("NFC(%s) should not be converted to"
" NFD(%s):%d", nfc, nfd, line);
assertEqualUTF8String(utf8_nfc, utf8.s);
} else {
failure("NFC(%s) should be converted to"
" NFD(%s):%d", nfc, nfd, line);
assertEqualUTF8String(utf8_nfd, utf8.s);
}
/*
* Normalize an NFD string for import.
*/
assertEqualInt(0, archive_strcpy_l(
&utf8, utf8_nfd, f_sconv8));
failure("NFD(%s) should not be any changed:%d",
nfd, line);
assertEqualUTF8String(utf8_nfd, utf8.s);
/*
* Copy an NFD string for export.
*/
assertEqualInt(0, archive_strcpy_l(
&utf8, utf8_nfd, t_sconv8));
failure("NFD(%s) should not be any changed:%d",
nfd, line);
assertEqualUTF8String(utf8_nfd, utf8.s);
/*
* Normalize an NFC string in UTF-16BE for import.
*/
assertEqualInt(0, archive_strncpy_l(
&utf8, utf16be_nfc, 100000, f_sconv16be));
if (should_be_nfc) {
failure("NFC(%s) should not be converted to"
" NFD(%s):%d", nfc, nfd, line);
assertEqualUTF8String(utf8_nfc, utf8.s);
} else {
failure("NFC(%s) should be converted to"
" NFD(%s):%d", nfc, nfd, line);
assertEqualUTF8String(utf8_nfd, utf8.s);
}
/*
* Normalize an NFC string in UTF-16LE for import.
*/
assertEqualInt(0, archive_strncpy_l(
&utf8, utf16le_nfc, 100000, f_sconv16le));
if (should_be_nfc) {
failure("NFC(%s) should not be converted to"
" NFD(%s):%d", nfc, nfd, line);
assertEqualUTF8String(utf8_nfc, utf8.s);
} else {
failure("NFC(%s) should be converted to"
" NFD(%s):%d", nfc, nfd, line);
assertEqualUTF8String(utf8_nfd, utf8.s);
}
}
/*
* Test for archive_mstring interface.
* In specific, Windows platform UTF-16BE is directly
* converted to/from wide-character to avoid the effect of
* current locale since windows platform cannot make
* locale UTF-8.
*/
if (locale_is_utf8 || wc_is_unicode) {
/*
* Normalize an NFD string in UTF-8 for import.
*/
assertEqualInt(0, archive_mstring_copy_mbs_len_l(
&mstr, utf8_nfc, 100000, f_sconv8));
assertEqualInt(0,
archive_mstring_get_wcs(a, &mstr, &wp));
if (should_be_nfc) {
failure("UTF-8 NFC(%s) should not be converted "
"to WCS NFD(%s):%d", nfc, nfd, line);
assertEqualWString(wc_nfc, wp);
} else {
failure("UTF-8 NFC(%s) should be converted "
"to WCS NFD(%s):%d", nfc, nfd, line);
assertEqualWString(wc_nfd, wp);
}
/*
* Normalize an NFD string in UTF-16BE for import.
*/
assertEqualInt(0, archive_mstring_copy_mbs_len_l(
&mstr, utf16be_nfc, 100000, f_sconv16be));
assertEqualInt(0,
archive_mstring_get_wcs(a, &mstr, &wp));
if (should_be_nfc) {
failure("UTF-16BE NFC(%s) should not be "
"converted to WCS NFD(%s):%d",
nfc, nfd, line);
assertEqualWString(wc_nfc, wp);
} else {
failure("UTF-16BE NFC(%s) should be converted "
"to WCS NFD(%s):%d", nfc, nfd, line);
assertEqualWString(wc_nfd, wp);
}
/*
* Normalize an NFD string in UTF-16LE for import.
*/
assertEqualInt(0, archive_mstring_copy_mbs_len_l(
&mstr, utf16le_nfc, 100000, f_sconv16le));
assertEqualInt(0,
archive_mstring_get_wcs(a, &mstr, &wp));
if (should_be_nfc) {
failure("UTF-16LE NFC(%s) should not be "
"converted to WCS NFD(%s):%d",
nfc, nfd, line);
assertEqualWString(wc_nfc, wp);
} else {
failure("UTF-16LE NFC(%s) should be converted "
"to WCS NFD(%s):%d", nfc, nfd, line);
assertEqualWString(wc_nfd, wp);
}
/*
* Copy an NFD wide-string for export.
*/
assertEqualInt(0, archive_mstring_copy_wcs(
&mstr, wc_nfd));
assertEqualInt(0, archive_mstring_get_mbs_l(
&mstr, &mp, &mplen, t_sconv8));
failure("WCS NFD(%s) should be UTF-8 NFD:%d"
,nfd, line);
assertEqualUTF8String(utf8_nfd, mp);
}
}
archive_string_free(&utf8);
archive_mstring_clean(&mstr);
fclose(fp);
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
assertEqualInt(ARCHIVE_OK, archive_write_free(a2));
}
static void
test_archive_string_canonicalization(void)
{
struct archive *a;
struct archive_string_conv *sconv;
setlocale(LC_ALL, "en_US.UTF-8");
assert((a = archive_read_new()) != NULL);
assertA(NULL != (sconv =
archive_string_conversion_to_charset(a, "UTF-8", 1)));
failure("Charset name should be UTF-8");
assertEqualString("UTF-8",
archive_string_conversion_charset_name(sconv));
assertA(NULL != (sconv =
archive_string_conversion_to_charset(a, "UTF8", 1)));
failure("Charset name should be UTF-8");
assertEqualString("UTF-8",
archive_string_conversion_charset_name(sconv));
assertA(NULL != (sconv =
archive_string_conversion_to_charset(a, "utf8", 1)));
failure("Charset name should be UTF-8");
assertEqualString("UTF-8",
archive_string_conversion_charset_name(sconv));
assertA(NULL != (sconv =
archive_string_conversion_to_charset(a, "UTF-16BE", 1)));
failure("Charset name should be UTF-16BE");
assertEqualString("UTF-16BE",
archive_string_conversion_charset_name(sconv));
assertA(NULL != (sconv =
archive_string_conversion_to_charset(a, "UTF16BE", 1)));
failure("Charset name should be UTF-16BE");
assertEqualString("UTF-16BE",
archive_string_conversion_charset_name(sconv));
assertA(NULL != (sconv =
archive_string_conversion_to_charset(a, "utf16be", 1)));
failure("Charset name should be UTF-16BE");
assertEqualString("UTF-16BE",
archive_string_conversion_charset_name(sconv));
assertA(NULL != (sconv =
archive_string_conversion_to_charset(a, "UTF-16LE", 1)));
failure("Charset name should be UTF-16LE");
assertEqualString("UTF-16LE",
archive_string_conversion_charset_name(sconv));
assertA(NULL != (sconv =
archive_string_conversion_to_charset(a, "UTF16LE", 1)));
failure("Charset name should be UTF-16LE");
assertEqualString("UTF-16LE",
archive_string_conversion_charset_name(sconv));
assertA(NULL != (sconv =
archive_string_conversion_to_charset(a, "utf16le", 1)));
failure("Charset name should be UTF-16LE");
assertEqualString("UTF-16LE",
archive_string_conversion_charset_name(sconv));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}
DEFINE_TEST(test_archive_string_conversion)
{
static const char reffile[] = "test_archive_string_conversion.txt.Z";
static const char testdata[] = "testdata.txt";
struct archive *a;
struct archive_entry *ae;
char buff[512];
ssize_t size;
FILE *fp;
/*
* Extract a test pattern file.
*/
extract_reference_file(reffile);
assert((a = archive_read_new()) != NULL);
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_raw(a));
assertEqualIntA(a, ARCHIVE_OK,
archive_read_open_filename(a, reffile, 512));
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assert((fp = fopen(testdata, "w")) != NULL);
while ((size = archive_read_data(a, buff, 512)) > 0)
assertEqualInt(size, fwrite(buff, 1, size, fp));
assertEqualInt(0, fclose(fp));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
test_archive_string_normalization_nfc(testdata);
test_archive_string_normalization_mac_nfd(testdata);
test_archive_string_canonicalization();
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,214 @@
/*-
* Copyright (c) 2012 Michihiro NAKAJIMA
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD$");
static void
test_filter_by_name(const char *filter_name, int filter_code,
int (*can_filter_prog)(void))
{
struct archive_entry *ae;
struct archive *a;
size_t used;
size_t buffsize = 1024 * 128;
char *buff;
int r;
assert((buff = calloc(1, buffsize)) != NULL);
if (buff == NULL)
return;
/* Create a new archive in memory. */
assert((a = archive_write_new()) != NULL);
assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a));
r = archive_write_add_filter_by_name(a, filter_name);
if (r == ARCHIVE_WARN) {
if (!can_filter_prog()) {
skipping("%s filter not supported on this platform",
filter_name);
assertEqualInt(ARCHIVE_OK, archive_write_free(a));
free(buff);
return;
}
} else if (r == ARCHIVE_FATAL &&
(strcmp(archive_error_string(a),
"lzma compression not supported on this platform") == 0 ||
strcmp(archive_error_string(a),
"xz compression not supported on this platform") == 0)) {
skipping("%s filter not supported on this platform", filter_name);
assertEqualInt(ARCHIVE_OK, archive_write_free(a));
free(buff);
return;
} else {
if (!assertEqualIntA(a, ARCHIVE_OK, r)) {
assertEqualInt(ARCHIVE_OK, archive_write_free(a));
free(buff);
return;
}
}
if (filter_code == ARCHIVE_FILTER_LRZIP)
{
/*
* There's a bug in lrzip (as of release 0.612) where 2nd stage
* compression can't be performed on smaller files. Set lrzip to
* use no 2nd stage compression.
*/
assertEqualIntA(a, ARCHIVE_OK,
archive_write_set_options(a, "lrzip:compression=none"));
}
assertEqualIntA(a, ARCHIVE_OK, archive_write_set_bytes_per_block(a, 10));
assertEqualIntA(a, ARCHIVE_OK,
archive_write_open_memory(a, buff, buffsize, &used));
/*
* Write a file to it.
*/
assert((ae = archive_entry_new()) != NULL);
archive_entry_set_mtime(ae, 1, 0);
assertEqualInt(1, archive_entry_mtime(ae));
archive_entry_set_ctime(ae, 1, 0);
assertEqualInt(1, archive_entry_ctime(ae));
archive_entry_set_atime(ae, 1, 0);
assertEqualInt(1, archive_entry_atime(ae));
archive_entry_copy_pathname(ae, "file");
assertEqualString("file", archive_entry_pathname(ae));
archive_entry_set_mode(ae, AE_IFREG | 0755);
assertEqualInt((AE_IFREG | 0755), archive_entry_mode(ae));
archive_entry_set_size(ae, 8);
assertEqualInt(0, archive_write_header(a, ae));
archive_entry_free(ae);
assertEqualInt(8, archive_write_data(a, "12345678", 8));
/* Close out the archive. */
assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a));
assertEqualInt(ARCHIVE_OK, archive_write_free(a));
/*
* Now, read the data back.
*/
assert((a = archive_read_new()) != NULL);
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_open_memory(a, buff, used));
/*
* Read and verify the file.
*/
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualInt(1, archive_entry_mtime(ae));
assertEqualString("file", archive_entry_pathname(ae));
assertEqualInt(AE_IFREG, archive_entry_filetype(ae));
assertEqualInt(8, archive_entry_size(ae));
/* Verify the end of the archive. */
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
/* Verify archive format. */
assertEqualIntA(a, filter_code, archive_filter_code(a, 0));
assertEqualIntA(a, ARCHIVE_FORMAT_TAR_USTAR, archive_format(a));
assertEqualInt(ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
free(buff);
}
static int
canAlways(void)
{
return 1;
}
static int
cannot(void)
{
return 0;
}
DEFINE_TEST(test_archive_write_add_filter_by_name_b64encode)
{
test_filter_by_name("b64encode", ARCHIVE_FILTER_UU, canAlways);
}
DEFINE_TEST(test_archive_write_add_filter_by_name_bzip2)
{
test_filter_by_name("bzip2", ARCHIVE_FILTER_BZIP2, canBzip2);
}
DEFINE_TEST(test_archive_write_add_filter_by_name_compress)
{
test_filter_by_name("compress", ARCHIVE_FILTER_COMPRESS, canAlways);
}
DEFINE_TEST(test_archive_write_add_filter_by_name_grzip)
{
test_filter_by_name("grzip", ARCHIVE_FILTER_GRZIP, canGrzip);
}
DEFINE_TEST(test_archive_write_add_filter_by_name_gzip)
{
test_filter_by_name("gzip", ARCHIVE_FILTER_GZIP, canGzip);
}
DEFINE_TEST(test_archive_write_add_filter_by_name_lrzip)
{
test_filter_by_name("lrzip", ARCHIVE_FILTER_LRZIP, canLrzip);
}
DEFINE_TEST(test_archive_write_add_filter_by_name_lz4)
{
test_filter_by_name("lz4", ARCHIVE_FILTER_LZ4, canLz4);
}
DEFINE_TEST(test_archive_write_add_filter_by_name_lzip)
{
test_filter_by_name("lzip", ARCHIVE_FILTER_LZIP, cannot);
}
DEFINE_TEST(test_archive_write_add_filter_by_name_lzma)
{
test_filter_by_name("lzma", ARCHIVE_FILTER_LZMA, cannot);
}
DEFINE_TEST(test_archive_write_add_filter_by_name_lzop)
{
test_filter_by_name("lzop", ARCHIVE_FILTER_LZOP, canLzop);
}
DEFINE_TEST(test_archive_write_add_filter_by_name_uuencode)
{
test_filter_by_name("uuencode", ARCHIVE_FILTER_UU, canAlways);
}
DEFINE_TEST(test_archive_write_add_filter_by_name_xz)
{
test_filter_by_name("xz", ARCHIVE_FILTER_XZ, cannot);
}
DEFINE_TEST(test_archive_write_add_filter_by_name_zstd)
{
test_filter_by_name("zstd", ARCHIVE_FILTER_ZSTD, canZstd);
}

View file

@ -0,0 +1,55 @@
/*-
* Copyright (c) 2011 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD$");
#define should(__a, __code, __m, __o, __v) \
assertEqualInt(__code, archive_write_set_filter_option(__a, __m, __o, __v))
static void
test(int pristine)
{
struct archive* a = archive_write_new();
if (!pristine)
archive_write_add_filter_gzip(a);
should(a, ARCHIVE_OK, NULL, NULL, NULL);
should(a, ARCHIVE_OK, "", "", "");
should(a, ARCHIVE_FAILED, NULL, "fubar", NULL);
should(a, ARCHIVE_FAILED, NULL, "fubar", "snafu");
should(a, ARCHIVE_FAILED, "fubar", "snafu", NULL);
should(a, ARCHIVE_FAILED, "fubar", "snafu", "betcha");
archive_write_free(a);
}
DEFINE_TEST(test_archive_write_set_filter_option)
{
test(1);
test(0);
}

View file

@ -0,0 +1,290 @@
/*-
* Copyright (c) 2012 Michihiro NAKAJIMA
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD$");
static void
test_format_by_name(const char *format_name, const char *compression_type,
int format_id, int dot_stored, const void *image, size_t image_size)
{
struct archive_entry *ae;
struct archive *a;
size_t used;
size_t buffsize = 1024 * 1024;
char *buff;
int r;
assert((buff = malloc(buffsize)) != NULL);
if (buff == NULL)
return;
/* Create a new archive in memory. */
assert((a = archive_write_new()) != NULL);
r = archive_write_set_format_by_name(a, format_name);
if (r == ARCHIVE_WARN) {
skipping("%s format not fully supported on this platform",
compression_type);
assertEqualInt(ARCHIVE_OK, archive_write_free(a));
free(buff);
return;
}
assertEqualIntA(a, ARCHIVE_OK, r);
if (compression_type != NULL &&
ARCHIVE_OK != archive_write_set_format_option(a, format_name,
"compression", compression_type)) {
skipping("%s writing not fully supported on this platform",
compression_type);
assertEqualInt(ARCHIVE_OK, archive_write_free(a));
free(buff);
return;
}
assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_none(a));
assertEqualIntA(a, ARCHIVE_OK,
archive_write_open_memory(a, buff, buffsize, &used));
/*
* Write a file to it.
*/
assert((ae = archive_entry_new()) != NULL);
archive_entry_set_mtime(ae, 1, 0);
assertEqualInt(1, archive_entry_mtime(ae));
archive_entry_set_ctime(ae, 1, 0);
assertEqualInt(1, archive_entry_ctime(ae));
archive_entry_set_atime(ae, 1, 0);
assertEqualInt(1, archive_entry_atime(ae));
archive_entry_copy_pathname(ae, "file");
assertEqualString("file", archive_entry_pathname(ae));
archive_entry_set_mode(ae, AE_IFREG | 0755);
assertEqualInt((AE_IFREG | 0755), archive_entry_mode(ae));
archive_entry_set_size(ae, 8);
assertEqualInt(0, archive_write_header(a, ae));
archive_entry_free(ae);
assertEqualInt(8, archive_write_data(a, "12345678", 8));
/* Close out the archive. */
assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a));
assertEqualInt(ARCHIVE_OK, archive_write_free(a));
if (image && image_size > 0) {
assertEqualMem(buff, image, image_size);
}
if (format_id > 0) {
/*
* Now, read the data back.
*/
/* With the test memory reader -- seeking mode. */
assert((a = archive_read_new()) != NULL);
assertEqualIntA(a, ARCHIVE_OK,
archive_read_support_format_all(a));
assertEqualIntA(a, ARCHIVE_OK,
archive_read_support_filter_all(a));
assertEqualIntA(a, ARCHIVE_OK,
read_open_memory_seek(a, buff, used, 7));
if (dot_stored & 1) {
assertEqualIntA(a, ARCHIVE_OK,
archive_read_next_header(a, &ae));
assertEqualString(".", archive_entry_pathname(ae));
assertEqualInt(AE_IFDIR, archive_entry_filetype(ae));
}
/*
* Read and verify the file.
*/
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualInt(1, archive_entry_mtime(ae));
if (dot_stored & 2) {
assertEqualString("./file", archive_entry_pathname(ae));
} else {
assertEqualString("file", archive_entry_pathname(ae));
}
assertEqualInt(AE_IFREG, archive_entry_filetype(ae));
assertEqualInt(8, archive_entry_size(ae));
/* Verify the end of the archive. */
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
/* Verify archive format. */
assertEqualIntA(a, ARCHIVE_FILTER_NONE,
archive_filter_code(a, 0));
assertEqualIntA(a, format_id, archive_format(a));
assertEqualInt(ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}
free(buff);
}
DEFINE_TEST(test_archive_write_set_format_by_name_7zip)
{
test_format_by_name("7zip", "copy", ARCHIVE_FORMAT_7ZIP, 0,
"\x37\x7a\xbc\xaf\x27\x1c\x00\x03", 8);
}
DEFINE_TEST(test_archive_write_set_format_by_name_ar)
{
test_format_by_name("ar", NULL, ARCHIVE_FORMAT_AR, 0, NULL, 0);
}
DEFINE_TEST(test_archive_write_set_format_by_name_arbsd)
{
test_format_by_name("arbsd", NULL, ARCHIVE_FORMAT_AR, 0, NULL, 0);
}
DEFINE_TEST(test_archive_write_set_format_by_name_argnu)
{
test_format_by_name("argnu", NULL, ARCHIVE_FORMAT_AR_GNU, 0, NULL, 0);
}
DEFINE_TEST(test_archive_write_set_format_by_name_arsvr4)
{
test_format_by_name("arsvr4", NULL, ARCHIVE_FORMAT_AR_GNU, 0, NULL, 0);
}
DEFINE_TEST(test_archive_write_set_format_by_name_bsdtar)
{
test_format_by_name("bsdtar", NULL, ARCHIVE_FORMAT_TAR_USTAR, 0, NULL, 0);
}
DEFINE_TEST(test_archive_write_set_format_by_name_cd9660)
{
test_format_by_name("cd9660", NULL, ARCHIVE_FORMAT_ISO9660_ROCKRIDGE, 1,
NULL, 0);
}
DEFINE_TEST(test_archive_write_set_format_by_name_cpio)
{
test_format_by_name("cpio", NULL, ARCHIVE_FORMAT_CPIO_POSIX, 0, NULL, 0);
}
DEFINE_TEST(test_archive_write_set_format_by_name_gnutar)
{
test_format_by_name("gnutar", NULL, ARCHIVE_FORMAT_TAR_GNUTAR, 0,
NULL, 0);
}
DEFINE_TEST(test_archive_write_set_format_by_name_iso)
{
test_format_by_name("iso", NULL, ARCHIVE_FORMAT_ISO9660_ROCKRIDGE, 1,
NULL, 0);
}
DEFINE_TEST(test_archive_write_set_format_by_name_iso9660)
{
test_format_by_name("iso9660", NULL, ARCHIVE_FORMAT_ISO9660_ROCKRIDGE, 1,
NULL, 0);
}
DEFINE_TEST(test_archive_write_set_format_by_name_mtree)
{
test_format_by_name("mtree", NULL, ARCHIVE_FORMAT_MTREE, 2, NULL, 0);
}
DEFINE_TEST(test_archive_write_set_format_by_name_mtree_classic)
{
test_format_by_name("mtree-classic", NULL, ARCHIVE_FORMAT_MTREE, 1,
NULL, 0);
}
DEFINE_TEST(test_archive_write_set_format_by_name_newc)
{
test_format_by_name("newc", NULL, ARCHIVE_FORMAT_CPIO_SVR4_NOCRC, 0,
NULL, 0);
}
DEFINE_TEST(test_archive_write_set_format_by_name_odc)
{
test_format_by_name("odc", NULL, ARCHIVE_FORMAT_CPIO_POSIX, 0, NULL, 0);
}
DEFINE_TEST(test_archive_write_set_format_by_name_oldtar)
{
test_format_by_name("oldtar", NULL, ARCHIVE_FORMAT_TAR, 0, NULL, 0);
}
DEFINE_TEST(test_archive_write_set_format_by_name_pax)
{
test_format_by_name("pax", NULL, ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE, 0,
NULL, 0);
}
DEFINE_TEST(test_archive_write_set_format_by_name_paxr)
{
test_format_by_name("paxr", NULL, ARCHIVE_FORMAT_TAR_USTAR, 0, NULL, 0);
}
DEFINE_TEST(test_archive_write_set_format_by_name_posix)
{
test_format_by_name("posix", NULL, ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE, 0,
NULL, 0);
}
DEFINE_TEST(test_archive_write_set_format_by_name_rpax)
{
test_format_by_name("rpax", NULL, ARCHIVE_FORMAT_TAR_USTAR, 0, NULL, 0);
}
DEFINE_TEST(test_archive_write_set_format_by_name_shar)
{
test_format_by_name("shar", NULL, -1, 0,
"#!/bin/sh\n# This is a shell archive\n", 36);
}
DEFINE_TEST(test_archive_write_set_format_by_name_shardump)
{
test_format_by_name("shardump", NULL, -1, 0,
"#!/bin/sh\n# This is a shell archive\n", 36);
}
DEFINE_TEST(test_archive_write_set_format_by_name_ustar)
{
test_format_by_name("ustar", NULL, ARCHIVE_FORMAT_TAR_USTAR, 0, NULL, 0);
}
DEFINE_TEST(test_archive_write_set_format_by_name_v7tar)
{
test_format_by_name("v7tar", NULL, ARCHIVE_FORMAT_TAR, 0, NULL, 0);
}
DEFINE_TEST(test_archive_write_set_format_by_name_v7)
{
test_format_by_name("v7", NULL, ARCHIVE_FORMAT_TAR, 0, NULL, 0);
}
DEFINE_TEST(test_archive_write_set_format_by_name_warc)
{
test_format_by_name("warc", NULL, ARCHIVE_FORMAT_WARC, 0, NULL, 0);
}
DEFINE_TEST(test_archive_write_set_format_by_name_xar)
{
test_format_by_name("xar", "gzip", ARCHIVE_FORMAT_XAR, 0, NULL, 0);
}
DEFINE_TEST(test_archive_write_set_format_by_name_zip)
{
test_format_by_name("zip", "store", ARCHIVE_FORMAT_ZIP, 0, NULL, 0);
}

View file

@ -0,0 +1,211 @@
/*-
* Copyright (c) 2012 Michihiro NAKAJIMA
* Copyright (c) 2015 Okhotnikov Kirill
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD$");
static void
test_format_filter_by_ext(const char *output_file,
int format_id, int filter_id, int dot_stored, const char * def_ext)
{
struct archive_entry *ae;
struct archive *a;
size_t used;
size_t buffsize = 1024 * 1024;
char *buff;
int r;
assert((buff = malloc(buffsize)) != NULL);
if (buff == NULL)
return;
/* Create a new archive in memory. */
assert((a = archive_write_new()) != NULL);
if( def_ext == NULL)
r = archive_write_set_format_filter_by_ext(a, output_file);
else
r = archive_write_set_format_filter_by_ext_def(a, output_file, def_ext);
if (r == ARCHIVE_WARN) {
skipping("%s format not fully supported on this platform",
archive_format_name(a));
assertEqualInt(ARCHIVE_OK, archive_write_free(a));
free(buff);
return;
} else if (r == ARCHIVE_FATAL &&
(strcmp(archive_error_string(a),
"lzma compression not supported on this platform") == 0 ||
strcmp(archive_error_string(a),
"xz compression not supported on this platform") == 0)) {
const char *filter_name = archive_filter_name(a, 0);
skipping("%s filter not supported on this platform", filter_name);
assertEqualInt(ARCHIVE_OK, archive_write_free(a));
free(buff);
return;
} else {
if (!assertEqualIntA(a, ARCHIVE_OK, r)) {
assertEqualInt(ARCHIVE_OK, archive_write_free(a));
free(buff);
return;
}
}
assertEqualIntA(a, ARCHIVE_OK,
archive_write_open_memory(a, buff, buffsize, &used));
/*
* Write a file to it.
*/
assert((ae = archive_entry_new()) != NULL);
archive_entry_set_mtime(ae, 1, 0);
assertEqualInt(1, archive_entry_mtime(ae));
archive_entry_set_ctime(ae, 1, 0);
assertEqualInt(1, archive_entry_ctime(ae));
archive_entry_set_atime(ae, 1, 0);
assertEqualInt(1, archive_entry_atime(ae));
archive_entry_copy_pathname(ae, "file");
assertEqualString("file", archive_entry_pathname(ae));
archive_entry_set_mode(ae, AE_IFREG | 0755);
assertEqualInt((AE_IFREG | 0755), archive_entry_mode(ae));
archive_entry_set_size(ae, 8);
assertEqualInt(0, archive_write_header(a, ae));
archive_entry_free(ae);
assertEqualInt(8, archive_write_data(a, "12345678", 8));
/* Close out the archive. */
assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a));
assertEqualInt(ARCHIVE_OK, archive_write_free(a));
if (format_id > 0) {
/*
* Now, read the data back.
*/
/* With the test memory reader -- seeking mode. */
assert((a = archive_read_new()) != NULL);
assertEqualIntA(a, ARCHIVE_OK,
archive_read_support_format_all(a));
assertEqualIntA(a, ARCHIVE_OK,
archive_read_support_filter_all(a));
assertEqualIntA(a, ARCHIVE_OK,
read_open_memory_seek(a, buff, used, 7));
if (dot_stored & 1) {
assertEqualIntA(a, ARCHIVE_OK,
archive_read_next_header(a, &ae));
assertEqualString(".", archive_entry_pathname(ae));
assertEqualInt(AE_IFDIR, archive_entry_filetype(ae));
}
/*
* Read and verify the file.
*/
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualInt(1, archive_entry_mtime(ae));
if (dot_stored & 2) {
assertEqualString("./file", archive_entry_pathname(ae));
} else {
assertEqualString("file", archive_entry_pathname(ae));
}
assertEqualInt(AE_IFREG, archive_entry_filetype(ae));
assertEqualInt(8, archive_entry_size(ae));
/* Verify the end of the archive. */
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
/* Verify archive format. */
assertEqualIntA(a, filter_id,
archive_filter_code(a, 0));
assertEqualIntA(a, format_id, archive_format(a) & ARCHIVE_FORMAT_BASE_MASK );
assertEqualInt(ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}
free(buff);
}
DEFINE_TEST(test_archive_write_set_format_filter_by_ext_7zip)
{
test_format_filter_by_ext("./data/test.7z", ARCHIVE_FORMAT_7ZIP, ARCHIVE_FILTER_NONE, 0, NULL);
}
DEFINE_TEST(test_archive_write_set_format_filter_by_ext_zip)
{
test_format_filter_by_ext("./data/test.zip", ARCHIVE_FORMAT_ZIP, ARCHIVE_FILTER_NONE, 0, NULL);
}
DEFINE_TEST(test_archive_write_set_format_filter_by_ext_jar)
{
test_format_filter_by_ext("./data/test.jar", ARCHIVE_FORMAT_ZIP, ARCHIVE_FILTER_NONE, 0, NULL);
}
DEFINE_TEST(test_archive_write_set_format_filter_by_ext_a)
{
test_format_filter_by_ext("./data/test.a", ARCHIVE_FORMAT_AR, ARCHIVE_FILTER_NONE, 0, NULL);
}
DEFINE_TEST(test_archive_write_set_format_filter_by_ext_ar)
{
test_format_filter_by_ext("./data/test.ar", ARCHIVE_FORMAT_AR, ARCHIVE_FILTER_NONE, 0, NULL);
}
DEFINE_TEST(test_archive_write_set_format_filter_by_ext_cpio)
{
test_format_filter_by_ext("./data/test.cpio", ARCHIVE_FORMAT_CPIO, ARCHIVE_FILTER_NONE, 0, NULL);
}
DEFINE_TEST(test_archive_write_set_format_filter_by_ext_iso)
{
test_format_filter_by_ext("./data/test.iso", ARCHIVE_FORMAT_ISO9660, ARCHIVE_FILTER_NONE, 1, NULL);
}
DEFINE_TEST(test_archive_write_set_format_filter_by_ext_tar)
{
test_format_filter_by_ext("./data/test.tar", ARCHIVE_FORMAT_TAR, ARCHIVE_FILTER_NONE, 0, NULL);
}
DEFINE_TEST(test_archive_write_set_format_filter_by_ext_tar_gz)
{
test_format_filter_by_ext("./data/test.tar.gz", ARCHIVE_FORMAT_TAR, ARCHIVE_FILTER_GZIP, 20, NULL);
}
DEFINE_TEST(test_archive_write_set_format_filter_by_ext_tar_bz2)
{
test_format_filter_by_ext("./data/test.tar.bz2", ARCHIVE_FORMAT_TAR, ARCHIVE_FILTER_BZIP2, 0, NULL);
}
DEFINE_TEST(test_archive_write_set_format_filter_by_ext_tar_xz)
{
test_format_filter_by_ext("./data/test.tar.xz", ARCHIVE_FORMAT_TAR, ARCHIVE_FILTER_XZ, 0, NULL);
}
DEFINE_TEST(test_archive_write_set_format_filter_by_no_ext_def_zip)
{
test_format_filter_by_ext("./data/test", ARCHIVE_FORMAT_ZIP, ARCHIVE_FILTER_NONE, 0, ".zip");
}
DEFINE_TEST(test_archive_write_set_format_filter_by_ext_tar_bz2_def_zip)
{
test_format_filter_by_ext("./data/test.tar.bz2", ARCHIVE_FORMAT_TAR, ARCHIVE_FILTER_BZIP2, 0, ".zip");
}

View file

@ -0,0 +1,67 @@
/*-
* Copyright (c) 2011 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD$");
#define should(__a, __code, __m, __o, __v) \
assertEqualInt(__code, archive_write_set_format_option(__a, __m, __o, __v))
static void
test(int pristine)
{
struct archive* a = archive_write_new();
int known_option_rv = pristine ? ARCHIVE_FAILED : ARCHIVE_OK;
if (!pristine)
archive_write_set_format_iso9660(a);
/* NULL and "" denote `no option', so they're ok no matter
* what, if any, formats are registered */
should(a, ARCHIVE_OK, NULL, NULL, NULL);
should(a, ARCHIVE_OK, "", "", "");
/* unknown modules and options */
should(a, ARCHIVE_FAILED, "fubar", "snafu", NULL);
should(a, ARCHIVE_FAILED, "fubar", "snafu", "betcha");
/* unknown modules and options */
should(a, ARCHIVE_FAILED, NULL, "snafu", NULL);
should(a, ARCHIVE_FAILED, NULL, "snafu", "betcha");
/* ARCHIVE_OK with iso9660 loaded, ARCHIVE_WARN otherwise */
should(a, known_option_rv, "iso9660", "joliet", NULL);
should(a, known_option_rv, "iso9660", "joliet", NULL);
should(a, known_option_rv, NULL, "joliet", NULL);
should(a, known_option_rv, NULL, "joliet", NULL);
archive_write_free(a);
}
DEFINE_TEST(test_archive_write_set_format_option)
{
test(1);
test(0);
}

View file

@ -0,0 +1,69 @@
/*-
* Copyright (c) 2011 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD$");
#define should(__a, __code, __m, __o, __v) \
assertEqualInt(__code, archive_write_set_option(__a, __m, __o, __v))
static void
test(int pristine)
{
struct archive* a = archive_write_new();
int known_option_rv = pristine ? ARCHIVE_FAILED : ARCHIVE_OK;
if (!pristine) {
archive_write_add_filter_gzip(a);
archive_write_set_format_iso9660(a);
}
/* NULL and "" denote `no option', so they're ok no matter
* what, if any, formats are registered */
should(a, ARCHIVE_OK, NULL, NULL, NULL);
should(a, ARCHIVE_OK, "", "", "");
/* unknown modules and options */
should(a, ARCHIVE_FAILED, "fubar", "snafu", NULL);
should(a, ARCHIVE_FAILED, "fubar", "snafu", "betcha");
/* unknown modules and options */
should(a, ARCHIVE_FAILED, NULL, "snafu", NULL);
should(a, ARCHIVE_FAILED, NULL, "snafu", "betcha");
/* ARCHIVE_OK with iso9660 loaded, ARCHIVE_WARN otherwise */
should(a, known_option_rv, "iso9660", "joliet", NULL);
should(a, known_option_rv, "iso9660", "joliet", NULL);
should(a, known_option_rv, NULL, "joliet", NULL);
should(a, known_option_rv, NULL, "joliet", NULL);
archive_write_free(a);
}
DEFINE_TEST(test_archive_write_set_option)
{
test(1);
test(0);
}

View file

@ -0,0 +1,126 @@
/*-
* Copyright (c) 2011 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD$");
#define should(__a, __code, __opts) \
assertEqualInt(__code, archive_write_set_options(__a, __opts))
static void
test(int pristine)
{
struct archive* a = archive_write_new();
int halfempty_options_rv = pristine ? ARCHIVE_FAILED : ARCHIVE_OK;
int known_option_rv = pristine ? ARCHIVE_FAILED : ARCHIVE_OK;
if (!pristine) {
archive_write_add_filter_gzip(a);
archive_write_set_format_iso9660(a);
}
/* NULL and "" denote `no option', so they're ok no matter
* what, if any, formats are registered */
should(a, ARCHIVE_OK, NULL);
should(a, ARCHIVE_OK, "");
/* unknown modules and options */
should(a, ARCHIVE_FAILED, "fubar:snafu");
assertEqualString("Unknown module name: `fubar'",
archive_error_string(a));
should(a, ARCHIVE_FAILED, "fubar:snafu=betcha");
assertEqualString("Unknown module name: `fubar'",
archive_error_string(a));
/* unknown modules and options */
should(a, ARCHIVE_FAILED, "snafu");
assertEqualString("Undefined option: `snafu'",
archive_error_string(a));
should(a, ARCHIVE_FAILED, "snafu=betcha");
assertEqualString("Undefined option: `snafu'",
archive_error_string(a));
/* ARCHIVE_OK with iso9660 loaded, ARCHIVE_FAILED otherwise */
should(a, known_option_rv, "iso9660:joliet");
if (pristine) {
assertEqualString("Unknown module name: `iso9660'",
archive_error_string(a));
}
should(a, known_option_rv, "iso9660:joliet");
if (pristine) {
assertEqualString("Unknown module name: `iso9660'",
archive_error_string(a));
}
should(a, known_option_rv, "joliet");
if (pristine) {
assertEqualString("Undefined option: `joliet'",
archive_error_string(a));
}
should(a, known_option_rv, "!joliet");
if (pristine) {
assertEqualString("Undefined option: `joliet'",
archive_error_string(a));
}
should(a, ARCHIVE_OK, ",");
should(a, ARCHIVE_OK, ",,");
should(a, halfempty_options_rv, ",joliet");
if (pristine) {
assertEqualString("Undefined option: `joliet'",
archive_error_string(a));
}
should(a, halfempty_options_rv, "joliet,");
if (pristine) {
assertEqualString("Undefined option: `joliet'",
archive_error_string(a));
}
should(a, ARCHIVE_FAILED, "joliet,snafu");
if (pristine) {
assertEqualString("Undefined option: `joliet'",
archive_error_string(a));
} else {
assertEqualString("Undefined option: `snafu'",
archive_error_string(a));
}
should(a, ARCHIVE_FAILED, "iso9660:snafu");
if (pristine) {
assertEqualString("Unknown module name: `iso9660'",
archive_error_string(a));
} else {
assertEqualString("Undefined option: `iso9660:snafu'",
archive_error_string(a));
}
archive_write_free(a);
}
DEFINE_TEST(test_archive_write_set_options)
{
test(1);
test(0);
}

View file

@ -0,0 +1,95 @@
/*-
* Copyright (c) 2011 Tim Kientzle
* Copyright (c) 2014 Michihiro NAKAJIMA
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD$");
struct archive_write;
extern const char * __archive_write_get_passphrase(struct archive_write *);
static void
test(int pristine)
{
struct archive* a = archive_write_new();
struct archive_write* aw = (struct archive_write *)a;
if (!pristine) {
archive_write_add_filter_gzip(a);
archive_write_set_format_iso9660(a);
}
assertEqualInt(ARCHIVE_OK, archive_write_set_passphrase(a, "pass1"));
/* An empty passphrase cannot be accepted. */
assertEqualInt(ARCHIVE_FAILED, archive_write_set_passphrase(a, ""));
/* NULL passphrases cannot be accepted. */
assertEqualInt(ARCHIVE_FAILED, archive_write_set_passphrase(a, NULL));
/* Check a passphrase. */
assertEqualString("pass1", __archive_write_get_passphrase(aw));
/* Change the passphrase. */
assertEqualInt(ARCHIVE_OK, archive_write_set_passphrase(a, "pass2"));
assertEqualString("pass2", __archive_write_get_passphrase(aw));
archive_write_free(a);
}
DEFINE_TEST(test_archive_write_set_passphrase)
{
test(1);
test(0);
}
static const char *
callback1(struct archive *a, void *_client_data)
{
int *cnt;
(void)a; /* UNUSED */
cnt = (int *)_client_data;
*cnt += 1;
return ("passCallBack");
}
DEFINE_TEST(test_archive_write_set_passphrase_callback)
{
struct archive* a = archive_write_new();
struct archive_write* aw = (struct archive_write *)a;
int cnt = 0;
archive_write_set_format_zip(a);
assertEqualInt(ARCHIVE_OK,
archive_write_set_passphrase_callback(a, &cnt, callback1));
/* Check a passphrase. */
assertEqualString("passCallBack", __archive_write_get_passphrase(aw));
assertEqualInt(1, cnt);
/* Callback function should be called just once. */
assertEqualString("passCallBack", __archive_write_get_passphrase(aw));
assertEqualInt(1, cnt);
archive_write_free(a);
}

View file

@ -0,0 +1,37 @@
/*-
* Copyright (c) 2003-2007 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD: src/lib/libarchive/test/test_bad_fd.c,v 1.2 2008/09/01 05:38:33 kientzle Exp $");
/* Verify that attempting to open an invalid fd returns correct error. */
DEFINE_TEST(test_bad_fd)
{
struct archive *a;
assert((a = archive_read_new()) != NULL);
assertA(0 == archive_read_support_filter_all(a));
assertA(ARCHIVE_FATAL == archive_read_open_fd(a, -1, 1024));
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}

View file

@ -0,0 +1,89 @@
/*-
* Copyright (c) 2003-2008 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD: head/lib/libarchive/test/test_compat_bzip2.c 201247 2009-12-30 05:59:21Z kientzle $");
/*
* Verify our ability to read sample files compatibly with bunzip2.
*
* In particular:
* * bunzip2 will read multiple bzip2 streams, concatenating the output
* * bunzip2 will stop at the end of a stream if the following data
* doesn't start with a bzip2 signature.
*/
/*
* All of the sample files have the same contents; they're just
* compressed in different ways.
*/
static void
compat_bzip2(const char *name)
{
const char *n[7] = { "f1", "f2", "f3", "d1/f1", "d1/f2", "d1/f3", NULL };
struct archive_entry *ae;
struct archive *a;
int i;
assert((a = archive_read_new()) != NULL);
if (ARCHIVE_OK != archive_read_support_filter_bzip2(a)) {
skipping("Unsupported bzip2");
return;
}
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
extract_reference_file(name);
assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name, 2));
/* Read entries, match up names with list above. */
for (i = 0; i < 6; ++i) {
failure("Could not read file %d (%s) from %s", i, n[i], name);
assertEqualIntA(a, ARCHIVE_OK,
archive_read_next_header(a, &ae));
assertEqualString(n[i], archive_entry_pathname(ae));
}
/* Verify the end-of-archive. */
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
/* Verify that the format detection worked. */
assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_BZIP2);
assertEqualString(archive_filter_name(a, 0), "bzip2");
assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR);
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_BZIP2);
assertEqualString(archive_filter_name(a, 0), "bzip2");
assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR);
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}
DEFINE_TEST(test_compat_bzip2)
{
compat_bzip2("test_compat_bzip2_1.tbz");
compat_bzip2("test_compat_bzip2_2.tbz");
}

View file

@ -0,0 +1,24 @@
$FreeBSD: head/lib/libarchive/test/test_compat_bzip2_1.tbz.uu 185683 2008-12-06 07:08:08Z kientzle $
begin 644 test_compat_bzip2_1.tbz
M0EIH.3%!62936;12^)(``#-;D=$00`!_@``!8RT>$`0`$```""``5#5/*'J>
MD#(&30_5!H4_5-ZH`T``327U4@&L('"(9-%8<7&$I,`:7FXH<P(<:8)$*)(U
MZH$>+*\GV#JF<`PK29-8'OPDG36S\7<D4X4)"T4OB2!"6F@Y,4%9)E-92FB6
M4````'N4T1`$`$``?X```6,M'A`$```0``@@`'0:H]$R>HR&C(T:/U0:$U'I
MJ!ZC0`#VECO\[$10H'-Z@F*:6A1$H$V("2G0Q(U0(8=(7AK$S04#!)RXOAP%
MP:D%#Q;NO)\4UL23'2[\7<D4X4)!*:)90$)::#DQ05DF4UD;;[2>````6YC1
M$$`$?X```6,M'A`$`!````@@`'4-4S*,U!HT!HT?J@T)E-I--!H`![6<G^E$
M$5QJ!S2`*)/,*+VQ9'B0",=3$#5`CA"8<%1\7A4X$T:,-A)F5^*"X5[IR?&-
M*DDY2+\7<D4X4)`;;[2>0EIH.3%!629364RNM^,```#?L-$00`#_@`0```AG
M+1X0`!`$```((`!U#5-,:1IH`TT,1^J#)&H]3U`T``!CX[_.[`F40.64EC"D
M()+?<M#$":=,4$46`@@DBMQ)81MJACLC[V0".0,7#AH=97F?G1I@9U))RD?Q
M=R13A0D$RNM^,$)::#DQ05DF4UDS!PL0```!6]#1$$``_X``#&<M'A`0``0`
M``@@`'4-4\2-&@`:#31^J#)3TU&U!H``!B_C_.]`)J4#F929S&D0$F:4(J50
M&#)@@5&F"H,GH(J*7*@X&>KX6,VP?6Y;F%5$XR[Y/D#*9),K3^+N2*<*$@9@
MX6(`0EIH.3%!62936>ZM4*4```);D-$00`#O@``(9ST>$`0```@@`'0:IFC2
M&F@!B:/U0:$R&H:&@`"KS^U=Y`BC`#FY2*9-8%%&13E$@%8ZF(&J!##]!#E`
MKVL'2LUW2.*<!T+W-B@46%:=GQ<#6Q*DYH/Q=R13A0D.ZM4*4$)::#DQ05DF
M4UD!Z-!@```!P`'```"```@@`""J;4&8NH/%W)%.%"0`>C08`$)::#DQ05DF
?4UDI/)=P````0!!```0`(``A`(*#%W)%.%"0*3R7<```
`
end

View file

@ -0,0 +1,11 @@
$FreeBSD: head/lib/libarchive/test/test_compat_bzip2_2.tbz.uu 185683 2008-12-06 07:08:08Z kientzle $
begin 644 test_compat_bzip2_2.tbz
M0EIH.3%!629361HI1P<``4#;D-$00`#_@``)9RT>$`0``!@P`/@#&$Q,F`F`
M`,83$R8"8``1133"1/2-J-#$/U3@;XVF9V'`Y3882XA$*KO6\WTL`]QU&J"8
M$-=*Q$\@=`=QJ,TQ;3UH,NPT$-(!"HV&!ZO5D&@P-1D&1@'L<8&209QV9'G`
MW&PRZ0Q(-BT%&DG*DE.!U*#J.P]*#%-P9G`W9+34:#S&M`;@^1R^![C]:Y)U
MDF9/(\AR/@?P<CD<CD>@^@I_B[DBG"A(#12C@X!3;VUE(&UO<F4@9&%T82!T
7:&%T(&ES(&YO="!B>FEP('-T<F5A;0H`
`
end

View file

@ -0,0 +1,106 @@
/*-
* Copyright (c) 2003-2009 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD: head/lib/libarchive/test/test_compat_cpio.c 201247 2009-12-30 05:59:21Z kientzle $");
/*
* Verify our ability to read various sample files.
* It should be easy to add any new sample files sent in by users
* to this collection of tests.
*/
/* Copy this function for each test file and adjust it accordingly. */
/*
* test_compat_cpio_1.cpio checks heuristics for avoiding false
* hardlinks. foo1 and foo2 are files that have nlinks=1 and so
* should not be marked as hardlinks even though they have identical
* ino values. bar1 and bar2 have nlinks=2 so should be marked
* as hardlinks.
*/
static void
test_compat_cpio_1(void)
{
char name[] = "test_compat_cpio_1.cpio";
struct archive_entry *ae;
struct archive *a;
assert((a = archive_read_new()) != NULL);
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
extract_reference_file(name);
assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name, 17));
/* Read first entry. */
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("foo1", archive_entry_pathname(ae));
assertEqualString(NULL, archive_entry_hardlink(ae));
assertEqualInt(1260250228, archive_entry_mtime(ae));
assertEqualInt(1000, archive_entry_uid(ae));
assertEqualInt(1000, archive_entry_gid(ae));
assertEqualInt(0100644, archive_entry_mode(ae));
/* Read second entry. */
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("foo2", archive_entry_pathname(ae));
assertEqualString(NULL, archive_entry_hardlink(ae));
assertEqualInt(1260250228, archive_entry_mtime(ae));
assertEqualInt(1000, archive_entry_uid(ae));
assertEqualInt(1000, archive_entry_gid(ae));
assertEqualInt(0100644, archive_entry_mode(ae));
/* Read third entry. */
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("bar1", archive_entry_pathname(ae));
assertEqualString(NULL, archive_entry_hardlink(ae));
assertEqualInt(1260250228, archive_entry_mtime(ae));
assertEqualInt(1000, archive_entry_uid(ae));
assertEqualInt(1000, archive_entry_gid(ae));
assertEqualInt(0100644, archive_entry_mode(ae));
/* Read fourth entry. */
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("bar2", archive_entry_pathname(ae));
assertEqualString("bar1", archive_entry_hardlink(ae));
assertEqualInt(1260250228, archive_entry_mtime(ae));
assertEqualInt(1000, archive_entry_uid(ae));
assertEqualInt(1000, archive_entry_gid(ae));
assertEqualInt(0100644, archive_entry_mode(ae));
/* Verify that the format detection worked. */
assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_NONE);
assertEqualInt(archive_format(a), ARCHIVE_FORMAT_CPIO_SVR4_NOCRC);
assertEqualInt(ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}
DEFINE_TEST(test_compat_cpio)
{
test_compat_cpio_1();
}

View file

@ -0,0 +1,19 @@
$FreeBSD: head/lib/libarchive/test/test_compat_cpio_1.cpio.uu 201247 2009-12-30 05:59:21Z kientzle $
begin 644 test_compat_cpio_1.cpio
M,#<P-S`Q,#`U-CEE8F4P,#`P.#%A-#`P,#`P,V4X,#`P,#`S93@P,#`P,#`P
M,31B,61E-#<T,#`P,#`P,#0P,#`P,#`P,#`P,#`P,#4T,#`P,#`P,#`P,#`P
M,#`P,#`P,#`P,#`U,#`P,#`P,#!F;V\Q``!F;V\*,#<P-S`Q,#`U-CEE8F4P
M,#`P.#%A-#`P,#`P,V4X,#`P,#`S93@P,#`P,#`P,31B,61E-#<T,#`P,#`P
M,#0P,#`P,#`P,#`P,#`P,#4T,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`U,#`P
M,#`P,#!F;V\R``!B87(*,#<P-S`Q,#`U-CEE8F4P,#`P.#%A-#`P,#`P,V4X
M,#`P,#`S93@P,#`P,#`P,C1B,61E-#<T,#`P,#`P,#0P,#`P,#`P,#`P,#`P
M,#4T,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`U,#`P,#`P,#!B87(Q``!B87H*
M,#<P-S`Q,#`U-CEE8F4P,#`P.#%A-#`P,#`P,V4X,#`P,#`S93@P,#`P,#`P
M,C1B,61E-#<T,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#4T,#`P,#`P,#`P,#`P
M,#`P,#`P,#`P,#`U,#`P,#`P,#!B87(R```P-S`W,#$P,#`P,#`P,#`P,#`P
M,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`Q,#`P,#`P,#`P,#`P,#`P,#`P
M,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#`P,&(P,#`P,#`P
/,%1204E,15(A(2$`````
`
end

View file

@ -0,0 +1,155 @@
/*-
* Copyright (c) 2003-2007 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD: head/lib/libarchive/test/test_compat_gtar.c 189308 2009-03-03 17:02:51Z kientzle $");
/*
* Verify our ability to read sample files created by GNU tar.
* It should be easy to add any new sample files sent in by users
* to this collection of tests.
*/
/* Copy this function for each test file and adjust it accordingly. */
/*
* test_compat_gtar_1.tgz exercises reading long filenames and
* symlink targets stored in the GNU tar format.
*/
static void
test_compat_gtar_1(void)
{
char name[] = "test_compat_gtar_1.tar";
struct archive_entry *ae;
struct archive *a;
int r;
assert((a = archive_read_new()) != NULL);
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
extract_reference_file(name);
assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name, 10240));
/* Read first entry. */
assertEqualIntA(a, ARCHIVE_OK, r = archive_read_next_header(a, &ae));
if (r != ARCHIVE_OK) {
archive_read_free(a);
return;
}
assertEqualString(
"12345678901234567890123456789012345678901234567890"
"12345678901234567890123456789012345678901234567890"
"12345678901234567890123456789012345678901234567890"
"12345678901234567890123456789012345678901234567890",
archive_entry_pathname(ae));
assertEqualInt(1197179003, archive_entry_mtime(ae));
assertEqualInt(1000, archive_entry_uid(ae));
assertEqualString("tim", archive_entry_uname(ae));
assertEqualInt(1000, archive_entry_gid(ae));
assertEqualString("tim", archive_entry_gname(ae));
assertEqualInt(0100644, archive_entry_mode(ae));
/* Read second entry. */
assertEqualIntA(a, ARCHIVE_OK, r = archive_read_next_header(a, &ae));
if (r != ARCHIVE_OK) {
archive_read_free(a);
return;
}
assertEqualString(
"abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij"
"abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij"
"abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij"
"abcdefghijabcdefghijabcdefghijabcdefghijabcdefghij",
archive_entry_pathname(ae));
assertEqualString(
"12345678901234567890123456789012345678901234567890"
"12345678901234567890123456789012345678901234567890"
"12345678901234567890123456789012345678901234567890"
"12345678901234567890123456789012345678901234567890",
archive_entry_symlink(ae));
assertEqualInt(1197179043, archive_entry_mtime(ae));
assertEqualInt(1000, archive_entry_uid(ae));
assertEqualString("tim", archive_entry_uname(ae));
assertEqualInt(1000, archive_entry_gid(ae));
assertEqualString("tim", archive_entry_gname(ae));
assertEqualInt(0120755, archive_entry_mode(ae));
/* Verify the end-of-archive. */
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
/* Verify that the format detection worked. */
assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_NONE);
assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_GNUTAR);
assertEqualInt(ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}
/*
* test_compat_gtar_2.tar exercises reading of UID = 2097152 as base256
* and GID = 2097152 as octal without null terminator.
*/
static void
test_compat_gtar_2(void)
{
char name[] = "test_compat_gtar_2.tar";
struct archive_entry *ae;
struct archive *a;
int r;
assert((a = archive_read_new()) != NULL);
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
extract_reference_file(name);
assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name, 10240));
/* Read first entry. */
assertEqualIntA(a, ARCHIVE_OK, r = archive_read_next_header(a, &ae));
if (r != ARCHIVE_OK) {
archive_read_free(a);
return;
}
/* Check UID and GID */
assertEqualInt(2097152, archive_entry_uid(ae));
assertEqualInt(2097152, archive_entry_gid(ae));
/* Verify the end-of-archive. */
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
/* Verify that the format detection worked. */
assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_NONE);
assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_GNUTAR);
assertEqualInt(ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}
DEFINE_TEST(test_compat_gtar)
{
test_compat_gtar_1();
test_compat_gtar_2();
}

View file

@ -0,0 +1,232 @@
$FreeBSD: head/lib/libarchive/test/test_compat_gtar_1.tar.uu 189308 2009-03-03 17:02:51Z kientzle $
begin 644 test_compat_gtar_1.tar
M+B\N+T!,;VYG3&EN:P``````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````"`@("`@,"``("`@("`P(``@("`@(#`@`"`@("`@("`@,S$Q
M("`@("`@("`@("`P("`Q,#<P,0`@3```````````````````````````````
M````````````````````````````````````````````````````````````
M``````````````````````````````````````````!U<W1A<B`@`')O;W0`
M````````````````````````````````````=VAE96P`````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M```````````````````````Q,C,T-38W.#DP,3(S-#4V-S@Y,#$R,S0U-C<X
M.3`Q,C,T-38W.#DP,3(S-#4V-S@Y,#$R,S0U-C<X.3`Q,C,T-38W.#DP,3(S
M-#4V-S@Y,#$R,S0U-C<X.3`Q,C,T-38W.#DP,3(S-#4V-S@Y,#$R,S0U-C<X
M.3`Q,C,T-38W.#DP,3(S-#4V-S@Y,#$R,S0U-C<X.3`Q,C,T-38W.#DP,3(S
M-#4V-S@Y,#$R,S0U-C<X.3`Q,C,T-38W.#DP,3(S-#4V-S@Y,```````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````````````````````````````````````#$R,S0U-C<X.3`Q
M,C,T-38W.#DP,3(S-#4V-S@Y,#$R,S0U-C<X.3`Q,C,T-38W.#DP,3(S-#4V
M-S@Y,#$R,S0U-C<X.3`Q,C,T-38W.#DP,3(S-#4V-S@Y,#$R,S0U-C<X.0`Q
M,#`V-#0@`"`@,3<U,"``("`Q-S4P(``@("`@("`@("`@,"`Q,#<R-C<P,#$W
M,R`@,C$P,C``(#``````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````=7-T87(@(`!T:6T`````````````````
M`````````````````````'1I;0``````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````+B\N+T!,;VYG3&EN:P``````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````````````"`@("`@,"``("`@("`P(``@("`@(#`@`"`@("`@
M("`@,S$Q("`@("`@("`@("`P("`Q,#<P,``@2P``````````````````````
M````````````````````````````````````````````````````````````
M``````````````````````````````````````````````````!U<W1A<B`@
M`')O;W0`````````````````````````````````````=VAE96P`````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M```````````````````````````````Q,C,T-38W.#DP,3(S-#4V-S@Y,#$R
M,S0U-C<X.3`Q,C,T-38W.#DP,3(S-#4V-S@Y,#$R,S0U-C<X.3`Q,C,T-38W
M.#DP,3(S-#4V-S@Y,#$R,S0U-C<X.3`Q,C,T-38W.#DP,3(S-#4V-S@Y,#$R
M,S0U-C<X.3`Q,C,T-38W.#DP,3(S-#4V-S@Y,#$R,S0U-C<X.3`Q,C,T-38W
M.#DP,3(S-#4V-S@Y,#$R,S0U-C<X.3`Q,C,T-38W.#DP,3(S-#4V-S@Y,```
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````````````````````````````````````````````"XO+B]`
M3&]N9TQI;FL`````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M```````@("`@(#`@`"`@("`@,"``("`@("`P(``@("`@("`@(#,Q,2`@("`@
M("`@("`@,"`@,3`W,#$`($P`````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````=7-T87(@(`!R;V]T````````
M`````````````````````````````'=H965L````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````86)C9&5F9VAI:F%B8V1E9F=H:6IA8F-D969G:&EJ86)C
M9&5F9VAI:F%B8V1E9F=H:6IA8F-D969G:&EJ86)C9&5F9VAI:F%B8V1E9F=H
M:6IA8F-D969G:&EJ86)C9&5F9VAI:F%B8V1E9F=H:6IA8F-D969G:&EJ86)C
M9&5F9VAI:F%B8V1E9F=H:6IA8F-D969G:&EJ86)C9&5F9VAI:F%B8V1E9F=H
M:6IA8F-D969G:&EJ86)C9&5F9VAI:F%B8V1E9F=H:6H`````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M``````````````````````````````````````!A8F-D969G:&EJ86)C9&5F
M9VAI:F%B8V1E9F=H:6IA8F-D969G:&EJ86)C9&5F9VAI:F%B8V1E9F=H:6IA
M8F-D969G:&EJ86)C9&5F9VAI:F%B8V1E9F=H:6IA8F-D969G:&D`,3(P-S4U
M(``@(#$W-3`@`"`@,3<U,"``("`@("`@("`@(#`@,3`W,C8W,#`R-#,@(#0T
M-3(Q`"`R,3(S-#4V-S@Y,#$R,S0U-C<X.3`Q,C,T-38W.#DP,3(S-#4V-S@Y
M,#$R,S0U-C<X.3`Q,C,T-38W.#DP,3(S-#4V-S@Y,#$R,S0U-C<X.3`Q,C,T
M-38W.#DP,3(S-#4V-S@Y`'5S=&%R("``=&EM````````````````````````
M``````````````!T:6T`````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
9````````````````````````````````````
`
end

View file

@ -0,0 +1,49 @@
begin 660 test_compat_gtar_2.tar.uu
M9FEL95]W:71H7V)I9U]U:61?9VED````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````#`P,#`V-C8`@``````@```Q,#`P,#`P,#`P,#`P,#`P,38W
M`#$S,#$T-C<R,38W`#`Q,S,U,``@,```````````````````````````````
M````````````````````````````````````````````````````````````
M``````````````````````````````````````````!U<W1A<B`@`'1E<W0`
M````````````````````````````````````8FEG````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M``````````````````````!4:&ES(&9I;&4@:&%S($=)1#TR,#DW,34R('=H
M:6-H(&ES(&]N92!O=F5R('1H92!L:6UI="!O9B!T87(@=BXW(&%N9"!'3E4@
M=&%R('-T;W)E<R!I="!A<R!B87-E(#(U-B!N=6UB97(@*&YO="!O8W1A;"DN
M"@``````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
7````````````````````````````````
`
end

View file

@ -0,0 +1,97 @@
/*-
* Copyright (c) 2003-2008 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD: head/lib/libarchive/test/test_compat_gzip.c 191183 2009-04-17 01:06:31Z kientzle $");
/*
* Verify our ability to read sample files compatibly with gunzip.
*
* In particular:
* * gunzip will read multiple gzip streams, concatenating the output
* * gunzip will stop at the end of a stream if the following data
* doesn't start with a gzip signature.
*/
/*
* All of the sample files have the same contents; they're just
* compressed in different ways.
*/
static void
verify(const char *name)
{
const char *n[7] = { "f1", "f2", "f3", "d1/f1", "d1/f2", "d1/f3", NULL };
struct archive_entry *ae;
struct archive *a;
int i,r;
assert((a = archive_read_new()) != NULL);
r = archive_read_support_filter_gzip(a);
if (r == ARCHIVE_WARN) {
skipping("gzip reading not fully supported on this platform");
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
return;
}
assertEqualIntA(a, ARCHIVE_OK, r);
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
extract_reference_file(name);
assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name, 200));
/* Read entries, match up names with list above. */
for (i = 0; i < 6; ++i) {
failure("Could not read file %d (%s) from %s", i, n[i], name);
assertEqualIntA(a, ARCHIVE_OK,
archive_read_next_header(a, &ae));
if (r != ARCHIVE_OK) {
archive_read_free(a);
return;
}
assertEqualString(n[i], archive_entry_pathname(ae));
}
/* Verify the end-of-archive. */
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
/* Verify that the format detection worked. */
assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_GZIP);
assertEqualString(archive_filter_name(a, 0), "gzip");
assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR);
assertEqualInt(ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}
DEFINE_TEST(test_compat_gzip)
{
/* This sample has been 'split', each piece compressed separately,
* then concatenated. Gunzip will emit the concatenated result. */
/* Not supported in libarchive 2.6 and earlier */
verify("test_compat_gzip_1.tgz");
/* This sample has been compressed as a single stream, but then
* some unrelated garbage text has been appended to the end. */
verify("test_compat_gzip_2.tgz");
}

View file

@ -0,0 +1,24 @@
$FreeBSD: head/lib/libarchive/test/test_compat_gzip_1.tgz.uu 185683 2008-12-06 07:08:08Z kientzle $
begin 644 test_compat_gzip_1.tgz
M'XL(")B^(DD``W1E<W0M<W!L:70N=&%R86$`2S-DH#DP,#`P,S%1`-*&YJ:&
MR#0,&"L8`H&!J;&9F:&A@H&AH9&),8."`>V=QL!06ER26`1T2G9F:EY)54XJ
MN>9`/*(`IX<(2#/D&F@GC`(Z``#S<P4"Z`,``!^+"`B8OB))``-T97-T+7-P
M;&ET+G1A<F%B`&-@P`[2C'!(4!$8&!B8F9@H`&E#<U-#9!H&C!4,@<#`U-C,
MS-!8P<#0T,C$C$'!@/9.8V`H+2Y)+`(Z)3LS-:^D*B>57',@'E&`TT,$I!EQ
M#;031@$5`0`Q!<\4Z`,``!^+"`B8OB))``-T97-T+7-P;&ET+G1A<F%C`&-@
M(`VD&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=N2]6E\!JOH/P])_2OC^-X'YOV]+_]97@*K^A4K_C/Y;P/S?MZ5_
MZRM`7?]<^L?_OR8P_P,`].D%,XR2*0`<``!4:&ES(&ES('5N<F5L871E9"!J
@=6YK(&1A=&$@870@=&AE(&5N9"!O9B!T:&4@9FEL90H`
`
end

View file

@ -0,0 +1,120 @@
/*-
* Copyright (c) 2003-2008 Tim Kientzle
* Copyright (c) 2014 Michihiro NAKAJIMA
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD$");
/*
* Verify our ability to read sample files compatibly with 'lz4 -d'.
*
* In particular:
* * lz4 -d will read multiple lz4 streams, concatenating the output
* * lz4 -d will stop at the end of a stream if the following data
* doesn't start with a lz4 signature.
*/
/*
* All of the sample files have the same contents; they're just
* compressed in different ways.
*/
static void
verify(const char *name, const char *n[])
{
struct archive_entry *ae;
struct archive *a;
int i,r;
assert((a = archive_read_new()) != NULL);
r = archive_read_support_filter_lz4(a);
if (r == ARCHIVE_WARN) {
skipping("lz4 reading not fully supported on this platform");
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
return;
}
assertEqualIntA(a, ARCHIVE_OK, r);
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
copy_reference_file(name);
assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name, 200));
/* Read entries, match up names with list above. */
for (i = 0; n[i] != NULL; ++i) {
failure("Could not read file %d (%s) from %s", i, n[i], name);
assertEqualIntA(a, ARCHIVE_OK,
archive_read_next_header(a, &ae));
if (r != ARCHIVE_OK) {
archive_read_free(a);
return;
}
assertEqualString(n[i], archive_entry_pathname(ae));
}
/* Verify the end-of-archive. */
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
/* Verify that the format detection worked. */
assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_LZ4);
assertEqualString(archive_filter_name(a, 0), "lz4");
assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR);
assertEqualInt(ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}
DEFINE_TEST(test_compat_lz4)
{
const char *n[7] = { "f1", "f2", "f3", "d1/f1", "d1/f2", "d1/f3", NULL };
const char *n2[7] = { "xfile", "README", "NEWS", NULL };
/* This sample has been 'split', each piece compressed separately,
* then concatenated. Lz4 will emit the concatenated result. */
/* Not supported in libarchive 2.6 and earlier */
verify("test_compat_lz4_1.tar.lz4.uu", n);
/* This sample has been compressed as a single stream, but then
* some unrelated garbage text has been appended to the end. */
verify("test_compat_lz4_2.tar.lz4.uu", n);
/* This sample has been compressed as a legacy stream. */
verify("test_compat_lz4_3.tar.lz4.uu", n);
/* This sample has been compressed with -B4 option. */
verify("test_compat_lz4_B4.tar.lz4.uu", n2);
/* This sample has been compressed with -B5 option. */
verify("test_compat_lz4_B5.tar.lz4.uu", n2);
/* This sample has been compressed with -B6 option. */
verify("test_compat_lz4_B6.tar.lz4.uu", n2);
/* This sample has been compressed with -B7 option. */
verify("test_compat_lz4_B7.tar.lz4.uu", n2);
/* This sample has been compressed with -B4 and -BD options. */
verify("test_compat_lz4_B4BD.tar.lz4.uu", n2);
/* This sample has been compressed with -B5 and -BD options. */
verify("test_compat_lz4_B5BD.tar.lz4.uu", n2);
/* This sample has been compressed with -B6 and -BD options. */
verify("test_compat_lz4_B6BD.tar.lz4.uu", n2);
/* This sample has been compressed with -B7 and -BD options. */
verify("test_compat_lz4_B7BD.tar.lz4.uu", n2);
/* This sample has been compressed with -B4 ,-BD and -BX options. */
verify("test_compat_lz4_B4BDBX.tar.lz4.uu", n2);
}

View file

@ -0,0 +1,12 @@
begin 644 test_compat_lz4_1.tar.lz4
M!")-&&1PN:8````_9C$``0!.Z#`P,#8T-"``,#`Q-S4Q"``$`@#_"#,@,3$Q
M,3`U,S8V,3$@,#$Q,C0S`"`PF@!.\00```!U<W1A<@`P,&MI96YT>FQE%0`/
M`@`@`LL``-T```(`'R!"`"`/`@!B/V8Q"G@`8@\"`/]V+V8RB@%/#P`$&Q(S
M``0?-@`$_U4?,@`$_^T?,P`$?1$V``0O-3(`!/]5'S,`!/_G4```````````
M`";]7\`$(DT89'"YL@```&]D,2]F,0`!`$OH,#`P-C0T(``P,#$W-3$(``0"
M`/\(,R`Q,3$Q,#4S-C8R-R`P,3$U-38`(#"7`$L"`@#R`75S=&%R`#`P:VEE
M;G1Z;&46``\"`!\"RP``W0```@`?($$`'P\"`&,_9C$*>0!C#P(`_W4```0?
M,HP!3`\`!!HB,S``!!\Q``3_51\R``3_\!\S``1Z$C$`!!\S``3_51\S``3_
6[`\"`/___^M0````````````;,,BR0``
`
end

View file

@ -0,0 +1,13 @@
begin 644 test_compat_lz4_2.tar.lz4
M!")-&&1PN:8````_9C$``0!.Z#`P,#8T-"``,#`Q-S4Q"``$`@#_"#,@,3$Q
M,3`U,S8V,3$@,#$Q,C0S`"`PF@!.\00```!U<W1A<@`P,&MI96YT>FQE%0`/
M`@`@`LL``-T```(`'R!"`"`/`@!B/V8Q"G@`8@\"`/]V+V8RB@%/#P`$&Q(S
M``0?-@`$_U4?,@`$_^T?,P`$?1$V``0O-3(`!/]5'S,`!/_G4```````````
M`";]7\`$(DT89'"YL@```&]D,2]F,0`!`$OH,#`P-C0T(``P,#$W-3$(``0"
M`/\(,R`Q,3$Q,#4S-C8R-R`P,3$U-38`(#"7`$L"`@#R`75S=&%R`#`P:VEE
M;G1Z;&46``\"`!\"RP``W0```@`?($$`'P\"`&,_9C$*>0!C#P(`_W4```0?
M,HP!3`\`!!HB,S``!!\Q``3_51\R``3_\!\S``1Z$C$`!!\S``3_51\S``3_
M[`\"`/___^M0````````````;,,BR51H:7,@:7,@=6YR96QA=&5D(&IU;FL@
<9&%T82!A="!T:&4@96YD(&]F('1H92!F:6QE"@``
`
end

View file

@ -0,0 +1,9 @@
begin 644 test_compat_lz4_3.tar.lz4
M`B%,&/X````_9C$``0!.Z#`P,#8T-"``,#`Q-S4Q"``$`@#_"#,@,3$Q,3`U
M,S8V,3$@,#$Q,C0S`"`PF@!.\00```!U<W1A<@`P,&MI96YT>FQE%0`/`@`@
M`LL``-T```(`'R!"`"`/`@!B/V8Q"G@`8@\"`/]V+V8RB@%/#P`$&Q(S``0?
M-@`$_U4?,@`$_^T?,P`$?1$V``0O-3(`!/]5'S,`!/_L/V0Q+P,,3@\`"!H@
M,C<`!"\U-0`(_U8/``S_[0``!`\##$T/``0:(C,P``0?,0`(_U4/``S_[0``
E!`\##$T/``0;`0`4+S4U`!3_5@\`#/_M#P(`____ZU``````````
`
end

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,918 @@
begin 644 test_compat_lz4_B7.tar.lz4
M!")-&&1PN>]0``!O>&9I;&4``0!+X3`P,#8T-"``,#`P-S8U"``B,#(0`"(R
M,`$`_P<@,3(S-3,U-3,U,3(@,#$R,#(S`"`PEP!+`@(`KW5S=&%R`#`P8W4'
M`0M2<W1A9F8S``\"``(#R```Y0!/,#`P("0``@\"`(#V-%)%041-12!F;W(@
M;&EB87)C:&EV92!B=6YD;&4N"@I1=65S=&EO;G,_("!)<W-U97,_"B`@("H@
M:'1T<#HO+W=W=RXX`/$!+F]R9R!I<R!T:&4@:&]M95<`<&]N9V]I;F<W`!@@
M9`#P#&1E=F5L;W!M96YT+"!I;F-L=61I;F<@9&]C=10`$&%W`%0L(&%N9#H`
M86YK<R!T;UT`!ZL`0&UA:6PX`&!L:7-T<RXL`/`!*B!4;R!R97!O<G0@86X@
M:;<`42P@=7-E.P`!#P"P('1R86-K97(@870R`!0@SP#V`V-O9&4N9V]O9VQE
M+F-O;2]P+VH`$2\Z`"!S+VD``#4``6<`47-U8FUI9P!P96YH86YC9;L``*8`
M!C@`@RP@<&QE87-E+```.P#`("!A('!U;&P@<F5Q80&Q('9I82!':71(=6+"
M``*0`*%S.B\O9VET:'5BC``&4@`(E0``1P#P`7,*"E1H:7,@9&ES=')I8G4Z
M`0/#`0-9`1)EE`%@9F]L;&]W+@&P8V]M<&]N96YT<SJ1`!<JF0$P.B!A#@!!
M<F%R><`!,7)E89D!@&%N9"!W<FET/P!@<W1R96%M"@`#,@(2<T8`071A<CK^
M`?`!)V)S9'1A<B<@<')O9W)A;18"\`)A(&9U;&PM9F5A='5R960@)R$``#@`
M`P(`4W)E<&QA0@&`8G5I;'0@;VZ*``-C```J`&8J(&-P:6]C```.``MD`/`'
M9&EF9F5R96YT(&EN=&5R9F%C92!T;ST``P(`L65S<V5N=&EA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R!B=?D4$B`D"`!E``1R`7!A('-O8VME9A<"/@-)
M=VES:+H$1'-O;659#P!S`@6,```,`P/O#5`@96%S>4X.``P1$2(A`0!:""`L
M(E`(H"P@8V%P86)I;&D2%`8#`07Q``+S#P&W!`CV!0&7`8`@:6YD:79I9&P.
M`&@%(6EEA`$`.A("0@`$K`4`-@$A=&^L#3!D8737```%#A8Z+@$"R`D`P@`2
M8>P"`,D*`2L`,VEN("<!`(\",&%D9'0$`$P`"/<,`:D*`QX/469I<G-TD@(`
MI@$187`2$F\4%R!I;!0"!*(!`]D#`J<!`+\``IP!`84`!K@!`'8``I0!`*$#
M`9,``NX4`(46!J,!!H`%,7=A;G\%$G0=#P$V`@%;`P!C#``S`%!D:7-K+$X#
M`6L#V64@8V]N=F5N:65N8V7``0")```P%`*!$V!E<W!E8VEN!`'0`0*J`0`Z
M"#`Z("*3"@$.$0(S%0#"!4-M870BN0(`W@XB86[H`@"E!P8T"D`L"B`@S`<0
M<*(``&P$`)8``:8.<R!S87ES+@HD%1%FN`T/9!K_____________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M______________________________^:4&%U=&]MR$\``/`<871I8V%L;'DN
M"@H@*B!))W9E(&%T=&5M<'1E9"!T;R!M:6YI;6EZ92!S="L`^%,@;&EN:R!P
M;VQL=71I;VXN("!)9B!Y;W4@9&]N)W0*("`@97AP;&EC:71L>2!I;G9O:V4@
M82!P87)T:6-U;&%R(&9E871U<F4@*'-U8V@@87,@<W5P<&]R="!F;W(@80H@
M("T`\`UC;VUP<F5S<VEO;B!O<B!F;W)M870I+"!I="!W<`#P`"!G970@<'5L
M;&5D(&EN+G\`)TEN00`W+"!IG@`(FP!:96YA8FR;```^``MQ`"AD91$``ZH`
M$2SP``*``")N928!`!8!`$``^`MA9V%I;G-T('1H92!C;W)R97-P;VYD:6YG
M($D`#5H`D6QI8G)A<FEE<\,`\0)4:&ES(&%L<V\@<F5D=6-E<T\`$'.%`2-O
M9H@!`+,!$"UV`&%E9"!B:6X]`#`@:6Z$`/`*96YV:7)O;FUE;G1S('=H97)E
M('1H870@;=@!(G)SZ0'_`4]N(')E860L(%)%041-10`!`$KA,#`P-C0T(``P
M,#`W-C4(`"(P,A``_P\P,#`Q-3$T-"`Q,C,U,S(U-S(U-B`P,3$V-S0`(#"6
M`$H#`@"S=7-T87(`,#!C=642``\"``-?<W1A9F8;``,!`@`!S``2,-T`,3`P
M(!0`#P(`D`(``@!;`_`*(&QI8F%R8VAI=F4@8G5N9&QE+@H*475E<^D#L',_
M("!)<W-U97,_9`+6*B!H='1P.B\O=W=W+C@`8BYO<F<@:;`"06AO;657`'!O
M;F=O:6YG-P`8(&0`<&1E=F5L;W"H`G$L(&EN8VQU*0-`9&]C=10`$&%W`%0L
M(&%N9#H`,&YK<Y($`%P#!G,`4"!M86EL80-";&ES=$`#,"H@5#L#`58$0&%N
M(&FW`$`L('5S"`,290\`H2!T<F%C:V5R(&&T!!0@SP#V`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P(!U!$`
M2#D!5@,!&U(#5@`@86PE#@`=`0'5'P/L%@$`&@4Q.P1S``0&.P2_``!]``.'
M!Q$TBBL`I2H%FW@#;X3Q!2P@2%`M55@L(%5N:7AW87)E+"!S:2D`TRH"+@$`
D?@$1<#T``I(!`'P$'P`!`/______;U````````````",W%#R
`
end

View file

@ -0,0 +1,918 @@
begin 644 test_compat_lz4_B7BD.tar.lz4
M!")-&&1PN>]0``!O>&9I;&4``0!+X3`P,#8T-"``,#`P-S8U"``B,#(0`"(R
M,`$`_P<@,3(S-3,U-3,U,3(@,#$R,#(S`"`PEP!+`@(`KW5S=&%R`#`P8W4'
M`0M2<W1A9F8S``\"``(#R```Y0!/,#`P("0``@\"`(#V-%)%041-12!F;W(@
M;&EB87)C:&EV92!B=6YD;&4N"@I1=65S=&EO;G,_("!)<W-U97,_"B`@("H@
M:'1T<#HO+W=W=RXX`/$!+F]R9R!I<R!T:&4@:&]M95<`<&]N9V]I;F<W`!@@
M9`#P#&1E=F5L;W!M96YT+"!I;F-L=61I;F<@9&]C=10`$&%W`%0L(&%N9#H`
M86YK<R!T;UT`!ZL`0&UA:6PX`&!L:7-T<RXL`/`!*B!4;R!R97!O<G0@86X@
M:;<`42P@=7-E.P`!#P"P('1R86-K97(@870R`!0@SP#V`V-O9&4N9V]O9VQE
M+F-O;2]P+VH`$2\Z`"!S+VD``#4``6<`47-U8FUI9P!P96YH86YC9;L``*8`
M!C@`@RP@<&QE87-E+```.P#`("!A('!U;&P@<F5Q80&Q('9I82!':71(=6+"
M``*0`*%S.B\O9VET:'5BC``&4@`(E0``1P#P`7,*"E1H:7,@9&ES=')I8G4Z
M`0/#`0-9`1)EE`%@9F]L;&]W+@&P8V]M<&]N96YT<SJ1`!<JF0$P.B!A#@!!
M<F%R><`!,7)E89D!@&%N9"!W<FET/P!@<W1R96%M"@`#,@(2<T8`071A<CK^
M`?`!)V)S9'1A<B<@<')O9W)A;18"\`)A(&9U;&PM9F5A='5R960@)R$``#@`
M`P(`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P``"H`,&5L9E,!4')E
M860OY@!@=&5N('5S;P8`-PP!<@$$@A0"-`(`(0TB8V$%!#4@86ZD``(C$U!L
M>2!F<EP%$&Y_!3!M96TT$R!B=?D4$B`D"`!E``1R`7!A('-O8VME9A<"/@-)
M=VES:+H$1'-O;659#P!S`@6,```,`P/O#5`@96%S>4X.``P1$2(A`0!:""`L
M(E`(H"P@8V%P86)I;&D2%`8#`07Q``+S#P&W!`CV!0&7`8`@:6YD:79I9&P.
M`&@%(6EEA`$`.A("0@`$K`4`-@$A=&^L#3!D8737```%#A8Z+@$"R`D`P@`2
M8>P"`,D*`2L`,VEN("<!`(\",&%D9'0$`$P`"/<,`:D*`QX/469I<G-TD@(`
MI@$187`2$F\4%R!I;!0"!*(!`]D#`J<!`+\``IP!`84`!K@!`'8``I0!`*$#
M`9,``NX4`(46!J,!!H`%,7=A;G\%$G0=#P$V`@%;`P!C#``S`%!D:7-K+$X#
M`6L#V64@8V]N=F5N:65N8V7``0")```P%`*!$V!E<W!E8VEN!`'0`0*J`0`Z
M"#`Z("*3"@$.$0(S%0#"!4-M870BN0(`W@XB86[H`@"E!P8T"D`L"B`@S`<0
M<*(``&P$`)8``:8.<R!S87ES+@HD%1%FN`T/9!K_____________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M______________________________^:4&%U=&]MR$\``/`<871I8V%L;'DN
M"@H@*B!))W9E(&%T=&5M<'1E9"!T;R!M:6YI;6EZ92!S="L`^%,@;&EN:R!P
M;VQL=71I;VXN("!)9B!Y;W4@9&]N)W0*("`@97AP;&EC:71L>2!I;G9O:V4@
M82!P87)T:6-U;&%R(&9E871U<F4@*'-U8V@@87,@<W5P<&]R="!F;W(@80H@
M("T`\`UC;VUP<F5S<VEO;B!O<B!F;W)M870I+"!I="!W<`#P`"!G970@<'5L
M;&5D(&EN+G\`)TEN00`W+"!IG@`(FP!:96YA8FR;```^``MQ`"AD91$``ZH`
M$2SP``*``")N928!`!8!`$``^`MA9V%I;G-T('1H92!C;W)R97-P;VYD:6YG
M($D`#5H`D6QI8G)A<FEE<\,`\0)4:&ES(&%L<V\@<F5D=6-E<T\`$'.%`2-O
M9H@!`+,!$"UV`&%E9"!B:6X]`#`@:6Z$`/`*96YV:7)O;FUE;G1S('=H97)E
M('1H870@;=@!(G)SZ0'_`4]N(')E860L(%)%041-10`!`$KA,#`P-C0T(``P
M,#`W-C4(`"(P,A``_P\P,#`Q-3$T-"`Q,C,U,S(U-S(U-B`P,3$V-S0`(#"6
M`$H#`@"S=7-T87(`,#!C=642``\"``-?<W1A9F8;``,!`@`!S``2,-T`,3`P
M(!0`#P(`D`(``@!;`_`*(&QI8F%R8VAI=F4@8G5N9&QE+@H*475E<^D#L',_
M("!)<W-U97,_9`+6*B!H='1P.B\O=W=W+C@`8BYO<F<@:;`"06AO;657`'!O
M;F=O:6YG-P`8(&0`<&1E=F5L;W"H`G$L(&EN8VQU*0-`9&]C=10`$&%W`%0L
M(&%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QK6``!J!\`E@4"DP("70`#X"L1-6!A`/U#`+@'!%4``3(``2%;
M$#N$(@"4``0/!0"*#`#2`11YHQ(0--(!(6YY*RH0+7<(`,4](6QE+P(!U!$`
M2#D!5@,!&U(#5@`@86PE#@`=`0'5'P/L%@$`&@4Q.P1S``0&.P2_``!]``.'
M!Q$TBBL`I2H%FW@#;X3Q!2P@2%`M55@L(%5N:7AW87)E+"!S:2D`TRH"+@$`
D?@$1<#T``I(!`'P$'P`!`/______;U````````````",W%#R
`
end

View file

@ -0,0 +1,141 @@
/*-
* Copyright (c) 2010 Michihiro NAKAJIMA
* Copyright (c) 2003-2008 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD$");
/*
Execute the following to rebuild the data for this program:
tail -n +33 test_compat_lzip.c | /bin/sh
# Use lzip command.
zcmd=lzip
zsuffix=lz
ztar_suffix=tlz
mktarfile()
{
mkdir $dir
echo "f1" > $dir/f1
echo "f2" > $dir/f2
echo "f3" > $dir/f3
mkdir $dir/d1
echo "f1" > $dir/d1/f1
echo "f2" > $dir/d1/f2
echo "f3" > $dir/d1/f3
(cd $dir; tar cf ../$name.tar f1 f2 f3 d1/f1 d1/f2 d1/f3)
rm -r $dir
}
#
# Make a lzip file from splitted tar file.
#
name=test_compat_lzip_1
dir="$name`date +%Y%m%d%H%M%S`.$USER"
mktarfile
split -b 3600 $name.tar $name.tar.
rm $name.tar
$zcmd $name.tar.*
cat $name.tar.*.$zsuffix > $name.$ztar_suffix
rm $name.tar.*.$zsuffix
uuencode $name.$ztar_suffix $name.$ztar_suffix > $name.$ztar_suffix.uu
rm -f $name.$ztar_suffix
#
# Make a lzip file with junk data at the end of the file.
#
name=test_compat_lzip_2
dir="$name`date +%Y%m%d%H%M%S`.$USER"
mktarfile
$zcmd $name.tar
mv $name.tar.$zsuffix $name.$ztar_suffix
echo "This is unrelated junk data at the end of the file" >> $name.$ztar_suffix
uuencode $name.$ztar_suffix $name.$ztar_suffix > $name.$ztar_suffix.uu
rm -f $name.$ztar_suffix
exit 0
*/
/*
* Verify our ability to read sample files compatibly with lzip.
*
* In particular:
* * lzip will read multiple lzip streams, concatenating the output
* * lzip will stop at the end of a stream if the following data
* doesn't start with a gzip signature.
*
*/
/*
* All of the sample files have the same contents; they're just
* compressed in different ways.
*/
static void
compat_lzip(const char *name)
{
const char *n[7] = { "f1", "f2", "f3", "d1/f1", "d1/f2", "d1/f3", NULL };
struct archive_entry *ae;
struct archive *a;
int i, r;
assert((a = archive_read_new()) != NULL);
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
r = archive_read_support_filter_lzip(a);
if (r == ARCHIVE_WARN) {
skipping("lzip reading not fully supported on this platform");
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
return;
}
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
extract_reference_file(name);
assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name, 2));
/* Read entries, match up names with list above. */
for (i = 0; i < 6; ++i) {
failure("Could not read file %d (%s) from %s", i, n[i], name);
assertEqualIntA(a, ARCHIVE_OK,
archive_read_next_header(a, &ae));
assertEqualString(n[i], archive_entry_pathname(ae));
}
/* Verify the end-of-archive. */
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
/* Verify that the format detection worked. */
assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_LZIP);
assertEqualString(archive_filter_name(a, 0), "lzip");
assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR);
assertEqualInt(ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}
DEFINE_TEST(test_compat_lzip)
{
/* This sample has been 'split', each piece compressed separately,
* then concatenated. lzip will emit the concatenated result. */
compat_lzip("test_compat_lzip_1.tlz");
/* This sample has been compressed as a single stream, but then
* some unrelated garbage text has been appended to the end. */
compat_lzip("test_compat_lzip_2.tlz");
}

View file

@ -0,0 +1,10 @@
begin 644 test_compat_lzip_1.tlz
M3%I)4`$,`#,,/!NGC#0&C6L"2_R2/O9*^":#5/GP,U"QL$1\Q:(3S>V*OTP*
M1&9J-1:S\^>DEIOT;'&#"`B6#7ZO7%">,>LZ=:BU,Z7*^>M<3FV:GKO_?W;`
M,N31CE_$<-$(3$J*AB5TTG2\;X[CSPOI6IIPV8\]86+J37::!/_LA^/@O"(1
MAA`.````````F`````````!,6DE0`0P``&_]_BC86HZ6L8?*M6SC8*JJ7,GS
M0IZA9CQ/^VS2N26K[BXKGC_1Z&JR]S2)5Q",)*$1RS"):7X:?OBQDJXU`>8K
M\2*:_6!:)ZD5FBGJ?II6>-<K71*E]Z%2+8"G-.(X-N74SK.)7_YTN3Z\/1D0
0\`T```````"&````````````
`
end

View file

@ -0,0 +1,9 @@
begin 644 test_compat_lzip_2.tlz
M3%I)4`%-`#,,/!NGC#0&C6L"2_R2/O9*^":#5/GP,U"QL$1\Q:(3S>V*OTP*
M1&9J-1:S\^>DEIOT;'&#"`B6#7ZO7%">,>LZ=:BU,Z7*^>M<3FV:GKO_?W;`
M,N31CE_$<-$(3$J*AB5TTG2\;X[CSPOI6IIPV8\]9>BP>V?/L._78%+F2N-;
M6V[`1"7)=_,5LD9U%73FQV-?_X5OKW0_.'N"`!P```````"R`````````%1H
M:7,@:7,@=6YR96QA=&5D(&IU;FL@9&%T82!A="!T:&4@96YD(&]F('1H92!F
$:6QE"@``
`
end

View file

@ -0,0 +1,155 @@
/*-
* Copyright (c) 2009 Michihiro NAKAJIMA
* Copyright (c) 2003-2008 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD: head/lib/libarchive/test/test_compat_lzma.c 201247 2009-12-30 05:59:21Z kientzle $");
/*
Execute the following to rebuild the data for this program:
tail -n +33 test_compat_lzma.c | /bin/sh
# Use lzma command of XZ Utils.
name=test_compat_lzma_1
zcmd=lzma
zsuffix=lzma
ztar_suffix=tlz
dir="$name`date +%Y%m%d%H%M%S`.$USER"
mktarfile()
{
mkdir $dir
echo "f1" > $dir/f1
echo "f2" > $dir/f2
echo "f3" > $dir/f3
mkdir $dir/d1
echo "f1" > $dir/d1/f1
echo "f2" > $dir/d1/f2
echo "f3" > $dir/d1/f3
(cd $dir; tar cf ../$name.tar f1 f2 f3 d1/f1 d1/f2 d1/f3)
rm -r $dir
}
mktarfile
$zcmd $name.tar
mv $name.tar.$zsuffix $name.$ztar_suffix
echo "This is unrelated junk data at the end of the file" >> $name.$ztar_suffix
uuencode $name.$ztar_suffix $name.$ztar_suffix > $name.$ztar_suffix.uu
rm -f $name.$ztar_suffix
#
# Use option -e
#
name=test_compat_lzma_2
dir="$name`date +%Y%m%d%H%M%S`.$USER"
mktarfile
$zcmd -e $name.tar
mv $name.tar.$zsuffix $name.$ztar_suffix
uuencode $name.$ztar_suffix $name.$ztar_suffix > $name.$ztar_suffix.uu
rm -f $name.$ztar_suffix
#
# Use lzma command of LZMA SDK with option -d12.
#
name=test_compat_lzma_3
zcmd=lzmasdk # Change this path to use lzma of LZMA SDK.
dir="$name`date +%Y%m%d%H%M%S`.$USER"
mktarfile
$zcmd e -d12 $name.tar $name.$ztar_suffix
rm -f $name.tar
uuencode $name.$ztar_suffix $name.$ztar_suffix > $name.$ztar_suffix.uu
rm -f $name.$ztar_suffix
exit 0
*/
/*
* Verify our ability to read sample files compatibly with unlzma.
*
* In particular:
* * unlzma will read multiple lzma streams, concatenating the output
* * unlzma will read lzma streams which is made by lzma with option -e,
* concatenating the output
*
* Verify our ability to read sample files compatibly with lzma of
* LZMA SDK.
* * lzma will read lzma streams which is made by lzma with option -d12,
* concatenating the output
*/
/*
* All of the sample files have the same contents; they're just
* compressed in different ways.
*/
static void
compat_lzma(const char *name)
{
const char *n[7] = { "f1", "f2", "f3", "d1/f1", "d1/f2", "d1/f3", NULL };
struct archive_entry *ae;
struct archive *a;
int i, r;
assert((a = archive_read_new()) != NULL);
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
r = archive_read_support_filter_lzma(a);
if (r == ARCHIVE_WARN) {
skipping("lzma reading not fully supported on this platform");
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
return;
}
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
extract_reference_file(name);
assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name, 2));
/* Read entries, match up names with list above. */
for (i = 0; i < 6; ++i) {
failure("Could not read file %d (%s) from %s", i, n[i], name);
assertEqualIntA(a, ARCHIVE_OK,
archive_read_next_header(a, &ae));
assertEqualString(n[i], archive_entry_pathname(ae));
}
/* Verify the end-of-archive. */
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
/* Verify that the format detection worked. */
assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_LZMA);
assertEqualString(archive_filter_name(a, 0), "lzma");
assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR);
assertEqualInt(ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}
DEFINE_TEST(test_compat_lzma)
{
/* This sample has been added junk datas to its tail. */
compat_lzma("test_compat_lzma_1.tlz");
/* This sample has been made by lzma with option -e,
* the first byte of which is 0x5e.
* Not supported in libarchive 2.7.* and earlier */
compat_lzma("test_compat_lzma_2.tlz");
/* This sample has been made by lzma of LZMA SDK with
* option -d12, second byte and third byte of which is
* not zero.
* Not supported in libarchive 2.7.* and earlier */
compat_lzma("test_compat_lzma_3.tlz");
}

View file

@ -0,0 +1,10 @@
$FreeBSD: head/lib/libarchive/test/test_compat_lzma_1.tlz.uu 201247 2009-12-30 05:59:21Z kientzle $
begin 644 test_compat_lzma_1.tlz
M70``@`#__________P`S##P;IXPT!HUK`DO\DC[V2OB%Z^'=ZT59ANYMTD(/
M^W;\8!%O7<+P&=#(9W<_!$Z.7/Y<&\(8+E0^,_-\Z"D^P'N0J^4-UH"WMJ<&
MV-P6=Y[-FY$IFNZ="RF24TO.B7EP[F]BGMJSP[]OZ_P9/#J'T=;7E&&A@J<[
MA^C'Q*/Y&I)2^T930'MJTK-98U0D9R*-X2^5__6H:+A4:&ES(&ES('5N<F5L
F871E9"!J=6YK(&1A=&$@870@=&AE(&5N9"!O9B!T:&4@9FEL90H`
`
end

View file

@ -0,0 +1,9 @@
$FreeBSD: head/lib/libarchive/test/test_compat_lzma_2.tlz.uu 201247 2009-12-30 05:59:21Z kientzle $
begin 644 test_compat_lzma_2.tlz
M7@``@`#__________P`S##P;IXPT!HUK`DO\DC[V2OB%Z^'<FN`(!=!,)@8W
M9R(6\QIOTA6SGM20X;2'6#3B&HC%2XOX2?D['5WD"`>`W2"/3R1F1:P:&Q9A
MGH2JJI9$C?8.=WTE:O<1WA@X>DK-Y#SW;I2!P;NYG^2"-(D9/E(D_0XK_H,\
95*/V"T#E9ZO][@'R,6E&^A([.##_\M#YU@``
`
end

View file

@ -0,0 +1,9 @@
$FreeBSD: head/lib/libarchive/test/test_compat_lzma_3.tlz.uu 201247 2009-12-30 05:59:21Z kientzle $
begin 644 test_compat_lzma_3.tlz
M70`0````'``````````S##P;IXPT!HUK`DO\DC[V2OB%Z^'=ZT59ANYMTD(1
M$Y^=;\4%U_CXKQ*F$OFZKEQUG)1U8="](V<2K"U1\Z6%H(UNQ[Y3.=D'>_G-
MCO71X+M*7WH7$D1&E9Y$XHW,(`[X";GGTO+,'&1?F%<@`.$-OV;8P1?*M$A"
:MA+1XONREMK,1('455L=X1>WC#1YW"('I@``
`
end

View file

@ -0,0 +1,131 @@
/*-
* Copyright (c) 2003-2008 Tim Kientzle
* Copyright (c) 2012 Michihiro NAKAJIMA
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD$");
/*
* Verify our ability to read sample files compatibly with lzop.
*
* In particular:
* * lzop will stop at the end of a stream if the following data
* doesn't start with a lzop signature.
*
*/
DEFINE_TEST(test_compat_lzop)
{
const char *sample1 = "test_compat_lzop_1.tar.lzo";
const char *sample2 = "test_compat_lzop_2.tar.lzo";
const char *sample3 = "test_compat_lzop_3.tar.lzo";
struct archive_entry *ae;
struct archive *a;
int r;
/*
* Test1: tar ball compressed in one block.
*/
assert((a = archive_read_new()) != NULL);
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
r = archive_read_support_filter_lzop(a);
if (r == ARCHIVE_WARN) {
skipping("lzop reading not fully supported on this platform");
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
return;
}
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
extract_reference_file(sample1);
assertEqualIntA(a, ARCHIVE_OK,
archive_read_open_filename(a, sample1, 2));
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("INSTALL", archive_entry_pathname(ae));
/* Verify the end-of-archive. */
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
/* Verify that the format detection worked. */
assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_LZOP);
assertEqualString(archive_filter_name(a, 0), "lzop");
assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR);
assertEqualInt(ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
/*
* Test2: tar ball compressed in multi blocks.
*/
assert((a = archive_read_new()) != NULL);
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
extract_reference_file(sample2);
assertEqualIntA(a, ARCHIVE_OK,
archive_read_open_filename(a, sample2, 2));
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("file1", archive_entry_pathname(ae));
assertEqualInt(19, archive_entry_size(ae));
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("file2", archive_entry_pathname(ae));
assertEqualInt(262144, archive_entry_size(ae));
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("file3", archive_entry_pathname(ae));
assertEqualInt(19, archive_entry_size(ae));
/* Verify the end-of-archive. */
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
/* Verify that the format detection worked. */
assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_LZOP);
assertEqualString(archive_filter_name(a, 0), "lzop");
assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR);
assertEqualInt(ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
/*
* Test3: tar ball compressed in one block with junk data.
*/
assert((a = archive_read_new()) != NULL);
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
extract_reference_file(sample3);
assertEqualIntA(a, ARCHIVE_OK,
archive_read_open_filename(a, sample3, 2));
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("INSTALL", archive_entry_pathname(ae));
/* Verify the end-of-archive. */
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
/* Verify that the format detection worked. */
assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_LZOP);
assertEqualString(archive_filter_name(a, 0), "lzop");
assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR);
assertEqualInt(ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}

View file

@ -0,0 +1,30 @@
begin 664 test_compat_lzop_1.tar.lzo
MB4Q:3P`-"AH*$#`@8`E``04#```!``"!M%"`FEX`````%G1E<W1?8V]M<&%T
M7VQZ;W!?,2YT87+U<0SS```,````!&]C)A,T!4E.4U1!3$P`(#L```LP,#`V
M-C0@`#`P,3<U,"H=`#!@```(,C8U-2`Q,3<Q,S4U,#,W,B`P,3$U,3<`(#`@
M.U`"[`L(=7-T87(`,#!C=67H`C,<`#Y\`&49,)`;90$@,PP!(')0```]36]R
M92!C;VUP;&5T92!B=6EL9"!D;V-U;65N=&%T:6]N(&ES(&%V86EL86)L92!O
M;B!T:&4@;&EB87)C:&EV90I7:6MI.B`@:'1T<#HO+RA@```]+F=O;V=L96-O
M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O;VPND!`!9&5F8780;VXP.Q$@:7-L
M*<0K`V4@36%K98P.=!)U(@IW(F%L<V:'92"\'W]_96%D[#@N[`PJJ`0Y?`1\
MC'`@)X`1)UX14V6H5"AH!0(@5VEK:7B'C!YT!@(@<VET98-.9G5R;(HL)A8N
I"B!R_!@@````CD@"``(``````````````````````````!$`````````
`
end

View file

@ -0,0 +1,39 @@
begin 664 test_compat_lzop_2.tar.lzo
MB4Q:3P`-"AH*$#`@8`E``04#```!``"!M%"`F9,`````%G1E<W1?8V]M<&%T
M7VQZ;W!?,BYT87+[)0TH``0`````!3,8`"T1`V9I;&4Q`"`]```+,#`P-C8T
M(``P,#$W-3`J'0`PH```!C(S(#$R,#0P,3$T-#<W(#`Q,3,W,``@,"`]6`*T
M"PAU<W1A<@`P,&-U9:`"-10`/GP`I!EP&V4!(#44`2!P6``)8V]N=&5N=',@
M;V8@CD$N"B!PC`(@`#Q``FT^,B`^@`4Z_0\Q=F4P,"?_#S4R-9Y_-3<@`$;\
M#R`^Z`<@````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````*7@!#P```````````````````````"``````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M``"+`````@``````````````````````````(```````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````````````````````````````````````````````(L````"
M```````````````````````````@````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````BP````(`````````
M`````````````````"``````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M``````````````````````````````````"+`````@``````````````````
M````````(```````````````````````````````````````````````````
M```````````````````````````````````+`````0``````````````````
M```````1``````X`````H]OB&=8"```````@``````#?$``"9FEL93,@/OP7
M"S`P,#8V-"``,#`Q-S4P*AT`,*````8R,R`Q,C`T,#$Q-#4V,R`P,3$S-C8`
M(#`@/EP"F`L(=7-T87(`,#!C=66<`380`#Y\`*09<!ME`2`V&`$@;UP`"6-O
M;G1E;G1S(&]F((Y!+@H@;X@"(```````,#P"#@``````````````````````
'$0``````````
`
end

View file

@ -0,0 +1,32 @@
begin 664 test_compat_lzop_3.tar.lzo
MB4Q:3P`-"AH*$#`@8`E``04#```!``"!M%"`FEX`````%G1E<W1?8V]M<&%T
M7VQZ;W!?,2YT87+U<0SS```,````!&]C)A,T!4E.4U1!3$P`(#L```LP,#`V
M-C0@`#`P,3<U,"H=`#!@```(,C8U-2`Q,3<Q,S4U,#,W,B`P,3$U,3<`(#`@
M.U`"[`L(=7-T87(`,#!C=67H`C,<`#Y\`&49,)`;90$@,PP!(')0```]36]R
M92!C;VUP;&5T92!B=6EL9"!D;V-U;65N=&%T:6]N(&ES(&%V86EL86)L92!O
M;B!T:&4@;&EB87)C:&EV90I7:6MI.B`@:'1T<#HO+RA@```]+F=O;V=L96-O
M9&4N8V]M+PH*3VX@;6]S="!5;FEX+6QI:V4@<WES=&5M<RP@>6]U('-H;W5L
M9"!B92!A8FQE('1O(&EN<W1A;&P@;&EB8;0-``HL"F)S9'1A<BP@86YD(&)S
M9&-P:6\@=7-I;F<@?!(#9F]L;&]W=`$`"V-O;6UO;B!S=&5P<SH*("`@("XO
M8V]N9FEG=7)EGP%M86LH(0`@S`T!"@I)9I01#FYE960@=&\@8W5S=&]M:7IE
MG`L`&'1A<F=E="!D:7)E8W1O<FEE<R!O<B!O=&AE<G=I<V4@861J=7-T"G1H
M9<@I"'-E='1I;F<L('5SL`TI%`(,("TM:&5L<`IT;R!L:7-T@`PGBP(@;W!V
M+W,N)T0""&%R92!D979E;&]P8!PHI`6,(?P5`G5P9&%TD14**"P!`W-C<FEP
M=)P$C!70$P%F:6QET",$+V)I;B]S:*`#``$O875T;V=E;BYS:`H*5&\@8W)E
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&&,6,&
MZ<&1,$*.M.BTJM6K6+/V#.CB2YL\9-(,U4JV+$&,$SFBW2@UXL>V(VG$F%'R
M9(V4*UN^;/EQ94V:9@,+)O@SZ-"(18]J5<HT*U2X$:D.GDRY\M4"%@X`$#"P
M29@Q()Y,`8$%A.G3IC<33$!0!L%L!#D#"+#`<A`J5*0,%/!G(&V"_`@^P$D`
M.,$"`RN,>=/&Q1LXR\F4D3/'19@O9L0")1@@`$$#`RTL;_X\^O3J8K[,*;/<
M#9F'RID[A_Y&.G478[Z4:0.'3A[NF@U4'``4C#>?>?>1\04;86P'0';4T;%>
M>V0PZ*!E&&:HX88<!O156'((Q.&(!:%%45L:J>412!U!A5%=**G$DDLPQ2##
M###04---)/:84&%"$64468PUA=5C+;[HXY),6L655WEDQT8936:(D0TTL+B6
MBFYIZ:)<=)D48UXT\C73#']5R220A\&0&)%!-7;D5$E&IN:=>"Z$F6:R>0::
M:*2AAIIJ`[$VD&L#P;:;;[55=EMNN_G!J'$##??0@``$-Q!R`,1''GWV57<=
MA!=V]UUX!I97WWDNI#?A&^[!ERJHK.:W7W__^18@``,6*)^JH;J@H(5T#$2J
MA.S!6F&#Q>;I[+/0[N1AE&E,&:U@5V:)(EM)OE7G8V+>):->-=Y8@PUI7HLA
MFT(JEE61CM&)I+KTUFOOO?CFJ^^^_/;K[[\`!RSPP`07;/#!"">L\,(,-^SP
MPQ!'+/'$%%=L\<489ZSQQAQW[/''((<L\L@DEVSRR2BGK/+*++?L\LLPQRSS
*S#37;//-..>,$```
`
end

View file

@ -0,0 +1,214 @@
/*-
* Copyright (c) 2003-2010 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD$");
/* The sample has some files in a directory with a very long name. */
#define TESTPATH "abcdefghijklmnopqrstuvwxyz/" \
"abcdefghijklmnopqrstuvwxyz/" \
"abcdefghijklmnopqrstuvwxyz/" \
"abcdefghijklmnopqrstuvwxyz/" \
"abcdefghijklmnopqrstuvwxyz/" \
"abcdefghijklmnopqrstuvwxyz/" \
"abcdefghijklmnopqrstuvwxyz/"
static void test_compat_mac_1(void);
static void test_compat_mac_2(void);
/*
* Apple shipped an extended version of GNU tar with Mac OS X 10.5
* and earlier.
*/
static void
test_compat_mac_1(void)
{
char name[] = "test_compat_mac-1.tar.Z";
struct archive_entry *ae;
struct archive *a;
const void *attr;
size_t attrSize;
assert((a = archive_read_new()) != NULL);
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_set_options(a, "mac-ext"));
extract_reference_file(name);
assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name, 10240));
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString(TESTPATH, archive_entry_pathname(ae));
assertEqualInt(1275688109, archive_entry_mtime(ae));
assertEqualInt(95594, archive_entry_uid(ae));
assertEqualString("kientzle", archive_entry_uname(ae));
assertEqualInt(5000, archive_entry_gid(ae));
assertEqualString("", archive_entry_gname(ae));
assertEqualInt(040755, archive_entry_mode(ae));
attr = archive_entry_mac_metadata(ae, &attrSize);
assert(attr == NULL);
assertEqualInt(0, attrSize);
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString(TESTPATH "dir/", archive_entry_pathname(ae));
assertEqualInt(1275687611, archive_entry_mtime(ae));
assertEqualInt(95594, archive_entry_uid(ae));
assertEqualString("kientzle", archive_entry_uname(ae));
assertEqualInt(5000, archive_entry_gid(ae));
assertEqualString("", archive_entry_gname(ae));
assertEqualInt(040755, archive_entry_mode(ae));
attr = archive_entry_mac_metadata(ae, &attrSize);
assert(attr != NULL);
assertEqualInt(225, attrSize);
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString(TESTPATH "file", archive_entry_pathname(ae));
assertEqualInt(1275687588, archive_entry_mtime(ae));
assertEqualInt(95594, archive_entry_uid(ae));
assertEqualString("kientzle", archive_entry_uname(ae));
assertEqualInt(5000, archive_entry_gid(ae));
assertEqualString("", archive_entry_gname(ae));
assertEqualInt(0100644, archive_entry_mode(ae));
attr = archive_entry_mac_metadata(ae, &attrSize);
assert(attr != NULL);
assertEqualInt(225, attrSize);
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("dir/", archive_entry_pathname(ae));
assertEqualInt(1275688064, archive_entry_mtime(ae));
assertEqualInt(95594, archive_entry_uid(ae));
assertEqualString("kientzle", archive_entry_uname(ae));
assertEqualInt(5000, archive_entry_gid(ae));
assertEqualString("", archive_entry_gname(ae));
assertEqualInt(040755, archive_entry_mode(ae));
attr = archive_entry_mac_metadata(ae, &attrSize);
assert(attr != NULL);
assertEqualInt(225, attrSize);
assertEqualMem("\x00\x05\x16\x07\x00\x02\x00\x00Mac OS X", attr, 16);
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("file", archive_entry_pathname(ae));
assertEqualInt(1275625860, archive_entry_mtime(ae));
assertEqualInt(95594, archive_entry_uid(ae));
assertEqualString("kientzle", archive_entry_uname(ae));
assertEqualInt(5000, archive_entry_gid(ae));
assertEqualString("", archive_entry_gname(ae));
assertEqualInt(0100644, archive_entry_mode(ae));
attr = archive_entry_mac_metadata(ae, &attrSize);
assert(attr != NULL);
assertEqualInt(225, attrSize);
assertEqualMem("\x00\x05\x16\x07\x00\x02\x00\x00Mac OS X", attr, 16);
/* Verify the end-of-archive. */
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
/* Verify that the format detection worked. */
assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_COMPRESS);
assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_GNUTAR);
assertEqualInt(ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}
/*
* Apple shipped a customized version of bsdtar starting with MacOS 10.6.
*/
static void
test_compat_mac_2(void)
{
char name[] = "test_compat_mac-2.tar.Z";
struct archive_entry *ae;
struct archive *a;
const void *attr;
size_t attrSize;
assert((a = archive_read_new()) != NULL);
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_set_options(a, "mac-ext"));
extract_reference_file(name);
assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name, 10240));
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("./", archive_entry_pathname(ae));
assertEqualInt(1303628303, archive_entry_mtime(ae));
assertEqualInt(501, archive_entry_uid(ae));
assertEqualString("tim", archive_entry_uname(ae));
assertEqualInt(20, archive_entry_gid(ae));
assertEqualString("staff", archive_entry_gname(ae));
assertEqualInt(040755, archive_entry_mode(ae));
attr = archive_entry_mac_metadata(ae, &attrSize);
assert(attr == NULL);
assertEqualInt(0, attrSize);
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("./mydir/", archive_entry_pathname(ae));
assertEqualInt(1303628303, archive_entry_mtime(ae));
assertEqualInt(501, archive_entry_uid(ae));
assertEqualString("tim", archive_entry_uname(ae));
assertEqualInt(20, archive_entry_gid(ae));
assertEqualString("staff", archive_entry_gname(ae));
assertEqualInt(040755, archive_entry_mode(ae));
attr = archive_entry_mac_metadata(ae, &attrSize);
assert(attr != NULL);
assertEqualInt(267, attrSize);
assertEqualMem("\x00\x05\x16\x07\x00\x02\x00\x00Mac OS X", attr, 16);
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("./myfile", archive_entry_pathname(ae));
assertEqualInt(1303628303, archive_entry_mtime(ae));
assertEqualInt(501, archive_entry_uid(ae));
assertEqualString("tim", archive_entry_uname(ae));
assertEqualInt(20, archive_entry_gid(ae));
assertEqualString("staff", archive_entry_gname(ae));
assertEqualInt(0100644, archive_entry_mode(ae));
attr = archive_entry_mac_metadata(ae, &attrSize);
assert(attr != NULL);
assertEqualInt(267, attrSize);
assertEqualMem("\x00\x05\x16\x07\x00\x02\x00\x00Mac OS X", attr, 16);
/* Verify the end-of-archive. */
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
/* Verify that the format detection worked. */
assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_COMPRESS);
assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR);
assertEqualInt(ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}
DEFINE_TEST(test_compat_mac)
{
test_compat_mac_1();
test_compat_mac_2();
}

View file

@ -0,0 +1,66 @@
/*-
* Copyright (c) 2016 Martin Matuska
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD");
/*
* Verify our ability to read sample files created by Perl module Archive::Tar
*/
DEFINE_TEST(test_compat_perl_archive_tar)
{
char name[] = "test_compat_perl_archive_tar.tar";
struct archive_entry *ae;
struct archive *a;
int r;
assert((a = archive_read_new()) != NULL);
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
extract_reference_file(name);
assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name,
10240));
/* Read first entry. */
assertEqualIntA(a, ARCHIVE_OK, r = archive_read_next_header(a, &ae));
if (r != ARCHIVE_OK) {
archive_read_free(a);
return;
}
assertEqualString("file1", archive_entry_pathname(ae));
assertEqualInt(1480603099, archive_entry_mtime(ae));
assertEqualInt(1000, archive_entry_uid(ae));
assertEqualString("john", archive_entry_uname(ae));
assertEqualInt(1000, archive_entry_gid(ae));
assertEqualString("john", archive_entry_gname(ae));
assertEqualInt(0100644, archive_entry_mode(ae));
/* Verify that the format detection worked. */
assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_NONE);
assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR);
assertEqualInt(ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}

View file

@ -0,0 +1,49 @@
begin 644 test_compat_perl_archive_tar.tar
M9FEL93$`````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````#`P,#8T-```,#`Q-S4P```P,#$W-3```"`@("`@("`@("`U
M`#$S,#(P,#,R-S,S`"`Q,3$R,P`@,```````````````````````````````
M````````````````````````````````````````````````````````````
M``````````````````````````````````````````!U<W1A<@`P,&IO:&X`
M````````````````````````````````````:F]H;@``````````````````
M```````````````````P,#`P,#```#`P,#`P,```````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M``````````````````````!A8F-D"@``````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
7````````````````````````````````
`
end

View file

@ -0,0 +1,69 @@
/*-
* Copyright (c) 2016 Martin Matuska
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD");
/*
* Verify our ability to read sample files created by plexus-archiver version
* 2.6.2 and lower (project switched to Apache Commons Compress with 2.6.3).
*
* These files may have tar entries with uid and gid header fields filled with
* spaces without any octal digit.
*/
DEFINE_TEST(test_compat_plexus_archiver_tar)
{
char name[] = "test_compat_plexus_archiver_tar.tar";
struct archive_entry *ae;
struct archive *a;
int r;
assert((a = archive_read_new()) != NULL);
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
extract_reference_file(name);
assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name,
10240));
/* Read first entry. */
assertEqualIntA(a, ARCHIVE_OK, r = archive_read_next_header(a, &ae));
if (r != ARCHIVE_OK) {
archive_read_free(a);
return;
}
assertEqualString("commons-logging-1.2/NOTICE.txt",
archive_entry_pathname(ae));
assertEqualInt(1404583896, archive_entry_mtime(ae));
assertEqualInt(0100664, archive_entry_mode(ae));
assertEqualInt(0, archive_entry_uid(ae));
assertEqualInt(0, archive_entry_gid(ae));
/* Verify that the format detection worked. */
assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_NONE);
assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR);
assertEqualInt(ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}

View file

@ -0,0 +1,49 @@
begin 644 test_compat_plexus_archiver_tar.tar
M8V]M;6]N<RUL;V=G:6YG+3$N,B].3U1)0T4N='AT````````````````````
M````````````````````````````````````````````````````````````
M`````````````#$P,#8V-"``("`@("`@(``@("`@("`@`"`@("`@("`@,C8Q
M(#$R,S4V,#,W-S,P("`Q-#$U-P`@,```````````````````````````````
M````````````````````````````````````````````````````````````
M``````````````````````````````````````````!U<W1A<@```'1N````
M````````````````````````````````````=&X`````````````````````
M```````````````````@("`@(#`@`"`@("`@,"``````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M``````````````````````!!<&%C:&4@0V]M;6]N<R!,;V=G:6YG"D-O<'ER
M:6=H="`R,#`S+3(P,30@5&AE($%P86-H92!3;V9T=V%R92!&;W5N9&%T:6]N
M"@I4:&ES('!R;V1U8W0@:6YC;'5D97,@<V]F='=A<F4@9&5V96QO<&5D(&%T
M"E1H92!!<&%C:&4@4V]F='=A<F4@1F]U;F1A=&EO;B`H:'1T<#HO+W=W=RYA
M<&%C:&4N;W)G+RDN"@H`````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
7``````````````````````````````H`
`
end

View file

@ -0,0 +1,188 @@
/*-
* Copyright (c) 2011 Michihiro NAKAJIMA
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD$");
/*
* Verify our ability to read sample files created by Solaris pax for
* a sparse file.
*/
static void
test_compat_solaris_pax_sparse_1(void)
{
char name[] = "test_compat_solaris_pax_sparse_1.pax.Z";
struct archive_entry *ae;
struct archive *a;
int64_t offset, length;
const void *buff;
size_t bytes_read;
char data[1024*8];
int r;
assert((a = archive_read_new()) != NULL);
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
extract_reference_file(name);
assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name, 10240));
/* Read first entry. */
assertEqualIntA(a, ARCHIVE_OK, r = archive_read_next_header(a, &ae));
if (r != ARCHIVE_OK) {
archive_read_free(a);
return;
}
assertEqualString("hole", archive_entry_pathname(ae));
assertEqualInt(1310411683, archive_entry_mtime(ae));
assertEqualInt(101, archive_entry_uid(ae));
assertEqualString("cue", archive_entry_uname(ae));
assertEqualInt(10, archive_entry_gid(ae));
assertEqualString("staff", archive_entry_gname(ae));
assertEqualInt(0100644, archive_entry_mode(ae));
/* Verify the sparse information. */
failure("This sparse file should have tree data blocks");
assertEqualInt(3, archive_entry_sparse_reset(ae));
assertEqualInt(ARCHIVE_OK,
archive_entry_sparse_next(ae, &offset, &length));
assertEqualInt(0, offset);
assertEqualInt(131072, length);
assertEqualInt(ARCHIVE_OK,
archive_entry_sparse_next(ae, &offset, &length));
assertEqualInt(393216, offset);
assertEqualInt(131072, length);
assertEqualInt(ARCHIVE_OK,
archive_entry_sparse_next(ae, &offset, &length));
assertEqualInt(786432, offset);
assertEqualInt(32775, length);
while (ARCHIVE_OK ==
archive_read_data_block(a, &buff, &bytes_read, &offset)) {
failure("The data blocks should not include the hole");
assert((offset >= 0 && offset + bytes_read <= 131072) ||
(offset >= 393216 && offset + bytes_read <= 393216+131072) ||
(offset >= 786432 && offset + bytes_read <= 786432+32775));
if (offset == 0 && bytes_read >= 1024*8) {
memset(data, 'a', sizeof(data));
failure("First data block should be 8K bytes of 'a'");
assertEqualMem(buff, data, sizeof(data));
} else if (offset + bytes_read == 819207 && bytes_read >= 7) {
const char *last = buff;
last += bytes_read - 7;
memset(data, 'c', 7);
failure("Last seven bytes should be all 'c'");
assertEqualMem(last, data, 7);
}
}
/* Verify the end-of-archive. */
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
/* Verify that the format detection worked. */
assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_COMPRESS);
assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE);
assertEqualInt(ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}
/*
* Verify our ability to read sample files created by Solaris pax for
* a sparse file which begin with hole.
*/
static void
test_compat_solaris_pax_sparse_2(void)
{
char name[] = "test_compat_solaris_pax_sparse_2.pax.Z";
struct archive_entry *ae;
struct archive *a;
int64_t offset, length;
const void *buff;
size_t bytes_read;
int r;
assert((a = archive_read_new()) != NULL);
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
extract_reference_file(name);
assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name, 10240));
/* Read first entry. */
assertEqualIntA(a, ARCHIVE_OK, r = archive_read_next_header(a, &ae));
if (r != ARCHIVE_OK) {
archive_read_free(a);
return;
}
assertEqualString("hole", archive_entry_pathname(ae));
assertEqualInt(1310416789, archive_entry_mtime(ae));
assertEqualInt(101, archive_entry_uid(ae));
assertEqualString("cue", archive_entry_uname(ae));
assertEqualInt(10, archive_entry_gid(ae));
assertEqualString("staff", archive_entry_gname(ae));
assertEqualInt(0100644, archive_entry_mode(ae));
/* Verify the sparse information. */
failure("This sparse file should have two data blocks");
assertEqualInt(2, archive_entry_sparse_reset(ae));
assertEqualInt(ARCHIVE_OK,
archive_entry_sparse_next(ae, &offset, &length));
assertEqualInt(393216, offset);
assertEqualInt(131072, length);
assertEqualInt(ARCHIVE_OK,
archive_entry_sparse_next(ae, &offset, &length));
assertEqualInt(786432, offset);
assertEqualInt(32799, length);
while (ARCHIVE_OK ==
archive_read_data_block(a, &buff, &bytes_read, &offset)) {
failure("The data blocks should not include the hole");
assert((offset >= 393216 && offset + bytes_read <= 393216+131072) ||
(offset >= 786432 && offset + bytes_read <= 786432+32799));
if (offset + bytes_read == 819231 && bytes_read >= 31) {
char data[32];
const char *last = buff;
last += bytes_read - 31;
memset(data, 'c', 31);
failure("Last 31 bytes should be all 'c'");
assertEqualMem(last, data, 31);
}
}
/* Verify the end-of-archive. */
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
/* Verify that the format detection worked. */
assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_COMPRESS);
assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE);
assertEqualInt(ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}
DEFINE_TEST(test_compat_solaris_pax_sparse)
{
test_compat_solaris_pax_sparse_1();
test_compat_solaris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_[RF,^\YC?/^<Y[
F_O.@#[WH1T_ZTIO^]*A/O>I7S_K6NY[I8XB][&=/^]K;7O:O1Q4`
`
end

View file

@ -0,0 +1,267 @@
/*-
* Copyright (c) 2003-2009 Tim Kientzle
* Copyright (c) 2016 Martin Matuska
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD$");
/*
* Verify reading entries with POSIX.1e and NFSv4 ACLs from archives created
* with Solaris tar.
*
* This should work on all systems, regardless of whether local filesystems
* support ACLs or not.
*/
static struct archive_test_acl_t acls0[] = {
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_WRITE |
ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_USER_OBJ, -1, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_EXECUTE,
ARCHIVE_ENTRY_ACL_USER, 71, "lp" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_USER, 666, "666" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_EXECUTE |
ARCHIVE_ENTRY_ACL_WRITE | ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_USER, 1000, "1000" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_GROUP_OBJ, -1, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_MASK, -1, ""},
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_OTHER, -1, "" },
};
static struct archive_test_acl_t acls1[] = {
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_EXECUTE |
ARCHIVE_ENTRY_ACL_WRITE | ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_USER_OBJ, -1, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_EXECUTE |
ARCHIVE_ENTRY_ACL_WRITE | ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_USER, 2, "bin" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_EXECUTE |
ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_GROUP_OBJ, -1, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_EXECUTE |
ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_GROUP, 3, "sys" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_EXECUTE |
ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_MASK, -1, ""},
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0,
ARCHIVE_ENTRY_ACL_OTHER, -1, "" },
};
static struct archive_test_acl_t acls2[] = {
{ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, ARCHIVE_ENTRY_ACL_EXECUTE |
ARCHIVE_ENTRY_ACL_WRITE | ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_USER_OBJ, -1 ,"" },
{ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, ARCHIVE_ENTRY_ACL_EXECUTE |
ARCHIVE_ENTRY_ACL_WRITE | ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_USER, 2, "bin" },
{ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, ARCHIVE_ENTRY_ACL_EXECUTE |
ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_GROUP_OBJ, -1, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, ARCHIVE_ENTRY_ACL_EXECUTE |
ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_GROUP, 3, "sys" },
{ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, ARCHIVE_ENTRY_ACL_EXECUTE |
ARCHIVE_ENTRY_ACL_WRITE | ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_MASK, -1, ""},
{ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, 0,
ARCHIVE_ENTRY_ACL_OTHER, -1, "" },
};
static struct archive_test_acl_t acls3[] = {
{ ARCHIVE_ENTRY_ACL_TYPE_DENY,
ARCHIVE_ENTRY_ACL_EXECUTE |
ARCHIVE_ENTRY_ACL_READ_DATA |
ARCHIVE_ENTRY_ACL_WRITE_DATA |
ARCHIVE_ENTRY_ACL_APPEND_DATA |
ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_READ_ACL |
ARCHIVE_ENTRY_ACL_WRITE_ACL |
ARCHIVE_ENTRY_ACL_WRITE_OWNER |
ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
ARCHIVE_ENTRY_ACL_GROUP, 12, "daemon" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
ARCHIVE_ENTRY_ACL_EXECUTE |
ARCHIVE_ENTRY_ACL_READ_DATA |
ARCHIVE_ENTRY_ACL_WRITE_DATA |
ARCHIVE_ENTRY_ACL_APPEND_DATA |
ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
ARCHIVE_ENTRY_ACL_GROUP, 2, "bin" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
ARCHIVE_ENTRY_ACL_READ_DATA |
ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_READ_ACL |
ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
ARCHIVE_ENTRY_ACL_USER, 4, "adm" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
ARCHIVE_ENTRY_ACL_READ_DATA |
ARCHIVE_ENTRY_ACL_WRITE_DATA |
ARCHIVE_ENTRY_ACL_APPEND_DATA |
ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_READ_ACL |
ARCHIVE_ENTRY_ACL_WRITE_ACL |
ARCHIVE_ENTRY_ACL_WRITE_OWNER |
ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
ARCHIVE_ENTRY_ACL_USER_OBJ, 0, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
ARCHIVE_ENTRY_ACL_READ_DATA |
ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_READ_ACL |
ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
ARCHIVE_ENTRY_ACL_GROUP_OBJ, 0, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_READ_ACL |
ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
ARCHIVE_ENTRY_ACL_EVERYONE, 0, "" },
};
static struct archive_test_acl_t acls4[] = {
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
ARCHIVE_ENTRY_ACL_EXECUTE |
ARCHIVE_ENTRY_ACL_READ_DATA |
ARCHIVE_ENTRY_ACL_WRITE_DATA |
ARCHIVE_ENTRY_ACL_APPEND_DATA |
ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_READ_ACL |
ARCHIVE_ENTRY_ACL_WRITE_ACL |
ARCHIVE_ENTRY_ACL_WRITE_OWNER |
ARCHIVE_ENTRY_ACL_SYNCHRONIZE |
ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT |
ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT |
ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY,
ARCHIVE_ENTRY_ACL_USER, 1100, "1100" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
ARCHIVE_ENTRY_ACL_READ_DATA |
ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_READ_ACL |
ARCHIVE_ENTRY_ACL_SYNCHRONIZE |
ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT |
ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT,
ARCHIVE_ENTRY_ACL_GROUP, 4, "adm" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
ARCHIVE_ENTRY_ACL_EXECUTE |
ARCHIVE_ENTRY_ACL_READ_DATA |
ARCHIVE_ENTRY_ACL_WRITE_DATA |
ARCHIVE_ENTRY_ACL_APPEND_DATA |
ARCHIVE_ENTRY_ACL_DELETE_CHILD |
ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_READ_ACL |
ARCHIVE_ENTRY_ACL_WRITE_ACL |
ARCHIVE_ENTRY_ACL_WRITE_OWNER |
ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
ARCHIVE_ENTRY_ACL_USER_OBJ, 0, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
ARCHIVE_ENTRY_ACL_EXECUTE |
ARCHIVE_ENTRY_ACL_READ_DATA |
ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_READ_ACL |
ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
ARCHIVE_ENTRY_ACL_GROUP_OBJ, 0, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_READ_ACL |
ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
ARCHIVE_ENTRY_ACL_EVERYONE, 0, "" },
};
DEFINE_TEST(test_compat_solaris_tar_acl)
{
char name[] = "test_compat_solaris_tar_acl.tar";
struct archive *a;
struct archive_entry *ae;
/* Read archive file */
assert(NULL != (a = archive_read_new()));
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
extract_reference_file(name);
assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name,
10240));
/* First item has access ACLs */
assertA(0 == archive_read_next_header(a, &ae));
failure("One extended ACL should flag all ACLs to be returned.");
assertEqualInt(7, archive_entry_acl_reset(ae,
ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
assertEntryCompareAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]),
ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0644);
failure("Basic ACLs should set mode to 0644, not %04o",
archive_entry_mode(ae)&0777);
assert((archive_entry_mode(ae) & 0777) == 0644);
/* Second item has default and access ACLs */
assertA(0 == archive_read_next_header(a, &ae));
assertEqualInt(6, archive_entry_acl_reset(ae,
ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
assertEntryCompareAcls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]),
ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0750);
failure("Basic ACLs should set mode to 0750, not %04o",
archive_entry_mode(ae)&0777);
assert((archive_entry_mode(ae) & 0777) == 0750);
assertEqualInt(6, archive_entry_acl_reset(ae,
ARCHIVE_ENTRY_ACL_TYPE_DEFAULT));
assertEntryCompareAcls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]),
ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, 0750);
/* Third item has NFS4 ACLs */
assertA(0 == archive_read_next_header(a, &ae));
assertEqualInt(6, archive_entry_acl_reset(ae,
ARCHIVE_ENTRY_ACL_TYPE_NFS4));
assertEntryCompareAcls(ae, acls3, sizeof(acls3)/sizeof(acls3[0]),
ARCHIVE_ENTRY_ACL_TYPE_NFS4, 0);
/* Fourth item has NFS4 ACLs and inheritance flags */
assertA(0 == archive_read_next_header(a, &ae));
assertEqualInt(5, archive_entry_acl_reset(ae,
ARCHIVE_ENTRY_ACL_TYPE_NFS4));
assertEntryCompareAcls(ae, acls4, sizeof(acls4)/sizeof(acls0[4]),
ARCHIVE_ENTRY_ACL_TYPE_NFS4, 0);
/* Close the archive. */
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}

View file

@ -0,0 +1,163 @@
begin 644 test_compat_solaris_tar_acl.tar
M9FEL92UW:71H+7!O<VEX+6%C;',
M
M # P,# V-#0 ,# P,3<U, P,# P,# P # P,# P,# P,30S
M #$Q,3<T-C T,34W # P,30Q,C$ 00
M
M !U<W1A<@ P,
M <F]O=
M P,# P-#$T # P,# P,#,
M
M
M
M Q,# P,# W '5S97(Z.G)W+2QU<V5R.FQP.BTM
M>#HW,2QU<V5R.C8V-CIR+2TZ-C8V+'5S97(Z,3 P,#IR=W@Z,3 P,"QG<F]U
M<#HZ<BTM+&UA<VLZ<BTM+&]T:&5R.G(M+0 # !
M
M
M
M
M
M
M (Q@@( &L ,3 P,# P-P!U
M<V5R.CIR=RTL=7-E<CIL<#HM+7@Z-S$L=7-E<CHV-C8Z<BTM.C8V-BQU<V5R
M.C$P,# Z<G=X.C$P,# L9W)O=7 Z.G(M+2QM87-K.G(M+69I;&4M=VET:"UP
M;W-I>"UA8VQS
M P
M,# P-C0T # P,#$W-3 ,# P,# P, P,# P,# P,# P, Q,3$W-#8P-#$U
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W<L9W)O=7! .G(M>"TM+6$M4BUC+2US.BTM+2TM
M+2TZ86QL;W<L979E<GEO;F5 .BTM+2TM+6$M4BUC+2US.BTM+2TM+2TZ86QL
M;W< &1I<BUW:71H+6YF<W8T+6%C;',O
M
M P,# P-S4P # P,# P,# ,# P,# P, P,# P
M,# P,# P, Q,S S-C4Q,S<S-0 P,#$T-3<W #4
M
M =7-T87(
M,#!R;V]T ')O;W0
M ,# P,#0Q- P,C P,# R
M
M
M
M
M
M
M
M
M
M
M
M
M
M
M
M
M
M
M
M
M
M
M
M
M
M
-
end

View file

@ -0,0 +1,321 @@
/*-
* Copyright (c) 2003-2007 Tim Kientzle
* Copyright (c) 2016 Martin Matuska
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD$");
/*
* Verify reading entries with POSIX.1e and NFSv4 ACLs from archives created
* by star.
*
* This should work on all systems, regardless of whether local filesystems
* support ACLs or not.
*/
static struct archive_test_acl_t acls0[] = {
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_EXECUTE,
ARCHIVE_ENTRY_ACL_USER_OBJ, -1, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_USER, -1, "user77" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_GROUP_OBJ, -1, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_MASK, -1, ""},
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_WRITE,
ARCHIVE_ENTRY_ACL_OTHER, -1, "" },
};
static struct archive_test_acl_t acls1[] = {
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_EXECUTE | ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_USER_OBJ, -1, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_USER, -1, "user77" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0,
ARCHIVE_ENTRY_ACL_USER, -1, "user78" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_GROUP_OBJ, -1, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0007,
ARCHIVE_ENTRY_ACL_GROUP, -1, "group78" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0007,
ARCHIVE_ENTRY_ACL_MASK, -1, ""},
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_WRITE | ARCHIVE_ENTRY_ACL_EXECUTE,
ARCHIVE_ENTRY_ACL_OTHER, -1, "" },
};
static struct archive_test_acl_t acls2[] = {
{ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, ARCHIVE_ENTRY_ACL_EXECUTE,
ARCHIVE_ENTRY_ACL_USER_OBJ, -1 ,"" },
{ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_USER, -1, "user77" },
{ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_GROUP_OBJ, -1, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, ARCHIVE_ENTRY_ACL_EXECUTE,
ARCHIVE_ENTRY_ACL_GROUP, -1, "group78" },
{ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, ARCHIVE_ENTRY_ACL_READ | ARCHIVE_ENTRY_ACL_EXECUTE,
ARCHIVE_ENTRY_ACL_MASK, -1, ""},
{ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, ARCHIVE_ENTRY_ACL_WRITE,
ARCHIVE_ENTRY_ACL_OTHER, -1, "" },
};
static struct archive_test_acl_t acls3[] = {
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
ARCHIVE_ENTRY_ACL_READ_DATA |
ARCHIVE_ENTRY_ACL_WRITE_DATA |
ARCHIVE_ENTRY_ACL_EXECUTE |
ARCHIVE_ENTRY_ACL_APPEND_DATA |
ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_READ_ACL |
ARCHIVE_ENTRY_ACL_WRITE_ACL |
ARCHIVE_ENTRY_ACL_WRITE_OWNER |
ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
ARCHIVE_ENTRY_ACL_USER_OBJ, 0, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
ARCHIVE_ENTRY_ACL_READ_DATA |
ARCHIVE_ENTRY_ACL_WRITE_DATA |
ARCHIVE_ENTRY_ACL_APPEND_DATA |
ARCHIVE_ENTRY_ACL_READ_ACL |
ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_READ_ACL |
ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
ARCHIVE_ENTRY_ACL_GROUP_OBJ, 0, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
ARCHIVE_ENTRY_ACL_READ_DATA |
ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_READ_ACL |
ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
ARCHIVE_ENTRY_ACL_EVERYONE, 0, "" },
};
static struct archive_test_acl_t acls4[] = {
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
ARCHIVE_ENTRY_ACL_READ_DATA |
ARCHIVE_ENTRY_ACL_WRITE_DATA |
ARCHIVE_ENTRY_ACL_APPEND_DATA |
ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_READ_ACL |
ARCHIVE_ENTRY_ACL_WRITE_ACL |
ARCHIVE_ENTRY_ACL_WRITE_OWNER |
ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
ARCHIVE_ENTRY_ACL_USER_OBJ, 0, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
ARCHIVE_ENTRY_ACL_READ_DATA |
ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_READ_ACL |
ARCHIVE_ENTRY_ACL_SYNCHRONIZE |
ARCHIVE_ENTRY_ACL_ENTRY_INHERITED,
ARCHIVE_ENTRY_ACL_USER, 77, "user77" },
{ ARCHIVE_ENTRY_ACL_TYPE_DENY,
ARCHIVE_ENTRY_ACL_READ_DATA |
ARCHIVE_ENTRY_ACL_WRITE_DATA |
ARCHIVE_ENTRY_ACL_EXECUTE,
ARCHIVE_ENTRY_ACL_USER, 78, "user78" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
ARCHIVE_ENTRY_ACL_READ_DATA |
ARCHIVE_ENTRY_ACL_WRITE_DATA |
ARCHIVE_ENTRY_ACL_APPEND_DATA |
ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_READ_ACL |
ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
ARCHIVE_ENTRY_ACL_GROUP_OBJ, 0, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_DENY,
ARCHIVE_ENTRY_ACL_WRITE_DATA |
ARCHIVE_ENTRY_ACL_APPEND_DATA |
ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_WRITE_ACL |
ARCHIVE_ENTRY_ACL_WRITE_OWNER,
ARCHIVE_ENTRY_ACL_GROUP, 78, "group78" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
ARCHIVE_ENTRY_ACL_READ_DATA |
ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_READ_ACL |
ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
ARCHIVE_ENTRY_ACL_EVERYONE, 0, "" },
};
static struct archive_test_acl_t acls5[] = {
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
ARCHIVE_ENTRY_ACL_READ_DATA |
ARCHIVE_ENTRY_ACL_WRITE_DATA |
ARCHIVE_ENTRY_ACL_EXECUTE |
ARCHIVE_ENTRY_ACL_APPEND_DATA |
ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_READ_ACL |
ARCHIVE_ENTRY_ACL_WRITE_ACL |
ARCHIVE_ENTRY_ACL_WRITE_OWNER |
ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
ARCHIVE_ENTRY_ACL_USER_OBJ, 0, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
ARCHIVE_ENTRY_ACL_READ_DATA |
ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_READ_ACL |
ARCHIVE_ENTRY_ACL_SYNCHRONIZE |
ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT |
ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT,
ARCHIVE_ENTRY_ACL_USER, 77, "user77" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
ARCHIVE_ENTRY_ACL_READ_DATA |
ARCHIVE_ENTRY_ACL_WRITE_DATA |
ARCHIVE_ENTRY_ACL_EXECUTE |
ARCHIVE_ENTRY_ACL_APPEND_DATA |
ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_READ_ACL |
ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
ARCHIVE_ENTRY_ACL_GROUP_OBJ, 0, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_DENY,
ARCHIVE_ENTRY_ACL_READ_DATA |
ARCHIVE_ENTRY_ACL_WRITE_DATA |
ARCHIVE_ENTRY_ACL_APPEND_DATA |
ARCHIVE_ENTRY_ACL_EXECUTE |
ARCHIVE_ENTRY_ACL_DELETE |
ARCHIVE_ENTRY_ACL_DELETE_CHILD |
ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_READ_ACL |
ARCHIVE_ENTRY_ACL_WRITE_ACL |
ARCHIVE_ENTRY_ACL_WRITE_OWNER |
ARCHIVE_ENTRY_ACL_SYNCHRONIZE |
ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT |
ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT,
ARCHIVE_ENTRY_ACL_GROUP, 78, "group78" },
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
ARCHIVE_ENTRY_ACL_READ_DATA |
ARCHIVE_ENTRY_ACL_EXECUTE |
ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
ARCHIVE_ENTRY_ACL_READ_ACL |
ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
ARCHIVE_ENTRY_ACL_EVERYONE, 0, "" },
};
DEFINE_TEST(test_compat_star_acl_posix1e)
{
char name[] = "test_compat_star_acl_posix1e.tar";
struct archive *a;
struct archive_entry *ae;
/* Read archive file */
assert(NULL != (a = archive_read_new()));
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
extract_reference_file(name);
assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name,
10240));
/* First item has a few ACLs */
assertA(0 == archive_read_next_header(a, &ae));
failure("One extended ACL should flag all ACLs to be returned.");
assertEqualInt(5, archive_entry_acl_reset(ae,
ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
assertEntryCompareAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]),
ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0142);
failure("Basic ACLs should set mode to 0142, not %04o",
archive_entry_mode(ae)&0777);
assert((archive_entry_mode(ae) & 0777) == 0142);
/* Second item has pretty extensive ACLs */
assertA(0 == archive_read_next_header(a, &ae));
assertEqualInt(7, archive_entry_acl_reset(ae,
ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
assertEntryCompareAcls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]),
ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0543);
failure("Basic ACLs should set mode to 0543, not %04o",
archive_entry_mode(ae)&0777);
assert((archive_entry_mode(ae) & 0777) == 0543);
/* Third item has default ACLs */
assertA(0 == archive_read_next_header(a, &ae));
assertEqualInt(6, archive_entry_acl_reset(ae,
ARCHIVE_ENTRY_ACL_TYPE_DEFAULT));
assertEntryCompareAcls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]),
ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, 0142);
failure("Basic ACLs should set mode to 0142, not %04o",
archive_entry_mode(ae)&0777);
assert((archive_entry_mode(ae) & 0777) == 0142);
/* Close the archive. */
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}
DEFINE_TEST(test_compat_star_acl_nfs4)
{
char name[] = "test_compat_star_acl_nfs4.tar";
struct archive *a;
struct archive_entry *ae;
/* Read archive file */
assert(NULL != (a = archive_read_new()));
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
extract_reference_file(name);
assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name, 10240
));
/* First item has NFS4 ACLs mirroring file mode */
assertA(0 == archive_read_next_header(a, &ae));
assertEqualInt(3, archive_entry_acl_reset(ae,
ARCHIVE_ENTRY_ACL_TYPE_ALLOW));
assertEntryCompareAcls(ae, acls3, sizeof(acls3)/sizeof(acls3[0]),
ARCHIVE_ENTRY_ACL_TYPE_ALLOW, 0);
/* Second item has has fine-grained NFS4 ACLs */
assertA(0 == archive_read_next_header(a, &ae));
assertEqualInt(6, archive_entry_acl_reset(ae,
ARCHIVE_ENTRY_ACL_TYPE_NFS4));
assertEntryCompareAcls(ae, acls4, sizeof(acls4)/sizeof(acls0[4]),
ARCHIVE_ENTRY_ACL_TYPE_NFS4, 0);
/* Third item has file and directory inheritance NFS4 ACLs */
assertA(0 == archive_read_next_header(a, &ae));
assertEqualInt(5, archive_entry_acl_reset(ae,
ARCHIVE_ENTRY_ACL_TYPE_NFS4));
assertEntryCompareAcls(ae, acls5, sizeof(acls5)/sizeof(acls5[0]),
ARCHIVE_ENTRY_ACL_TYPE_NFS4, 0);
/* Close the archive. */
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}

View file

@ -0,0 +1,231 @@
begin 644 test_compat_star_acl_nfs4.tar
M+B\N+T!087A(96%D97(`````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````#`P,#`V,#`@,#`P,#`P,"`P,#`P,#`P(#`P,#`P,#`P,C<R
M(#`P,#`P,#`P,#`P(#`P,38P-S0@9P``````````````````````````````
M````````````````````````````````````````````````````````````
M``````````````````````````````````````````!U<W1A<@`P,')O;W0`
M````````````````````````````````````=VAE96P`````````````````
M```````````````````P,#`P,#`P(#`P,#`P,#`@````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M```````````````````````````````````P,#`P,#`P,#`P,"`P,#`P,#`P
M,#`P,"`````````````````U-R!30TA)3%DN<F5L96%S93US=&%R(#$N-2XS
M("AA;60V-"UU;FMN;W=N+69R965B<V0Q,2XP*0HR-R!30TA)3%DN87)C:'1Y
M<&4]97AU<W1A<@HT-R!30TA)3%DN=F]L:&1R+F1U;7!D871E/3$T-SDQ-C<W
M,C<N,38W,C(U,C@Q"C(U(%-#2$E,62YV;VQH9'(N=F]L;F\],0HS,"!30TA)
M3%DN=F]L:&1R+F)L;V-K<VEZ93TR,`H`````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````````````````````````````````````"XO+B]`4&%X2&5A
M9&5R````````````````````````````````````````````````````````
M```````````````````````````````````````````````````````````P
M,#`P-C`P(#`P,#`P,#`@,#`P,#`P,"`P,#`P,#`P,#,S-"`P,#`P,#`P,#`P
M,"`P,#$V,3$T('@`````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````=7-T87(`,#!R;V]T````````````````
M`````````````````````'=H965L````````````````````````````````
M````,#`P,#`P,"`P,#`P,#`P(```````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````,#`P,#`P,#`P,#`@,#`P,#`P,#`P,#`@````````
M````````,S`@871I;64],30W.3$Q.34U-"XP-#,U-#DP,#`*,S`@8W1I;64]
M,30W.3$Q.3DQ,BXY,SDQ-C@P,#`*,S`@;71I;64],30W.3$Q.34U-"XP-#,U
M-#DP,#`*,3,P(%-#2$E,62YA8VPN86-E/6]W;F5R0#IR=WAP+2UA05)78T-O
M<SHM+2TM+2TM.F%L;&]W+&=R;W5P0#IR=RUP+2UA+5(M8RTM<SHM+2TM+2TM
M.F%L;&]W+&5V97)Y;VYE0#IR+2TM+2UA+5(M8RTM<SHM+2TM+2TM.F%L;&]W
M"@``````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M``````````````````````````````!F:6QE,0``````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````,#`P,#<V-"`P,#`P
M,#`P(#`P,#`P,#`@,#`P,#`P,#`P,#`@,3,P,3(S,3$S,#(@,#`Q-#8S-B`P
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````'5S=&%R`#`P<F]O=```````````````````````````````
M``````!W:&5E;````````````````````````````````````#`P,#`P,#`@
M,#`P,#`P,"``````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````#$S,#$R,S$Q,S`R(#$S,#$R,S$R,#4P(````````````````"XO+B]`
M4&%X2&5A9&5R````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M```````P,#`P-C`P(#`P,#`P,#`@,#`P,#`P,"`P,#`P,#`P,#4T,"`P,#`P
M,#`P,#`P,"`P,#$V,3$S('@`````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````=7-T87(`,#!R;V]T````````
M`````````````````````````````'=H965L````````````````````````
M````````````,#`P,#`P,"`P,#`P,#`P(```````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````,#`P,#`P,#`P,#`@,#`P,#`P,#`P,#`@
M````````````````,S`@871I;64],30W.3$Q.34U-2XR-C<P,3@P,#`*,S`@
M8W1I;64],30W.3$V,34Y."XY,SDV-#8P,#`*,S`@;71I;64],30W.3$Q.34U
M-2XR-C<P,3@P,#`*,C8R(%-#2$E,62YA8VPN86-E/75S97(Z=7-E<C<X.G)W
M>"TM+2TM+2TM+2TM.BTM+2TM+2TZ9&5N>3HW."QG<F]U<#IG<F]U<#<X.BUW
M+7`M+2U!+5<M0V\M.BTM+2TM+2TZ9&5N>3HW."QU<V5R.G5S97(W-SIR+2TM
M+2UA+5(M8RTM<SHM+2TM+2U).F%L;&]W.C<W+&]W;F5R0#IR=RUP+2UA05)7
M8T-O<SHM+2TM+2TM.F%L;&]W+&=R;W5P0#IR=RUP+2UA+5(M8RTM<SHM+2TM
M+2TM.F%L;&]W+&5V97)Y;VYE0#IR+2TM+2UA+5(M8RTM<SHM+2TM+2TM.F%L
M;&]W"@``````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M``````````````````````````````````````!F:6QE,@``````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````,#`P,#8V
M-"`P,#`P,#`P(#`P,#`P,#`@,#`P,#`P,#`P,#`@,3,P,3(S,3$S,#,@,#`Q
M-#8U-R`P````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````````````'5S=&%R`#`P<F]O=```````````````````````
M``````````````!W:&5E;````````````````````````````````````#`P
M,#`P,#`@,#`P,#`P,"``````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````#$S,#$R,S$Q,S`S(#$S,#$R-#,S,S<V(```````````````
M`"XO+B]`4&%X2&5A9&5R````````````````````````````````````````
M````````````````````````````````````````````````````````````
M```````````````P,#`P-C`P(#`P,#`P,#`@,#`P,#`P,"`P,#`P,#`P,#0V
M-2`P,#`P,#`P,#`P,"`P,#$V,3(Q('@`````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````=7-T87(`,#!R;V]T
M`````````````````````````````````````'=H965L````````````````
M````````````````````,#`P,#`P,"`P,#`P,#`P(```````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````,#`P,#`P,#`P,#`@,#`P,#`P
M,#`P,#`@````````````````,S`@871I;64],30W.3$V-S0Y-2XV.#<X-C8P
M,#`*,S`@8W1I;64],30W.3$V-S<R,RXT-#`X-C<P,#`*,S`@;71I;64],30W
M.3$R,#8W."XT-#$U.#`P,#`*,C$Y(%-#2$E,62YA8VPN86-E/6=R;W5P.F=R
M;W5P-S@Z<G=X<$1D84%25V-#;W,Z9F0M+2TM+3ID96YY.C<X+'5S97(Z=7-E
M<C<W.G(M+2TM+6$M4BUC+2US.F9D+2TM+2TZ86QL;W<Z-S<L;W=N97)`.G)W
M>'`M+6%!4E=C0V]S.BTM+2TM+2TZ86QL;W<L9W)O=7!`.G)W>'`M+6%!4E=C
M+2US.BTM+2TM+2TZ86QL;W<L979E<GEO;F5`.G(M>"TM+6$M4BUC+2US.BTM
M+2TM+2TZ86QL;W<*````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M``````````````````````````````````````````````!D:7(Q+P``````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M,#`P,#<W-2`P,#`P,#`P(#`P,#`P,#`@,#`P,#`P,#`P,#`@,3,P,3(S,3,T
M-#8@,#`Q-#8S,2`U````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````````````````````'5S=&%R`#`P<F]O=```````````````
M``````````````````````!W:&5E;```````````````````````````````
M`````#`P,#`P,#`@,#`P,#`P,"``````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````````````#$S,#$R-#0W,#`W(#$S,#$R-#0W,S4S(```````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
9````````````````````````````````````
`
end

View file

@ -0,0 +1,231 @@
begin 644 test_compat_star_acl_posix1e.tar
M+B\N+T!087A(96%D97(`````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````#`P,#`V,#`@,#`P,#`P,"`P,#`P,#`P(#`P,#`P,#`P,C<R
M(#`P,#`P,#`P,#`P(#`P,38P-S0@9P``````````````````````````````
M````````````````````````````````````````````````````````````
M``````````````````````````````````````````!U<W1A<@`P,')O;W0`
M````````````````````````````````````=VAE96P`````````````````
M```````````````````P,#`P,#`P(#`P,#`P,#`@````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M```````````````````````````````````P,#`P,#`P,#`P,"`P,#`P,#`P
M,#`P,"`````````````````U-R!30TA)3%DN<F5L96%S93US=&%R(#$N-2XS
M("AA;60V-"UU;FMN;W=N+69R965B<V0Q,2XP*0HR-R!30TA)3%DN87)C:'1Y
M<&4]97AU<W1A<@HT-R!30TA)3%DN=F]L:&1R+F1U;7!D871E/3$T-SDQ,CDY
M-30N,#4X-S<R-SDS"C(U(%-#2$E,62YV;VQH9'(N=F]L;F\],0HS,"!30TA)
M3%DN=F]L:&1R+F)L;V-K<VEZ93TR,`H`````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````````````````````````````````````"XO+B]`4&%X2&5A
M9&5R````````````````````````````````````````````````````````
M```````````````````````````````````````````````````````````P
M,#`P-C`P(#`P,#`P,#`@,#`P,#`P,"`P,#`P,#`P,#(U,2`P,#`P,#`P,#`P
M,"`P,#$V,3$R('@`````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````=7-T87(`,#!R;V]T````````````````
M`````````````````````'=H965L````````````````````````````````
M````,#`P,#`P,"`P,#`P,#`P(```````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````,#`P,#`P,#`P,#`@,#`P,#`P,#`P,#`@````````
M````````,S`@871I;64],30W.3$R,34Y-BXT.#4W,30P,#`*,S`@8W1I;64]
M,30W.3$R.3<V-RXQ,#@Y.#8P,#`*,S`@;71I;64],30W.3$R,34Y-BXT.#4W
M,30P,#`*-SD@4T-(24Q9+F%C;"YA8V-E<W,]=7-E<CHZ+2UX+'5S97(Z=7-E
M<C<W.G(M+2QG<F]U<#HZ<BTM+&UA<VLZ.G(M+2QO=&AE<CHZ+7<M"@``````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M``````````````````````````````!F:6QE,0``````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````,#`P,#$T,B`P,#`P
M,#`P(#`P,#`P,#`@,#`P,#`P,#`P,#`@,3,P,3(S,34R-S0@,#`Q-#8W,2`P
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````'5S=&%R`#`P<F]O=```````````````````````````````
M``````!W:&5E;````````````````````````````````````#`P,#`P,#`@
M,#`P,#`P,"``````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````#$S,#$R,S$U,C<T(#$S,#$R,S,U,C0W(````````````````"XO+B]`
M4&%X2&5A9&5R````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M```````P,#`P-C`P(#`P,#`P,#`@,#`P,#`P,"`P,#`P,#`P,#,Q-"`P,#`P
M,#`P,#`P,"`P,#$V,3$R('@`````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````=7-T87(`,#!R;V]T````````
M`````````````````````````````'=H965L````````````````````````
M````````````,#`P,#`P,"`P,#`P,#`P(```````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````,#`P,#`P,#`P,#`@,#`P,#`P,#`P,#`@
M````````````````,S`@871I;64],30W.3$R,38P,2XP-C`X-C8P,#`*,S`@
M8W1I;64],30W.3$R.3<V-RXQ,#@Y-S0P,#`*,S`@;71I;64],30W.3$R,38P
M,2XP-C`X-C8P,#`*,3$T(%-#2$E,62YA8VPN86-C97-S/75S97(Z.G(M>"QU
M<V5R.G5S97(W-SIR+2TL=7-E<CIU<V5R-S@Z+2TM+&=R;W5P.CIR+2TL9W)O
M=7`Z9W)O=7`W.#IR=W@L;6%S:SHZ<G=X+&]T:&5R.CHM=W@*````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M``````````````````````````````````````!F:6QE,@``````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````,#`P,#4W
M,R`P,#`P,#`P(#`P,#`P,#`@,#`P,#`P,#`P,#`@,3,P,3(S,34S,#$@,#`Q
M-#8V,"`P````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````````````'5S=&%R`#`P<F]O=```````````````````````
M``````````````!W:&5E;````````````````````````````````````#`P
M,#`P,#`@,#`P,#`P,"``````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````#$S,#$R,S$U,S`Q(#$S,#$R,S,U,C0W(```````````````
M`"XO+B]`4&%X2&5A9&5R````````````````````````````````````````
M````````````````````````````````````````````````````````````
M```````````````P,#`P-C`P(#`P,#`P,#`@,#`P,#`P,"`P,#`P,#`P,#,W
M,R`P,#`P,#`P,#`P,"`P,#$V,3$W('@`````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````=7-T87(`,#!R;V]T
M`````````````````````````````````````'=H965L````````````````
M````````````````````,#`P,#`P,"`P,#`P,#`P(```````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````,#`P,#`P,#`P,#`@,#`P,#`P
M,#`P,#`@````````````````,S`@871I;64],30W.3$R,3<R-BXX,3<T-3`P
M,#`*,S`@8W1I;64],30W.3$R,3@S,2XU.#,U-3(P,#`*,S`@;71I;64],30W
M.3$R,3<R-BXX,3<T-3`P,#`*-C,@4T-(24Q9+F%C;"YA8V-E<W,]=7-E<CHZ
M+2UX+&=R;W5P.CIR+2TL;6%S:SHZ<BTM+&]T:&5R.CHM=RT*.3@@4T-(24Q9
M+F%C;"YD969A=6QT/75S97(Z.BTM>"QU<V5R.G5S97(W-SIR+2TL9W)O=7`Z
M.G(M+2QG<F]U<#IG<F]U<#<X.BTM>"QM87-K.CIR+7@L;W1H97(Z.BUW+0H`
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M``````````````````````````````````````````````!D:7(Q+P``````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M,#`P,#$T,B`P,#`P,#`P(#`P,#`P,#`@,#`P,#`P,#`P,#`@,3,P,3(S,34T
M-S8@,#`Q-#8R-B`U````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````````````````````'5S=&%R`#`P<F]O=```````````````
M``````````````````````!W:&5E;```````````````````````````````
M`````#`P,#`P,#`@,#`P,#`P,"``````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````````````#$S,#$R,S$U-#<V(#$S,#$R,S$U-C0W(```````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
9````````````````````````````````````
`
end

View file

@ -0,0 +1,104 @@
/*-
* Copyright (c) 2003-2007 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
__FBSDID("$FreeBSD: src/lib/libarchive/test/test_compat_tar_hardlink.c,v 1.3 2008/08/11 01:19:36 kientzle Exp $");
/*
* Background: There are two written standards for the tar file format.
* The first is the POSIX 1988 "ustar" format, the second is the 2001
* "pax extended" format that builds on the "ustar" format by adding
* support for generic additional attributes. Buried in the details
* is one frustrating incompatibility: The 1988 standard says that
* tar readers MUST ignore the size field on hardlink entries; the
* 2001 standard says that tar readers MUST obey the size field on
* hardlink entries. libarchive tries to navigate this particular
* minefield by using auto-detect logic to guess whether it should
* or should not obey the size field.
*
* This test tries to probe the boundaries of such handling; the test
* archives here were adapted from real archives created by real
* tar implementations that are (as of early 2008) apparently still
* in use.
*/
static void
test_compat_tar_hardlink_1(void)
{
char name[] = "test_compat_tar_hardlink_1.tar";
struct archive_entry *ae;
struct archive *a;
assert((a = archive_read_new()) != NULL);
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
extract_reference_file(name);
assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name, 10240));
/* Read first entry, which is a regular file. */
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("xmcd-3.3.2/docs_d/READMf",
archive_entry_pathname(ae));
assertEqualString(NULL, archive_entry_hardlink(ae));
assertEqualInt(321, archive_entry_size(ae));
assertEqualInt(1082575645, archive_entry_mtime(ae));
assertEqualInt(1851, archive_entry_uid(ae));
assertEqualInt(3, archive_entry_gid(ae));
assertEqualInt(0100444, archive_entry_mode(ae));
/* Read second entry, which is a hard link at the end of archive. */
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("xmcd-3.3.2/README",
archive_entry_pathname(ae));
assertEqualString(
"xmcd-3.3.2/docs_d/READMf",
archive_entry_hardlink(ae));
assertEqualInt(0, archive_entry_size(ae));
assertEqualInt(1082575645, archive_entry_mtime(ae));
assertEqualInt(1851, archive_entry_uid(ae));
assertEqualInt(3, archive_entry_gid(ae));
assertEqualInt(0100444, archive_entry_mode(ae));
/* Verify the end-of-archive. */
/*
* This failed in libarchive 2.4.12 because the tar reader
* tried to obey the size field for the hard link and ended
* up running past the end of the file.
*/
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
/* Verify that the format detection worked. */
assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_NONE);
assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR);
assertEqualInt(ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}
DEFINE_TEST(test_compat_tar_hardlink)
{
test_compat_tar_hardlink_1();
}

View file

@ -0,0 +1,39 @@
$FreeBSD: src/lib/libarchive/test/test_compat_tar_hardlink_1.tar.uu,v 1.1 2008/01/31 07:47:38 kientzle Exp $
begin 644 test_compat_tar_hardlink_1.tar
M>&UC9"TS+C,N,B]D;V-S7V0O4D5!1$UF````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````"`@(#0T-"``("`S-#<S(``@("`@(#,@`"`@("`@("`@-3`Q
M(#$P,#0Q-30U-#,U("`@-S8U-``@````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M``````````````````````!X>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX
M>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX
M>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX
M>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX
M>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX
M>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX
M>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'AX
M>'AX>'AX>'AX>'AX>'AX>'AX>'AX>'@`````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````````````````````````````````````'AM8V0M,RXS+C(O
M4D5!1$U%````````````````````````````````````````````````````
M```````````````````````````````````````````````````````````@
M("`T-#0@`"`@,S0W,R``("`@("`S(``@("`@("`@(#4P,2`Q,#`T,34T-30S
M-2`@,3(R,#<`(#%X;6-D+3,N,RXR+V1O8W-?9"]214%$368`````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
&````````
`
end

Some files were not shown because too many files have changed in this diff Show more