Multi-format archive and compression library

Overview

Welcome to libarchive!

The libarchive project develops a portable, efficient C library that can read and write streaming archives in a variety of formats. It also includes implementations of the common tar, cpio, and zcat command-line tools that use the libarchive library.

Questions? Issues?

Contents of the Distribution

This distribution bundle includes the following major components:

  • libarchive: a library for reading and writing streaming archives
  • tar: the 'bsdtar' program is a full-featured 'tar' implementation built on libarchive
  • cpio: the 'bsdcpio' program is a different interface to essentially the same functionality
  • cat: the 'bsdcat' program is a simple replacement tool for zcat, bzcat, xzcat, and such
  • examples: Some small example programs that you may find useful.
  • examples/minitar: a compact sample demonstrating use of libarchive.
  • contrib: Various items sent to me by third parties; please contact the authors with any questions.

The top-level directory contains the following information files:

  • NEWS - highlights of recent changes
  • COPYING - what you can do with this
  • INSTALL - installation instructions
  • README - this file
  • CMakeLists.txt - input for "cmake" build tool, see INSTALL
  • configure - configuration script, see INSTALL for details. If your copy of the source lacks a configure script, you can try to construct it by running the script in build/autogen.sh (or use cmake).

The following files in the top-level directory are used by the 'configure' script:

  • Makefile.am, aclocal.m4, configure.ac - used to build this distribution, only needed by maintainers
  • Makefile.in, config.h.in - templates used by configure script

Documentation

In addition to the informational articles and documentation in the online libarchive Wiki, the distribution also includes a number of manual pages:

  • bsdtar.1 explains the use of the bsdtar program
  • bsdcpio.1 explains the use of the bsdcpio program
  • bsdcat.1 explains the use of the bsdcat program
  • libarchive.3 gives an overview of the library as a whole
  • archive_read.3, archive_write.3, archive_write_disk.3, and archive_read_disk.3 provide detailed calling sequences for the read and write APIs
  • archive_entry.3 details the "struct archive_entry" utility class
  • archive_internals.3 provides some insight into libarchive's internal structure and operation.
  • libarchive-formats.5 documents the file formats supported by the library
  • cpio.5, mtree.5, and tar.5 provide detailed information about these popular archive formats, including hard-to-find details about modern cpio and tar variants.

The manual pages above are provided in the 'doc' directory in a number of different formats.

You should also read the copious comments in archive.h and the source code for the sample programs for more details. Please let us know about any errors or omissions you find.

Supported Formats

Currently, the library automatically detects and reads the following formats:

  • Old V7 tar archives
  • POSIX ustar
  • GNU tar format (including GNU long filenames, long link names, and sparse files)
  • Solaris 9 extended tar format (including ACLs)
  • POSIX pax interchange format
  • POSIX octet-oriented cpio
  • SVR4 ASCII cpio
  • Binary cpio (big-endian or little-endian)
  • ISO9660 CD-ROM images (with optional Rockridge or Joliet extensions)
  • ZIP archives (with uncompressed or "deflate" compressed entries, including support for encrypted Zip archives)
  • ZIPX archives (with support for bzip2, ppmd8, lzma and xz compressed entries)
  • GNU and BSD 'ar' archives
  • 'mtree' format
  • 7-Zip archives
  • Microsoft CAB format
  • LHA and LZH archives
  • RAR and RAR 5.0 archives (with some limitations due to RAR's proprietary status)
  • XAR archives

The library also detects and handles any of the following before evaluating the archive:

  • uuencoded files
  • files with RPM wrapper
  • gzip compression
  • bzip2 compression
  • compress/LZW compression
  • lzma, lzip, and xz compression
  • lz4 compression
  • lzop compression
  • zstandard compression

The library can create archives in any of the following formats:

  • POSIX ustar
  • POSIX pax interchange format
  • "restricted" pax format, which will create ustar archives except for entries that require pax extensions (for long filenames, ACLs, etc).
  • Old GNU tar format
  • Old V7 tar format
  • POSIX octet-oriented cpio
  • SVR4 "newc" cpio
  • shar archives
  • ZIP archives (with uncompressed or "deflate" compressed entries)
  • GNU and BSD 'ar' archives
  • 'mtree' format
  • ISO9660 format
  • 7-Zip archives
  • XAR archives

When creating archives, the result can be filtered with any of the following:

  • uuencode
  • gzip compression
  • bzip2 compression
  • compress/LZW compression
  • lzma, lzip, and xz compression
  • lz4 compression
  • lzop compression
  • zstandard compression

Notes about the Library Design

The following notes address many of the most common questions we are asked about libarchive:

  • This is a heavily stream-oriented system. That means that it is optimized to read or write the archive in a single pass from beginning to end. For example, this allows libarchive to process archives too large to store on disk by processing them on-the-fly as they are read from or written to a network or tape drive. This also makes libarchive useful for tools that need to produce archives on-the-fly (such as webservers that provide archived contents of a users account).

  • In-place modification and random access to the contents of an archive are not directly supported. For some formats, this is not an issue: For example, tar.gz archives are not designed for random access. In some other cases, libarchive can re-open an archive and scan it from the beginning quickly enough to provide the needed abilities even without true random access. Of course, some applications do require true random access; those applications should consider alternatives to libarchive.

  • The library is designed to be extended with new compression and archive formats. The only requirement is that the format be readable or writable as a stream and that each archive entry be independent. There are articles on the libarchive Wiki explaining how to extend libarchive.

  • On read, compression and format are always detected automatically.

  • The same API is used for all formats; it should be very easy for software using libarchive to transparently handle any of libarchive's archiving formats.

  • Libarchive's automatic support for decompression can be used without archiving by explicitly selecting the "raw" and "empty" formats.

  • I've attempted to minimize static link pollution. If you don't explicitly invoke a particular feature (such as support for a particular compression or format), it won't get pulled in to statically-linked programs. In particular, if you don't explicitly enable a particular compression or decompression support, you won't need to link against the corresponding compression or decompression libraries. This also reduces the size of statically-linked binaries in environments where that matters.

  • The library is generally thread safe depending on the platform: it does not define any global variables of its own. However, some platforms do not provide fully thread-safe versions of key C library functions. On those platforms, libarchive will use the non-thread-safe functions. Patches to improve this are of great interest to us.

  • In particular, libarchive's modules to read or write a directory tree do use chdir() to optimize the directory traversals. This can cause problems for programs that expect to do disk access from multiple threads. Of course, those modules are completely optional and you can use the rest of libarchive without them.

  • The library is not thread aware, however. It does no locking or thread management of any kind. If you create a libarchive object and need to access it from multiple threads, you will need to provide your own locking.

  • On read, the library accepts whatever blocks you hand it. Your read callback is free to pass the library a byte at a time or mmap the entire archive and give it to the library at once. On write, the library always produces correctly-blocked output.

  • The object-style approach allows you to have multiple archive streams open at once. bsdtar uses this in its "@archive" extension.

  • The archive itself is read/written using callback functions. You can read an archive directly from an in-memory buffer or write it to a socket, if you wish. There are some utility functions to provide easy-to-use "open file," etc, capabilities.

  • The read/write APIs are designed to allow individual entries to be read or written to any data source: You can create a block of data in memory and add it to a tar archive without first writing a temporary file. You can also read an entry from an archive and write the data directly to a socket. If you want to read/write entries to disk, there are convenience functions to make this especially easy.

  • Note: The "pax interchange format" is a POSIX standard extended tar format that should be used when the older ustar format is not appropriate. It has many advantages over other tar formats (including the legacy GNU tar format) and is widely supported by current tar implementations.

Comments
  • The libarchive lib exist a READ memory access Vulnerability

    The libarchive lib exist a READ memory access Vulnerability

    hello,when i use libfuzzer to write code to call archive_read_data function,i find a READ memory access Vulnerability.see the picture! The lzma_decode function crashed when decode my testcase. 图片

    opened by icycityone 47
  • Support for RAR

    Support for RAR

    Original issue 40 created by Google Code user ondra.pelech on 2009-10-05T16:05:49.000Z:

    Hi,
    
    it would be great if libarchive supported the RAR format; even if it would
    be passworded archive.
    
    This is just a wish/enhancement, not a bug; and I know it's probably not
    easy to implement and may take a long time. And thanks for this great
    project, I use it through GNOME's gvfs-mount.
    
    Type-Enhancement OpSys-All Milestone-Later Component-libarchive Priority-None 
    opened by kwrobot 45
  • libarchive's CMakeLists.txt finds major() when it shouldn't

    libarchive's CMakeLists.txt finds major() when it shouldn't

    Original issue 125 created by Google Code user audiofanatic on 2011-01-04T08:44:44.000Z:

    When building the cmlibarchive project with LSB compilers (LSB = Linux Standards Base), the archive_entry.c file generates compiler errors because it relies on the following functions which are not provided by the LSB:
    
    major
    minor
    makedev
    
    On linux, these are generally implemented as macros which forward to functions like gnu_dev_makedev, etc., but they actually have very simple inlineable implementations. In fact, with certain GCC flags, these macros/functions *are* fully inlined. It would seem that this has been noted by the cmlibarchive developers too, since they have recently added the following to archive_entry.c
    
    #if !defined(HAVE_MAJOR) && !defined(major)
    /* Replacement for major/minor/makedev. */
    #define major(x) ((int)(0x00ff & ((x) >> 8)))
    #define minor(x) ((int)(0xffff00ff & (x)))
    #define makedev(maj,min) ((0xff00 & ((maj)<<8)) | (0xffff00ff & (min)))
    #endif
    
    The HAVE_MAJOR switch is the problem for LSB compilers. It is set earlier in archive_entry.c and it merely depends on one of MAJOR_IN_MKDEV or MAJOR_IN_SYSMACROS being defined. Unfortunately, the top level CMakeLists.txt file does this detection without considering LSB compilers, since the LSB does not provide either mkdev.h nor sysmacros.h, but the CMakeLists.txt file doesn't account for this. The result is that system versions of these headers can be found, which is incorrect/dangerous when using LSB compilers. This is easy to fix with the attached patch to the top level CMakeLists.txt file.
    
    Note that this bug was originally reported to KitWare since it affects CMake itself. They have requested that this issue be fixed in cmlibarchive itself since they import cmlibarchive sources. For reference, see here:
    
    http://public.kitware.com/Bug/view.php?id=11648
    
    
    
    
    

    See attachment: CMakeLists.txt.patch

    Type-Defect Priority-Medium OpSys-All 
    opened by kwrobot 34
  • Add support for extracting SCHILY.xattr extended attributes

    Add support for extracting SCHILY.xattr extended attributes

    This patch adds support for extracting SCHIL.xattr extended attributes found in the PAX extended header. Since some of the attributes found there can be binary data, we extend the parser for support of binary data.

    One example for an attribute with binary data is SCHILY.xattr.security.ima, which contains a digital signature.

    Signed-off-by: Stefan Berger [email protected]

    Type-Feature 
    opened by stefanberger 26
  • Unicode filenames inside RAR not working

    Unicode filenames inside RAR not working

    Original issue 247 created by Google Code user [email protected] on 2012-03-06T03:13:12.000Z:

    <b>What steps will reproduce the problem?</b>
    Attached RAR file contains one file called &quot;テスト3.xlsx&quot;.
    Read filenames in attached file with archive_read_next_header and archive_entry_pathname_w.
    
    <b>What is the expected output? What do you see instead?</b>
    Expected filename == &quot;テスト3.xlsx&quot;, but get &quot;テスト3&quot;.
    
    <b>What version are you using?</b>
    3.0.3
    
    <b>On what operating system?</b>
    Win7-64
    
    <b>How did you build?  (cmake, configure, or pre-packaged binary)</b>
    Cmake
    
    <b>What compiler or development environment (please include version)?</b>
    VS2010
    
    <b>Please provide any additional information below.</b>
    64-bit build.
    

    See attachment: unicode-subfile.rar

    Type-Defect Priority-Medium OpSys-All 
    opened by kwrobot 24
  • [meta] Reporting potential security problems

    [meta] Reporting potential security problems

    (copy of https://groups.google.com/d/topic/libarchive-discuss/zFtqsPhNcQ0/discussion)

    Our fuzzing effort (read more at our home page: https://github.com/google/oss-fuzz) has detected several crashes (2 buffer overrun and one null deref) in libarchive trunk using the fuzz target that we developed:

    https://github.com/google/oss-fuzz/blob/master/targets/libarchive/libarchive_fuzzer.cc

    These crashes are now filed in a security-protected monorail tracker (https://bugs.chromium.org/p/oss-fuzz/issues/list) and we'd like to find libarchive engineers to take a look at them.

    We'd like to CC developers on libarchive issues to give them access to stack traces and reproducer data. For that we'd only need an e-mail with associated gmail account. We can set up the process to auto-CC these e-mails when we find more issues.

    opened by mikea 23
  • build fails on SCO 5

    build fails on SCO 5

    Original issue 129 created by Google Code user brianchina60221 on 2011-01-18T18:34:53.000Z:

    libarchive/archive.h defines some types appropriate to the platform, but those types aren't used elsewhere in the code. There are many direct uses of, e.g., uint32_t.
    
    The attached patch against trunk is big, but it just rearranges some stuff in archive.h, archive_entry.h, and archive_platform.h, and then seds the C99 types in libarchive/* to use the internal names.
    
    Thank you.
    

    See attachment: types.patch

    Type-Defect Priority-Medium OpSys-Other 
    opened by kwrobot 22
  • libarchive fails to process zip files with garbage padding at end

    libarchive fails to process zip files with garbage padding at end

    Original issue 257 created by Google Code user alexkozlov0 on 2012-04-11T00:29:38.000Z:

    <b>What steps will reproduce the problem?</b>
    1. wget ftp://ftp.adobe.com/pub/adobe/magic/acrobatviewer/unix/1.x/viewer.bin
    2. bsdtar tvf viewer.bin
    
    What is the expected output?
    The zip file listing.
    
    What do you see instead?
    bsdtar: Invalid central directory signature
    bsdtar: Error exit delayed from previous errors.
    
    <b>What version are you using?</b>
    3.0.4, git
    
    <b>On what operating system?</b>
    FreeBSD 9.x
    
    <b>How did you build?  (cmake, configure, or pre-packaged binary)</b>
    configure
    
    <b>What compiler or development environment (please include version)?</b>
    gcc 4.2
    
    <b>Please provide any additional information below.</b>
    Now that libarchive have seekable zip reader, it can fallback to Central directory at the end of the zip file instead of terminating with error.
    
    Type-Defect Priority-Medium OpSys-All 
    opened by kwrobot 18
  • Support reading from multiple data objects (multivolume reading)

    Support reading from multiple data objects (multivolume reading)

    Original issue 166 created by Google Code user mcitadel on 2011-08-13T18:39:46.000Z:

    RAR archives can be split into multiple files (to provide multivolume support). Each file contains the RAR signature header, a main archive header, and the optional EOF header. The data blocks are split arbitrarily between each file in a multivolume set of files. Currently, libarchive doesn't handle reading from multiple files.
    
    This patch would introduce reading from multiple files by way of reading from multiple client objects. What would happen is that there is a chain of client objects, each with the callbacks and data necessary to open, read, skip, and close each object it's reading from (such as different files). Data is read from each of these clients as one large stream. I plan on implementing multivolume reading support of RAR files once general reading from multiple streams is accepted and committed to trunk.
    
    I introduced a new callback (switch callback) that can be used to switch from reading of one client to the next or previous client. I needed some way to determine whether a file should be closed because it's going to open the next file, or if it's being closed because libarchive is done reading from the file set. The latter would mean that I also need to free all memory allocated for all data objects of each client.
    
    I've introduced some test cases already for reading from these multiple clients. The test files are simply some reused test rar files that have been splitted using the 'split' program. There's also a test case for supplying custom callbacks and multiple client objects. This custom callbacks test case is essentially the way I see of using libarchive to read from multiple files with custom callbacks. I plan on using libarchive in this way in another application (XBMC).
    
    This patch also updates test_fuzz so it can read from multiple files. Currently, the multiple files used in test_fuzz would have the same result as &quot;test_read_format_rar.rar&quot; would. Once I have RARv3 multivolume reading support implemented, this would provide a better test for test_fuzz.
    
    
    Priority-Medium Type-Review 
    opened by kwrobot 18
  • Wrong locale defaults for windows

    Wrong locale defaults for windows

    Original issue 132 created by Google Code user repalov on 2011-01-31T18:08:58.000Z:

    <b>What version are you using?</b>
    trunk / revision 2953
    
    <b>On what operating system?</b>
    Windows 7
    
    <b>How did you build?  (cmake, configure, or pre-packaged binary)</b>
    cmake
    
    <b>What compiler or development environment (please include version)?</b>
    Visual Studio 2010
    
    I have two comments.
    
    1)  In line 464 of archive_string.c (
    http://code.google.com/p/libarchive/source/browse/trunk/libarchive/archive_string.c#464 ) used ACP code page, but ZIP and TAR (and may be other) archives created in Windows with using CP_OEMCP (OEM) character set for filenames (at least for russian it is true - ACP defines codepage 1251, but in archive names are in 866 codepage).
    
    2) It is incorrect idea to use _system_ default locale to convert mbstring&lt;-&gt;wcstring. Because if I have archive with russian filenames from FreeBSD it filenames is in koi8-r, and if I can't define charset for archive - I can't get proper names. 
    The other problem - if i build libarchive as dll, then dll have it's own locale and I can't change it from program at all.
    
    So I think it is need mechanism to change locale for string conversion for library (as minimum) or for archive (optimal).
    
    At this time no one archiver that I tested (7zip, WinRar, bsdtar from libarchive) not extracted russian names correct from tar.bz2 archive created on FreeBSD 8.1.
    
    Type-Defect OpSys-All Priority-Critical Milestone-3.0 
    opened by kwrobot 18
  • Hide private symbols in libarchive.so

    Hide private symbols in libarchive.so

    Libarchive.so presently exports 281 symbols (over 50%, full list attached) which are not present in libarchive's headers and thus are not supposed to be used by clients.

    Removing these symbols would allow compiler to optimize code more aggressively (.text reduced by 1%), speed up dynamic linker on Linux and prevent clients from inadvertently using internal APIs.

    I attached a simple patch that hides private symbols. It passes make check (I can do additional testing if needed). Would something like this be interesting for the project?

    0001-Hide-private-symbols.patch.txt private_syms.txt

    The issue was found using ShlibVisibilityChecker.

    opened by yugr 17
  • Writing into fd faster than going through `archive_write_data_block`

    Writing into fd faster than going through `archive_write_data_block`

    I am currently optimizing our libarchive usage for the mamba package manager (http://github.com/mamba-org/mamba).

    I've noticed that archive_read_data_into_fd is 2x faster on certain archives vs. the usual copy_data loop that uses archive_read_data_block and archive_write_data_block. Since archive_read_data_into_fd uses the same archive_read_data_block, the slowdown is probably coming from archive_write_data_block invocations that are slower than directly writing to the file descriptor.

    The archives I am talking about are zstd compressed.

    Using archive_read_data_into_fd works well on Linux and macOS (with another open() call but unfortunately fails on Windows because the file is already open from archive_write_header. I guess I could close it first with archive_write_finish_entry and then open it again to write to it. Ideally I would be happy to re-use the opened file handle though -- but I don't think that is exposed anywhere.

    I am wondering if anyone has any ideas? We could also add a function like archive_read_data_into_fd that re-uses the filehandle from the archive_write struct?

    opened by wolfv 10
  • ZIP created by Java with a member of exactly 4294967295 bytes long shows

    ZIP created by Java with a member of exactly 4294967295 bytes long shows "ZIP uncompressed data is wrong size" error

    If I create a ZIP file from Java with a member that is exactly 4294967295 bytes long, then when uncompressing with libarchive, I get the error

    ZIP uncompressed data is wrong size (read 4294967295, expected 0)

    In more detail, I create a Java source file

    Zip.java

    import java.io.FileOutputStream;
    import java.io.FileNotFoundException;
    import java.io.IOException;
    import java.io.BufferedOutputStream;
    import java.util.zip.ZipOutputStream;
    import java.util.zip.ZipEntry;
    
    class Zip {
        public static void main(String[] args) throws FileNotFoundException, IOException {
            FileOutputStream fos = new FileOutputStream("file.zip");
            BufferedOutputStream bos = new BufferedOutputStream(fos);
            ZipOutputStream zos = new ZipOutputStream(bos);
    
            try {
                zos.putNextEntry(new ZipEntry("file"));
                byte[] b =  new byte[67108864];
                for (int i=0; i < 63; ++i) {
                    zos.write(b);
                }
                zos.write(new byte[67108863]);
                zos.closeEntry();
            }
            finally {
                zos.close();
            }
            System.out.println("Done");
        }
    }
    

    Then compile it, run it, and uncompress it with cpio (in this case, installed by homebrew on macOS):

    javac Zip.java
    java Zip
    cat file.zip | /System/Volumes/Data/opt/homebrew/Cellar/libarchive/3.6.2/bin/cpio -i
    

    I get the error:

    cpio: ZIP uncompressed data is wrong size (read 4294967295, expected 0)
    : Unknown error: -1
    

    If I adjust the size of the member file by one byte up or down, the error doesn't seem to happen

    A very similar message appears when uncompressing the file using https://github.com/Changaco/python-libarchive-c, so I suspect this isn’t specific to cpio

    opened by michalc 23
  • .7z issues with backslashes

    .7z issues with backslashes

    I have a Windows application (compiled with MinGW-w64) that uses libarchive (currently version 3.6.2).

    Since it's Windows the separator used in paths is backslash (instead of slash on other operating systems).

    This works fine in libarchive most of the time, but when writing .7z (archive_write_set_format_7zip()) the archive created has all the files in the top level with the directory as part of the filename.

    Extracting such archive with 7-Zip gives problems as well as it tries to create files with backslash in the name.

    Is this a bug, or is this in issue in an underlying library used by libarchive?

    opened by brechtsanders 2
  • [Help document bug] For bsdtar, --help options doesn't list some options

    [Help document bug] For bsdtar, --help options doesn't list some options

    The help document of bsdtar misses some options for version 3.6.2.

    • For the option "a", the following code appears during option parsing and modifies the bsdtar->flags in ./tar/bsdtar.c:295 for version 3.6.2.
    			bsdtar->flags |= OPTFLAG_AUTO_COMPRESS;
    
    • For the option "H", the following code appears during option parsing and modifies the bsdtar->symlink_mode in ./tar/bsdtar.c:395 for version 3.6.2.
    			bsdtar->symlink_mode = 'H';
    
    • For the option "h", the following code appears during option parsing and modifies the bsdtar->symlink_mode and possible_help_request in ./tar/bsdtar.c:398-400 for version 3.6.2.
    			bsdtar->symlink_mode = 'L';
    			/* Hack: -h by itself is the "help" command. */
    			possible_help_request = 1;
    
    • For the option "I", the following code appears during option parsing and modifies the bsdtar->names_from_file in ./tar/bsdtar.c:424 for version 3.6.2.
    			bsdtar->names_from_file = bsdtar->argument;
    
    • For the option "L", the following code appears during option parsing and modifies the bsdtar->symlink_mode in ./tar/bsdtar.c:461 for version 3.6.2.
    			bsdtar->symlink_mode = 'L';
    
    • For the option "l", the following code appears during option parsing and modifies the bsdtar->flags in ./tar/bsdtar.c:465 for version 3.6.2.
    			bsdtar->flags |= OPTFLAG_WARN_LINKS;
    
    • For the option "n", the following code appears during option parsing and modifies the bsdtar->flags in ./tar/bsdtar.c:496 for version 3.6.2.
    			bsdtar->flags |= OPTFLAG_NO_SUBDIRS;
    
    • For the option "o", the following code appears during option parsing and modifies the bsdtar->flags in ./tar/bsdtar.c:589 for version 3.6.2.
    			bsdtar->flags |= OPTFLAG_O;
    
    • For the option "P", the following code appears during option parsing and modifies the bsdtar->extract_flags and bsdtar->flags in ./tar/bsdtar.c:644-645 for version 3.6.2.
    			bsdtar->extract_flags &= ~SECURITY;
    			bsdtar->flags |= OPTFLAG_ABSOLUTE_PATHS;
    
    • For the option "q", the following code appears during option parsing and modifies the bsdtar->flags in ./tar/bsdtar.c:661 for version 3.6.2.
    			bsdtar->flags |= OPTFLAG_FAST_READ;
    
    • For the option "S", the following code appears during option parsing and modifies the bsdtar->extract_flags in ./tar/bsdtar.c:671 for version 3.6.2.
    			bsdtar->extract_flags |= ARCHIVE_EXTRACT_SPARSE;
    
    • For the option "s", the following code appears during option parsing and calls the add_substitution in ./tar/bsdtar.c:674-680 for version 3.6.2.
    #if defined(HAVE_REGEX_H) || defined(HAVE_PCREPOSIX_H)
    			add_substitution(bsdtar, bsdtar->argument);
    #else
    			lafe_warnc(0,
    			    "-s is not supported by this version of bsdtar");
    			usage();
    #endif
    
    • For the option "T", the following code appears during option parsing and modifies the bsdtar->names_from_file in ./tar/bsdtar.c:700 for version 3.6.2.
    			bsdtar->names_from_file = bsdtar->argument;
    
    • For the option "U", the following code appears during option parsing and modifies the bsdtar->extract_flags, bsdtar->flags in ./tar/bsdtar.c:710-711 for version 3.6.2.
    			bsdtar->extract_flags |= ARCHIVE_EXTRACT_UNLINK;
    			bsdtar->flags |= OPTFLAG_UNLINK_FIRST;
    
    • For the option "X", the following code appears during option parsing and calls the archive_match_exclude_pattern_from_file and archive_error_string in ./tar/bsdtar.c:755-759 for version 3.6.2.
    			if (archive_match_exclude_pattern_from_file(
    			    bsdtar->matching, bsdtar->argument, 0)
    			    != ARCHIVE_OK)
    				lafe_errc(1, 0, "Error : %s",
    				    archive_error_string(bsdtar->matching));
    
    • For the option "y", the following code appears during option parsing and modifies the compression, compression_name in ./tar/bsdtar.c:770-775 for version 3.6.2.
    			if (compression != '\0')
    				lafe_errc(1, 0,
    				    "Can't specify both -%c and -%c", opt,
    				    compression);
    			compression = opt;
    			compression_name = "bzip2";
    
    • For the option "Z", the following code appears during option parsing and modifies the compression, compression_name in ./tar/bsdtar.c:778-783 for version 3.6.2.
    			if (compression != '\0')
    				lafe_errc(1, 0,
    				    "Can't specify both -%c and -%c", opt,
    				    compression);
    			compression = opt;
    			compression_name = "compress";
    
    • For the option "acls", the following code appears during option parsing and modifies the bsdtar->extract_flags, bsdtar->readdisk_flags, bsdtar->flags in ./tar/bsdtar.c:298-300 for version 3.6.2.
    			bsdtar->extract_flags |= ARCHIVE_EXTRACT_ACL;
    			bsdtar->readdisk_flags &= ~ARCHIVE_READDISK_NO_ACL;
    			bsdtar->flags |= OPTFLAG_ACLS;
    
    • For the option "b64encode", the following code appears during option parsing and modifies the compression2, compression2_name in ./tar/bsdtar.c:320-325 for version 3.6.2.
    			if (compression2 != '\0')
    				lafe_errc(1, 0,
    				    "Can't specify both --uuencode and "
    				    "--b64encode");
    			compression2 = opt;
    			compression2_name = "b64encode";
    
    • For the option "check-links", the following code appears during option parsing and modifies the bsdtar->flags in ./tar/bsdtar.c:338 for version 3.6.2.
    			bsdtar->flags |= OPTFLAG_WARN_LINKS;
    
    • For the option "chroot", the following code appears during option parsing and modifies the bsdtar->flags in ./tar/bsdtar.c:341 for version 3.6.2.
    			bsdtar->flags |= OPTFLAG_CHROOT;
    
    • For the option "clear-nochange-fflags", the following code appears during option parsing and modifies the bsdtar->extract_flags in ./tar/bsdtar.c:344-345 for version 3.6.2.
    			bsdtar->extract_flags |=
    			    ARCHIVE_EXTRACT_CLEAR_NOCHANGE_FFLAGS;
    
    • For the option "exclude-vcs", the following code appears during option parsing and calls the archive_match_exclude_pattern in ./tar/bsdtar.c:354-359 for version 3.6.2.
    			for(t=0; vcs_files[t]; t++) {
    				if (archive_match_exclude_pattern(
    				    bsdtar->matching,
    				    vcs_files[t]) != ARCHIVE_OK)
    					lafe_errc(1, 0, "Couldn't "
    					    "exclude %s\n", vcs_files[t]);
    			}
    
    • For the option "fflags", the following code appears during option parsing and modifies the bsdtar->extract_flags, bsdtar->readdisk_flags, bsdtar->flags in ./tar/bsdtar.c:363-365 for version 3.6.2.
    			bsdtar->extract_flags |= ARCHIVE_EXTRACT_FFLAGS;
    			bsdtar->readdisk_flags &= ~ARCHIVE_READDISK_NO_FFLAGS;
    			bsdtar->flags |= OPTFLAG_FFLAGS;
    
    • For the option "gid", the following code appears during option parsing and modifies the errno, tptr, t, bsdtar->gid in ./tar/bsdtar.c:374-381 for version 3.6.2.
    			errno = 0;
    			tptr = NULL;
    			t = (int)strtol(bsdtar->argument, &tptr, 10);
    			if (errno || t < 0 || *(bsdtar->argument) == '\0' ||
    			    tptr == NULL || *tptr != '\0') {
    				lafe_errc(1, 0, "Invalid argument to --gid");
    			}
    			bsdtar->gid = t;
    
    • For the option "gname", the following code appears during option parsing and modifies the bsdtar->gname in ./tar/bsdtar.c:384 for version 3.6.2.
    			bsdtar->gname = bsdtar->argument;
    
    • For the option "grzip", the following code appears during option parsing and modifies the compression2, compression2_name in ./tar/bsdtar.c:387-392 for version 3.6.2.
    			if (compression != '\0')
    				lafe_errc(1, 0,
    				    "Can't specify both -%c and -%c", opt,
    				    compression);
    			compression = opt;
    			compression_name = "grzip";
    
    • For the option "hfs-compression", the following code appears during option parsing and modifies the bsdtar->extract_flags in ./tar/bsdtar.c:407-408 for version 3.6.2.
    			bsdtar->extract_flags |=
    			    ARCHIVE_EXTRACT_HFS_COMPRESSION_FORCED;
    
    • For the option "ignore-zeros", the following code appears during option parsing and modifies the bsdtar->flags in ./tar/bsdtar.c:411 for version 3.6.2.
    			bsdtar->flags |= OPTFLAG_IGNORE_ZEROS;
    
    • For the option "include", the following code appears during option parsing and calls the archive_match_include_pattern in ./tar/bsdtar.c:432-436 for version 3.6.2.
    			if (archive_match_include_pattern(bsdtar->matching,
    			    bsdtar->argument) != ARCHIVE_OK)
    				lafe_errc(1, 0,
    				    "Failed to add %s to inclusion list",
    				    bsdtar->argument);
    
    • For the option "keep-newer-files", the following code appears during option parsing and modifies the bsdtar->extract_flags in ./tar/bsdtar.c:458 for version 3.6.2.
    			bsdtar->extract_flags |= ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER;
    
    • For the option "mac-metadata", the following code appears during option parsing and modifies the bsdtar->readdisk_flags, bsdtar->extract_flags, bsdtar->flags in ./tar/bsdtar.c:491-493 for version 3.6.2.
    			bsdtar->readdisk_flags |= ARCHIVE_READDISK_MAC_COPYFILE;
    			bsdtar->extract_flags |= ARCHIVE_EXTRACT_MAC_METADATA;
    			bsdtar->flags |= OPTFLAG_MAC_METADATA;
    
    • For the option "newer-ctime", the following code appears during option parsing and calls the archive_match_include_date in ./tar/bsdtar.c:505-509 for version 3.6.2.
    			if (archive_match_include_date(bsdtar->matching,
    			    ARCHIVE_MATCH_CTIME | ARCHIVE_MATCH_NEWER,
    			    bsdtar->argument) != ARCHIVE_OK)
    				lafe_errc(1, 0, "Error : %s",
    				    archive_error_string(bsdtar->matching));
    
    • For the option "newer-ctime-than", the following code appears during option parsing and calls the archive_match_include_file_time in ./tar/bsdtar.c:512-516 for version 3.6.2.
    			if (archive_match_include_file_time(bsdtar->matching,
    			    ARCHIVE_MATCH_CTIME | ARCHIVE_MATCH_NEWER,
    			    bsdtar->argument) != ARCHIVE_OK)
    				lafe_errc(1, 0, "Error : %s",
    				    archive_error_string(bsdtar->matching));
    
    • For the option "newer-mtime", the following code appears during option parsing and calls the archive_match_include_date in ./tar/bsdtar.c:519-523 for version 3.6.2.
    			if (archive_match_include_date(bsdtar->matching,
    			    ARCHIVE_MATCH_MTIME | ARCHIVE_MATCH_NEWER,
    			    bsdtar->argument) != ARCHIVE_OK)
    				lafe_errc(1, 0, "Error : %s",
    				    archive_error_string(bsdtar->matching));
    
    • For the option "newer-mtime-than", the following code appears during option parsing and calls the archive_match_include_file_time in ./tar/bsdtar.c:519-523 for version 3.6.2.
    			if (archive_match_include_file_time(bsdtar->matching,
    			    ARCHIVE_MATCH_MTIME | ARCHIVE_MATCH_NEWER,
    			    bsdtar->argument) != ARCHIVE_OK)
    				lafe_errc(1, 0, "Error : %s",
    				    archive_error_string(bsdtar->matching));
    
    • For the option "nodump", the following code appears during option parsing and modifies the bsdtar->readdisk_flags in ./tar/bsdtar.c:533 for version 3.6.2.
    			bsdtar->readdisk_flags |= ARCHIVE_READDISK_HONOR_NODUMP;
    
    • For the option "nopreserve-hfs-compression", the following code appears during option parsing and modifies the bsdtar->extract_flags in ./tar/bsdtar.c537-538 for version 3.6.2.
    			bsdtar->extract_flags |=
    			    ARCHIVE_EXTRACT_NO_HFS_COMPRESSION;
    
    • For the option "no-acls", the following code appears during option parsing and modifies the bsdtar->extract_flags, bsdtar->readdisk_flags, bsdtar->flags in ./tar/bsdtar.c541-543 for version 3.6.2.
    			bsdtar->extract_flags &= ~ARCHIVE_EXTRACT_ACL;
    			bsdtar->readdisk_flags |= ARCHIVE_READDISK_NO_ACL;
    			bsdtar->flags |= OPTFLAG_NO_ACLS;
    
    • For the option "no-fflags", the following code appears during option parsing and modifies the bsdtar->extract_flags, bsdtar->readdisk_flags, bsdtar->flags in ./tar/bsdtar.c546-548 for version 3.6.2.
    			bsdtar->extract_flags &= ~ARCHIVE_EXTRACT_FFLAGS;
    			bsdtar->readdisk_flags |= ARCHIVE_READDISK_NO_FFLAGS;
    			bsdtar->flags |= OPTFLAG_NO_FFLAGS;
    
    • For the option "no-mac-metadata", the following code appears during option parsing and modifies the bsdtar->extract_flags, bsdtar->readdisk_flags, bsdtar->flags in ./tar/bsdtar.c551-553 for version 3.6.2.
    			bsdtar->readdisk_flags &= ~ARCHIVE_READDISK_MAC_COPYFILE;
    			bsdtar->extract_flags &= ~ARCHIVE_EXTRACT_MAC_METADATA;
    			bsdtar->flags |= OPTFLAG_NO_MAC_METADATA;
    
    • For the option "no-read-sparse", the following code appears during option parsing and modifies the bsdtar->readdisk_flags, bsdtar->flags in ./tar/bsdtar.c556-557 for version 3.6.2.
    			bsdtar->readdisk_flags |= ARCHIVE_READDISK_NO_SPARSE;
    			bsdtar->flags |= OPTFLAG_NO_READ_SPARSE;
    
    • For the option "no-safe-writes", the following code appears during option parsing and modifies the bsdtar->extract_flags in ./tar/bsdtar.c560 for version 3.6.2.
    			bsdtar->extract_flags &= ~ARCHIVE_EXTRACT_SAFE_WRITES;
    
    • For the option "no-same-owner", the following code appears during option parsing and modifies the bsdtar->extract_flags in ./tar/bsdtar.c563 for version 3.6.2.
    			bsdtar->extract_flags &= ~ARCHIVE_EXTRACT_OWNER;
    
    • For the option "no-same-permissions", the following code appears during option parsing and modifies the bsdtar->extract_flags in ./tar/bsdtar.c566-570 for version 3.6.2.
    			bsdtar->extract_flags &= ~ARCHIVE_EXTRACT_PERM;
    			bsdtar->extract_flags &= ~ARCHIVE_EXTRACT_ACL;
    			bsdtar->extract_flags &= ~ARCHIVE_EXTRACT_XATTR;
    			bsdtar->extract_flags &= ~ARCHIVE_EXTRACT_FFLAGS;
    			bsdtar->extract_flags &= ~ARCHIVE_EXTRACT_MAC_METADATA;
    
    • For the option "no-xattrs", the following code appears during option parsing and modifies the bsdtar->extract_flags, bsdtar->readdisk_flags, bsdtar->flags in ./tar/bsdtar.c573-575 for version 3.6.2.
    			bsdtar->extract_flags &= ~ARCHIVE_EXTRACT_XATTR;
    			bsdtar->readdisk_flags |= ARCHIVE_READDISK_NO_XATTR;
    			bsdtar->flags |= OPTFLAG_NO_XATTRS;
    
    • For the option "null", the following code appears during option parsing and modifies the bsdtar->flags in ./tar/bsdtar.c578 for version 3.6.2.
    			bsdtar->flags |= OPTFLAG_NULL;
    
    • For the option "numeric-owner", the following code appears during option parsing and modifies the bsdtar->uname, bsdtar->gname, bsdtar->flags in ./tar/bsdtar.c581-583 for version 3.6.2.
    			bsdtar->uname = "";
    			bsdtar->gname = "";
    			bsdtar->flags |= OPTFLAG_NUMERIC_OWNER;
    
    • For the option "older-ctime", the following code appears during option parsing and calls the archive_match_include_date in ./tar/bsdtar.c:598-602 for version 3.6.2.
    			if (archive_match_include_date(bsdtar->matching,
    			    ARCHIVE_MATCH_CTIME | ARCHIVE_MATCH_OLDER,
    			    bsdtar->argument) != ARCHIVE_OK)
    				lafe_errc(1, 0, "Error : %s",
    				    archive_error_string(bsdtar->matching));
    
    • For the option "older-ctime-than", the following code appears during option parsing and calls the archive_match_include_file_time in ./tar/bsdtar.c:605-609 for version 3.6.2.
    			if (archive_match_include_file_time(bsdtar->matching,
    			    ARCHIVE_MATCH_CTIME | ARCHIVE_MATCH_OLDER,
    			    bsdtar->argument) != ARCHIVE_OK)
    				lafe_errc(1, 0, "Error : %s",
    				    archive_error_string(bsdtar->matching));
    
    • For the option "older-mtime", the following code appears during option parsing and calls the archive_match_include_date in ./tar/bsdtar.c:612-616 for version 3.6.2.
    			if (archive_match_include_date(bsdtar->matching,
    			    ARCHIVE_MATCH_MTIME | ARCHIVE_MATCH_OLDER,
    			    bsdtar->argument) != ARCHIVE_OK)
    				lafe_errc(1, 0, "Error : %s",
    				    archive_error_string(bsdtar->matching));
    
    • For the option "older-mtime-than", the following code appears during option parsing and calls the archive_match_include_file_time in ./tar/bsdtar.c:612-616 for version 3.6.2.
    			if (archive_match_include_file_time(bsdtar->matching,
    			    ARCHIVE_MATCH_MTIME | ARCHIVE_MATCH_OLDER,
    			    bsdtar->argument) != ARCHIVE_OK)
    				lafe_errc(1, 0, "Error : %s",
    				    archive_error_string(bsdtar->matching));
    
    • For the option "one-file-system", the following code appears during option parsing and modifies the bsdtar->readdisk_flags in ./tar/bsdtar.c:626-627 for version 3.6.2.
    			bsdtar->readdisk_flags |=
    			    ARCHIVE_READDISK_NO_TRAVERSE_MOUNTS;
    
    • For the option "options", the following code appears during option parsing and modifies the bsdtar->option_options in ./tar/bsdtar.c:630 for version 3.6.2.
    			bsdtar->option_options = bsdtar->argument;
    
    • For the option "passphrase", the following code appears during option parsing and modifies the bsdtar->passphrase in ./tar/bsdtar.c:655 for version 3.6.2.
    			bsdtar->passphrase = bsdtar->argument;
    
    • For the option "posix", the following code appears during option parsing and calls the cset_set_format in ./tar/bsdtar.c:658 for version 3.6.2.
    			cset_set_format(bsdtar->cset, "pax");
    
    • For the option "read-sparse", the following code appears during option parsing and modifies the bsdtar->readdisk_flags, bsdtar->flags in ./tar/bsdtar.c:667-668 for version 3.6.2.
    			bsdtar->readdisk_flags &= ~ARCHIVE_READDISK_NO_SPARSE;
    			bsdtar->flags |= OPTFLAG_READ_SPARSE;
    
    • For the option "safe-writes", the following code appears during option parsing and modifies the bsdtar->extract_flags in ./tar/bsdtar.c:683 for version 3.6.2.
    			bsdtar->extract_flags |= ARCHIVE_EXTRACT_SAFE_WRITES;
    
    • For the option "same-owner", the following code appears during option parsing and modifies the bsdtar->extract_flags in ./tar/bsdtar.c:686 for version 3.6.2.
    			bsdtar->extract_flags |= ARCHIVE_EXTRACT_OWNER;
    
    • For the option "strip-components", the following code appears during option parsing and modifies the errno, tptr, t, bsdtar->strip_components in ./tar/bsdtar.c:689-697 for version 3.6.2.
    			errno = 0;
    			tptr = NULL;
    			t = (int)strtol(bsdtar->argument, &tptr, 10);
    			if (errno || t < 0 || *(bsdtar->argument) == '\0' ||
    			    tptr == NULL || *tptr != '\0') {
    				lafe_errc(1, 0, "Invalid argument to "
    				    "--strip-components");
    			}
    			bsdtar->strip_components = t;
    
    • For the option "totals", the following code appears during option parsing and modifies the bsdtar->flags in ./tar/bsdtar.c:707 for version 3.6.2.
    			bsdtar->flags |= OPTFLAG_TOTALS;
    
    • For the option "uid", the following code appears during option parsing and modifies the errno, tptr, t, bsdtar->uid in ./tar/bsdtar.c:717-724 for version 3.6.2.
    			errno = 0;
    			tptr = NULL;
    			t = (int)strtol(bsdtar->argument, &tptr, 10);
    			if (errno || t < 0 || *(bsdtar->argument) == '\0' ||
    			    tptr == NULL || *tptr != '\0') {
    				lafe_errc(1, 0, "Invalid argument to --uid");
    			}
    			bsdtar->uid = t;
    
    • For the option "uname", the following code appears during option parsing and modifies the bsdtar->uname in ./tar/bsdtar.c:727 for version 3.6.2.
    			bsdtar->uname = bsdtar->argument;
    
    • For the option "uuencode", the following code appears during option parsing and modifies the compression2, compression2_name in ./tar/bsdtar.c:730-735 for version 3.6.2.
    			if (compression2 != '\0')
    				lafe_errc(1, 0,
    				    "Can't specify both --uuencode and "
    				    "--b64encode");
    			compression2 = opt;
    			compression2_name = "uuencode";
    
    • For the option "xattrs", the following code appears during option parsing and modifies the bsdtar->extract_flags, bsdtar->readdisk_flags, bsdtar->flags in ./tar/bsdtar.c:765-767 for version 3.6.2.
    			bsdtar->extract_flags |= ARCHIVE_EXTRACT_XATTR;
    			bsdtar->readdisk_flags &= ~ARCHIVE_READDISK_NO_XATTR;
    			bsdtar->flags |= OPTFLAG_XATTRS;
    
    • For the option "use-compress-program", the following code appears during option parsing and modifies the compress_program in ./tar/bsdtar.c:794 for version 3.6.2.
    			compress_program = bsdtar->argument;
    

    But they do not appear in the help document. It may prevent users from using the relevant function.

    opened by ccccmd 0
  • [Help document bug] For bsdcpio,  --help options doesn't list some options

    [Help document bug] For bsdcpio, --help options doesn't list some options

    The help document of bsdcpio misses the option "0", "6", "7", "A", "a", "B", "b64encode", "C", "c", "d", "E", "F", "f", "grzip", "I", "j", "insecure", "L", "l", "m", "n", "no-preserve-owner", "O", "passphrase", "preserve-owner", "O", "passphrase", "preserve-owner", "quiet", "R", "r", "t", "u", "unencode", "Z" for version 3.6.2.

    • For the option "0", the following code appears during option parsing and modifies the cpio->option_null in ./cpio/cpio.c:193 for version 3.6.2.
    			cpio->option_null = 1;
    
    • For the option "6", the following code appears during option parsing and modifies the cpio->option_pwb in ./cpio/cpio.c:196 for version 3.6.2.
    			cpio->option_pwb = 1;
    
    • For the option "7", the following code appears during option parsing and modifies the cpio->format in ./cpio/cpio.c:199 for version 3.6.2.
    			cpio->format = "bin";
    
    • For the option "A", the following code appears during option parsing and modifies the cpio->option_append in ./cpio/cpio.c:202 for version 3.6.2.
    			cpio->option_append = 1;
    
    • For the option "a", the following code appears during option parsing and modifies the cpio->option_atime_restore in ./cpio/cpio.c:205 for version 3.6.2.
    			cpio->option_atime_restore = 1;
    
    • For the option "B", the following code appears during option parsing and modifies the cpio->bytes_per_block in ./cpio/cpio.c:208 for version 3.6.2.
    			cpio->bytes_per_block = 5120;
    
    • For the option "b64encode", the following code appears during option parsing and modifies the cpio->add_filter in ./cpio/cpio.c:211 for version 3.6.2.
    			cpio->add_filter = opt;
    
    • For the option "C", the following code appears during option parsing and modifies the errno, tptr, t, cpio->bytes_per_block in ./cpio/cpio.c:214-222 for version 3.6.2.
    			errno = 0;
    			tptr = NULL;
    			t = (int)strtol(cpio->argument, &tptr, 10);
    			if (errno || t <= 0 || *(cpio->argument) == '\0' ||
    			    tptr == NULL || *tptr != '\0') {
    				lafe_errc(1, 0, "Invalid blocksize: %s",
    				    cpio->argument);
    			}
    			cpio->bytes_per_block = t;
    
    • For the option "c", the following code appears during option parsing and modifies the cpio->format in ./cpio/cpio.c:225 for version 3.6.2.
    			cpio->format = "odc";
    
    • For the option "d", the following code appears during option parsing and modifies the cpio->extract_flags in ./cpio/cpio.c:228 for version 3.6.2.
    			cpio->extract_flags &= ~ARCHIVE_EXTRACT_NO_AUTODIR;
    
    • For the option "E", the following code appears during option parsing and calls the function archive_match_include_pattern_from_file in ./cpio/cpio.c:231-235 for version 3.6.2.
    			if (archive_match_include_pattern_from_file(
    			    cpio->matching, cpio->argument,
    			    cpio->option_null) != ARCHIVE_OK)
    				lafe_errc(1, 0, "Error : %s",
    				    archive_error_string(cpio->matching));
    
    • For the option "F", the following code appears during option parsing and modifies the cpio->filename in ./cpio/cpio.c:238 for version 3.6.2.
    			cpio->filename = cpio->argument;
    
    • For the option "f", the following code appears during option parsing and calls the function archive_match_exclude_pattern in ./cpio/cpio.c:241-244 for version 3.6.2.
    			if (archive_match_exclude_pattern(cpio->matching,
    			    cpio->argument) != ARCHIVE_OK)
    				lafe_errc(1, 0, "Error : %s",
    				    archive_error_string(cpio->matching));
    
    • For the option "grzip", the following code appears during option parsing and modifies the cpio->compress in ./cpio/cpio.c:247 for version 3.6.2.
    			cpio->compress = opt;
    
    • For the option "I", the following code appears during option parsing and modifies the cpio->filename in ./cpio/cpio.c:256 for version 3.6.2.
    			cpio->filename = cpio->argument;
    
    • For the option "j", the following code appears during option parsing and modifies the cpio->compress in ./cpio/cpio.c:268 for version 3.6.2.
    			cpio->compress = opt;
    
    • For the option "insecure", the following code appears during option parsing and modifies the cpio->extract_flags in ./cpio/cpio.c:271-273 for version 3.6.2.
    			cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_SYMLINKS;
    			cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NODOTDOT;
    			cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS;
    
    • For the option "L", the following code appears during option parsing and modifies the cpio->option_follow_links in ./cpio/cpio.c:276 for version 3.6.2.
    			cpio->option_follow_links = 1;
    
    • For the option "l", the following code appears during option parsing and modifies the cpio->option_link in ./cpio/cpio.c:279 for version 3.6.2.
    			cpio->option_link = 1;
    
    • For the option "m", the following code appears during option parsing and modifies the cpio->extract_flags in ./cpio/cpio.c:289 for version 3.6.2.
    			cpio->extract_flags |= ARCHIVE_EXTRACT_TIME;
    
    • For the option "n", the following code appears during option parsing and modifies the cpio->option_numeric_uid_gid in ./cpio/cpio.c:292 for version 3.6.2.
    			cpio->option_numeric_uid_gid = 1;
    
    • For the option "no-preserve-owener", the following code appears during option parsing and modifies the cpio->extract_flags in ./cpio/cpio.c:295 for version 3.6.2.
    			cpio->extract_flags &= ~ARCHIVE_EXTRACT_OWNER;
    
    • For the option "O", the following code appears during option parsing and modifies the cpio->filename in ./cpio/cpio.c:298 for version 3.6.2.
    			cpio->filename = cpio->argument;
    
    • For the option "passphrase", the following code appears during option parsing and modifies the cpio->passphrase in ./cpio/cpio.c:315 for version 3.6.2.
    			cpio->passphrase = cpio->argument;
    
    • For the option "preserve-owner", the following code appears during option parsing and modifies the cpio->extract_flags in ./cpio/cpio.c:318 for version 3.6.2.
    			cpio->extract_flags |= ARCHIVE_EXTRACT_OWNER;
    
    • For the option "quiet", the following code appears during option parsing and modifies the cpio->quiet in ./cpio/cpio.c:321 for version 3.6.2.
    			cpio->quiet = 1;
    
    • For the option "R", the following code appears during option parsing and calls owner_parse and modifies the errmsg, cpio->uid_override, cpio->uname_override, cpio->gid_override, cpio->gname_override in ./cpio/cpio.c:326-338 for version 3.6.2.
    			errmsg = owner_parse(cpio->argument, &uid, &gid);
    			if (errmsg) {
    				lafe_warnc(-1, "%s", errmsg);
    				usage();
    			}
    			if (uid != -1) {
    				cpio->uid_override = uid;
    				cpio->uname_override = NULL;
    			}
    			if (gid != -1) {
    				cpio->gid_override = gid;
    				cpio->gname_override = NULL;
    			}
    
    • For the option "r", the following code appears during option parsing and modifies the cpio->option_rename in ./cpio/cpio.c:341 for version 3.6.2.
    			cpio->option_rename = 1;
    
    • For the option "t", the following code appears during option parsing and modifies the cpio->option_list in ./cpio/cpio.c:344 for version 3.6.2.
    			cpio->option_list = 1;
    
    • For the option "u", the following code appears during option parsing and modifies the cpio->extract_flags in ./cpio/cpio.c:347-348 for version 3.6.2.
    			cpio->extract_flags
    			    &= ~ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER;
    
    • For the option "unencode", the following code appears during option parsing and modifies the cpio->add_filter in ./cpio/cpio.c:351 for version 3.6.2.
    			cpio->add_filter = opt;
    
    • For the option "Z", the following code appears during option parsing and modifies the cpio->compress in ./cpio/cpio.c:377 for version 3.6.2.
    			cpio->compress = opt;
    

    But they do not appear in the help document. It may prevent users from using the relevant function.

    opened by ccccmd 0
  • replace time64 functions with normal ones

    replace time64 functions with normal ones

    Otherwise there are 32/64-bit pointer conversions going on. In Windows since MSVC2005, time_t has been 64-bit. MinGW needs a hack to get 64-bit time_t.

    Signed-off-by: Rosen Penev [email protected]

    opened by neheb 4
Releases(v3.6.2)
Brotli compression format

SECURITY NOTE Please consider updating brotli to version 1.0.9 (latest). Version 1.0.9 contains a fix to "integer overflow" problem. This happens when

Google 11.8k Jan 5, 2023
Compression abstraction library and utilities

Squash - Compresion Abstraction Library

null 375 Dec 22, 2022
Superfast compression library

DENSITY Superfast compression library DENSITY is a free C99, open-source, BSD licensed compression library. It is focused on high-speed compression, a

Centaurean 984 Dec 17, 2022
data compression library for embedded/real-time systems

heatshrink A data compression/decompression library for embedded/real-time systems. Key Features: Low memory usage (as low as 50 bytes) It is useful f

Atomic Object 1.1k Jan 7, 2023
Small strings compression library

SMAZ - compression for very small strings ----------------------------------------- Smaz is a simple compression library suitable for compressing ver

Salvatore Sanfilippo 1k Dec 28, 2022
Heavily optimized zlib compression algorithm

Optimized version of longest_match for zlib Summary Fast zlib longest_match function. Produces slightly smaller compressed files for significantly fas

Konstantin Nosov 124 Dec 12, 2022
Fastest Integer Compression

TurboPFor: Fastest Integer Compression TurboPFor: The new synonym for "integer compression" ?? (2019.11) ALL functions now available for 64 bits ARMv8

powturbo 647 Dec 26, 2022
is a c++20 compile and runtime Struct Reflections header only library.

is a c++20 compile and runtime Struct Reflections header only library. It allows you to iterate over aggregate type's member variables.

RedSkittleFox 4 Apr 18, 2022
A simple C library for compressing lists of integers using binary packing

The SIMDComp library A simple C library for compressing lists of integers using binary packing and SIMD instructions. The assumption is either that yo

Daniel Lemire 409 Dec 22, 2022
A portable, simple zip library written in C

A portable (OSX/Linux/Windows), simple zip library written in C This is done by hacking awesome miniz library and layering functions on top of the min

Kuba Podgórski 1.1k Dec 29, 2022
Compile and execute C "scripts" in one go!

c "There isn't much that's special about C. That's one of the reasons why it's fast." I love C for its raw speed (although it does have its drawbacks)

Ryan Jacobs 2k Dec 30, 2022
distributed builds for C, C++ and Objective C

distcc -- a free distributed C/C++ compiler system by Martin Pool Current Documents: https://distcc.github.io/ Formally http://distcc.org/ "pump" func

distcc 1.8k Dec 27, 2022
Roaring bitmaps in C (and C++)

CRoaring Portable Roaring bitmaps in C (and C++) with full support for your favorite compiler (GNU GCC, LLVM's clang, Visual Studio). Included in the

Roaring bitmaps: A better compressed bitset 1.1k Jan 9, 2023
New generation entropy codecs : Finite State Entropy and Huff0

New Generation Entropy coders This library proposes two high speed entropy coders : Huff0, a Huffman codec designed for modern CPU, featuring OoO (Out

Yann Collet 1.1k Dec 26, 2022
Easing the task of comparing code generated by cc65, vbcc, and 6502-gcc

6502 C compilers benchmark Easing the way to compare code generated by cc65, 6502-gcc, vbcc, and KickC. This repository contains scripts to: Compile t

Sylvain Gadrat 17 Sep 4, 2022
Secure ECC-based DID intersection in Go, Java and C.

SecureUnionID Secure ECC-based DID intersection. ABSTRACT This project is used to protect device ID using Elliptic Curve Cryptography algorithm. The d

Volcengine 20 Dec 27, 2022
nanoc is a tiny subset of C and a tiny compiler that targets 32-bit x86 machines.

nanoc is a tiny subset of C and a tiny compiler that targets 32-bit x86 machines. Tiny? The only types are: int (32-bit signed integer) char (8-

Ajay Tatachar 19 Nov 28, 2022
Smaller C is a simple and small single-pass C compiler

Smaller C is a simple and small single-pass C compiler, currently supporting most of the C language common between C89/ANSI C and C99 (minus some C89 and plus some C99 features).

Alexey Frunze 1.2k Jan 7, 2023
Microvm is a virtual machine and compiler

The aim of this project is to create a stack based language and virtual machine for microcontrollers. A mix of approaches is used. Separate memory is used for program and variable space (Harvard architecture). An interpreter, virtual machine and compiler are available. A demostration of the interpreter in action is presented below.

null 10 Aug 14, 2022