head 1.11; access; symbols libarchive-3-8-11:1.1.1.9 libarchive-3-8-10:1.1.1.9 pkgsrc-2026Q3:1.10.0.2 pkgsrc-2026Q3-base:1.10 libarchive-3-8-9:1.1.1.8 libarchive-3-8-8:1.1.1.8 pkgsrc-2026Q2:1.9.0.10 pkgsrc-2026Q2-base:1.9 libarchive-3-8-7:1.1.1.7 libarchive-3-8-6:1.1.1.7 pkgsrc-2026Q1:1.9.0.8 pkgsrc-2026Q1-base:1.9 libarchive-3-8-5:1.1.1.7 libarchive-3-8-4:1.1.1.7 pkgsrc-2025Q4:1.9.0.6 pkgsrc-2025Q4-base:1.9 libarchive-3-8-3:1.1.1.7 libarchive-3-8-2:1.1.1.7 pkgsrc-2025Q3:1.9.0.4 pkgsrc-2025Q3-base:1.9 libarchive-3-8-1:1.1.1.7 pkgsrc-2025Q2:1.9.0.2 pkgsrc-2025Q2-base:1.9 libarchive-3-8-0:1.1.1.7 libarchive-3-7-9:1.1.1.6 pkgsrc-2025Q1:1.8.0.10 pkgsrc-2025Q1-base:1.8 pkgsrc-2024Q4:1.8.0.8 pkgsrc-2024Q4-base:1.8 libarchive-3-7-7:1.1.1.6 pkgsrc-2024Q3:1.8.0.6 pkgsrc-2024Q3-base:1.8 libarchive-3-7-5:1.1.1.6 pkgsrc-2024Q2:1.8.0.4 pkgsrc-2024Q2-base:1.8 libarchive-3-7-4:1.1.1.6 libarchive-3-7-3:1.1.1.6 pkgsrc-2024Q1:1.8.0.2 pkgsrc-2024Q1-base:1.8 libarchive-3-7-2:1.1.1.6 pkgsrc-2023Q4:1.7.0.30 pkgsrc-2023Q4-base:1.7 pkgsrc-2023Q3:1.7.0.28 pkgsrc-2023Q3-base:1.7 pkgsrc-2023Q2:1.7.0.26 pkgsrc-2023Q2-base:1.7 pkgsrc-2023Q1:1.7.0.24 pkgsrc-2023Q1-base:1.7 pkgsrc-2022Q4:1.7.0.22 pkgsrc-2022Q4-base:1.7 pkgsrc-2022Q3:1.7.0.20 pkgsrc-2022Q3-base:1.7 pkgsrc-2022Q2:1.7.0.18 pkgsrc-2022Q2-base:1.7 pkgsrc-2022Q1:1.7.0.16 pkgsrc-2022Q1-base:1.7 pkgsrc-2021Q4:1.7.0.14 pkgsrc-2021Q4-base:1.7 pkgsrc-2021Q3:1.7.0.12 pkgsrc-2021Q3-base:1.7 pkgsrc-2021Q2:1.7.0.10 pkgsrc-2021Q2-base:1.7 pkgsrc-2021Q1:1.7.0.8 pkgsrc-2021Q1-base:1.7 pkgsrc-2020Q4:1.7.0.6 pkgsrc-2020Q4-base:1.7 pkgsrc-2020Q3:1.7.0.4 pkgsrc-2020Q3-base:1.7 pkgsrc-2020Q2:1.7.0.2 pkgsrc-2020Q2-base:1.7 pkgsrc-2020Q1:1.6.0.4 pkgsrc-2020Q1-base:1.6 pkgsrc-2019Q4:1.6.0.6 pkgsrc-2019Q4-base:1.6 pkgsrc-2019Q3:1.6.0.2 pkgsrc-2019Q3-base:1.6 libarchive-3-4-0:1.1.1.5 libarchive-3-3-3:1.1.1.4 pkgsrc-2019Q2:1.5.0.18 pkgsrc-2019Q2-base:1.5 pkgsrc-2019Q1:1.5.0.16 pkgsrc-2019Q1-base:1.5 pkgsrc-2018Q4:1.5.0.14 pkgsrc-2018Q4-base:1.5 pkgsrc-2018Q3:1.5.0.12 pkgsrc-2018Q3-base:1.5 pkgsrc-2018Q2:1.5.0.10 pkgsrc-2018Q2-base:1.5 pkgsrc-2018Q1:1.5.0.8 pkgsrc-2018Q1-base:1.5 pkgsrc-2017Q4:1.5.0.6 pkgsrc-2017Q4-base:1.5 pkgsrc-2017Q3:1.5.0.4 pkgsrc-2017Q3-base:1.5 libarchive-3-3-2:1.1.1.4 pkgsrc-2017Q2:1.4.0.4 pkgsrc-2017Q2-base:1.4 pkgsrc-2017Q1:1.4.0.2 pkgsrc-2017Q1-base:1.4 libarchive-3-3-1:1.1.1.3 pkgsrc-2016Q4:1.3.0.6 pkgsrc-2016Q4-base:1.3 pkgsrc-2016Q3:1.3.0.4 pkgsrc-2016Q3-base:1.3 pkgsrc-2016Q2:1.3.0.2 pkgsrc-2016Q2-base:1.3 libarchive-3-2-1:1.1.1.2 pkgsrc-2016Q1:1.2.0.10 pkgsrc-2016Q1-base:1.2 pkgsrc-2015Q4:1.2.0.8 pkgsrc-2015Q4-base:1.2 pkgsrc-2015Q3:1.2.0.6 pkgsrc-2015Q3-base:1.2 pkgsrc-2015Q2:1.2.0.4 pkgsrc-2015Q2-base:1.2 pkgsrc-2015Q1:1.2.0.2 pkgsrc-2015Q1-base:1.2 pkgsrc-2014Q4:1.1.1.1.0.40 pkgsrc-2014Q4-base:1.1.1.1 pkgsrc-2014Q3:1.1.1.1.0.38 pkgsrc-2014Q3-base:1.1.1.1 pkgsrc-2014Q2:1.1.1.1.0.36 pkgsrc-2014Q2-base:1.1.1.1 pkgsrc-2014Q1:1.1.1.1.0.34 pkgsrc-2014Q1-base:1.1.1.1 pkgsrc-2013Q4:1.1.1.1.0.32 pkgsrc-2013Q4-base:1.1.1.1 pkgsrc-2013Q3:1.1.1.1.0.30 pkgsrc-2013Q3-base:1.1.1.1 pkgsrc-2013Q2:1.1.1.1.0.28 pkgsrc-2013Q2-base:1.1.1.1 pkgsrc-2013Q1:1.1.1.1.0.26 pkgsrc-2013Q1-base:1.1.1.1 pkgsrc-2012Q4:1.1.1.1.0.24 pkgsrc-2012Q4-base:1.1.1.1 pkgsrc-2012Q3:1.1.1.1.0.22 pkgsrc-2012Q3-base:1.1.1.1 pkgsrc-2012Q2:1.1.1.1.0.20 pkgsrc-2012Q2-base:1.1.1.1 pkgsrc-2012Q1:1.1.1.1.0.18 pkgsrc-2012Q1-base:1.1.1.1 pkgsrc-2011Q4:1.1.1.1.0.16 pkgsrc-2011Q4-base:1.1.1.1 pkgsrc-2011Q3:1.1.1.1.0.14 pkgsrc-2011Q3-base:1.1.1.1 pkgsrc-2011Q2:1.1.1.1.0.12 pkgsrc-2011Q2-base:1.1.1.1 pkgsrc-2011Q1:1.1.1.1.0.10 pkgsrc-2011Q1-base:1.1.1.1 pkgsrc-2010Q4:1.1.1.1.0.8 pkgsrc-2010Q4-base:1.1.1.1 pkgsrc-2010Q3:1.1.1.1.0.6 pkgsrc-2010Q3-base:1.1.1.1 libarchive-2-8-4:1.1.1.1 pkgsrc-2010Q2:1.1.1.1.0.4 pkgsrc-2010Q2-base:1.1.1.1 pkgsrc-2010Q1:1.1.1.1.0.2 pkgsrc-2010Q1-base:1.1.1.1 libarchive-2-8-3:1.1.1.1 libarchive-2-8-2:1.1.1.1 libarchive-2-8-0:1.1.1.1 KIENTZLE:1.1.1; locks; strict; comment @# @; 1.11 date 2026.10.19.12.05.18; author adam; state Exp; branches; next 1.10; commitid R3KJfVxz3NuPb50H; 1.10 date 2026.06.24.06.29.53; author adam; state Exp; branches; next 1.9; commitid keXVOnvWIwV061LG; 1.9 date 2025.05.21.15.25.50; author adam; state Exp; branches; next 1.8; commitid 6aTN21WjRYk8TMVF; 1.8 date 2024.01.18.18.00.17; author adam; state Exp; branches; next 1.7; commitid hNXpsHx3SuHqsXUE; 1.7 date 2020.05.26.09.16.41; author nia; state Exp; branches; next 1.6; commitid nNhsdZACz3PjmJ9C; 1.6 date 2019.09.22.09.55.08; author joerg; state Exp; branches; next 1.5; commitid FdPvRjF4OzwBwZDB; 1.5 date 2017.08.01.22.26.23; author joerg; state Exp; branches; next 1.4; commitid 32clTfkmVE8bPy1A; 1.4 date 2017.02.25.21.11.19; author joerg; state Exp; branches; next 1.3; commitid rW8QfCWrsCO1snHz; 1.3 date 2016.06.20.17.24.57; author joerg; state Exp; branches; next 1.2; commitid ArUvympBjfBseebz; 1.2 date 2015.01.17.12.44.49; author adam; state Exp; branches; next 1.1; commitid yy7e1hLrfmA2pn6y; 1.1 date 2010.02.20.03.49.48; author joerg; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2010.02.20.03.49.48; author joerg; state Exp; branches; next 1.1.1.2; 1.1.1.2 date 2016.06.20.17.12.06; author joerg; state Exp; branches; next 1.1.1.3; commitid rRgm3BqbmbI8aebz; 1.1.1.3 date 2017.02.25.20.54.21; author joerg; state Exp; branches; next 1.1.1.4; commitid ReqPI0ibLYjdmnHz; 1.1.1.4 date 2017.08.01.22.21.12; author joerg; state Exp; branches; next 1.1.1.5; commitid XQwPAFJku336Ny1A; 1.1.1.5 date 2019.09.22.09.51.33; author joerg; state Exp; branches; next 1.1.1.6; commitid 5kDbfPbiV3INvZDB; 1.1.1.6 date 2024.01.18.17.37.45; author adam; state Exp; branches; next 1.1.1.7; commitid zDULEPUODGjTkXUE; 1.1.1.7 date 2025.05.21.15.11.28; author adam; state Exp; branches; next 1.1.1.8; commitid Nzqt2UgtvkVXNMVF; 1.1.1.8 date 2026.06.24.05.39.01; author adam; state Exp; branches; next 1.1.1.9; commitid zmhI9f4umm2AO0LG; 1.1.1.9 date 2026.10.19.11.50.39; author adam; state Exp; branches; next ; commitid eS0MvMrTxXQX650H; desc @@ 1.11 log @libarchive: updated to 3.8.10 3.8.10 New features: 7z: add Delta, RISCV, ARMTHUMB and IA64 filters for non-lzma archives libarchive: support digest with nettle 4 and mbedtls 3 tar: add --mode option Security and Bug Fixes see ChangeLog @ text @LIBARCHIVE-FORMATS(5) manual page == NAME == '''libarchive-formats''' - archive formats supported by the libarchive library == DESCRIPTION == The [[ManPageLibarchive3]] library reads and writes a variety of streaming archive formats. Generally speaking, all of these archive formats consist of a series of "entries". Each entry stores a single file system object, such as a file, directory, or symbolic link. The following provides a brief description of each format supported by libarchive, with some information about recognized extensions or limitations of the current library support. Note that just because a format is supported by libarchive does not imply that a program that uses libarchive will support that format. Applications that use libarchive specify which formats they wish to support, though many programs do use libarchive convenience functions to enable all supported formats. === Tar Formats=== The [[ManPageLibarchive3]] library can read most tar archives. It can write POSIX-standard "ustar" and "pax interchange" formats as well as v7 tar format and a subset of the legacy GNU tar format. All tar formats store each entry in one or more 512-byte records. The first record is used for file metadata, including filename, timestamp, and mode information, and the file data is stored in subsequent records. Later variants have extended this by either appropriating undefined areas of the header record, extending the header to multiple records, or by storing special entries that modify the interpretation of subsequent entries.
'''gnutar'''
The [[ManPageLibarchive3]] library can read most GNU-format tar archives. It currently supports the most popular GNU extensions, including modern long filename and linkname support, as well as atime and ctime data. The libarchive library does not support multi-volume archives, nor the old GNU long filename format. It can read GNU sparse file entries, including the new POSIX-based formats. The [[ManPageLibarchive3]] library can write GNU tar format, including long filename and linkname support, as well as atime and ctime data.
'''pax'''
The [[ManPageLibarchive3]] library can read and write POSIX-compliant pax interchange format archives. Pax interchange format archives are an extension of the older ustar format that adds a separate entry with additional attributes stored as key/value pairs immediately before each regular entry. The presence of these additional entries is the only difference between pax interchange format and the older ustar format. The extended attributes are of unlimited length and are stored as UTF-8 Unicode strings. Keywords defined in the standard are in all lowercase; vendors are allowed to define custom keys by preceding them with the vendor name in all uppercase. When writing pax archives, libarchive uses many of the SCHILY keys defined by Joerg Schilling's "star" archiver and a few LIBARCHIVE keys. The libarchive library can read most of the SCHILY keys and most of the GNU keys introduced by GNU tar. It silently ignores any keywords that it does not understand. The pax interchange format converts filenames to Unicode and stores them using the UTF-8 encoding. Prior to libarchive 3.0, libarchive erroneously assumed that the system wide-character routines natively supported Unicode. This caused it to mis-handle non-ASCII filenames on systems that did not satisfy this assumption.
'''restricted''' pax
The libarchive library can also write pax archives in which it attempts to suppress the extended attributes entry whenever possible. The result will be identical to a ustar archive unless the extended attributes entry is required to store a long file name, long linkname, extended ACL, file flags, or if any of the standard ustar data (user name, group name, UID, GID, etc) cannot be fully represented in the ustar header. In all cases, the result can be dearchived by any program that can read POSIX-compliant pax interchange format archives. Programs that correctly read ustar format (see below) will also be able to read this format; any extended attributes will be extracted as separate files stored in ''PaxHeader'' directories.
'''ustar'''
The libarchive library can both read and write this format. This format has the following limitations: Note that the pax interchange format has none of these restrictions. The ustar format is old and widely supported. It is recommended when compatibility is the primary concern.
'''v7'''
The libarchive library can read and write the legacy v7 tar format. This format has the following limitations: Generally, users should prefer the ustar format for portability as the v7 tar format is both less useful and less portable.
The libarchive library also reads a variety of commonly-used extensions to the basic tar format. These extensions are recognized automatically whenever they appear.
Numeric extensions.
The POSIX standards require fixed-length numeric fields to be written with some character position reserved for terminators. Libarchive allows these fields to be written without terminator characters. This extends the allowable range; in particular, ustar archives with this extension can support entries up to 64 gigabytes in size. Libarchive also recognizes base-256 values in most numeric fields. This essentially removes all limitations on file size, modification time, and device numbers.
Solaris extensions
Libarchive recognizes ACL and extended attribute records written by Solaris tar.
The first tar program appeared in Seventh Edition Unix in 1979. The first official standard for the tar file format was the "ustar" (Unix Standard Tar) format defined by POSIX in 1988. POSIX.1-2001 extended the ustar format to create the "pax interchange" format. === Cpio Formats=== The libarchive library can read and write a number of common cpio variants. A cpio archive stores each entry as a fixed-size header followed by a variable-length filename and variable-length data. Unlike the tar format, the cpio format does only minimal padding of the header or file data. There are several cpio variants, which differ primarily in how they store the initial header: some store the values as octal or hexadecimal numbers in ASCII, others as binary values of varying byte order and length.
'''binary'''
The libarchive library transparently reads both big-endian and little-endian variants of the two binary cpio formats; the original one from PWB/UNIX, and the later, more widely used, variant. This format used 32-bit binary values for file size and mtime, and 16-bit binary values for the other fields. The formats support only the file types present in UNIX at the time of their creation. File sizes are limited to 24 bits in the PWB format, because of the limits of the file system, and to 31 bits in the newer binary format, where signed 32 bit longs were used.
'''odc'''
This is the POSIX standardized format, which is officially known as the "cpio interchange format" or the "octet-oriented cpio archive format" and sometimes unofficially referred to as the "old character format". This format stores the header contents as octal values in ASCII. It is standard, portable, and immune from byte-order confusion. File sizes and mtime are limited to 33 bits (8GB file size), other fields are limited to 18 bits.
'''SVR4/newc'''
The libarchive library can read both CRC and non-CRC variants of this format. The SVR4 format uses eight-digit hexadecimal values for all header fields. This limits file size to 4GB, and also limits the mtime and other fields to 32 bits. The SVR4 format can optionally include a CRC of the file contents, although libarchive does not currently verify this CRC.
Cpio first appeared in PWB/UNIX 1.0, which was released within AT&T in 1977. PWB/UNIX 1.0 formed the basis of System III Unix, released outside of AT&T in 1981. This makes cpio older than tar, although cpio was not included in Version 7 AT&T Unix. As a result, the tar command became much better known in universities and research groups that used Version 7. The combination of the '''find''' and '''cpio''' utilities provided very precise control over file selection. Unfortunately, the format has many limitations that make it unsuitable for widespread use. Only the POSIX format permits files over 4GB, and its 18-bit limit for most other fields makes it unsuitable for modern systems. In addition, cpio formats only store numeric UID/GID values (not usernames and group names), which can make it very difficult to correctly transfer archives across systems with dissimilar user numbering. === Shar Formats=== A "shell archive" is a shell script that, when executed on a POSIX-compliant system, will recreate a collection of file system objects. The libarchive library can write two different kinds of shar archives:
'''shar'''
The traditional shar format uses a limited set of POSIX commands, including [[echo(1)|http://www.freebsd.org/cgi/man.cgi?query=echo&sektion=1]], [[mkdir(1)|http://www.freebsd.org/cgi/man.cgi?query=mkdir&sektion=1]], and [[sed(1)|http://www.freebsd.org/cgi/man.cgi?query=sed&sektion=1]]. It is suitable for portably archiving small collections of plain text files. However, it is not generally well-suited for large archives (many implementations of [[sh(1)|http://www.freebsd.org/cgi/man.cgi?query=sh&sektion=1]] have limits on the size of a script) nor should it be used with non-text files.
'''shardump'''
This format is similar to shar but encodes files using [[uuencode(1)|http://www.freebsd.org/cgi/man.cgi?query=uuencode&sektion=1]] so that the result will be a plain text file regardless of the file contents. It also includes additional shell commands that attempt to reproduce as many file attributes as possible, including owner, mode, and flags. The additional commands used to restore file attributes make shardump archives less portable than plain shar archives.
=== ISO9660 format=== Libarchive can read and extract from files containing ISO9660-compliant CDROM images. In many cases, this can remove the need to burn a physical CDROM just in order to read the files contained in an ISO9660 image. It also avoids security and complexity issues that come with virtual mounts and loopback devices. Libarchive supports the most common Rockridge extensions and has partial support for Joliet extensions. If both extensions are present, the Joliet extensions will be used and the Rockridge extensions will be ignored. In particular, this can create problems with hardlinks and symlinks, which are supported by Rockridge but not by Joliet. Libarchive reads ISO9660 images using a streaming strategy. This allows it to read compressed images directly (decompressing on the fly) and allows it to read images directly from network sockets, pipes, and other non-seekable data sources. This strategy works well for optimized ISO9660 images created by many popular programs. Such programs collect all directory information at the beginning of the ISO9660 image so it can be read from a physical disk with a minimum of seeking. However, not all ISO9660 images can be read in this fashion. Libarchive can also write ISO9660 images. Such images are fully optimized with the directory information preceding all file data. This is done by storing all file data to a temporary file while collecting directory information in memory. When the image is finished, libarchive writes out the directory structure followed by the file data. The location used for the temporary file can be changed by the usual environment variables. === Zip format=== Libarchive can read and write zip format archives that have uncompressed entries and entries compressed with the "deflate" , "LZMA" , "XZ" , "BZIP2" and "ZSTD" algorithms. Libarchive can also read, but not write, zip format archives that have entries compressed with the "PPMd" algorithm. Other zip compression algorithms are not supported. The extensions supported by libarchive are Zip64, Libarchive's extensions to better support streaming, PKZIP's traditional ZIP encryption, Info-ZIP's Unix extra fields, extra time, and Unicode path, as well as WinZIP's AES encryption. It can extract jar archives, __MACOSX resource forks extension for OS X, and self-extracting zip archives. Libarchive can use either of two different strategies for reading Zip archives: a streaming strategy which is fast and can handle extremely large archives, and a seeking strategy which can correctly process self-extracting Zip archives and archives with deleted members or other in-place modifications. The streaming reader processes Zip archives as they are read. It can read archives of arbitrary size from tape or network sockets, and can decode Zip archives that have been separately compressed or encoded. However, self-extracting Zip archives and archives with certain types of modifications cannot be correctly handled. Such archives require that the reader first process the Central Directory, which is ordinarily located at the end of a Zip archive and is thus inaccessible to the streaming reader. If the program using libarchive has enabled seek support, then libarchive will use this to process the central directory first. In particular, the seeking reader must be used to correctly handle self-extracting archives. Such archives consist of a program followed by a regular Zip archive. The streaming reader cannot parse the initial program portion, but the seeking reader starts by reading the Central Directory from the end of the archive. Similarly, Zip archives that have been modified in-place can have deleted entries or other garbage data that can only be accurately detected by first reading the Central Directory. === Archive (library) file format=== The Unix archive format (commonly created by the [[ar(1)|http://www.freebsd.org/cgi/man.cgi?query=ar&sektion=1]] archiver) is a general-purpose format which is used almost exclusively for object files to be read by the link editor [[ld(1)|http://www.freebsd.org/cgi/man.cgi?query=ld&sektion=1]]. The ar format has never been standardised. There are two common variants: the GNU format derived from SVR4, and the BSD format, which first appeared in 4.4BSD. The two differ primarily in their handling of filenames longer than 15 characters: the GNU/SVR4 variant writes a filename table at the beginning of the archive; the BSD format stores each long filename in an extension area adjacent to the entry. Libarchive can read both extensions, including archives that may include both types of long filenames. Programs using libarchive can write GNU/SVR4 format if they provide an entry called ''//'' containing a filename table to be written into the archive before any of the entries. Any entries whose names are not in the filename table will be written using BSD-style long filenames. This can cause problems for programs such as GNU ld that do not support the BSD-style long filenames. === mtree=== Libarchive can read and write files in [[ManPageMtree5]] format. This format is not a true archive format, but rather a textual description of a file hierarchy in which each line specifies the name of a file and provides specific metadata about that file. Libarchive can read all of the keywords supported by both the NetBSD and FreeBSD versions of [[mtree(8)|http://www.freebsd.org/cgi/man.cgi?query=mtree&sektion=8]], although many of the keywords cannot currently be stored in an '''archive_entry''' object. When writing, libarchive supports use of the [[ManPageArchiveWriteSetOptions3]] interface to specify which keywords should be included in the output. If libarchive was compiled with access to suitable cryptographic libraries (such as the OpenSSL libraries), it can compute hash entries such as '''sha512''' or '''md5''' from file data being written to the mtree writer. When reading an mtree file, libarchive will locate the corresponding files on disk using the '''contents''' keyword if present or the regular filename. If it can locate and open the file on disk, it will use that to fill in any metadata that is missing from the mtree file and will read the file contents and return those to the program using libarchive. If it cannot locate and open the file on disk, libarchive will return an error for any attempt to read the entry body. === 7-Zip=== Libarchive can read and write 7-Zip format archives. TODO: Need more information === CAB=== Libarchive can read Microsoft Cabinet ( "CAB )" format archives. TODO: Need more information. === LHA=== TODO: Information about libarchive's LHA support === RAR=== Libarchive has limited support for reading RAR format archives. Currently, libarchive can read RARv3 format archives which have been either created uncompressed, or compressed using any of the compression methods supported by the RARv3 format. Libarchive can also read self-extracting RAR archives. === Warc=== Libarchive can read and write "web archives". TODO: Need more information === XAR=== Libarchive can read and write the XAR format used by many Apple tools. TODO: Need more information == SEE ALSO == [[ar(1)|http://www.freebsd.org/cgi/man.cgi?query=ar&sektion=1]], [[ManPageBsdcpio1]], [[mkisofs(1)|http://www.freebsd.org/cgi/man.cgi?query=mkisofs&sektion=1]], [[shar(1)|http://www.freebsd.org/cgi/man.cgi?query=shar&sektion=1]], [[ManPageBsdtar1]], [[zip(1)|http://www.freebsd.org/cgi/man.cgi?query=zip&sektion=1]], [[zlib(3)|http://www.freebsd.org/cgi/man.cgi?query=zlib&sektion=3]], [[ManPageCpio5]], [[ManPageMtree5]], [[ManPageTar5]] @ 1.10 log @libarchive: updated to 3.8.8 Libarchive 3.8.8 is a security, bugfix and minor feature release. New features: add support for reading encrypted zipx formats (bzip2, lzma, ppmd, xz, zstd) Fix overview: https://github.com/libarchive/libarchive/releases/tag/v3.8.8 @ text @d343 1 a343 1 libarchive will use this to processes the central directory first. @ 1.9 log @libarchive bsdtar: updated to 3.8.0 Libarchive 3.8.0 is a feature and bugfix release. New features: bsdtar: support --mtime and --clamp-mtime lib: mbedtls 3.x compatibility 7-zip reader: improve self-extracting archive detection xar: xmllite support for the XAR reader and writer zip writer: added XZ, LZMA, ZSTD and BZIP2 support zip writer: added LZMA + RISCV BCJ filter Notable security fixes: rar: do not skip past EOF while reading rar: fix double free with over 4 billion nodes rar: fix heap-buffer-overflow warc: prevent signed integer overflow tar: fix overflow in build_ustar_entry Notable bugfixes: bsdtar: don't hardlink negative inode files together gz: allow setting the original filename for gzip compressed files lib: improve lseek handling lib: support @@-prefixed Unix epoch timestamps as date strings rar: support large headers on 32 bit systems tar reader: Improve LFS support on 32 bit systems @ text @d187 1 a187 1 little-endian variants of the the two binary cpio formats; the @ 1.8 log @libarchive: updated to 3.7.2 Libarchive 3.7.2 is a security, bugfix and feature release. Security fixes: Multiple vulnerabilities have been fixed in the PAX writer (1b4e0d0) Important bugfixes: bsdunzip(1) now correctly handles arguments following an -x after the zipfile New features: bsdunzip(1) now supports the "--version" flag 7-zip reader now translates Windows permissions into UNIX permissions uudecode filter in raw mode now supports file name and file mode zstd filter now supports the "long" write option Libarchive 3.7.1 is a security, feature and bugfix release. Security fixes: SEGV and stack buffer overflow in verbose mode of cpio Feature updates: bsdunzip updated to match latest upstream code Important bugfixes: miscellaneous functional bugfixes build fixes on multiple platforms Libarchive 3.7.0 is a feature and bugfix release. New features: bsdunzip: new tool ported from FreeBSD drop-in replacement for Info-ZIP unzip, not yet ported for Windows 7zip reader: support for Zstandard compression 7zip reader: support for ARM64 filter zstd filter: support for multi-frame zstd archives Other notable bugfixes and improvements: pax: fix year 2038 problem on platforms with 64-bit time_t Windows: Universal Windows Platform (UWP) fixes and improvements Windows: bcrypt usage fixes and improvements Windows: time function usage fixes and improvements @ text @d304 12 d318 6 a323 2 It can extract jar archives, archives that use Zip64 extensions and self-extracting zip archives. @ 1.7 log @libarchive: Update to 3.4.3 Libarchive 3.4.3 is a feature and bugfix release. New features: support for pzstd compressed files (#1357) support for RHT.security.selinux tar extended attribute (#1348) Important bugfixes: various zstd fixes and improvements (#1342 #1352 #1359) child process handling fixes (#1372) Libarchive 3.4.2 is a feature and security release. New features: support for atomic file extraction (bsdtar -x --safe-writes) (#1289) support for mbed TLS (PolarSSL) (#1301) Important bugfixes: security fixes in RAR5 reader (#1280 #1326) compression buffer fix in XAR writer (#1317) fix uname and gname longer than 32 characters in PAX writer (#1319) fix segfault when archiving hard links in ISO9660 and XAR writers (#1325) fix support for extracting 7z archive entries with Delta filter (#987) Libarchive 3.4.1 is a feature and security release. New features: Unicode filename support for reading lha/lzh archives New pax write option "xattrhdr" Important bugfixes: security fixes in wide string processing (#1276 #1298) security fixes in RAR5 reader (#1212 #1217 #1296) security fixes and optimizations to write filter logic (#351) security fix related to use of readlink(2) (1dae5a5) sparse file handling fixes (#1218 #1260) Thanks to all contributors and bug reporters. Special thanks to Christos Zoulas (@@zoulasc) from NetBSD for the atomic file extraction feature. @ text @d7 1 a7 1 [[ManPageibarchive3]] d24 1 a24 1 [[ManPageibarchive3]] d43 1 a43 1 [[ManPageibarchive3]] d53 1 a53 1 [[ManPageibarchive3]] d58 1 a58 1 [[ManPageibarchive3]] d176 8 a183 13 The libarchive library can read a number of common cpio variants and can write "odc" and "newc" format archives. A cpio archive stores each entry as a fixed-size header followed by a variable-length filename and variable-length data. Unlike the tar format, the cpio format does only minimal padding of the header or file data. There are several cpio variants, which differ primarily in how they store the initial header: some store the values as octal or hexadecimal numbers in ASCII, others as binary values of varying byte order and length. d186 9 a194 4 The libarchive library transparently reads both big-endian and little-endian variants of the original binary cpio format. This format used 32-bit binary values for file size and mtime, and 16-bit binary values for the other fields. d196 1 a196 2 The libarchive library can both read and write this POSIX-standard format, which is officially known as the d381 1 a381 1 [[ManPagerchiveriteetptions3]] @ 1.6 log @Update for libarchive-3.4.0: - improvements for Android APK and JAR archives - better support for non-recursive list and extract - tar --exclude-vcs support - fixes for file attributes and flags handling - zipx support - rar 5.0 reader @ text @d7 1 a7 1 [[ManPageLibarchive3]] d24 1 a24 1 [[ManPageLibarchive3]] d43 1 a43 1 [[ManPageLibarchive3]] d53 1 a53 1 [[ManPageLibarchive3]] d58 1 a58 1 [[ManPageLibarchive3]] d382 1 a382 1 [[ManPageArchiveWriteSetOptions3]] @ 1.5 log @Merge for libarchive-3.3.2. @ text @d7 1 a7 1 [[ManPageibarchive3]] d24 1 a24 1 [[ManPageibarchive3]] d43 1 a43 1 [[ManPageibarchive3]] d53 1 a53 1 [[ManPageibarchive3]] d58 1 a58 1 [[ManPageibarchive3]] d382 1 a382 1 [[ManPagerchiveriteetptions3]] @ 1.4 log @Merge libarchive-3.3.1. @ text @d7 1 a7 1 [[ManPageLibarchive3]] d24 1 a24 1 [[ManPageLibarchive3]] d43 1 a43 1 [[ManPageLibarchive3]] d53 1 a53 1 [[ManPageLibarchive3]] d58 1 a58 1 [[ManPageLibarchive3]] d382 1 a382 1 [[ManPageArchiveWriteSetOptions3]] @ 1.3 log @Update for libarchive 3.2.1. @ text @d7 1 a7 1 [[ManPageibarchive3]] d24 1 a24 1 [[ManPageibarchive3]] d43 1 a43 1 [[ManPageibarchive3]] d53 1 a53 1 [[ManPageibarchive3]] d58 1 a58 1 [[ManPageibarchive3]] a165 2 Currently, libarchive only has support for old-style ACLs; the newer NFSv4 ACLs are recognized but discarded. d382 1 a382 1 [[ManPagerchiveriteetptions3]] @ 1.2 log @Changes 3.1.2: This is a maintenance update to fix issues with the new RAR seeking feature. This new release also contains fixes for build failures when building libarchive using Visual Studio 2012 and MinGW. @ text @d7 1 a7 1 '''libarchive'''(3) d24 1 a24 1 '''libarchive'''(3) d30 1 a30 1 formats and a subset of the legacy GNU tar format. a39 1 d43 1 a43 1 '''libarchive'''(3) d53 1 a53 1 '''libarchive'''(3) d58 1 a58 1 '''libarchive'''(3) d124 24 d209 1 a209 1
'''SVR4'''
d250 2 a251 2 '''echo'''(1), '''mkdir'''(1), d253 1 a253 1 '''sed'''(1). d257 1 a257 1 '''sh'''(1) d261 1 a261 1 '''uuencode'''(1) d345 1 a345 1 '''ar'''(1) d349 1 a349 1 '''ld'''(1). d362 4 a365 2 if they provide a filename table to be written into the archive before any of the entries. d372 1 a372 1 '''mtree'''(5) d379 1 a379 1 '''mtree'''(8), d384 1 a384 1 '''archive_write_set_options'''(3) d406 8 d415 1 a415 5 XXX Information about libarchive's LHA support XXX === CAB=== XXX Information about libarchive's CAB support XXX === XAR=== XXX Information about libarchive's XAR support XXX d422 7 d430 10 a439 10 '''ar'''(1), '''cpio'''(1), '''mkisofs'''(1), '''shar'''(1), '''tar'''(1), '''zip'''(1), '''zlib'''(3), '''cpio'''(5), '''mtree'''(5), '''tar'''(5) @ 1.1 log @Initial revision @ text @d1 403 a403 327 #summary libarchive-formats 5 manual page == NAME == *libarchive-formats* - archive formats supported by the libarchive library == DESCRIPTION == The *libarchive*(3) library reads and writes a variety of streaming archive formats. Generally speaking, all of these archive formats consist of a series of "entries". Each entry stores a single file system object, such as a file, directory, or symbolic link. The following provides a brief description of each format supported by libarchive, with some information about recognized extensions or limitations of the current library support. Note that just because a format is supported by libarchive does not imply that a program that uses libarchive will support that format. Applications that use libarchive specify which formats they wish to support, though many programs do use libarchive convenience functions to enable all supported formats. === Tar Formats=== The *libarchive*(3) library can read most tar archives. However, it only writes POSIX-standard "ustar" and "pax interchange" formats. All tar formats store each entry in one or more 512-byte records. The first record is used for file metadata, including filename, timestamp, and mode information, and the file data is stored in subsequent records. Later variants have extended this by either appropriating undefined areas of the header record, extending the header to multiple records, or by storing special entries that modify the interpretation of subsequent entries.
*gnutar*
The *libarchive*(3) library can read GNU-format tar archives. It currently supports the most popular GNU extensions, including modern long filename and linkname support, as well as atime and ctime data. The libarchive library does not support multi-volume archives, nor the old GNU long filename format. It can read GNU sparse file entries, including the new POSIX-based formats, but cannot write GNU sparse file entries.
*pax*
The *libarchive*(3) library can read and write POSIX-compliant pax interchange format archives. Pax interchange format archives are an extension of the older ustar format that adds a separate entry with additional attributes stored as key/value pairs immediately before each regular entry. The presence of these additional entries is the only difference between pax interchange format and the older ustar format. The extended attributes are of unlimited length and are stored as UTF-8 Unicode strings. Keywords defined in the standard are in all lowercase; vendors are allowed to define custom keys by preceding them with the vendor name in all uppercase. When writing pax archives, libarchive uses many of the SCHILY keys defined by Joerg Schilling's "star" archiver and a few LIBARCHIVE keys. The libarchive library can read most of the SCHILY keys and most of the GNU keys introduced by GNU tar. It silently ignores any keywords that it does not understand.
*restricted* pax
The libarchive library can also write pax archives in which it attempts to suppress the extended attributes entry whenever possible. The result will be identical to a ustar archive unless the extended attributes entry is required to store a long file name, long linkname, extended ACL, file flags, or if any of the standard ustar data (user name, group name, UID, GID, etc) cannot be fully represented in the ustar header. In all cases, the result can be dearchived by any program that can read POSIX-compliant pax interchange format archives. Programs that correctly read ustar format (see below) will also be able to read this format; any extended attributes will be extracted as separate files stored in _PaxHeader_ directories.
*ustar*
The libarchive library can both read and write this format. This format has the following limitations:
  • Device major and minor numbers are limited to 21 bits. Nodes with larger numbers will not be added to the archive.
  • Path names in the archive are limited to 255 bytes. (Shorter if there is no / character in exactly the right place.)
  • Symbolic links and hard links are stored in the archive with the name of the referenced file. This name is limited to 100 bytes.
  • Extended attributes, file flags, and other extended security information cannot be stored.
  • Archive entries are limited to 8 gigabytes in size.
Note that the pax interchange format has none of these restrictions.
The libarchive library also reads a variety of commonly-used extensions to the basic tar format. These extensions are recognized automatically whenever they appear.
Numeric extensions.
The POSIX standards require fixed-length numeric fields to be written with some character position reserved for terminators. Libarchive allows these fields to be written without terminator characters. This extends the allowable range; in particular, ustar archives with this extension can support entries up to 64 gigabytes in size. Libarchive also recognizes base-256 values in most numeric fields. This essentially removes all limitations on file size, modification time, and device numbers.
Solaris extensions
Libarchive recognizes ACL and extended attribute records written by Solaris tar. Currently, libarchive only has support for old-style ACLs; the newer NFSv4 ACLs are recognized but discarded.
The first tar program appeared in Seventh Edition Unix in 1979. The first official standard for the tar file format was the "ustar" (Unix Standard Tar) format defined by POSIX in 1988. POSIX.1-2001 extended the ustar format to create the "pax interchange" format. === Cpio Formats=== The libarchive library can read a number of common cpio variants and can write "odc" and "newc" format archives. A cpio archive stores each entry as a fixed-size header followed by a variable-length filename and variable-length data. Unlike the tar format, the cpio format does only minimal padding of the header or file data. There are several cpio variants, which differ primarily in how they store the initial header: some store the values as octal or hexadecimal numbers in ASCII, others as binary values of varying byte order and length.
*binary*
The libarchive library transparently reads both big-endian and little-endian variants of the original binary cpio format. This format used 32-bit binary values for file size and mtime, and 16-bit binary values for the other fields.
*odc*
The libarchive library can both read and write this POSIX-standard format, which is officially known as the "cpio interchange format" or the "octet-oriented cpio archive format" and sometimes unofficially referred to as the "old character format". This format stores the header contents as octal values in ASCII. It is standard, portable, and immune from byte-order confusion. File sizes and mtime are limited to 33 bits (8GB file size), other fields are limited to 18 bits.
*SVR4*
The libarchive library can read both CRC and non-CRC variants of this format. The SVR4 format uses eight-digit hexadecimal values for all header fields. This limits file size to 4GB, and also limits the mtime and other fields to 32 bits. The SVR4 format can optionally include a CRC of the file contents, although libarchive does not currently verify this CRC.
Cpio first appeared in PWB/UNIX 1.0, which was released within AT&T in 1977. PWB/UNIX 1.0 formed the basis of System III Unix, released outside of AT&T in 1981. This makes cpio older than tar, although cpio was not included in Version 7 AT&T Unix. As a result, the tar command became much better known in universities and research groups that used Version 7. The combination of the *find* and *cpio* utilities provided very precise control over file selection. Unfortunately, the format has many limitations that make it unsuitable for widespread use. Only the POSIX format permits files over 4GB, and its 18-bit limit for most other fields makes it unsuitable for modern systems. In addition, cpio formats only store numeric UID/GID values (not usernames and group names), which can make it very difficult to correctly transfer archives across systems with dissimilar user numbering. === Shar Formats=== A "shell archive" is a shell script that, when executed on a POSIX-compliant system, will recreate a collection of file system objects. The libarchive library can write two different kinds of shar archives:
*shar*
The traditional shar format uses a limited set of POSIX commands, including *echo*(1), *mkdir*(1), and *sed*(1). It is suitable for portably archiving small collections of plain text files. However, it is not generally well-suited for large archives (many implementations of *sh*(1) have limits on the size of a script) nor should it be used with non-text files.
*shardump*
This format is similar to shar but encodes files using *uuencode*(1) so that the result will be a plain text file regardless of the file contents. It also includes additional shell commands that attempt to reproduce as many file attributes as possible, including owner, mode, and flags. The additional commands used to restore file attributes make shardump archives less portable than plain shar archives.
=== ISO9660 format=== Libarchive can read and extract from files containing ISO9660-compliant CDROM images. In many cases, this can remove the need to burn a physical CDROM just in order to read the files contained in an ISO9660 image. It also avoids security and complexity issues that come with virtual mounts and loopback devices. Libarchive supports the most common Rockridge extensions and has partial support for Joliet extensions. If both extensions are present, the Joliet extensions will be used and the Rockridge extensions will be ignored. In particular, this can create problems with hardlinks and symlinks, which are supported by Rockridge but not by Joliet. === Zip format=== Libarchive can read and write zip format archives that have uncompressed entries and entries compressed with the "deflate" algorithm. Older zip compression algorithms are not supported. It can extract jar archives, archives that use Zip64 extensions and many self-extracting zip archives. Libarchive reads Zip archives as they are being streamed, which allows it to read archives of arbitrary size. It currently does not use the central directory; this limits libarchive's ability to support some self-extracting archives and ones that have been modified in certain ways. === Archive (library) file format=== The Unix archive format (commonly created by the *ar*(1) archiver) is a general-purpose format which is used almost exclusively for object files to be read by the link editor *ld*(1). The ar format has never been standardised. There are two common variants: the GNU format derived from SVR4, and the BSD format, which first appeared in 4.4BSD. The two differ primarily in their handling of filenames longer than 15 characters: the GNU/SVR4 variant writes a filename table at the beginning of the archive; the BSD format stores each long filename in an extension area adjacent to the entry. Libarchive can read both extensions, including archives that may include both types of long filenames. Programs using libarchive can write GNU/SVR4 format if they provide a filename table to be written into the archive before any of the entries. Any entries whose names are not in the filename table will be written using BSD-style long filenames. This can cause problems for programs such as GNU ld that do not support the BSD-style long filenames. === mtree=== Libarchive can read and write files in *mtree*(5) format. This format is not a true archive format, but rather a textual description of a file hierarchy in which each line specifies the name of a file and provides specific metadata about that file. Libarchive can read all of the keywords supported by both the NetBSD and FreeBSD versions of *mtree*(1), although many of the keywords cannot currently be stored in an *archive_entry* object. When writing, libarchive supports use of the *archive_write_set_options*(3) interface to specify which keywords should be included in the output. If libarchive was compiled with access to suitable cryptographic libraries (such as the OpenSSL libraries), it can compute hash entries such as *sha512* or *md5* from file data being written to the mtree writer. When reading an mtree file, libarchive will locate the corresponding files on disk using the *contents* keyword if present or the regular filename. If it can locate and open the file on disk, it will use that to fill in any metadata that is missing from the mtree file and will read the file contents and return those to the program using libarchive. If it cannot locate and open the file on disk, libarchive will return an error for any attempt to read the entry body. == SEE ALSO == *ar*(1), *cpio*(1), *mkisofs*(1), *shar*(1), *tar*(1), *zip*(1), *zlib*(3), *cpio*(5), *mtree*(5), *tar*(5) @ 1.1.1.1 log @Import libarchive 2.8.0: - Infrastructure: - Allow command line tools as fallback for missing compression libraries. If compiled without gzip for example, gunzip will be used automatically. - Improved support for a number of platforms like high-resolution timestamps and Extended Attributes on various Unix systems - New convience interface for creating archives based on disk content, complement of the archive_write_disk interface. - Frontends: - bsdcpio ready for public consumption - hand-written date parser replaces the yacc code - Filter system: - Simplified read filter chains - Option support for filters - LZMA, XZ, uudecode handled - Format support: - Write support for mtree files based on file system or archive content - Basic read support for Joliet - Write support for zip files - Write support for shar archives, both text-only and binary-safe @ text @@ 1.1.1.2 log @Import libarchive-3.2.1: - security fixes and other bugfixes - support for multhreading in xz 5.2+ @ text @d1 327 a327 439 LIBARCHIVE-FORMATS(5) manual page == NAME == '''libarchive-formats''' - archive formats supported by the libarchive library == DESCRIPTION == The [[ManPageibarchive3]] library reads and writes a variety of streaming archive formats. Generally speaking, all of these archive formats consist of a series of "entries". Each entry stores a single file system object, such as a file, directory, or symbolic link. The following provides a brief description of each format supported by libarchive, with some information about recognized extensions or limitations of the current library support. Note that just because a format is supported by libarchive does not imply that a program that uses libarchive will support that format. Applications that use libarchive specify which formats they wish to support, though many programs do use libarchive convenience functions to enable all supported formats. === Tar Formats=== The [[ManPageibarchive3]] library can read most tar archives. It can write POSIX-standard "ustar" and "pax interchange" formats as well as v7 tar format and a subset of the legacy GNU tar format. All tar formats store each entry in one or more 512-byte records. The first record is used for file metadata, including filename, timestamp, and mode information, and the file data is stored in subsequent records. Later variants have extended this by either appropriating undefined areas of the header record, extending the header to multiple records, or by storing special entries that modify the interpretation of subsequent entries.
'''gnutar'''
The [[ManPageibarchive3]] library can read most GNU-format tar archives. It currently supports the most popular GNU extensions, including modern long filename and linkname support, as well as atime and ctime data. The libarchive library does not support multi-volume archives, nor the old GNU long filename format. It can read GNU sparse file entries, including the new POSIX-based formats. The [[ManPageibarchive3]] library can write GNU tar format, including long filename and linkname support, as well as atime and ctime data.
'''pax'''
The [[ManPageibarchive3]] library can read and write POSIX-compliant pax interchange format archives. Pax interchange format archives are an extension of the older ustar format that adds a separate entry with additional attributes stored as key/value pairs immediately before each regular entry. The presence of these additional entries is the only difference between pax interchange format and the older ustar format. The extended attributes are of unlimited length and are stored as UTF-8 Unicode strings. Keywords defined in the standard are in all lowercase; vendors are allowed to define custom keys by preceding them with the vendor name in all uppercase. When writing pax archives, libarchive uses many of the SCHILY keys defined by Joerg Schilling's "star" archiver and a few LIBARCHIVE keys. The libarchive library can read most of the SCHILY keys and most of the GNU keys introduced by GNU tar. It silently ignores any keywords that it does not understand. The pax interchange format converts filenames to Unicode and stores them using the UTF-8 encoding. Prior to libarchive 3.0, libarchive erroneously assumed that the system wide-character routines natively supported Unicode. This caused it to mis-handle non-ASCII filenames on systems that did not satisfy this assumption.
'''restricted''' pax
The libarchive library can also write pax archives in which it attempts to suppress the extended attributes entry whenever possible. The result will be identical to a ustar archive unless the extended attributes entry is required to store a long file name, long linkname, extended ACL, file flags, or if any of the standard ustar data (user name, group name, UID, GID, etc) cannot be fully represented in the ustar header. In all cases, the result can be dearchived by any program that can read POSIX-compliant pax interchange format archives. Programs that correctly read ustar format (see below) will also be able to read this format; any extended attributes will be extracted as separate files stored in ''PaxHeader'' directories.
'''ustar'''
The libarchive library can both read and write this format. This format has the following limitations:
  • Device major and minor numbers are limited to 21 bits. Nodes with larger numbers will not be added to the archive.
  • Path names in the archive are limited to 255 bytes. (Shorter if there is no / character in exactly the right place.)
  • Symbolic links and hard links are stored in the archive with the name of the referenced file. This name is limited to 100 bytes.
  • Extended attributes, file flags, and other extended security information cannot be stored.
  • Archive entries are limited to 8 gigabytes in size.
Note that the pax interchange format has none of these restrictions. The ustar format is old and widely supported. It is recommended when compatibility is the primary concern.
'''v7'''
The libarchive library can read and write the legacy v7 tar format. This format has the following limitations:
  • Only regular files, directories, and symbolic links can be archived. Block and character device nodes, FIFOs, and sockets cannot be archived.
  • Path names in the archive are limited to 100 bytes.
  • Symbolic links and hard links are stored in the archive with the name of the referenced file. This name is limited to 100 bytes.
  • User and group information are stored as numeric IDs; there is no provision for storing user or group names.
  • Extended attributes, file flags, and other extended security information cannot be stored.
  • Archive entries are limited to 8 gigabytes in size.
Generally, users should prefer the ustar format for portability as the v7 tar format is both less useful and less portable.
The libarchive library also reads a variety of commonly-used extensions to the basic tar format. These extensions are recognized automatically whenever they appear.
Numeric extensions.
The POSIX standards require fixed-length numeric fields to be written with some character position reserved for terminators. Libarchive allows these fields to be written without terminator characters. This extends the allowable range; in particular, ustar archives with this extension can support entries up to 64 gigabytes in size. Libarchive also recognizes base-256 values in most numeric fields. This essentially removes all limitations on file size, modification time, and device numbers.
Solaris extensions
Libarchive recognizes ACL and extended attribute records written by Solaris tar. Currently, libarchive only has support for old-style ACLs; the newer NFSv4 ACLs are recognized but discarded.
The first tar program appeared in Seventh Edition Unix in 1979. The first official standard for the tar file format was the "ustar" (Unix Standard Tar) format defined by POSIX in 1988. POSIX.1-2001 extended the ustar format to create the "pax interchange" format. === Cpio Formats=== The libarchive library can read a number of common cpio variants and can write "odc" and "newc" format archives. A cpio archive stores each entry as a fixed-size header followed by a variable-length filename and variable-length data. Unlike the tar format, the cpio format does only minimal padding of the header or file data. There are several cpio variants, which differ primarily in how they store the initial header: some store the values as octal or hexadecimal numbers in ASCII, others as binary values of varying byte order and length.
'''binary'''
The libarchive library transparently reads both big-endian and little-endian variants of the original binary cpio format. This format used 32-bit binary values for file size and mtime, and 16-bit binary values for the other fields.
'''odc'''
The libarchive library can both read and write this POSIX-standard format, which is officially known as the "cpio interchange format" or the "octet-oriented cpio archive format" and sometimes unofficially referred to as the "old character format". This format stores the header contents as octal values in ASCII. It is standard, portable, and immune from byte-order confusion. File sizes and mtime are limited to 33 bits (8GB file size), other fields are limited to 18 bits.
'''SVR4/newc'''
The libarchive library can read both CRC and non-CRC variants of this format. The SVR4 format uses eight-digit hexadecimal values for all header fields. This limits file size to 4GB, and also limits the mtime and other fields to 32 bits. The SVR4 format can optionally include a CRC of the file contents, although libarchive does not currently verify this CRC.
Cpio first appeared in PWB/UNIX 1.0, which was released within AT&T in 1977. PWB/UNIX 1.0 formed the basis of System III Unix, released outside of AT&T in 1981. This makes cpio older than tar, although cpio was not included in Version 7 AT&T Unix. As a result, the tar command became much better known in universities and research groups that used Version 7. The combination of the '''find''' and '''cpio''' utilities provided very precise control over file selection. Unfortunately, the format has many limitations that make it unsuitable for widespread use. Only the POSIX format permits files over 4GB, and its 18-bit limit for most other fields makes it unsuitable for modern systems. In addition, cpio formats only store numeric UID/GID values (not usernames and group names), which can make it very difficult to correctly transfer archives across systems with dissimilar user numbering. === Shar Formats=== A "shell archive" is a shell script that, when executed on a POSIX-compliant system, will recreate a collection of file system objects. The libarchive library can write two different kinds of shar archives:
'''shar'''
The traditional shar format uses a limited set of POSIX commands, including [[echo(1)|http://www.freebsd.org/cgi/man.cgi?query=echo&sektion=1]], [[mkdir(1)|http://www.freebsd.org/cgi/man.cgi?query=mkdir&sektion=1]], and [[sed(1)|http://www.freebsd.org/cgi/man.cgi?query=sed&sektion=1]]. It is suitable for portably archiving small collections of plain text files. However, it is not generally well-suited for large archives (many implementations of [[sh(1)|http://www.freebsd.org/cgi/man.cgi?query=sh&sektion=1]] have limits on the size of a script) nor should it be used with non-text files.
'''shardump'''
This format is similar to shar but encodes files using [[uuencode(1)|http://www.freebsd.org/cgi/man.cgi?query=uuencode&sektion=1]] so that the result will be a plain text file regardless of the file contents. It also includes additional shell commands that attempt to reproduce as many file attributes as possible, including owner, mode, and flags. The additional commands used to restore file attributes make shardump archives less portable than plain shar archives.
=== ISO9660 format=== Libarchive can read and extract from files containing ISO9660-compliant CDROM images. In many cases, this can remove the need to burn a physical CDROM just in order to read the files contained in an ISO9660 image. It also avoids security and complexity issues that come with virtual mounts and loopback devices. Libarchive supports the most common Rockridge extensions and has partial support for Joliet extensions. If both extensions are present, the Joliet extensions will be used and the Rockridge extensions will be ignored. In particular, this can create problems with hardlinks and symlinks, which are supported by Rockridge but not by Joliet. Libarchive reads ISO9660 images using a streaming strategy. This allows it to read compressed images directly (decompressing on the fly) and allows it to read images directly from network sockets, pipes, and other non-seekable data sources. This strategy works well for optimized ISO9660 images created by many popular programs. Such programs collect all directory information at the beginning of the ISO9660 image so it can be read from a physical disk with a minimum of seeking. However, not all ISO9660 images can be read in this fashion. Libarchive can also write ISO9660 images. Such images are fully optimized with the directory information preceding all file data. This is done by storing all file data to a temporary file while collecting directory information in memory. When the image is finished, libarchive writes out the directory structure followed by the file data. The location used for the temporary file can be changed by the usual environment variables. === Zip format=== Libarchive can read and write zip format archives that have uncompressed entries and entries compressed with the "deflate" algorithm. Other zip compression algorithms are not supported. It can extract jar archives, archives that use Zip64 extensions and self-extracting zip archives. Libarchive can use either of two different strategies for reading Zip archives: a streaming strategy which is fast and can handle extremely large archives, and a seeking strategy which can correctly process self-extracting Zip archives and archives with deleted members or other in-place modifications. The streaming reader processes Zip archives as they are read. It can read archives of arbitrary size from tape or network sockets, and can decode Zip archives that have been separately compressed or encoded. However, self-extracting Zip archives and archives with certain types of modifications cannot be correctly handled. Such archives require that the reader first process the Central Directory, which is ordinarily located at the end of a Zip archive and is thus inaccessible to the streaming reader. If the program using libarchive has enabled seek support, then libarchive will use this to processes the central directory first. In particular, the seeking reader must be used to correctly handle self-extracting archives. Such archives consist of a program followed by a regular Zip archive. The streaming reader cannot parse the initial program portion, but the seeking reader starts by reading the Central Directory from the end of the archive. Similarly, Zip archives that have been modified in-place can have deleted entries or other garbage data that can only be accurately detected by first reading the Central Directory. === Archive (library) file format=== The Unix archive format (commonly created by the [[ar(1)|http://www.freebsd.org/cgi/man.cgi?query=ar&sektion=1]] archiver) is a general-purpose format which is used almost exclusively for object files to be read by the link editor [[ld(1)|http://www.freebsd.org/cgi/man.cgi?query=ld&sektion=1]]. The ar format has never been standardised. There are two common variants: the GNU format derived from SVR4, and the BSD format, which first appeared in 4.4BSD. The two differ primarily in their handling of filenames longer than 15 characters: the GNU/SVR4 variant writes a filename table at the beginning of the archive; the BSD format stores each long filename in an extension area adjacent to the entry. Libarchive can read both extensions, including archives that may include both types of long filenames. Programs using libarchive can write GNU/SVR4 format if they provide an entry called ''//'' containing a filename table to be written into the archive before any of the entries. Any entries whose names are not in the filename table will be written using BSD-style long filenames. This can cause problems for programs such as GNU ld that do not support the BSD-style long filenames. === mtree=== Libarchive can read and write files in [[ManPageMtree5]] format. This format is not a true archive format, but rather a textual description of a file hierarchy in which each line specifies the name of a file and provides specific metadata about that file. Libarchive can read all of the keywords supported by both the NetBSD and FreeBSD versions of [[mtree(8)|http://www.freebsd.org/cgi/man.cgi?query=mtree&sektion=8]], although many of the keywords cannot currently be stored in an '''archive_entry''' object. When writing, libarchive supports use of the [[ManPagerchiveriteetptions3]] interface to specify which keywords should be included in the output. If libarchive was compiled with access to suitable cryptographic libraries (such as the OpenSSL libraries), it can compute hash entries such as '''sha512''' or '''md5''' from file data being written to the mtree writer. When reading an mtree file, libarchive will locate the corresponding files on disk using the '''contents''' keyword if present or the regular filename. If it can locate and open the file on disk, it will use that to fill in any metadata that is missing from the mtree file and will read the file contents and return those to the program using libarchive. If it cannot locate and open the file on disk, libarchive will return an error for any attempt to read the entry body. === 7-Zip=== Libarchive can read and write 7-Zip format archives. TODO: Need more information === CAB=== Libarchive can read Microsoft Cabinet ( "CAB )" format archives. TODO: Need more information. === LHA=== TODO: Information about libarchive's LHA support === RAR=== Libarchive has limited support for reading RAR format archives. Currently, libarchive can read RARv3 format archives which have been either created uncompressed, or compressed using any of the compression methods supported by the RARv3 format. Libarchive can also read self-extracting RAR archives. === Warc=== Libarchive can read and write "web archives". TODO: Need more information === XAR=== Libarchive can read and write the XAR format used by many Apple tools. TODO: Need more information == SEE ALSO == [[ar(1)|http://www.freebsd.org/cgi/man.cgi?query=ar&sektion=1]], [[ManPageBsdcpio1]], [[mkisofs(1)|http://www.freebsd.org/cgi/man.cgi?query=mkisofs&sektion=1]], [[shar(1)|http://www.freebsd.org/cgi/man.cgi?query=shar&sektion=1]], [[ManPageBsdtar1]], [[zip(1)|http://www.freebsd.org/cgi/man.cgi?query=zip&sektion=1]], [[zlib(3)|http://www.freebsd.org/cgi/man.cgi?query=zlib&sektion=3]], [[ManPageCpio5]], [[ManPageMtree5]], [[ManPageTar5]] @ 1.1.1.3 log @Import libarchive-3.3.1. @ text @d7 1 a7 1 [[ManPageLibarchive3]] d24 1 a24 1 [[ManPageLibarchive3]] d43 1 a43 1 [[ManPageLibarchive3]] d53 1 a53 1 [[ManPageLibarchive3]] d58 1 a58 1 [[ManPageLibarchive3]] d166 2 d384 1 a384 1 [[ManPageArchiveWriteSetOptions3]] @ 1.1.1.4 log @Import libarchive-3.3.2 + 9de5f3 + f9dacbf: - Support NFS4 ACLs on Linux - Bugfixes @ text @d7 1 a7 1 [[ManPageibarchive3]] d24 1 a24 1 [[ManPageibarchive3]] d43 1 a43 1 [[ManPageibarchive3]] d53 1 a53 1 [[ManPageibarchive3]] d58 1 a58 1 [[ManPageibarchive3]] d382 1 a382 1 [[ManPagerchiveriteetptions3]] @ 1.1.1.5 log @Import libarchive 3.4.0 @ text @d7 1 a7 1 [[ManPageLibarchive3]] d24 1 a24 1 [[ManPageLibarchive3]] d43 1 a43 1 [[ManPageLibarchive3]] d53 1 a53 1 [[ManPageLibarchive3]] d58 1 a58 1 [[ManPageLibarchive3]] d382 1 a382 1 [[ManPageArchiveWriteSetOptions3]] @ 1.1.1.6 log @Import libarchive 3.7.2 @ text @d176 13 a188 8 The libarchive library can read and write a number of common cpio variants. A cpio archive stores each entry as a fixed-size header followed by a variable-length filename and variable-length data. Unlike the tar format, the cpio format does only minimal padding of the header or file data. There are several cpio variants, which differ primarily in how they store the initial header: some store the values as octal or hexadecimal numbers in ASCII, others as binary values of varying byte order and length. d191 4 a194 9 The libarchive library transparently reads both big-endian and little-endian variants of the the two binary cpio formats; the original one from PWB/UNIX, and the later, more widely used, variant. This format used 32-bit binary values for file size and mtime, and 16-bit binary values for the other fields. The formats support only the file types present in UNIX at the time of their creation. File sizes are limited to 24 bits in the PWB format, because of the limits of the file system, and to 31 bits in the newer binary format, where signed 32 bit longs were used. d196 2 a197 1 This is the POSIX standardized format, which is officially known as the @ 1.1.1.7 log @libarchive: import version 3.8.0 Libarchive 3.8.0 is a feature and bugfix release. New features: bsdtar: support --mtime and --clamp-mtime lib: mbedtls 3.x compatibility 7-zip reader: improve self-extracting archive detection xar: xmllite support for the XAR reader and writer zip writer: added XZ, LZMA, ZSTD and BZIP2 support zip writer: added LZMA + RISCV BCJ filter Notable security fixes: rar: do not skip past EOF while reading rar: fix double free with over 4 billion nodes rar: fix heap-buffer-overflow warc: prevent signed integer overflow tar: fix overflow in build_ustar_entry Notable bugfixes: bsdtar: don't hardlink negative inode files together gz: allow setting the original filename for gzip compressed files lib: improve lseek handling lib: support @@-prefixed Unix epoch timestamps as date strings rar: support large headers on 32 bit systems tar reader: Improve LFS support on 32 bit systems @ text @a303 12 , "LZMA" , "XZ" , "BZIP2" and "ZSTD" algorithms. Libarchive can also read, but not write, zip format archives that have entries compressed with the "PPMd" d306 2 a307 6 The extensions supported by libarchive are Zip64, Libarchive's extensions to better support streaming, PKZIP's traditional ZIP encryption, Info-ZIP's Unix extra fields, extra time, and Unicode path, as well as WinZIP's AES encryption. It can extract jar archives, __MACOSX resource forks extension for OS X, and self-extracting zip archives. @ 1.1.1.8 log @libarchive: import 3.8.8 @ text @d187 1 a187 1 little-endian variants of the two binary cpio formats; the @ 1.1.1.9 log @libarchive: import version 3.8.10 @ text @d343 1 a343 1 libarchive will use this to process the central directory first. @