head	1.23;
access;
symbols
	libarchive-3-8-8:1.1.1.24
	pkgsrc-2026Q2:1.22.0.2
	pkgsrc-2026Q2-base:1.22
	libarchive-3-8-7:1.1.1.23
	libarchive-3-8-6:1.1.1.22
	pkgsrc-2026Q1:1.20.0.2
	pkgsrc-2026Q1-base:1.20
	libarchive-3-8-5:1.1.1.21
	libarchive-3-8-4:1.1.1.20
	pkgsrc-2025Q4:1.18.0.2
	pkgsrc-2025Q4-base:1.18
	libarchive-3-8-3:1.1.1.19
	libarchive-3-8-2:1.1.1.18
	pkgsrc-2025Q3:1.16.0.2
	pkgsrc-2025Q3-base:1.16
	libarchive-3-8-1:1.1.1.17
	pkgsrc-2025Q2:1.15.0.2
	pkgsrc-2025Q2-base:1.15
	libarchive-3-8-0:1.1.1.16
	libarchive-3-7-9:1.1.1.15
	pkgsrc-2025Q1:1.13.0.4
	pkgsrc-2025Q1-base:1.13
	pkgsrc-2024Q4:1.13.0.2
	pkgsrc-2024Q4-base:1.13
	libarchive-3-7-7:1.1.1.14
	pkgsrc-2024Q3:1.12.0.2
	pkgsrc-2024Q3-base:1.12
	libarchive-3-7-5:1.1.1.13
	pkgsrc-2024Q2:1.11.0.2
	pkgsrc-2024Q2-base:1.11
	libarchive-3-7-4:1.1.1.12
	libarchive-3-7-3:1.1.1.11
	pkgsrc-2024Q1:1.9.0.2
	pkgsrc-2024Q1-base:1.9
	libarchive-3-7-2:1.1.1.10
	pkgsrc-2023Q4:1.8.0.30
	pkgsrc-2023Q4-base:1.8
	pkgsrc-2023Q3:1.8.0.28
	pkgsrc-2023Q3-base:1.8
	pkgsrc-2023Q2:1.8.0.26
	pkgsrc-2023Q2-base:1.8
	pkgsrc-2023Q1:1.8.0.24
	pkgsrc-2023Q1-base:1.8
	pkgsrc-2022Q4:1.8.0.22
	pkgsrc-2022Q4-base:1.8
	pkgsrc-2022Q3:1.8.0.20
	pkgsrc-2022Q3-base:1.8
	pkgsrc-2022Q2:1.8.0.18
	pkgsrc-2022Q2-base:1.8
	pkgsrc-2022Q1:1.8.0.16
	pkgsrc-2022Q1-base:1.8
	pkgsrc-2021Q4:1.8.0.14
	pkgsrc-2021Q4-base:1.8
	pkgsrc-2021Q3:1.8.0.12
	pkgsrc-2021Q3-base:1.8
	pkgsrc-2021Q2:1.8.0.10
	pkgsrc-2021Q2-base:1.8
	pkgsrc-2021Q1:1.8.0.8
	pkgsrc-2021Q1-base:1.8
	pkgsrc-2020Q4:1.8.0.6
	pkgsrc-2020Q4-base:1.8
	pkgsrc-2020Q3:1.8.0.4
	pkgsrc-2020Q3-base:1.8
	pkgsrc-2020Q2:1.8.0.2
	pkgsrc-2020Q2-base:1.8
	pkgsrc-2020Q1:1.7.0.4
	pkgsrc-2020Q1-base:1.7
	pkgsrc-2019Q4:1.7.0.6
	pkgsrc-2019Q4-base:1.7
	pkgsrc-2019Q3:1.7.0.2
	pkgsrc-2019Q3-base:1.7
	libarchive-3-4-0:1.1.1.9
	libarchive-3-3-3:1.1.1.8
	pkgsrc-2019Q2:1.6.0.2
	pkgsrc-2019Q2-base:1.6
	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.7
	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.6
	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.5
	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.4.0.36
	pkgsrc-2014Q4-base:1.1.1.4
	pkgsrc-2014Q3:1.1.1.4.0.34
	pkgsrc-2014Q3-base:1.1.1.4
	pkgsrc-2014Q2:1.1.1.4.0.32
	pkgsrc-2014Q2-base:1.1.1.4
	pkgsrc-2014Q1:1.1.1.4.0.30
	pkgsrc-2014Q1-base:1.1.1.4
	pkgsrc-2013Q4:1.1.1.4.0.28
	pkgsrc-2013Q4-base:1.1.1.4
	pkgsrc-2013Q3:1.1.1.4.0.26
	pkgsrc-2013Q3-base:1.1.1.4
	pkgsrc-2013Q2:1.1.1.4.0.24
	pkgsrc-2013Q2-base:1.1.1.4
	pkgsrc-2013Q1:1.1.1.4.0.22
	pkgsrc-2013Q1-base:1.1.1.4
	pkgsrc-2012Q4:1.1.1.4.0.20
	pkgsrc-2012Q4-base:1.1.1.4
	pkgsrc-2012Q3:1.1.1.4.0.18
	pkgsrc-2012Q3-base:1.1.1.4
	pkgsrc-2012Q2:1.1.1.4.0.16
	pkgsrc-2012Q2-base:1.1.1.4
	pkgsrc-2012Q1:1.1.1.4.0.14
	pkgsrc-2012Q1-base:1.1.1.4
	pkgsrc-2011Q4:1.1.1.4.0.12
	pkgsrc-2011Q4-base:1.1.1.4
	pkgsrc-2011Q3:1.1.1.4.0.10
	pkgsrc-2011Q3-base:1.1.1.4
	pkgsrc-2011Q2:1.1.1.4.0.8
	pkgsrc-2011Q2-base:1.1.1.4
	pkgsrc-2011Q1:1.1.1.4.0.6
	pkgsrc-2011Q1-base:1.1.1.4
	pkgsrc-2010Q4:1.1.1.4.0.4
	pkgsrc-2010Q4-base:1.1.1.4
	pkgsrc-2010Q3:1.1.1.4.0.2
	pkgsrc-2010Q3-base:1.1.1.4
	libarchive-2-8-4:1.1.1.4
	pkgsrc-2010Q2:1.1.1.3.0.4
	pkgsrc-2010Q2-base:1.1.1.3
	pkgsrc-2010Q1:1.1.1.3.0.2
	pkgsrc-2010Q1-base:1.1.1.3
	libarchive-2-8-3:1.1.1.3
	libarchive-2-8-2:1.1.1.2
	libarchive-2-8-0:1.1.1.1
	KIENTZLE:1.1.1;
locks; strict;
comment	@# @;


1.23
date	2026.06.24.06.29.52;	author adam;	state Exp;
branches;
next	1.22;
commitid	keXVOnvWIwV061LG;

1.22
date	2026.04.15.08.46.34;	author adam;	state Exp;
branches;
next	1.21;
commitid	pL26mrnh4kOo62CG;

1.21
date	2026.03.26.11.20.06;	author adam;	state Exp;
branches;
next	1.20;
commitid	8pSUUUHFeJu1BtzG;

1.20
date	2026.01.06.11.55.22;	author adam;	state Exp;
branches;
next	1.19;
commitid	lOosf75XWhczkkpG;

1.19
date	2025.12.23.14.01.22;	author adam;	state Exp;
branches;
next	1.18;
commitid	3zKcl3VhUVXFtxnG;

1.18
date	2025.11.20.06.08.25;	author adam;	state Exp;
branches;
next	1.17;
commitid	kB7NF5kSlmUaVfjG;

1.17
date	2025.11.02.08.52.12;	author adam;	state Exp;
branches;
next	1.16;
commitid	hdaVwMAEUWR8pXgG;

1.16
date	2025.07.01.15.14.43;	author adam;	state Exp;
branches;
next	1.15;
commitid	sA2cBFYBXpUBv31G;

1.15
date	2025.05.21.15.25.49;	author adam;	state Exp;
branches;
next	1.14;
commitid	6aTN21WjRYk8TMVF;

1.14
date	2025.04.28.10.31.33;	author adam;	state Exp;
branches;
next	1.13;
commitid	Tocq615J6mYPZNSF;

1.13
date	2024.10.19.05.39.56;	author adam;	state Exp;
branches;
next	1.12;
commitid	fYRSlpIWMYluweuF;

1.12
date	2024.09.15.07.02.19;	author adam;	state Exp;
branches;
next	1.11;
commitid	x365AQIKhret4SpF;

1.11
date	2024.04.30.06.05.18;	author adam;	state Exp;
branches;
next	1.10;
commitid	id0E8i4RwCC4c88F;

1.10
date	2024.04.12.15.39.48;	author adam;	state Exp;
branches;
next	1.9;
commitid	52ilmjFHKDf0XR5F;

1.9
date	2024.01.18.18.00.14;	author adam;	state Exp;
branches;
next	1.8;
commitid	hNXpsHx3SuHqsXUE;

1.8
date	2020.05.26.09.16.40;	author nia;	state Exp;
branches;
next	1.7;
commitid	nNhsdZACz3PjmJ9C;

1.7
date	2019.09.22.09.55.07;	author joerg;	state Exp;
branches;
next	1.6;
commitid	FdPvRjF4OzwBwZDB;

1.6
date	2019.04.10.08.24.05;	author adam;	state Exp;
branches;
next	1.5;
commitid	LnliQ9ieqYkikMiB;

1.5
date	2017.08.01.22.26.22;	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.56;	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.44;	author joerg;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2010.02.20.03.49.44;	author joerg;	state Exp;
branches;
next	1.1.1.2;

1.1.1.2
date	2010.03.14.17.57.26;	author joerg;	state Exp;
branches;
next	1.1.1.3;

1.1.1.3
date	2010.03.16.17.07.04;	author joerg;	state Exp;
branches;
next	1.1.1.4;

1.1.1.4
date	2010.07.09.11.53.34;	author joerg;	state Exp;
branches;
next	1.1.1.5;

1.1.1.5
date	2016.06.20.17.11.53;	author joerg;	state Exp;
branches;
next	1.1.1.6;
commitid	rRgm3BqbmbI8aebz;

1.1.1.6
date	2017.02.25.20.54.23;	author joerg;	state Exp;
branches;
next	1.1.1.7;
commitid	ReqPI0ibLYjdmnHz;

1.1.1.7
date	2017.08.01.22.21.11;	author joerg;	state Exp;
branches;
next	1.1.1.8;
commitid	XQwPAFJku336Ny1A;

1.1.1.8
date	2019.09.22.09.47.04;	author joerg;	state Exp;
branches;
next	1.1.1.9;
commitid	N0KxAXOYyULduZDB;

1.1.1.9
date	2019.09.22.09.51.33;	author joerg;	state Exp;
branches;
next	1.1.1.10;
commitid	5kDbfPbiV3INvZDB;

1.1.1.10
date	2024.01.18.17.37.45;	author adam;	state Exp;
branches;
next	1.1.1.11;
commitid	zDULEPUODGjTkXUE;

1.1.1.11
date	2024.04.12.15.27.44;	author adam;	state Exp;
branches;
next	1.1.1.12;
commitid	tQWTddCoxBumSR5F;

1.1.1.12
date	2024.04.30.05.50.49;	author adam;	state Exp;
branches;
next	1.1.1.13;
commitid	e4DnFoZdQV9Z688F;

1.1.1.13
date	2024.09.15.06.45.25;	author adam;	state Exp;
branches;
next	1.1.1.14;
commitid	pOuXKsbh8iPCYRpF;

1.1.1.14
date	2024.10.19.05.27.34;	author adam;	state Exp;
branches;
next	1.1.1.15;
commitid	v1iXM4j1Na52seuF;

1.1.1.15
date	2025.04.28.09.44.10;	author adam;	state Exp;
branches;
next	1.1.1.16;
commitid	1zB7ffc4d2qCJNSF;

1.1.1.16
date	2025.05.21.15.11.28;	author adam;	state Exp;
branches;
next	1.1.1.17;
commitid	Nzqt2UgtvkVXNMVF;

1.1.1.17
date	2025.07.01.14.58.53;	author adam;	state Exp;
branches;
next	1.1.1.18;
commitid	wKXYoBc9F9j8q31G;

1.1.1.18
date	2025.11.02.08.32.34;	author adam;	state Exp;
branches;
next	1.1.1.19;
commitid	8C56Xg3dc0HriXgG;

1.1.1.19
date	2025.11.20.05.51.45;	author adam;	state Exp;
branches;
next	1.1.1.20;
commitid	LC6NMc2P0QpnPfjG;

1.1.1.20
date	2025.12.23.13.41.06;	author adam;	state Exp;
branches;
next	1.1.1.21;
commitid	hhQbXTytJ7PFmxnG;

1.1.1.21
date	2026.01.06.11.43.29;	author adam;	state Exp;
branches;
next	1.1.1.22;
commitid	Q4rjOheYoLWofkpG;

1.1.1.22
date	2026.03.26.11.11.16;	author adam;	state Exp;
branches;
next	1.1.1.23;
commitid	P6u0vpfNBymXxtzG;

1.1.1.23
date	2026.04.15.08.40.11;	author adam;	state Exp;
branches;
next	1.1.1.24;
commitid	enlkxxj5Vxhi42CG;

1.1.1.24
date	2026.06.24.05.39.01;	author adam;	state Exp;
branches;
next	;
commitid	zmhI9f4umm2AO0LG;


desc
@@


1.23
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
@<!-- Creator     : groff version 1.23.0 -->
<!-- CreationDate: Tue Jun 23 09:58:14 2026 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="generator" content="groff -Thtml, see www.gnu.org">
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta name="Content-Style" content="text/css">
<style type="text/css">
       p       { margin-top: 0; margin-bottom: 0; vertical-align: top }
       pre     { margin-top: 0; margin-bottom: 0; vertical-align: top }
       table   { margin-top: 0; margin-bottom: 0; vertical-align: top }
       h1      { text-align: center }
</style>
<title></title>
</head>
<body>

<hr>


<p><i>CPIO</i>(5) File Formats Manual <i>CPIO</i>(5)</p>

<p style="margin-top: 1em"><b>NAME</b></p>

<p style="margin-left:9%;">cpio &mdash; format of cpio
archive files</p>

<p style="margin-top: 1em"><b>DESCRIPTION</b></p>

<p style="margin-left:9%;">The <b>cpio</b> archive format
collects any number of files, directories, and other file
system objects (symbolic links, device nodes, etc.) into a
single stream of bytes.</p>

<p style="margin-left:4%; margin-top: 1em"><b>General
Format</b></p>

<p style="margin-left:9%;">Each file system object in a
<b>cpio</b> archive comprises a header record with basic
numeric metadata followed by the full pathname of the entry
and the file data. The header record stores a series of
integer values that generally follow the fields in <i>struct
stat</i>. (See <i>stat</i>(2) for details.) The variants
differ primarily in how they store those integers (binary,
octal, or hexadecimal). The header is followed by the
pathname of the entry (the length of the pathname is stored
in the header) and any file data. The end of the archive is
indicated by a special record with the pathname
&ldquo;TRAILER!!!&rdquo;.</p>

<p style="margin-left:4%; margin-top: 1em"><b>PWB
format</b></p>

<p style="margin-left:9%;">The PWB binary <b>cpio</b>
format is the original format, when cpio was introduced as
part of the Programmer&rsquo;s Work Bench system, a variant
of 6th Edition UNIX. It stores numbers as 2-byte and 4-byte
binary values. Each entry begins with a header in the
following format:</p>

<p style="margin-left:17%; margin-top: 1em">struct
header_pwb_cpio { <br>
short h_magic; <br>
short h_dev; <br>
short h_ino; <br>
short h_mode; <br>
short h_uid; <br>
short h_gid; <br>
short h_nlink; <br>
short h_majmin; <br>
long h_mtime; <br>
short h_namesize; <br>
long h_filesize; <br>
};</p>

<p style="margin-left:9%; margin-top: 1em">The <i>short</i>
fields here are 16-bit integer values, while the <i>long</i>
fields are 32 bit integers. Since PWB UNIX, like the 6th
Edition UNIX it was based on, only ran on PDP-11 computers,
they are in PDP-endian format, which has little-endian
shorts, and big-endian longs. That is, the long integer
whose hexadecimal representation is 0x12345678 would be
stored in four successive bytes as 0x34, 0x12, 0x78, 0x56.
The fields are as follows:</p>

<p style="margin-top: 1em"><i>h_magic</i></p>

<p style="margin-left:19%;">The integer value octal
070707.</p>

<p style="margin-top: 1em"><i>h_dev</i>, <i>h_ino</i></p>

<p style="margin-left:19%;">The device and inode numbers
from the disk. These are used by programs that read
<b>cpio</b> archives to determine when two entries refer to
the same file. Programs that synthesize <b>cpio</b> archives
should be careful to set these to distinct values for each
entry.</p>

<p style="margin-top: 1em"><i>h_mode</i></p>

<p style="margin-left:19%; margin-top: 1em">The mode
specifies both the regular permissions and the file type,
and it also holds a couple of bits that are irrelevant to
the cpio format, because the field is actually a raw copy of
the mode field in the inode representing the file. These are
the IALLOC flag, which shows that the inode entry is in use,
and the ILARG flag, which shows that the file it represents
is large enough to have indirect blocks pointers in the
inode. The mode is decoded as follows:</p>

<p style="margin-top: 1em">0100000</p>

<p style="margin-left:31%; margin-top: 1em">IALLOC flag -
irrelevant to cpio.</p>

<p>0060000</p>

<p style="margin-left:31%; margin-top: 1em">This masks the
file type bits.</p>

<p>0040000</p>

<p style="margin-left:31%; margin-top: 1em">File type value
for directories.</p>

<p>0020000</p>

<p style="margin-left:31%; margin-top: 1em">File type value
for character special devices.</p>

<p>0060000</p>

<p style="margin-left:31%; margin-top: 1em">File type value
for block special devices.</p>

<p>0010000</p>

<p style="margin-left:31%; margin-top: 1em">ILARG flag -
irrelevant to cpio.</p>

<p>0004000</p>

<p style="margin-left:31%; margin-top: 1em">SUID bit.</p>

<p>0002000</p>

<p style="margin-left:31%; margin-top: 1em">SGID bit.</p>

<p>0001000</p>

<p style="margin-left:31%; margin-top: 1em">Sticky bit.</p>

<p>0000777</p>

<p style="margin-left:31%; margin-top: 1em">The lower 9
bits specify read/write/execute permissions for world,
group, and user following standard POSIX conventions.</p>

<p style="margin-top: 1em"><i>h_uid</i>, <i>h_gid</i></p>

<p style="margin-left:19%;">The numeric user id and group
id of the owner.</p>

<p style="margin-top: 1em"><i>h_nlink</i></p>

<p style="margin-left:19%;">The number of links to this
file. Directories always have a value of at least two here.
Note that hardlinked files include file data with every copy
in the archive.</p>

<p style="margin-top: 1em"><i>h_majmin</i></p>

<p style="margin-left:19%;">For block special and character
special entries, this field contains the associated device
number, with the major number in the high byte, and the
minor number in the low byte. For all other entry types, it
should be set to zero by writers and ignored by readers.</p>

<p style="margin-top: 1em"><i>h_mtime</i></p>

<p style="margin-left:19%;">Modification time of the file,
indicated as the number of seconds since the start of the
epoch, 00:00:00 UTC January 1, 1970.</p>

<p style="margin-top: 1em"><i>h_namesize</i></p>

<p style="margin-left:19%;">The number of bytes in the
pathname that follows the header. This count includes the
trailing NUL byte.</p>

<p style="margin-top: 1em"><i>h_filesize</i></p>

<p style="margin-left:19%;">The size of the file. Note that
this archive format is limited to 16 megabyte file sizes,
because PWB UNIX, like 6th Edition, only used an unsigned 24
bit integer for the file size internally.</p>

<p style="margin-left:9%; margin-top: 1em">The pathname
immediately follows the fixed header. If <b>h_namesize</b>
is odd, an additional NUL byte is added after the pathname.
The file data is then appended, again with an additional NUL
appended if needed to get the next header at an even
offset.</p>

<p style="margin-left:9%; margin-top: 1em">Hardlinked files
are not given special treatment; the full file contents are
included with each copy of the file.</p>

<p style="margin-left:4%; margin-top: 1em"><b>New Binary
Format</b></p>

<p style="margin-left:9%;">The new binary <b>cpio</b>
format showed up when cpio was adopted into late 7th Edition
UNIX. It is exactly like the PWB binary format, described
above, except for three changes:</p>

<p style="margin-left:9%; margin-top: 1em">First, UNIX now
ran on more than one hardware type, so the endianness of 16
bit integers must be determined by observing the magic
number at the start of the header. The 32 bit integers are
still always stored with the most significant word first,
though, so each of those two, in the struct shown above, was
stored as an array of two 16 bit integers, in the
traditional order. Those 16 bit integers, like all the
others in the struct, were accessed using a macro that byte
swapped them if necessary.</p>

<p style="margin-left:9%; margin-top: 1em">Next, 7th
Edition had more file types to store, and the IALLOC and
ILARG flag bits were re-purposed to accommodate these. The
revised use of the various bits is as follows:</p>

<p style="margin-top: 1em">0170000</p>

<p style="margin-left:21%; margin-top: 1em">This masks the
file type bits.</p>

<p>0140000</p>

<p style="margin-left:21%; margin-top: 1em">File type value
for sockets.</p>

<p>0120000</p>

<p style="margin-left:21%; margin-top: 1em">File type value
for symbolic links. For symbolic links, the link body is
stored as file data.</p>

<p>0100000</p>

<p style="margin-left:21%; margin-top: 1em">File type value
for regular files.</p>

<p>0060000</p>

<p style="margin-left:21%; margin-top: 1em">File type value
for block special devices.</p>

<p>0040000</p>

<p style="margin-left:21%; margin-top: 1em">File type value
for directories.</p>

<p>0020000</p>

<p style="margin-left:21%; margin-top: 1em">File type value
for character special devices.</p>

<p>0010000</p>

<p style="margin-left:21%; margin-top: 1em">File type value
for named pipes or FIFOs.</p>

<p>0004000</p>

<p style="margin-left:21%; margin-top: 1em">SUID bit.</p>

<p>0002000</p>

<p style="margin-left:21%; margin-top: 1em">SGID bit.</p>

<p>0001000</p>

<p style="margin-left:21%; margin-top: 1em">Sticky bit.</p>

<p>0000777</p>

<p style="margin-left:21%; margin-top: 1em">The lower 9
bits specify read/write/execute permissions for world,
group, and user following standard POSIX conventions.</p>

<p style="margin-left:9%; margin-top: 1em">Finally, the
file size field now represents a signed 32 bit integer in
the underlying file system, so the maximum file size has
increased to 2 gigabytes.</p>

<p style="margin-left:9%; margin-top: 1em">Note that there
is no obvious way to tell which of the two binary formats an
archive uses, other than to see which one makes more sense.
The typical error scenario is that a PWB format archive
unpacked as if it were in the new format will create named
sockets instead of directories, and then fail to unpack
files that should go in those directories. Running
<i>bsdcpio -itv</i> on an unknown archive will make it
obvious which it is: if it&rsquo;s PWB format, directories
will be listed with an &rsquo;s&rsquo; instead of a
&rsquo;d&rsquo; as the first character of the mode string,
and the larger files will have a &rsquo;?&rsquo; in that
position.</p>

<p style="margin-left:4%; margin-top: 1em"><b>Portable
ASCII Format</b></p>

<p style="margin-left:9%;">Version&nbsp;2 of the Single
UNIX Specification (&ldquo;SUSv2&rdquo;) standardized an
ASCII variant that is portable across all platforms. It is
commonly known as the &ldquo;old character&rdquo; format or
as the &ldquo;odc&rdquo; format. It stores the same numeric
fields as the old binary format, but represents them as
6-character or 11-character octal values.</p>

<p style="margin-left:17%; margin-top: 1em">struct
cpio_odc_header { <br>
char c_magic[6]; <br>
char c_dev[6]; <br>
char c_ino[6]; <br>
char c_mode[6]; <br>
char c_uid[6]; <br>
char c_gid[6]; <br>
char c_nlink[6]; <br>
char c_rdev[6]; <br>
char c_mtime[11]; <br>
char c_namesize[6]; <br>
char c_filesize[11]; <br>
};</p>

<p style="margin-left:9%; margin-top: 1em">The fields are
identical to those in the new binary format. The name and
file body follow the fixed header. Unlike the binary
formats, there is no additional padding after the pathname
or file contents. If the files being archived are themselves
entirely ASCII, then the resulting archive will be entirely
ASCII, except for the NUL byte that terminates the name
field.</p>

<p style="margin-left:4%; margin-top: 1em"><b>New ASCII
Format</b></p>

<p style="margin-left:9%;">The &quot;new&quot; ASCII format
uses 8-byte hexadecimal fields for all numbers and separates
device numbers into separate fields for major and minor
numbers.</p>

<p style="margin-left:17%; margin-top: 1em">struct
cpio_newc_header { <br>
char c_magic[6]; <br>
char c_ino[8]; <br>
char c_mode[8]; <br>
char c_uid[8]; <br>
char c_gid[8]; <br>
char c_nlink[8]; <br>
char c_mtime[8]; <br>
char c_filesize[8]; <br>
char c_devmajor[8]; <br>
char c_devminor[8]; <br>
char c_rdevmajor[8]; <br>
char c_rdevminor[8]; <br>
char c_namesize[8]; <br>
char c_check[8]; <br>
};</p>

<p style="margin-left:9%; margin-top: 1em">Except as
specified below, the fields here match those specified for
the new binary format above.</p>

<p style="margin-top: 1em"><i>magic</i></p>

<p style="margin-left:19%; margin-top: 1em">The string
&ldquo;070701&rdquo;.</p>

<p style="margin-top: 1em"><i>check</i></p>

<p style="margin-left:19%; margin-top: 1em">This field is
always set to zero by writers and ignored by readers. See
the next section for more details.</p>

<p style="margin-left:9%; margin-top: 1em">The pathname is
followed by NUL bytes so that the total size of the fixed
header plus pathname is a multiple of four. Likewise, the
file data is padded to a multiple of four bytes. Note that
this format supports only 4 gigabyte files (unlike the older
ASCII format, which supports 8 gigabyte files).</p>

<p style="margin-left:9%; margin-top: 1em">In this format,
hardlinked files are handled by setting the filesize to zero
for each entry except the first one that appears in the
archive.</p>

<p style="margin-left:4%; margin-top: 1em"><b>New CRC
Format</b></p>

<p style="margin-left:9%;">The CRC format is identical to
the new ASCII format described in the previous section
except that the magic field is set to &ldquo;070702&rdquo;
and the <i>check</i> field is set to the sum of all bytes in
the file data. This sum is computed treating all bytes as
unsigned values and using unsigned arithmetic. Only the
least-significant 32 bits of the sum are stored.</p>

<p style="margin-left:4%; margin-top: 1em"><b>HP
variants</b></p>

<p style="margin-left:9%;">The <b>cpio</b> implementation
distributed with HPUX used XXXX but stored device numbers
differently XXX.</p>

<p style="margin-left:4%; margin-top: 1em"><b>Other
Extensions and Variants</b></p>

<p style="margin-left:9%;">Sun Solaris uses additional file
types to store extended file data, including ACLs and
extended attributes, as special entries in cpio
archives.</p>

<p style="margin-left:9%; margin-top: 1em">XXX Others?
XXX</p>

<p style="margin-top: 1em"><b>SEE ALSO</b></p>

<p style="margin-left:9%;"><i>cpio</i>(1),
<i>tar</i>(5)</p>

<p style="margin-top: 1em"><b>STANDARDS</b></p>

<p style="margin-left:9%;">The <b>cpio</b> utility is no
longer a part of POSIX or the Single Unix Standard. It last
appeared in Version&nbsp;2 of the Single UNIX Specification
(&ldquo;SUSv2&rdquo;). It has been supplanted in subsequent
standards by <i>pax</i>(1). The portable ASCII format is
currently part of the specification for the <i>pax</i>(1)
utility.</p>

<p style="margin-top: 1em"><b>HISTORY</b></p>

<p style="margin-left:9%;">The original cpio utility was
written by Dick Haight while working in AT&amp;T&rsquo;s
Unix Support Group. It appeared in 1977 as part of PWB/UNIX
1.0, the &ldquo;Programmer&rsquo;s Work Bench&rdquo; derived
from Version&nbsp;6 AT&amp;T UNIX that was used internally
at AT&amp;T. Both the new binary and old character formats
were in use by 1980, according to the System III source
released by SCO under their &ldquo;Ancient Unix&rdquo;
license. The character format was adopted as part of IEEE
Std 1003.1-1988 (&ldquo;POSIX.1&rdquo;). XXX when did
&quot;newc&quot; appear? Who invented it? When did HP come
out with their variant? When did Sun introduce ACLs and
extended attributes? XXX</p>

<p style="margin-top: 1em"><b>BUGS</b></p>

<p style="margin-left:9%;">The &ldquo;CRC&rdquo; format is
mis-named, as it uses a simple checksum and not a cyclic
redundancy check.</p>

<p style="margin-left:9%; margin-top: 1em">The binary
formats are limited to 16 bits for user id, group id,
device, and inode numbers. They are limited to 16 megabyte
and 2 gigabyte file sizes for the older and newer variants,
respectively.</p>

<p style="margin-left:9%; margin-top: 1em">The old ASCII
format is limited to 18 bits for the user id, group id,
device, and inode numbers. It is limited to 8 gigabyte file
sizes.</p>

<p style="margin-left:9%; margin-top: 1em">The new ASCII
format is limited to 4 gigabyte file sizes.</p>

<p style="margin-left:9%; margin-top: 1em">None of the cpio
formats store user or group names, which are essential when
moving files between systems with dissimilar user or group
numbering.</p>

<p style="margin-left:9%; margin-top: 1em">Especially when
writing older cpio variants, it may be necessary to map
actual device/inode values to synthesized values that fit
the available fields. With very large filesystems, this may
be necessary even for the newer formats. Debian December 23,
2011 <i>CPIO</i>(5)</p>
<hr>
</body>
</html>
@


1.22
log
@libarchive: updated to 3.8.7

Libarchive 3.8.7 is a security and bugfix release.

Notable fixes:

CAB: fix NULL pointer dereference during skip
CAB: Fix Heap OOB Write in CAB LZX decoder
cpio: various fixes and improvements
contrib/untar: fix out-of-bounds read
iso9660: fix undefined behavior
iso9660: fix posibble heap buffer overflow on 32-bit systems
libarchive: fix handling of option failures
libarchive: do not continue with truncated numbers
libarchive: lzop and grzip filter support
RAR: fix LZSS window size mismatch after PPMd block
@
text
@d2 1
a2 1
<!-- CreationDate: Mon Apr 13 12:57:34 2026 -->
@


1.21
log
@libarchive: updated to 3.8.6

Libarchive 3.8.6 is a security and bugfix release.

Notable fixes:

libarchive: fix incompatibility with Nettle 4.x
libarchive: fix NULL pointer dereference in archive_acl_from_text_w()
bsdunzip: fix ISO week year and Gregorian year confusion
7zip: ix SEGV in check_7zip_header_in_sfx via ELF offset validation
7zip: fix out-of-bounds access on ELF 64-bit header
RAR5 reader: fix infinite loop in rar5 decompression
RAR5 reader: fix potential memory leak
RAR5: fix SIGSEGV when archive_read_support_format_rar5 is called twice
CAB reader: fix memory leak on repeated calls to archive_read_support_format_cab
mtree reader: Fix file descriptor leak in mtree parser cleanup
various small bugfixes in code and documentation
@
text
@d2 1
a2 1
<!-- CreationDate: Tue Mar 10 09:57:29 2026 -->
@


1.20
log
@libarchive: updated to 3.8.5

3.8.5

Notable bugxies:

bsdtar: fix regression from 3.8.4 zero-length pattern issue bugfix
various small bugfixes in code and documentation
@
text
@d2 1
a2 1
<!-- CreationDate: Mon Jan  5 10:42:45 2026 -->
@


1.19
log
@libarchive: updated to 3.8.4

3.8.4

Notable bugxies:

bsdtar: Fix zero-length pattern issue
lib: Fix regression introduced in libarchive 3.8.2 when walking enterable but unreadable directories
@
text
@d2 1
a2 1
<!-- CreationDate: Mon Dec  1 12:42:38 2025 -->
@


1.18
log
@libarchive: updated to 3.8.3

Libarchive 3.8.3 is a bugfix and security release.

Security fixes:

lib: Create temporary files in the target directory
lha: Fix for an out-of-bounds buffer overrun when using p[H_LEVEL_OFFSET]
7-zip: Fix a buffer overrun when reading truncated 7zip headers

Notable bugxies:

lz4 and zstd: Support both lz4 and zstd data with leading skippable frames
@
text
@d2 1
a2 1
<!-- CreationDate: Mon Nov 17 22:19:03 2025 -->
@


1.17
log
@libarchive: updated to 3.8.2

Libarchive 3.8.2 is a bugfix and security release.

Security fixes:

7zip: Fix out of boundary access
tar reader: fix checking the result of the strftime

Notable bugfixes:

bsdtar: Allow filename to have CRLF endings
lib: archive_read_data: handle sparse holes at end of file correctly
lib: improve filter process handling
lib: fix error checking in writing files
lib: handle possible errors from system calls
lib: avoid leaking file descriptors into subprocesses
lib: parse_date: handle dates in 2038 and beyond if time_t is big enough
RAR5 reader: fix multiple issues in extra field parsing function
RAR5 reader: early fail when file declares data for a dir entry
tar writer: fix replacing a regular file with a dir for ARCHIVE_EXTRACT_SAFE_WRITES
tar reader (Windows): check WCS pathname in header_gnutar before overwriting
tar reader: fix an infinite loop when parsing V headers
zip writer: fix a memory leak if write callback error early
zip writer: fix writing with ZSTD compression
zstd write filter: enable Zstandard's checksum feature
@
text
@d2 1
a2 1
<!-- CreationDate: Wed Oct 15 21:49:46 2025 -->
@


1.16
log
@libarchive: updated to 3.8.1

3.8.1

Important bugfixes

various compilation fixes
fixed undefined behavior in a function in warc reader
Windows binary uses xz 5.2.5
@
text
@d2 1
a2 1
<!-- CreationDate: Sun Jun  1 19:29:41 2025 -->
@


1.15
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
@d2 1
a2 1
<!-- CreationDate: Tue May 20 09:02:20 2025 -->
@


1.14
log
@bsdtar libarchive: updated to 3.7.9

3.7.9

Important bugfixes:

a regression in libarchive 3.7.8 regarding GNU sparse entries was fixed


3.7.8

Security fixes:

tar reader: Handle truncation in the middle of a GNU long linkname
unzip: fix null pointer dereference
tar reader: fix unchecked return value in list_item_verbose()

Important bugfixes:

7zip reader: add SPARC
tar reader: Ignore ustar size when pax size is present
tar writer: Fix bug when -s/a/b/ used more than once with b flag
cpio: Fix a Y2038 bug on Windows
libarchive: Handle ARCHIVE_FILTER_LZOP in archive_read_append_filter
libarchive: Adding missing seeker function to archive_read_open_FILE()
@
text
@d2 1
a2 1
<!-- CreationDate: Sun Mar 30 20:07:38 2025 -->
@


1.13
log
@libarchive: updated to 3.7.7

Libarchive 3.7.7 is a bugfix and security release

Security fixes:

gzip: prevent a hang when processing a malformed gzip inside a gzip
tar: don't crash on truncated tar archives
tar: fix two leaks in tar header parsing

Important bugfixes:

7-zip: read/write symlink paths as UTF-8
cpio: exit with an error code if an entry could not be extracted
rar5: report encrypted entries
tar: fix truncation of entry pathnames in specific archives
windows: fix ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS


Libarchive 3.7.6 is a bugfix and security release.
This release fixes a tar regression introduced in libarchive 3.7.5

Important bugfixes.

tar: clean up linkpath between entries
tar: fix memory leaks when processing symlinks or parsing pax headers
iso: be more cautious about parsing ISO-9660 timestamps
@
text
@d2 1
a2 1
<!-- CreationDate: Sun Oct 13 08:12:10 2024 -->
@


1.12
log
@libarchive: updated to 3.7.5

Libarchive 3.7.5

Security fixes:

fix multiple vulnerabilities identified by SAST
cpio: ignore out-of-range gid/uid/size/ino and harden AFIO parsing
lzop: prevent integer overflow
rar4: protect copy_from_lzss_window_to_unp()
rar4: fix CVE-2024-26256
rar4: fix OOB in delta and audio filter
rar4: fix out of boundary access with large files
rar4: add boundary checks to rgb filter
rar4: fix OOB access with unicode filenames
rar5: clear 'data ready' cache on window buffer reallocs
rpm: calculate huge header sizes correctly
unzip: unify EOF handling
util: fix out of boundary access in mktemp functions
uu: stop processing if lines are too long

Important bugfixes:

7zip: fix issue when skipping first file in 7zip archive that is a multiple of 65536 bytes
ar: fix archive entries having no type
lha: do not allow negative file sizes
lha: fix integer truncation on 32-bit systems
shar: check strdup return value
rar5: don't try to read rediculously long names
xar: fix another infinite loop and expat error handling
many Windows fixes, cleanups and improvements
@
text
@d1 2
a2 2
<!-- Creator     : groff version 1.22.4 -->
<!-- CreationDate: Fri Sep 13 20:31:06 2024 -->
d23 1
a23 1
<p>CPIO(5) BSD File Formats Manual CPIO(5)</p>
d27 2
a28 2
<p style="margin-left:6%;"><b>cpio</b> &mdash; format of
cpio archive files</p>
d32 1
a32 1
<p style="margin-left:6%;">The <b>cpio</b> archive format
d37 2
a38 21
<p style="margin-left:6%; margin-top: 1em"><b>General
Format</b> <br>
Each file system object in a <b>cpio</b> archive comprises a
header record with basic numeric metadata followed by the
full pathname of the entry and the file data. The header
record stores a series of integer values that generally
follow the fields in <i>struct stat</i>. (See stat(2) for
details.) The variants differ primarily in how they store
those integers (binary, octal, or hexadecimal). The header
is followed by the pathname of the entry (the length of the
pathname is stored in the header) and any file data. The end
of the archive is indicated by a special record with the
pathname &ldquo;TRAILER!!!&rdquo;.</p>

<p style="margin-left:6%; margin-top: 1em"><b>PWB
format</b> <br>
The PWB binary <b>cpio</b> format is the original format,
when cpio was introduced as part of the Programmer&rsquo;s
Work Bench system, a variant of 6th Edition UNIX. It stores
numbers as 2-byte and 4-byte binary values. Each entry
begins with a header in the following format:</p>
d40 24
a63 1
<p style="margin-left:14%; margin-top: 1em">struct
d78 1
a78 1
<p style="margin-left:6%; margin-top: 1em">The <i>short</i>
d90 1
a90 1
<p style="margin-left:17%;">The integer value octal
d95 1
a95 1
<p style="margin-left:17%;">The device and inode numbers
d104 1
a104 1
<p style="margin-left:17%; margin-top: 1em">The mode
d116 1
a116 1
<p style="margin-left:28%; margin-top: 1em">IALLOC flag -
d121 1
a121 1
<p style="margin-left:28%; margin-top: 1em">This masks the
d126 1
a126 1
<p style="margin-left:28%; margin-top: 1em">File type value
d131 1
a131 1
<p style="margin-left:28%; margin-top: 1em">File type value
d136 1
a136 1
<p style="margin-left:28%; margin-top: 1em">File type value
d141 1
a141 1
<p style="margin-left:28%; margin-top: 1em">ILARG flag -
d146 1
a146 1
<p style="margin-left:28%; margin-top: 1em">SUID bit.</p>
d150 1
a150 1
<p style="margin-left:28%; margin-top: 1em">SGID bit.</p>
d154 1
a154 1
<p style="margin-left:28%; margin-top: 1em">Sticky bit.</p>
d158 1
a158 1
<p style="margin-left:28%; margin-top: 1em">The lower 9
d164 1
a164 1
<p style="margin-left:17%;">The numeric user id and group
d169 1
a169 1
<p style="margin-left:17%;">The number of links to this
d176 1
a176 1
<p style="margin-left:17%;">For block special and character
d184 1
a184 1
<p style="margin-left:17%;">Modification time of the file,
d190 1
a190 1
<p style="margin-left:17%;">The number of bytes in the
d196 1
a196 1
<p style="margin-left:17%;">The size of the file. Note that
d201 1
a201 1
<p style="margin-left:6%; margin-top: 1em">The pathname
d208 1
a208 1
<p style="margin-left:6%; margin-top: 1em">Hardlinked files
d212 7
a218 6
<p style="margin-left:6%; margin-top: 1em"><b>New Binary
Format</b> <br>
The new binary <b>cpio</b> format showed up when cpio was
adopted into late 7th Edition UNIX. It is exactly like the
PWB binary format, described above, except for three
changes:</p>
d220 1
a220 1
<p style="margin-left:6%; margin-top: 1em">First, UNIX now
d231 1
a231 1
<p style="margin-left:6%; margin-top: 1em">Next, 7th
d238 1
a238 1
<p style="margin-left:18%; margin-top: 1em">This masks the
d243 1
a243 1
<p style="margin-left:18%; margin-top: 1em">File type value
d248 1
a248 1
<p style="margin-left:18%; margin-top: 1em">File type value
d254 1
a254 1
<p style="margin-left:18%; margin-top: 1em">File type value
d259 1
a259 1
<p style="margin-left:18%; margin-top: 1em">File type value
d264 1
a264 1
<p style="margin-left:18%; margin-top: 1em">File type value
d269 1
a269 1
<p style="margin-left:18%; margin-top: 1em">File type value
d274 1
a274 1
<p style="margin-left:18%; margin-top: 1em">File type value
d279 1
a279 1
<p style="margin-left:18%; margin-top: 1em">SUID bit.</p>
d283 1
a283 1
<p style="margin-left:18%; margin-top: 1em">SGID bit.</p>
d287 1
a287 1
<p style="margin-left:18%; margin-top: 1em">Sticky bit.</p>
d291 1
a291 1
<p style="margin-left:18%; margin-top: 1em">The lower 9
d295 1
a295 1
<p style="margin-left:6%; margin-top: 1em">Finally, the
d300 1
a300 1
<p style="margin-left:6%; margin-top: 1em">Note that there
d314 10
a323 9
<p style="margin-left:6%; margin-top: 1em"><b>Portable
ASCII Format</b> <br>
Version&nbsp;2 of the Single UNIX Specification
(&ldquo;SUSv2&rdquo;) standardized an ASCII variant that is
portable across all platforms. It is commonly known as the
&ldquo;old character&rdquo; format or as the
&ldquo;odc&rdquo; format. It stores the same numeric fields
as the old binary format, but represents them as 6-character
or 11-character octal values.</p>
d325 1
a325 1
<p style="margin-left:14%; margin-top: 1em">struct
d340 1
a340 1
<p style="margin-left:6%; margin-top: 1em">The fields are
d349 2
a350 5
<p style="margin-left:6%; margin-top: 1em"><b>New ASCII
Format</b> <br>
The &quot;new&quot; ASCII format uses 8-byte hexadecimal
fields for all numbers and separates device numbers into
separate fields for major and minor numbers.</p>
d352 6
a357 1
<p style="margin-left:14%; margin-top: 1em">struct
d375 1
a375 1
<p style="margin-left:6%; margin-top: 1em">Except as
d381 1
a381 1
<p style="margin-left:17%; margin-top: 1em">The string
d386 1
a386 1
<p style="margin-left:17%; margin-top: 1em">This field is
d390 1
a390 1
<p style="margin-left:6%; margin-top: 1em">The pathname is
d397 1
a397 1
<p style="margin-left:6%; margin-top: 1em">In this format,
d402 25
a426 20
<p style="margin-left:6%; margin-top: 1em"><b>New CRC
Format</b> <br>
The CRC format is identical to the new ASCII format
described in the previous section except that the magic
field is set to &ldquo;070702&rdquo; and the <i>check</i>
field is set to the sum of all bytes in the file data. This
sum is computed treating all bytes as unsigned values and
using unsigned arithmetic. Only the least-significant 32
bits of the sum are stored.</p>

<p style="margin-left:6%; margin-top: 1em"><b>HP
variants</b> <br>
The <b>cpio</b> implementation distributed with HPUX used
XXXX but stored device numbers differently XXX.</p>

<p style="margin-left:6%; margin-top: 1em"><b>Other
Extensions and Variants</b> <br>
Sun Solaris uses additional file types to store extended
file data, including ACLs and extended attributes, as
special entries in cpio archives.</p>
d428 1
a428 1
<p style="margin-left:6%; margin-top: 1em">XXX Others?
d433 2
a434 1
<p style="margin-left:6%;">cpio(1), tar(5)</p>
d438 1
a438 1
<p style="margin-left:6%;">The <b>cpio</b> utility is no
d442 3
a444 2
standards by pax(1). The portable ASCII format is currently
part of the specification for the pax(1) utility.</p>
d448 1
a448 1
<p style="margin-left:6%;">The original cpio utility was
d464 1
a464 1
<p style="margin-left:6%;">The &ldquo;CRC&rdquo; format is
d468 1
a468 1
<p style="margin-left:6%; margin-top: 1em">The binary
d474 1
a474 1
<p style="margin-left:6%; margin-top: 1em">The old ASCII
d479 1
a479 1
<p style="margin-left:6%; margin-top: 1em">The new ASCII
d482 1
a482 1
<p style="margin-left:6%; margin-top: 1em">None of the cpio
d487 1
a487 1
<p style="margin-left:6%; margin-top: 1em">Especially when
d491 2
a492 4
be necessary even for the newer formats.</p>

<p style="margin-left:6%; margin-top: 1em">BSD
December&nbsp;23, 2011 BSD</p>
@


1.11
log
@libarchive: updated to 3.7.4

Libarchive 3.7.4 is a bugfix and security release

Security fixes:

rar: Fix OOB in rar e8 filter (CVE-2024-26256)
zip: Fix out of boundary access

Important bugfixes:

7zip: Limit amount of properties
bsdtar: Fix error handling around strtol() usages
passphrase: Improve newline handling on Windows
passphrase: Never allow empty passwords
rar: Fix "File CRC Error" when extracting specific rar4 archives
xar: Avoid infinite link loop
zip: Update AppleDouble support for directories
zstd: Implement core detection
@
text
@d2 1
a2 1
<!-- CreationDate: Fri Apr 26 09:23:47 2024 -->
@


1.10
log
@libarchive: updated to 3.7.3

Libarchive 3.7.3 is a feature, security and bugfix release.

New features:

PCRE2 support
add trailing letter b to bsdtar(1) substitute pattern
add support for long options "--group" and "--owner" to tar(1)

Security fixes:

Fix possible vulnerability in tar error reporting introduced in f27c173

Important bugfixes:

ISO9660: preserve the natural order of links
rar5: fix decoding unicode filenames on Windows
rar5: fix infinite loop if during rar5 decompression the last block produced no data
xz filter: fix incorrect eof at the end of an lzip member
zip: fix end-of-data marker processing when decompressing zip archives
multiple bsdunzip(1) fixes
filetime truncation fix on Windows
@
text
@d2 1
a2 1
<!-- CreationDate: Sun Apr  7 22:36:27 2024 -->
@


1.9
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
@d2 1
a2 1
<!-- CreationDate: Mon Sep 11 22:06:21 2023 -->
@


1.8
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
@d1 2
a2 2
<!-- Creator     : groff version 1.22.3 -->
<!-- CreationDate: Wed May 20 01:10:08 2020 -->
d49 1
a49 1
pathname &rsquo;&rsquo;TRAILER!!!&rsquo;&rsquo;.</p>
d53 5
a57 2
XXX Any documentation of the original PWB/UNIX 1.0 format?
XXX</p>
d59 14
a72 5
<p style="margin-left:6%; margin-top: 1em"><b>Old Binary
Format</b> <br>
The old binary <b>cpio</b> format stores numbers as 2-byte
and 4-byte binary values. Each entry begins with a header in
the following format:</p>
d74 9
a82 41
<p style="margin-left:14%; margin-top: 1em">struct
header_old_cpio { <br>
unsigned short c_magic; <br>
unsigned short c_dev; <br>
unsigned short c_ino; <br>
unsigned short c_mode; <br>
unsigned short c_uid; <br>
unsigned short c_gid; <br>
unsigned short c_nlink; <br>
unsigned short c_rdev;</p>

<table width="100%" border="0" rules="none" frame="void"
       cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="24%"></td>
<td width="11%">


<p>unsigned short c_mtime[2];</p></td>
<td width="65%">
</td></tr>
</table>

<p style="margin-left:14%;">unsigned short c_namesize;</p>

<table width="100%" border="0" rules="none" frame="void"
       cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="24%"></td>
<td width="76%">


<p>unsigned short c_filesize[2];</p></td></tr>
</table>

<p style="margin-left:14%;">};</p>

<p style="margin-left:6%; margin-top: 1em">The <i>unsigned
short</i> fields here are 16-bit integer values; the
<i>unsigned int</i> fields are 32-bit integer values. The
fields are as follows</p>
d84 1
a84 1
<p style="margin-top: 1em"><i>magic</i></p>
d86 2
a87 4
<p style="margin-left:17%; margin-top: 1em">The integer
value octal 070707. This value can be used to determine
whether this archive is written with little-endian or
big-endian integers.</p>
d89 1
a89 1
<p style="margin-top: 1em"><i>dev</i>, <i>ino</i></p>
d98 1
a98 1
<p style="margin-top: 1em"><i>mode</i></p>
d101 8
a108 2
specifies both the regular permissions and the file type. It
consists of several bit fields as follows:</p>
d110 6
a115 1
<p>0170000</p>
d120 1
a120 1
<p>0140000</p>
d123 1
a123 1
for sockets.</p>
d125 1
a125 1
<p>0120000</p>
d128 1
a128 7
for symbolic links. For symbolic links, the link body is
stored as file data.</p>

<p>0100000</p>

<p style="margin-left:28%; margin-top: 1em">File type value
for regular files.</p>
a134 10
<p>0040000</p>

<p style="margin-left:28%; margin-top: 1em">File type value
for directories.</p>

<p>0020000</p>

<p style="margin-left:28%; margin-top: 1em">File type value
for character special devices.</p>

d137 2
a138 2
<p style="margin-left:28%; margin-top: 1em">File type value
for named pipes or FIFOs.</p>
d150 1
a150 3
<p style="margin-left:28%; margin-top: 1em">Sticky bit. On
some systems, this modifies the behavior of executables
and/or directories.</p>
d158 1
a158 1
<p style="margin-top: 1em"><i>uid</i>, <i>gid</i></p>
d163 1
a163 1
<p style="margin-top: 1em"><i>nlink</i></p>
d165 11
a175 10
<p style="margin-left:17%; margin-top: 1em">The number of
links to this file. Directories always have a value of at
least two here. Note that hardlinked files include file data
with every copy in the archive.</p>

<p style="margin-top: 1em"><i>rdev</i></p>

<p style="margin-left:17%; margin-top: 1em">For block
special and character special entries, this field contains
the associated device number. For all other entry types, it
d178 1
a178 1
<p style="margin-top: 1em"><i>mtime</i></p>
d180 3
a182 7
<p style="margin-left:17%; margin-top: 1em">Modification
time of the file, indicated as the number of seconds since
the start of the epoch, 00:00:00 UTC January 1, 1970. The
four-byte integer is stored with the most-significant 16
bits first followed by the least-significant 16 bits. Each
of the two 16 bit values are stored in machine-native byte
order.</p>
d184 1
a184 1
<p style="margin-top: 1em"><i>namesize</i></p>
d190 1
a190 1
<p style="margin-top: 1em"><i>filesize</i></p>
d193 3
a195 3
this archive format is limited to four gigabyte file sizes.
See <i>mtime</i> above for a description of the storage of
four-byte integers.</p>
d198 1
a198 1
immediately follows the fixed header. If the <b>namesize</b>
d200 3
a202 2
The file data is then appended, padded with NUL bytes to an
even length.</p>
d208 101
d312 6
a317 7
(&rsquo;&rsquo;SUSv2&rsquo;&rsquo;) standardized an ASCII
variant that is portable across all platforms. It is
commonly known as the &rsquo;&rsquo;old
character&rsquo;&rsquo; format or as the
&rsquo;&rsquo;odc&rsquo;&rsquo; format. It stores the same
numeric fields as the old binary format, but represents them
as 6-character or 11-character octal values.</p>
d335 4
a338 4
identical to those in the old binary format. The name and
file body follow the fixed header. Unlike the old binary
format, there is no additional padding after the pathname or
file contents. If the files being archived are themselves
d369 1
a369 1
the old binary format above.</p>
d374 1
a374 1
&rsquo;&rsquo;070701&rsquo;&rsquo;.</p>
d398 5
a402 5
field is set to &rsquo;&rsquo;070702&rsquo;&rsquo; and the
<i>check</i> field is set to the sum of all bytes in the
file data. This sum is computed treating all bytes as
unsigned values and using unsigned arithmetic. Only the
least-significant 32 bits of the sum are stored.</p>
d427 3
a429 4
(&rsquo;&rsquo;SUSv2&rsquo;&rsquo;). It has been supplanted
in subsequent standards by pax(1). The portable ASCII format
is currently part of the specification for the pax(1)
utility.</p>
d436 7
a442 8
1.0, the &rsquo;&rsquo;Programmer&rsquo;s Work
Bench&rsquo;&rsquo; derived from Version&nbsp;6 AT&amp;T
UNIX that was used internally at AT&amp;T. Both the old
binary and old character formats were in use by 1980,
according to the System III source released by SCO under
their &rsquo;&rsquo;Ancient Unix&rsquo;&rsquo; license. The
character format was adopted as part of IEEE Std 1003.1-1988
(&rsquo;&rsquo;POSIX.1&rsquo;&rsquo;). XXX when did
d449 9
a457 9
<p style="margin-left:6%;">The
&rsquo;&rsquo;CRC&rsquo;&rsquo; format is mis-named, as it
uses a simple checksum and not a cyclic redundancy
check.</p>

<p style="margin-left:6%; margin-top: 1em">The old binary
format is limited to 16 bits for user id, group id, device,
and inode numbers. It is limited to 4 gigabyte file
sizes.</p>
@


1.7
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
@d1 2
a2 2
<!-- Creator     : groff version 1.22.4 -->
<!-- CreationDate: Wed Jun 12 21:10:18 2019 -->
d49 1
a49 1
pathname &ldquo;TRAILER!!!&rdquo;.</p>
d242 7
a248 6
(&ldquo;SUSv2&rdquo;) standardized an ASCII variant that is
portable across all platforms. It is commonly known as the
&ldquo;old character&rdquo; format or as the
&ldquo;odc&rdquo; format. It stores the same numeric fields
as the old binary format, but represents them as 6-character
or 11-character octal values.</p>
d305 1
a305 1
&ldquo;070701&rdquo;.</p>
d322 1
a322 1
for each entry except the last one that appears in the
d329 5
a333 5
field is set to &ldquo;070702&rdquo; and the <i>check</i>
field is set to the sum of all bytes in the file data. This
sum is computed treating all bytes as unsigned values and
using unsigned arithmetic. Only the least-significant 32
bits of the sum are stored.</p>
d358 4
a361 3
(&ldquo;SUSv2&rdquo;). It has been supplanted in subsequent
standards by pax(1). The portable ASCII format is currently
part of the specification for the pax(1) utility.</p>
d368 8
a375 7
1.0, the &ldquo;Programmer&rsquo;s Work Bench&rdquo; derived
from Version&nbsp;6 AT&amp;T UNIX that was used internally
at AT&amp;T. Both the old binary and old character formats
were in use by 1980, according to the System III source
released by SCO under their &ldquo;Ancient Unix&rdquo;
license. The character format was adopted as part of IEEE
Std 1003.1-1988 (&ldquo;POSIX.1&rdquo;). XXX when did
d382 4
a385 3
<p style="margin-left:6%;">The &ldquo;CRC&rdquo; format is
mis-named, as it uses a simple checksum and not a cyclic
redundancy check.</p>
@


1.6
log
@libarchive: updated to 3.3.3

libarchive 3.3.3:
Avoid super-linear slowdown on malformed mtree files
Many fixes for building with Visual Studio
NO_OVERWRITE doesn't change existing directory attributes
New support for Zstandard read and write filters
@
text
@d1 2
a2 2
<!-- Creator     : groff version 1.22.3 -->
<!-- CreationDate: Mon Sep  3 22:55:09 2018 -->
d49 1
a49 1
pathname &rsquo;&rsquo;TRAILER!!!&rsquo;&rsquo;.</p>
d242 6
a247 7
(&rsquo;&rsquo;SUSv2&rsquo;&rsquo;) standardized an ASCII
variant that is portable across all platforms. It is
commonly known as the &rsquo;&rsquo;old
character&rsquo;&rsquo; format or as the
&rsquo;&rsquo;odc&rsquo;&rsquo; format. It stores the same
numeric fields as the old binary format, but represents them
as 6-character or 11-character octal values.</p>
d304 1
a304 1
&rsquo;&rsquo;070701&rsquo;&rsquo;.</p>
d328 5
a332 5
field is set to &rsquo;&rsquo;070702&rsquo;&rsquo; and the
<i>check</i> field is set to the sum of all bytes in the
file data. This sum is computed treating all bytes as
unsigned values and using unsigned arithmetic. Only the
least-significant 32 bits of the sum are stored.</p>
d357 3
a359 4
(&rsquo;&rsquo;SUSv2&rsquo;&rsquo;). It has been supplanted
in subsequent standards by pax(1). The portable ASCII format
is currently part of the specification for the pax(1)
utility.</p>
d366 7
a372 8
1.0, the &rsquo;&rsquo;Programmer&rsquo;s Work
Bench&rsquo;&rsquo; derived from Version&nbsp;6 AT&amp;T
UNIX that was used internally at AT&amp;T. Both the old
binary and old character formats were in use by 1980,
according to the System III source released by SCO under
their &rsquo;&rsquo;Ancient Unix&rsquo;&rsquo; license. The
character format was adopted as part of IEEE Std 1003.1-1988
(&rsquo;&rsquo;POSIX.1&rsquo;&rsquo;). XXX when did
d379 3
a381 4
<p style="margin-left:6%;">The
&rsquo;&rsquo;CRC&rsquo;&rsquo; format is mis-named, as it
uses a simple checksum and not a cyclic redundancy
check.</p>
@


1.5
log
@Merge for libarchive-3.3.2.
@
text
@d2 1
a2 1
<!-- CreationDate: Mon Jul 10 02:32:57 2017 -->
@


1.4
log
@Merge libarchive-3.3.1.
@
text
@d2 1
a2 1
<!-- CreationDate: Sat Feb 25 11:22:06 2017 -->
d49 1
a49 1
pathname &lsquo;&lsquo;TRAILER!!!&rsquo;&rsquo;.</p>
d242 1
a242 1
(&lsquo;&lsquo;SUSv2&rsquo;&rsquo;) standardized an ASCII
d244 1
a244 1
commonly known as the &lsquo;&lsquo;old
d246 1
a246 1
&lsquo;&lsquo;odc&rsquo;&rsquo; format. It stores the same
d305 1
a305 1
&lsquo;&lsquo;070701&rsquo;&rsquo;.</p>
d329 1
a329 1
field is set to &lsquo;&lsquo;070702&rsquo;&rsquo; and the
d358 1
a358 1
(&lsquo;&lsquo;SUSv2&rsquo;&rsquo;). It has been supplanted
d368 1
a368 1
1.0, the &lsquo;&lsquo;Programmer&rsquo;s Work
d373 1
a373 1
their &lsquo;&lsquo;Ancient Unix&rsquo;&rsquo; license. The
d375 1
a375 1
(&lsquo;&lsquo;POSIX.1&rsquo;&rsquo;). XXX when did
d383 1
a383 1
&lsquo;&lsquo;CRC&rsquo;&rsquo; format is mis-named, as it
@


1.3
log
@Update for libarchive 3.2.1.
@
text
@d2 1
a2 1
<!-- CreationDate: Sun Jun 19 19:54:08 2016 -->
d49 1
a49 1
pathname &rsquo;&rsquo;TRAILER!!!&rsquo;&rsquo;.</p>
d242 1
a242 1
(&rsquo;&rsquo;SUSv2&rsquo;&rsquo;) standardized an ASCII
d244 1
a244 1
commonly known as the &rsquo;&rsquo;old
d246 1
a246 1
&rsquo;&rsquo;odc&rsquo;&rsquo; format. It stores the same
d305 1
a305 1
&rsquo;&rsquo;070701&rsquo;&rsquo;.</p>
d329 1
a329 1
field is set to &rsquo;&rsquo;070702&rsquo;&rsquo; and the
d358 1
a358 1
(&rsquo;&rsquo;SUSv2&rsquo;&rsquo;). It has been supplanted
d368 1
a368 1
1.0, the &rsquo;&rsquo;Programmer&rsquo;s Work
d373 1
a373 1
their &rsquo;&rsquo;Ancient Unix&rsquo;&rsquo; license. The
d375 1
a375 1
(&rsquo;&rsquo;POSIX.1&rsquo;&rsquo;). XXX when did
d383 1
a383 1
&rsquo;&rsquo;CRC&rsquo;&rsquo; format is mis-named, as it
@


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
@d1 2
a2 2
<!-- Creator     : groff version 1.21 -->
<!-- CreationDate: Sat Feb  9 12:24:07 2013 -->
@


1.1
log
@Initial revision
@
text
@d1 2
a2 2
<!-- Creator     : groff version 1.19.2 -->
<!-- CreationDate: Thu Feb  4 20:36:34 2010 -->
d11 4
a14 3
       p     { margin-top: 0; margin-bottom: 0; }
       pre   { margin-top: 0; margin-bottom: 0; }
       table { margin-top: 0; margin-bottom: 0; }
d23 1
a23 2
<p valign="top">CPIO(5) FreeBSD File Formats Manual
CPIO(5)</p>
d25 1
a25 1
<p style="margin-top: 1em" valign="top"><b>NAME</b></p>
d27 1
a27 1
<p style="margin-left:8%;"><b>cpio</b> &mdash; format of
d30 1
d32 1
a32 3
<p style="margin-top: 1em" valign="top"><b>DESCRIPTION</b></p>

<p style="margin-left:8%;">The <b>cpio</b> archive format
d37 1
a37 1
<p style="margin-left:8%; margin-top: 1em"><b>General
d49 1
a49 1
pathname &lsquo;&lsquo;TRAILER!!!&rsquo;&rsquo;.</p>
d51 1
a51 1
<p style="margin-left:8%; margin-top: 1em"><b>PWB
d56 1
a56 1
<p style="margin-left:8%; margin-top: 1em"><b>Old Binary
d62 1
a62 1
<p style="margin-left:17%; margin-top: 1em">struct
d73 1
a73 1
<table width="100%" border=0 rules="none" frame="void"
d76 2
a77 2
<td width="29%"></td>
<td width="13%">
d80 3
a82 3
<p valign="top">unsigned short c_mtime[2];</p></td>
<td width="58%">
</td>
d85 1
a85 1
<p style="margin-left:17%;">unsigned short c_namesize;</p>
d87 1
a87 1
<table width="100%" border=0 rules="none" frame="void"
d90 2
a91 2
<td width="29%"></td>
<td width="71%">
d94 1
a94 1
<p valign="top">unsigned short c_filesize[2];</p></td>
d97 1
a97 1
<p style="margin-left:17%;">};</p>
d99 1
a99 1
<p style="margin-left:8%; margin-top: 1em">The <i>unsigned
d104 1
a104 1
<p style="margin-top: 1em" valign="top"><i>magic</i></p>
d106 1
a106 1
<p style="margin-left:20%; margin-top: 1em">The integer
d111 1
a111 2
<p style="margin-top: 1em" valign="top"><i>dev</i>,
<i>ino</i></p>
d113 1
a113 1
<p style="margin-left:20%;">The device and inode numbers
d120 1
a120 1
<p style="margin-top: 1em" valign="top"><i>mode</i></p>
d122 1
a122 1
<p style="margin-left:20%; margin-top: 1em">The mode
d126 1
a126 1
<p valign="top">0170000</p>
d128 1
a128 1
<p style="margin-left:34%; margin-top: 1em">This masks the
d131 1
a131 1
<p valign="top">0140000</p>
d133 1
a133 1
<p style="margin-left:34%; margin-top: 1em">File type value
d136 1
a136 1
<p valign="top">0120000</p>
d138 1
a138 1
<p style="margin-left:34%; margin-top: 1em">File type value
d142 1
a142 1
<p valign="top">0100000</p>
d144 1
a144 1
<p style="margin-left:34%; margin-top: 1em">File type value
d147 1
a147 1
<p valign="top">0060000</p>
d149 1
a149 1
<p style="margin-left:34%; margin-top: 1em">File type value
d152 1
a152 1
<p valign="top">0040000</p>
d154 1
a154 1
<p style="margin-left:34%; margin-top: 1em">File type value
d157 1
a157 1
<p valign="top">0020000</p>
d159 1
a159 1
<p style="margin-left:34%; margin-top: 1em">File type value
d162 1
a162 1
<p valign="top">0010000</p>
d164 1
a164 1
<p style="margin-left:34%; margin-top: 1em">File type value
d167 1
a167 1
<p valign="top">0004000</p>
d169 1
a169 1
<p style="margin-left:34%; margin-top: 1em">SUID bit.</p>
d171 1
a171 1
<p valign="top">0002000</p>
d173 1
a173 1
<p style="margin-left:34%; margin-top: 1em">SGID bit.</p>
d175 1
a175 1
<p valign="top">0001000</p>
d177 1
a177 1
<p style="margin-left:34%; margin-top: 1em">Sticky bit. On
d181 1
a181 1
<p valign="top">0000777</p>
d183 1
a183 1
<p style="margin-left:34%; margin-top: 1em">The lower 9
d187 1
a187 2
<p style="margin-top: 1em" valign="top"><i>uid</i>,
<i>gid</i></p>
d189 1
a189 1
<p style="margin-left:20%;">The numeric user id and group
d192 1
a192 1
<p style="margin-top: 1em" valign="top"><i>nlink</i></p>
d194 1
a194 1
<p style="margin-left:20%; margin-top: 1em">The number of
d199 1
a199 1
<p style="margin-top: 1em" valign="top"><i>rdev</i></p>
d201 1
a201 1
<p style="margin-left:20%; margin-top: 1em">For block
d206 1
a206 1
<p style="margin-top: 1em" valign="top"><i>mtime</i></p>
d208 1
a208 1
<p style="margin-left:20%; margin-top: 1em">Modification
d216 1
d218 1
a218 3
<p style="margin-top: 1em" valign="top"><i>namesize</i></p>

<p style="margin-left:20%;">The number of bytes in the
d222 1
d224 1
a224 3
<p style="margin-top: 1em" valign="top"><i>filesize</i></p>

<p style="margin-left:20%;">The size of the file. Note that
d229 1
a229 1
<p style="margin-left:8%; margin-top: 1em">The pathname
d235 1
a235 1
<p style="margin-left:8%; margin-top: 1em">Hardlinked files
d239 1
a239 1
<p style="margin-left:8%; margin-top: 1em"><b>Portable
d242 1
a242 1
(&lsquo;&lsquo;SUSv2&rsquo;&rsquo;) standardized an ASCII
d244 1
a244 1
commonly known as the &lsquo;&lsquo;old
d246 1
a246 1
&lsquo;&lsquo;odc&rsquo;&rsquo; format. It stores the same
d250 1
a250 1
<p style="margin-left:17%; margin-top: 1em">struct
d265 1
a265 1
<p style="margin-left:8%; margin-top: 1em">The fields are
d274 1
a274 1
<p style="margin-left:8%; margin-top: 1em"><b>New ASCII
d280 1
a280 1
<p style="margin-left:17%; margin-top: 1em">struct
d298 1
a298 1
<p style="margin-left:8%; margin-top: 1em">Except as
d302 1
a302 1
<p style="margin-top: 1em" valign="top"><i>magic</i></p>
d304 2
a305 2
<p style="margin-left:20%; margin-top: 1em">The string
&lsquo;&lsquo;070701&rsquo;&rsquo;.</p>
d307 1
a307 1
<p style="margin-top: 1em" valign="top"><i>check</i></p>
d309 1
a309 1
<p style="margin-left:20%; margin-top: 1em">This field is
d313 1
a313 1
<p style="margin-left:8%; margin-top: 1em">The pathname is
d320 1
a320 1
<p style="margin-left:8%; margin-top: 1em">In this format,
d325 1
a325 1
<p style="margin-left:8%; margin-top: 1em"><b>New CRC
d329 1
a329 1
field is set to &lsquo;&lsquo;070702&rsquo;&rsquo; and the
d335 1
a335 1
<p style="margin-left:8%; margin-top: 1em"><b>HP
d340 1
a340 1
<p style="margin-left:8%; margin-top: 1em"><b>Other
d346 1
a346 1
<p style="margin-left:8%; margin-top: 1em">XXX Others?
d349 32
a380 1
<p style="margin-top: 1em" valign="top"><b>BUGS</b></p>
d382 2
a383 2
<p style="margin-left:8%;">The
&lsquo;&lsquo;CRC&rsquo;&rsquo; format is mis-named, as it
d387 1
a387 1
<p style="margin-left:8%; margin-top: 1em">The old binary
d392 1
a392 1
<p style="margin-left:8%; margin-top: 1em">The old ASCII
d397 1
a397 1
<p style="margin-left:8%; margin-top: 1em">The new ASCII
d400 1
a400 1
<p style="margin-left:8%; margin-top: 1em">None of the cpio
d405 1
a405 1
<p style="margin-left:8%; margin-top: 1em">Especially when
d411 2
a412 35
<p style="margin-top: 1em" valign="top"><b>SEE ALSO</b></p>

<p style="margin-left:8%;">cpio(1), tar(5)</p>


<p style="margin-top: 1em" valign="top"><b>STANDARDS</b></p>

<p style="margin-left:8%;">The <b>cpio</b> utility is no
longer a part of POSIX or the Single Unix Standard. It last
appeared in Version&nbsp;2 of the Single UNIX Specification
(&lsquo;&lsquo;SUSv2&rsquo;&rsquo;). It has been supplanted
in subsequent standards by pax(1). The portable ASCII format
is currently part of the specification for the pax(1)
utility.</p>

<p style="margin-top: 1em" valign="top"><b>HISTORY</b></p>

<p style="margin-left:8%;">The original cpio utility was
written by Dick Haight while working in AT&amp;T&rsquo;s
Unix Support Group. It appeared in 1977 as part of PWB/UNIX
1.0, the &lsquo;&lsquo;Programmer&rsquo;s Work
Bench&rsquo;&rsquo; derived from Version&nbsp;6 AT&amp;T
UNIX that was used internally at AT&amp;T. Both the old
binary and old character formats were in use by 1980,
according to the System III source released by SCO under
their &lsquo;&lsquo;Ancient Unix&rsquo;&rsquo; license. The
character format was adopted as part of IEEE Std 1003.1-1988
(&lsquo;&lsquo;POSIX.1&rsquo;&rsquo;). XXX when did
&quot;newc&quot; appear? Who invented it? When did HP come
out with their variant? When did Sun introduce ACLs and
extended attributes? XXX</p>


<p style="margin-left:8%; margin-top: 1em">FreeBSD&nbsp;8.0
October&nbsp;5, 2007 FreeBSD&nbsp;8.0</p>
@


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
@libarchive-2.8.2:
- Fix NULL deference for short self-extracting zip archives
- Don't dereference symlinks on Linux when reading ACLs
- Better detection of SHA2 support for old OpenSSL versions
- Fix parsing of input files for bsdtar -T
- Do not leak setup_xattr into the global namespace
- Fix build when an older libarchive is already installed
- Use O_BINARY opening files in bsdtar
- Include missing archive_crc32.h
- Correctly include iconv.h required by libxml2
@
text
@d1 422
a422 769
%!PS-Adobe-3.0
%%Creator: groff version 1.19.2
%%CreationDate: Sun Mar 14 02:49:16 2010
%%DocumentNeededResources: font Times-Roman
%%DocumentSuppliedResources: procset grops 1.19 2
%%Pages: 60
%%PageOrder: Ascend
%%DocumentMedia: Default 612 792 0 () ()
%%Orientation: Portrait
%%EndComments
%%BeginDefaults
%%PageMedia: Default
%%EndDefaults
%%BeginProlog
%%BeginResource: procset grops 1.19 2
%!PS-Adobe-3.0 Resource-ProcSet
/setpacking where{
pop
currentpacking
true setpacking
}if
/grops 120 dict dup begin
/SC 32 def
/A/show load def
/B{0 SC 3 -1 roll widthshow}bind def
/C{0 exch ashow}bind def
/D{0 exch 0 SC 5 2 roll awidthshow}bind def
/E{0 rmoveto show}bind def
/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
/G{0 rmoveto 0 exch ashow}bind def
/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
/I{0 exch rmoveto show}bind def
/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
/K{0 exch rmoveto 0 exch ashow}bind def
/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
/M{rmoveto show}bind def
/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
/O{rmoveto 0 exch ashow}bind def
/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
/Q{moveto show}bind def
/R{moveto 0 SC 3 -1 roll widthshow}bind def
/S{moveto 0 exch ashow}bind def
/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
/SF{
findfont exch
[exch dup 0 exch 0 exch neg 0 0]makefont
dup setfont
[exch/setfont cvx]cvx bind def
}bind def
/MF{
findfont
[5 2 roll
0 3 1 roll
neg 0 0]makefont
dup setfont
[exch/setfont cvx]cvx bind def
}bind def
/level0 0 def
/RES 0 def
/PL 0 def
/LS 0 def
/MANUAL{
statusdict begin/manualfeed true store end
}bind def
/PLG{
gsave newpath clippath pathbbox grestore
exch pop add exch pop
}bind def
/BP{
/level0 save def
1 setlinecap
1 setlinejoin
72 RES div dup scale
LS{
90 rotate
}{
0 PL translate
}ifelse
1 -1 scale
}bind def
/EP{
level0 restore
showpage
}def
/DA{
newpath arcn stroke
}bind def
/SN{
transform
.25 sub exch .25 sub exch
round .25 add exch round .25 add exch
itransform
}bind def
/DL{
SN
moveto
SN
lineto stroke
}bind def
/DC{
newpath 0 360 arc closepath
}bind def
/TM matrix def
/DE{
TM currentmatrix pop
translate scale newpath 0 0 .5 0 360 arc closepath
TM setmatrix
}bind def
/RC/rcurveto load def
/RL/rlineto load def
/ST/stroke load def
/MT/moveto load def
/CL/closepath load def
/Fr{
setrgbcolor fill
}bind def
/setcmykcolor where{
pop
/Fk{
setcmykcolor fill
}bind def
}if
/Fg{
setgray fill
}bind def
/FL/fill load def
/LW/setlinewidth load def
/Cr/setrgbcolor load def
/setcmykcolor where{
pop
/Ck/setcmykcolor load def
}if
/Cg/setgray load def
/RE{
findfont
dup maxlength 1 index/FontName known not{1 add}if dict begin
{
1 index/FID ne{def}{pop pop}ifelse
}forall
/Encoding exch def
dup/FontName exch def
currentdict end definefont pop
}bind def
/DEFS 0 def
/EBEGIN{
moveto
DEFS begin
}bind def
/EEND/end load def
/CNT 0 def
/level1 0 def
/PBEGIN{
/level1 save def
translate
div 3 1 roll div exch scale
neg exch neg exch translate
0 setgray
0 setlinecap
1 setlinewidth
0 setlinejoin
10 setmiterlimit
[]0 setdash
/setstrokeadjust where{
pop
false setstrokeadjust
}if
/setoverprint where{
pop
false setoverprint
}if
newpath
/CNT countdictstack def
userdict begin
/showpage{}def
/setpagedevice{}def
}bind def
/PEND{
countdictstack CNT sub{end}repeat
level1 restore
}bind def
end def
/setpacking where{
pop
setpacking
}if
%%EndResource
%%EndProlog
%%BeginSetup
%%BeginFeature: *PageSize Default
<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
%%EndFeature
%%IncludeResource: font Times-Roman
grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
/Times-Roman@@0 ENC0/Times-Roman RE
%%EndSetup
%%Page: 1 1
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<html>)0 12 Q(<head>)0 24 Q(<title>)36 36 Q
(October 5, 2007 CPIO 5)74.5 48 Q(</title>)36 72 Q 0 Cg EP
%%Page: 2 2
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<style type="te)36 12 Q(xt/css">)-.15 E(<!--)36
24 Q(body { mar)72 36 Q(gin-left:4%; })-.18 E(H1, H2, H3, H4, H5 {)72 48
Q(color: maroon; padding: 4pt; mar)108 60 Q(gin-left: -4%;)-.18 E
(border: solid; border)108 72 Q(-width: thin; width: 100%;)-.2 E 0 Cg EP
%%Page: 3 3
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(background: r)108 12 Q(gb\(204,204,255\))-.18 E
(})72 24 Q(-->)36 36 Q(</style>)36 48 Q(</head>)0 60 Q
(<body bgcolor="#FFFFFF" te)0 72 Q(xt="#000000">)-.15 E 0 Cg EP
%%Page: 4 4
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<h3 id="N)36 12 Q(AME">)-.35 E -.35(NA)36 24 S
(ME).35 E(</h3>)36 36 Q(<b>cpio</b>)0 48 Q 2.5(-f)0 60 S
(ormat of cpio archi)-2.5 E .3 -.15(ve \214)-.25 H(les).15 E
(<h3 id="DESCRIPTION">)36 72 Q 0 Cg EP
%%Page: 5 5
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(DESCRIPTION)36 12 Q(</h3>)36 24 Q(The)0 36 Q
(<b>cpio</b>)0 48 Q(archi)0 60 Q .3 -.15(ve f)-.25 H(ormat collects an)
.15 E 2.5(yn)-.15 G(umber of \214les, directories, and other)-2.5 E
(\214le system objects \(symbolic links, de)0 72 Q
(vice nodes, etc.\) into a single)-.25 E 0 Cg EP
%%Page: 6 6
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(stream of bytes.)0 12 Q(<h4 id="General F)36 24
Q(ormat">)-.15 E(General F)36 36 Q(ormat)-.15 E(</h4>)36 48 Q
(Each \214le system object in a)0 60 Q(<b>cpio</b>)0 72 Q 0 Cg EP
%%Page: 7 7
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(archi)0 12 Q .3 -.15(ve c)-.25 H
(omprises a header record with basic numeric metadata).15 E(follo)0 24 Q
(wed by the full pathname of the entry and the \214le data.)-.25 E
(The header record stores a series of inte)0 36 Q(ger v)-.15 E
(alues that generally)-.25 E(follo)0 48 Q 2.5(wt)-.25 G(he \214elds in)
-2.5 E(<i></i><i>struct</i><i> stat</i>.)0 60 Q(\(See)0 72 Q 0 Cg EP
%%Page: 8 8
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<a href="../html2/stat.html">stat\(2\)</a>)0 12
Q(for details.\))0 24 Q(The v)0 36 Q(ariants dif)-.25 E
(fer primarily in ho)-.25 E 2.5(wt)-.25 G(he)-2.5 E 2.5(ys)-.15 G
(tore those inte)-2.5 E(gers)-.15 E(\(binary)0 48 Q 2.5(,o)-.65 G
(ctal, or he)-2.5 E(xadecimal\).)-.15 E(The header is follo)0 60 Q
(wed by the pathname of the)-.25 E
(entry \(the length of the pathname is stored in the header\))0 72 Q 0
Cg EP
%%Page: 9 9
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(and an)0 12 Q 2.5<798c>-.15 G(le data.)-2.5 E
(The end of the archi)0 24 Q .3 -.15(ve i)-.25 H 2.5(si).15 G
(ndicated by a special record with)-2.5 E(the pathname)0 36 Q -.74(``)0
48 S(TRAILER!!!').74 E('.)-.74 E(<h4 id="PWB format">)36 60 Q
(PWB format)36 72 Q 0 Cg EP
%%Page: 10 10
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(</h4>)36 12 Q(XXX An)0 24 Q 2.5(yd)-.15 G
(ocumentation of the original PWB/UNIX 1.0 format? XXX)-2.5 E
(<h4 id="Old Binary F)36 36 Q(ormat">)-.15 E(Old Binary F)36 48 Q(ormat)
-.15 E(</h4>)36 60 Q(The old binary)0 72 Q 0 Cg EP
%%Page: 11 11
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>cpio</b>)0 12 Q
(format stores numbers as 2-byte and 4-byte binary v)0 24 Q(alues.)-.25
E(Each entry be)0 36 Q(gins with a header in the follo)-.15 E
(wing format:)-.25 E(<dl compact><dt><dd>)0 48 Q(<code>)0 60 Q(<pre>)0
72 Q 0 Cg EP
%%Page: 12 12
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(struct header_old_cpio {)0 12 Q(unsigned short)
20 24 Q(c_magic;)7.5 E(unsigned short)20 36 Q(c_de)7.5 E(v;)-.25 E
(unsigned short)20 48 Q(c_ino;)7.5 E(unsigned short)20 60 Q(c_mode;)7.5
E(unsigned short)20 72 Q(c_uid;)7.5 E 0 Cg EP
%%Page: 13 13
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(unsigned short)20 12 Q(c_gid;)7.5 E
(unsigned short)20 24 Q(c_nlink;)7.5 E(unsigned short)20 36 Q(c_rde)7.5
E(v;)-.25 E(unsigned short)36 48 Q(c_mtime[2];)7.5 E(unsigned short)20
60 Q(c_namesize;)7.5 E(unsigned short)36 72 Q(c_\214lesize[2];)7.5 E 0
Cg EP
%%Page: 14 14
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(};)0 12 Q(</pre>)0 24 Q(</code>)0 36 Q(</dl>)0
48 Q(<p>)36 60 Q(The)0 72 Q 0 Cg EP
%%Page: 15 15
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<i></i><i>unsigned</i><i> short</i>)0 12 Q
(\214elds here are 16-bit inte)0 24 Q(ger v)-.15 E(alues; the)-.25 E
(<i></i><i>unsigned</i><i> int</i>)0 36 Q(\214elds are 32-bit inte)0 48
Q(ger v)-.15 E(alues.)-.25 E(The \214elds are as follo)0 60 Q(ws)-.25 E
(<dl compact>)0 72 Q 0 Cg EP
%%Page: 16 16
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<p><dt><i></i><i>magic</i><dd>)0 12 Q(The inte)0
24 Q(ger v)-.15 E(alue octal 070707.)-.25 E(This v)0 36 Q
(alue can be used to determine whether this archi)-.25 E .3 -.15(ve i)
-.25 H(s).15 E(written with little-endian or big-endian inte)0 48 Q
(gers.)-.15 E(<p><dt><i></i><i>de)0 60 Q(v</i><i></i>,<i> ino</i><dd>)
-.25 E(The de)0 72 Q(vice and inode numbers from the disk.)-.25 E 0 Cg
EP
%%Page: 17 17
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(These are used by programs that read)0 12 Q
(<b>cpio</b>)0 24 Q(archi)0 36 Q -.15(ve)-.25 G 2.5(st).15 G 2.5(od)-2.5
G(etermine when tw)-2.5 E 2.5(oe)-.1 G(ntries refer to the same \214le.)
-2.5 E(Programs that synthesize)0 48 Q(<b>cpio</b>)0 60 Q(archi)0 72 Q
-.15(ve)-.25 G 2.5(ss).15 G(hould be careful to set these to distinct v)
-2.5 E(alues for each entry)-.25 E(.)-.65 E 0 Cg EP
%%Page: 18 18
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<p><dt><i></i><i>mode</i><dd>)0 12 Q
(The mode speci\214es both the re)0 24 Q
(gular permissions and the \214le type.)-.15 E(It consists of se)0 36 Q
-.15(ve)-.25 G(ral bit \214elds as follo).15 E(ws:)-.25 E(<dl compact>)0
48 Q(<dt>0170000<dd>)0 60 Q(This masks the \214le type bits.)0 72 Q 0 Cg
EP
%%Page: 19 19
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<dt>0140000<dd>)0 12 Q(File type v)0 24 Q
(alue for sock)-.25 E(ets.)-.1 E(<dt>0120000<dd>)0 36 Q(File type v)0 48
Q(alue for symbolic links.)-.25 E -.15(Fo)0 60 S 2.5(rs).15 G
(ymbolic links, the link body is stored as \214le data.)-2.5 E
(<dt>0100000<dd>)0 72 Q 0 Cg EP
%%Page: 20 20
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(File type v)0 12 Q(alue for re)-.25 E
(gular \214les.)-.15 E(<dt>0060000<dd>)0 24 Q(File type v)0 36 Q
(alue for block special de)-.25 E(vices.)-.25 E(<dt>0040000<dd>)0 48 Q
(File type v)0 60 Q(alue for directories.)-.25 E(<dt>0020000<dd>)0 72 Q
0 Cg EP
%%Page: 21 21
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(File type v)0 12 Q
(alue for character special de)-.25 E(vices.)-.25 E(<dt>0010000<dd>)0 24
Q(File type v)0 36 Q(alue for named pipes or FIFOs.)-.25 E
(<dt>0004000<dd>)0 48 Q(SUID bit.)0 60 Q(<dt>0002000<dd>)0 72 Q 0 Cg EP
%%Page: 22 22
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(SGID bit.)0 12 Q(<dt>0001000<dd>)0 24 Q(Stick)0
36 Q 2.5(yb)-.15 G(it.)-2.5 E(On some systems, this modi\214es the beha)
0 48 Q(vior of e)-.2 E -.15(xe)-.15 G(cutables and/or directories.).15 E
(<dt>0000777<dd>)0 60 Q(The lo)0 72 Q(wer 9 bits specify read/write/e)
-.25 E -.15(xe)-.15 G(cute permissions).15 E 0 Cg EP
%%Page: 23 23
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(for w)0 12 Q(orld, group, and user follo)-.1 E
(wing standard POSIX con)-.25 E -.15(ve)-.4 G(ntions.).15 E(</dl>)0 24 Q
(<p><dt><i></i><i>uid</i><i></i>,<i> gid</i><dd>)0 36 Q
(The numeric user id and group id of the o)0 48 Q(wner)-.25 E(.)-.55 E
(<p><dt><i></i><i>nlink</i><dd>)0 60 Q
(The number of links to this \214le.)0 72 Q 0 Cg EP
%%Page: 24 24
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(Directories al)0 12 Q -.1(wa)-.1 G(ys ha).1 E .3
-.15(ve a v)-.2 H(alue of at least tw)-.1 E 2.5(oh)-.1 G(ere.)-2.5 E
(Note that hardlink)0 24 Q(ed \214les include \214le data with e)-.1 E
-.15(ve)-.25 G(ry cop).15 E 2.5(yi)-.1 G 2.5(nt)-2.5 G(he archi)-2.5 E
-.15(ve)-.25 G(.).15 E(<p><dt><i></i><i>rde)0 36 Q(v</i><dd>)-.25 E -.15
(Fo)0 48 S 2.5(rb).15 G(lock special and character special entries,)-2.5
E(this \214eld contains the associated de)0 60 Q(vice number)-.25 E(.)
-.55 E -.15(Fo)0 72 S 2.5(ra).15 G
(ll other entry types, it should be set to zero by writers)-2.5 E 0 Cg
EP
%%Page: 25 25
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(and ignored by readers.)0 12 Q
(<p><dt><i></i><i>mtime</i><dd>)0 24 Q
(Modi\214cation time of the \214le, indicated as the number)0 36 Q
(of seconds since the start of the epoch,)0 48 Q
(00:00:00 UTC January 1, 1970.)0 60 Q(The four)0 72 Q(-byte inte)-.2 E
(ger is stored with the most-signi\214cant 16 bits \214rst)-.15 E 0 Cg
EP
%%Page: 26 26
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(follo)0 12 Q
(wed by the least-signi\214cant 16 bits.)-.25 E(Each of the tw)0 24 Q
2.5(o1)-.1 G 2.5(6b)-2.5 G(it v)-2.5 E(alues are stored in machine-nati)
-.25 E .3 -.15(ve b)-.25 H(yte order).15 E(.)-.55 E
(<p><dt><i></i><i>namesize</i><dd>)0 36 Q
(The number of bytes in the pathname that follo)0 48 Q(ws the header)
-.25 E(.)-.55 E(This count includes the trailing NUL byte.)0 60 Q
(<p><dt><i></i><i>\214lesize</i><dd>)0 72 Q 0 Cg EP
%%Page: 27 27
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(The size of the \214le.)0 12 Q
(Note that this archi)0 24 Q .3 -.15(ve f)-.25 H(ormat is limited to).15
E(four gig)0 36 Q(abyte \214le sizes.)-.05 E(See)0 48 Q
(<i></i><i>mtime</i>)0 60 Q(abo)0 72 Q .3 -.15(ve f)-.15 H
(or a description of the storage of four).15 E(-byte inte)-.2 E(gers.)
-.15 E 0 Cg EP
%%Page: 28 28
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(</dl>)0 12 Q(<p>)36 24 Q
(The pathname immediately follo)0 36 Q(ws the \214x)-.25 E(ed header)
-.15 E(.)-.55 E(If the)0 48 Q(<b></b><b>namesize</b>)0 60 Q
(is odd, an additional NUL byte is added after the pathname.)0 72 Q 0 Cg
EP
%%Page: 29 29
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF
(The \214le data is then appended, padded with NUL)0 12 Q(bytes to an e)
0 24 Q -.15(ve)-.25 G 2.5(nl).15 G(ength.)-2.5 E(<p>)36 36 Q(Hardlink)0
48 Q(ed \214les are not gi)-.1 E -.15(ve)-.25 G 2.5(ns).15 G
(pecial treatment;)-2.5 E
(the full \214le contents are included with each cop)0 60 Q 2.5(yo)-.1 G
2.5(ft)-2.5 G(he)-2.5 E(\214le.)0 72 Q 0 Cg EP
%%Page: 30 30
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<h4 id="Portable ASCII F)36 12 Q(ormat">)-.15 E
(Portable ASCII F)36 24 Q(ormat)-.15 E(</h4>)36 36 Q -1.11(Ve)2.5 48 S
(rsion 2 of the Single UNIX Speci\214cation \(`)1.11 E(`SUSv2')-.74 E
('\))-.74 E(standardized an ASCII v)0 60 Q
(ariant that is portable across all)-.25 E(platforms.)0 72 Q 0 Cg EP
%%Page: 31 31
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(It is commonly kno)0 12 Q(wn as the)-.25 E -.74
(``)0 24 S(old character').74 E(')-.74 E(format or as the)0 36 Q -.74
(``)0 48 S(odc').74 E(')-.74 E(format.)0 60 Q
(It stores the same numeric \214elds as the old binary format, b)0 72 Q
(ut)-.2 E 0 Cg EP
%%Page: 32 32
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF
(represents them as 6-character or 11-character octal v)0 12 Q(alues.)
-.25 E(<dl compact><dt><dd>)0 24 Q(<code>)0 36 Q(<pre>)0 48 Q
(struct cpio_odc_header {)0 60 Q 7.5(char c_magic[6];)20 72 R 0 Cg EP
%%Page: 33 33
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF 7.5(char c_de)20 12 R(v[6];)-.25 E 7.5
(char c_ino[6];)20 24 R 7.5(char c_mode[6];)20 36 R 7.5(char c_uid[6];)
20 48 R 7.5(char c_gid[6];)20 60 R 7.5(char c_nlink[6];)20 72 R 0 Cg EP
%%Page: 34 34
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF 7.5(char c_rde)20 12 R(v[6];)-.25 E 7.5
(char c_mtime[11];)20 24 R 7.5(char c_namesize[6];)20 36 R 7.5
(char c_\214lesize[11];)20 48 R(};)0 60 Q(</pre>)0 72 Q 0 Cg EP
%%Page: 35 35
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(</code>)0 12 Q(</dl>)0 24 Q(<p>)36 36 Q
(The \214elds are identical to those in the old binary format.)0 48 Q
(The name and \214le body follo)0 60 Q 2.5(wt)-.25 G(he \214x)-2.5 E
(ed header)-.15 E(.)-.55 E(Unlik)0 72 Q 2.5(et)-.1 G
(he old binary format, there is no additional padding)-2.5 E 0 Cg EP
%%Page: 36 36
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(after the pathname or \214le contents.)0 12 Q
(If the \214les being archi)0 24 Q -.15(ve)-.25 G 2.5(da).15 G
(re themselv)-2.5 E(es entirely ASCII, then)-.15 E(the resulting archi)0
36 Q .3 -.15(ve w)-.25 H(ill be entirely ASCII, e).15 E(xcept for the)
-.15 E(NUL byte that terminates the name \214eld.)0 48 Q(<h4 id="Ne)36
60 Q 2.5(wA)-.25 G(SCII F)-2.5 E(ormat">)-.15 E(Ne)36 72 Q 2.5(wA)-.25 G
(SCII F)-2.5 E(ormat)-.15 E 0 Cg EP
%%Page: 37 37
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(</h4>)36 12 Q(The "ne)0 24 Q
(w" ASCII format uses 8-byte he)-.25 E(xadecimal \214elds for)-.15 E
(all numbers and separates de)0 36 Q
(vice numbers into separate \214elds)-.25 E
(for major and minor numbers.)0 48 Q(<dl compact><dt><dd>)0 60 Q(<code>)
0 72 Q 0 Cg EP
%%Page: 38 38
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<pre>)0 12 Q(struct cpio_ne)0 24 Q(wc_header {)
-.25 E 7.5(char c_magic[6];)20 36 R 7.5(char c_ino[8];)20 48 R 7.5
(char c_mode[8];)20 60 R 7.5(char c_uid[8];)20 72 R 0 Cg EP
%%Page: 39 39
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF 7.5(char c_gid[8];)20 12 R 7.5(char c_nlink[8];)
20 24 R 7.5(char c_mtime[8];)20 36 R 7.5(char c_\214lesize[8];)20 48 R
7.5(char c_de)20 60 R(vmajor[8];)-.25 E 7.5(char c_de)20 72 R
(vminor[8];)-.25 E 0 Cg EP
%%Page: 40 40
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF 7.5(char c_rde)20 12 R(vmajor[8];)-.25 E 7.5
(char c_rde)20 24 R(vminor[8];)-.25 E 7.5(char c_namesize[8];)20 36 R
7.5(char c_check[8];)20 48 R(};)0 60 Q(</pre>)0 72 Q 0 Cg EP
%%Page: 41 41
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(</code>)0 12 Q(</dl>)0 24 Q(<p>)36 36 Q
(Except as speci\214ed belo)0 48 Q 1.3 -.65(w, t)-.25 H
(he \214elds here match those speci\214ed).65 E
(for the old binary format abo)0 60 Q -.15(ve)-.15 G(.).15 E
(<dl compact>)0 72 Q 0 Cg EP
%%Page: 42 42
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<p><dt><i></i><i>magic</i><dd>)0 12 Q
(The string)0 24 Q -.74(``)0 36 S(070701').74 E('.)-.74 E
(<p><dt><i></i><i>check</i><dd>)0 48 Q(This \214eld is al)0 60 Q -.1(wa)
-.1 G(ys set to zero by writers and ignored by readers.).1 E(See the ne)
0 72 Q(xt section for more details.)-.15 E 0 Cg EP
%%Page: 43 43
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(</dl>)0 12 Q(<p>)36 24 Q(The pathname is follo)0
36 Q(wed by NUL bytes so that the total size)-.25 E(of the \214x)0 48 Q
(ed header plus pathname is a multiple of four)-.15 E(.)-.55 E(Lik)0 60
Q -.25(ew)-.1 G
(ise, the \214le data is padded to a multiple of four bytes.).25 E
(Note that this format supports only 4 gig)0 72 Q(abyte \214les \(unlik)
-.05 E 2.5(et)-.1 G(he)-2.5 E 0 Cg EP
%%Page: 44 44
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(older ASCII format, which supports 8 gig)0 12 Q
(abyte \214les\).)-.05 E(<p>)36 24 Q(In this format, hardlink)0 36 Q
(ed \214les are handled by setting the)-.1 E
(\214lesize to zero for each entry e)0 48 Q(xcept the last one that)-.15
E(appears in the archi)0 60 Q -.15(ve)-.25 G(.).15 E(<h4 id="Ne)36 72 Q
2.5(wC)-.25 G(RC F)-2.5 E(ormat">)-.15 E 0 Cg EP
%%Page: 45 45
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(Ne)36 12 Q 2.5(wC)-.25 G(RC F)-2.5 E(ormat)-.15
E(</h4>)36 24 Q(The CRC format is identical to the ne)0 36 Q 2.5(wA)-.25
G(SCII format described)-2.5 E(in the pre)0 48 Q(vious section e)-.25 E
(xcept that the magic \214eld is set)-.15 E(to)0 60 Q -.74(``)0 72 S
(070702').74 E(')-.74 E 0 Cg EP
%%Page: 46 46
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(and the)0 12 Q(<i></i><i>check</i>)0 24 Q
(\214eld is set to the sum of all bytes in the \214le data.)0 36 Q
(This sum is computed treating all bytes as unsigned v)0 48 Q(alues)-.25
E(and using unsigned arithmetic.)0 60 Q
(Only the least-signi\214cant 32 bits of the sum are stored.)0 72 Q 0 Cg
EP
%%Page: 47 47
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<h4 id="HP v)36 12 Q(ariants">)-.25 E(HP v)36 24
Q(ariants)-.25 E(</h4>)36 36 Q(The)0 48 Q(<b>cpio</b>)0 60 Q
(implementation distrib)0 72 Q(uted with HPUX used XXXX b)-.2 E
(ut stored)-.2 E 0 Cg EP
%%Page: 48 48
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(de)0 12 Q(vice numbers dif)-.25 E(ferently XXX.)
-.25 E(<h4 id="Other Extensions and V)36 24 Q(ariants">)-1.11 E
(Other Extensions and V)36 36 Q(ariants)-1.11 E(</h4>)36 48 Q
(Sun Solaris uses additional \214le types to store e)0 60 Q
(xtended \214le)-.15 E(data, including A)0 72 Q(CLs and e)-.4 E
(xtended attrib)-.15 E(utes, as special)-.2 E 0 Cg EP
%%Page: 49 49
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(entries in cpio archi)0 12 Q -.15(ve)-.25 G(s.)
.15 E(<p>)36 24 Q(XXX Others? XXX)0 36 Q(<h3 id="B)36 48 Q(UGS">)-.1 E
-.1(BU)36 60 S(GS).1 E(</h3>)36 72 Q 0 Cg EP
%%Page: 50 50
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(The)0 12 Q -.74(``)0 24 S(CRC').74 E(')-.74 E
(format is mis-named, as it uses a simple checksum and)0 36 Q(not a c)0
48 Q(yclic redundanc)-.15 E 2.5(yc)-.15 G(heck.)-2.5 E(<p>)36 60 Q
(The old binary format is limited to 16 bits for user id,)0 72 Q 0 Cg EP
%%Page: 51 51
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(group id, de)0 12 Q(vice, and inode numbers.)
-.25 E(It is limited to 4 gig)0 24 Q(abyte \214le sizes.)-.05 E(<p>)36
36 Q(The old ASCII format is limited to 18 bits for)0 48 Q
(the user id, group id, de)0 60 Q(vice, and inode numbers.)-.25 E
(It is limited to 8 gig)0 72 Q(abyte \214le sizes.)-.05 E 0 Cg EP
%%Page: 52 52
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<p>)36 12 Q(The ne)0 24 Q 2.5(wA)-.25 G
(SCII format is limited to 4 gig)-2.5 E(abyte \214le sizes.)-.05 E(<p>)
36 36 Q(None of the cpio formats store user or group names,)0 48 Q
(which are essential when mo)0 60 Q(ving \214les between systems with)
-.15 E(dissimilar user or group numbering.)0 72 Q 0 Cg EP
%%Page: 53 53
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<p>)36 12 Q
(Especially when writing older cpio v)0 24 Q
(ariants, it may be necessary)-.25 E(to map actual de)0 36 Q
(vice/inode v)-.25 E(alues to synthesized v)-.25 E(alues that)-.25 E
(\214t the a)0 48 Q -.25(va)-.2 G(ilable \214elds.).25 E -.4(Wi)0 60 S
(th v).4 E(ery lar)-.15 E(ge \214lesystems, this may be necessary e)-.18
E -.15(ve)-.25 G 2.5(nf).15 G(or)-2.5 E(the ne)0 72 Q(wer formats.)-.25
E 0 Cg EP
%%Page: 54 54
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<h3 id="SEE ALSO">)36 12 Q(SEE ALSO)36 24 Q
(</h3>)36 36 Q(<a href="../html1/cpio.html">cpio\(1\)</a>,)0 48 Q
(<a href="../html5/tar)0 60 Q(.html">tar\(5\)</a>)-.55 E(<h3 id="ST)36
72 Q(AND)-.93 E(ARDS">)-.4 E 0 Cg EP
%%Page: 55 55
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(ST)36 12 Q(AND)-.93 E(ARDS)-.4 E(</h3>)36 24 Q
(The)0 36 Q(<b>cpio</b>)0 48 Q
(utility is no longer a part of POSIX or the Single Unix Standard.)0 60
Q(It last appeared in)0 72 Q 0 Cg EP
%%Page: 56 56
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF -1.11(Ve)2.5 12 S
(rsion 2 of the Single UNIX Speci\214cation \(`)1.11 E(`SUSv2')-.74 E
('\) .)-.74 E(It has been supplanted in subsequent standards by)0 24 Q
(<a href="../html1/pax.html">pax\(1\)</a>.)0 36 Q(The portable ASCII fo\
rmat is currently part of the speci\214cation for the)0 48 Q
(<a href="../html1/pax.html">pax\(1\)</a>)0 60 Q(utility)0 72 Q(.)-.65 E
0 Cg EP
%%Page: 57 57
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<h3 id="HIST)36 12 Q(OR)-.18 E(Y">)-.65 E(HIST)
36 24 Q(OR)-.18 E(Y)-.65 E(</h3>)36 36 Q(The original cpio utility w)0
48 Q(as written by Dick Haight)-.1 E(while w)0 60 Q(orking in A)-.1 E
(T&T')-1.11 E 2.5(sU)-.55 G(nix Support Group.)-2.5 E
(It appeared in 1977 as part of PWB/UNIX 1.0, the)0 72 Q 0 Cg EP
%%Page: 58 58
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF -.74(``)0 12 S(Programmer').74 E 2.5(sW)-.55 G
(ork Bench')-3.3 E(')-.74 E(deri)0 24 Q -.15(ve)-.25 G 2.5(df).15 G(rom)
-2.5 E -1.11(Ve)0 36 S(rsion 6 <code>A)1.11 E(T&T UNIX</code>)-1.11 E
(that w)0 48 Q(as used internally at A)-.1 E(T&T)-1.11 E(.)-.74 E
(Both the old binary and old character formats were in use)0 60 Q
(by 1980, according to the System III source released)0 72 Q 0 Cg EP
%%Page: 59 59
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(by SCO under their)0 12 Q -.74(``)0 24 S
(Ancient Unix')-.06 E(')-.74 E(license.)0 36 Q(The character format w)0
48 Q(as adopted as part of)-.1 E(IEEE Std 1003.1-1988 \(`)2.5 60 Q
(`<font size="-1">POSIX</font>.1')-.74 E('\) .)-.74 E(XXX when did "ne)0
72 Q(wc" appear?)-.25 E(Who in)5 E -.15(ve)-.4 G(nted it?).15 E
(When did HP come out with their v)5 E 2.5(ariant? When)-.25 F
(did Sun introduce A)2.5 E(CLs and e)-.4 E(xtended attrib)-.15 E
(utes? XXX)-.2 E 0 Cg EP
%%Page: 60 60
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(</body>)0 12 Q(</html>)0 24 Q 0 Cg EP
%%Trailer
end
%%EOF
@


1.1.1.3
log
@libarchive-2.8.3: Build fix for Linux
@
text
@d1 769
a769 422
<!-- Creator     : groff version 1.19.2 -->
<!-- CreationDate: Sun Mar 14 19:50:26 2010 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="generator" content="groff -Thtml, see www.gnu.org">
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta name="Content-Style" content="text/css">
<style type="text/css">
       p     { margin-top: 0; margin-bottom: 0; }
       pre   { margin-top: 0; margin-bottom: 0; }
       table { margin-top: 0; margin-bottom: 0; }
</style>
<title></title>
</head>
<body>

<hr>


<p valign="top">CPIO(5) FreeBSD File Formats Manual
CPIO(5)</p>

<p style="margin-top: 1em" valign="top"><b>NAME</b></p>

<p style="margin-left:8%;"><b>cpio</b> &mdash; format of
cpio archive files</p>


<p style="margin-top: 1em" valign="top"><b>DESCRIPTION</b></p>

<p style="margin-left:8%;">The <b>cpio</b> archive format
collects any number of files, directories, and other file
system objects (symbolic links, device nodes, etc.) into a
single stream of bytes.</p>

<p style="margin-left:8%; margin-top: 1em"><b>General
Format</b> <br>
Each file system object in a <b>cpio</b> archive comprises a
header record with basic numeric metadata followed by the
full pathname of the entry and the file data. The header
record stores a series of integer values that generally
follow the fields in <i>struct stat</i>. (See stat(2) for
details.) The variants differ primarily in how they store
those integers (binary, octal, or hexadecimal). The header
is followed by the pathname of the entry (the length of the
pathname is stored in the header) and any file data. The end
of the archive is indicated by a special record with the
pathname &lsquo;&lsquo;TRAILER!!!&rsquo;&rsquo;.</p>

<p style="margin-left:8%; margin-top: 1em"><b>PWB
format</b> <br>
XXX Any documentation of the original PWB/UNIX 1.0 format?
XXX</p>

<p style="margin-left:8%; margin-top: 1em"><b>Old Binary
Format</b> <br>
The old binary <b>cpio</b> format stores numbers as 2-byte
and 4-byte binary values. Each entry begins with a header in
the following format:</p>

<p style="margin-left:17%; margin-top: 1em">struct
header_old_cpio { <br>
unsigned short c_magic; <br>
unsigned short c_dev; <br>
unsigned short c_ino; <br>
unsigned short c_mode; <br>
unsigned short c_uid; <br>
unsigned short c_gid; <br>
unsigned short c_nlink; <br>
unsigned short c_rdev;</p>

<table width="100%" border=0 rules="none" frame="void"
       cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="29%"></td>
<td width="13%">


<p valign="top">unsigned short c_mtime[2];</p></td>
<td width="58%">
</td>
</table>

<p style="margin-left:17%;">unsigned short c_namesize;</p>

<table width="100%" border=0 rules="none" frame="void"
       cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="29%"></td>
<td width="71%">


<p valign="top">unsigned short c_filesize[2];</p></td>
</table>

<p style="margin-left:17%;">};</p>

<p style="margin-left:8%; margin-top: 1em">The <i>unsigned
short</i> fields here are 16-bit integer values; the
<i>unsigned int</i> fields are 32-bit integer values. The
fields are as follows</p>

<p style="margin-top: 1em" valign="top"><i>magic</i></p>

<p style="margin-left:20%; margin-top: 1em">The integer
value octal 070707. This value can be used to determine
whether this archive is written with little-endian or
big-endian integers.</p>

<p style="margin-top: 1em" valign="top"><i>dev</i>,
<i>ino</i></p>

<p style="margin-left:20%;">The device and inode numbers
from the disk. These are used by programs that read
<b>cpio</b> archives to determine when two entries refer to
the same file. Programs that synthesize <b>cpio</b> archives
should be careful to set these to distinct values for each
entry.</p>

<p style="margin-top: 1em" valign="top"><i>mode</i></p>

<p style="margin-left:20%; margin-top: 1em">The mode
specifies both the regular permissions and the file type. It
consists of several bit fields as follows:</p>

<p valign="top">0170000</p>

<p style="margin-left:34%; margin-top: 1em">This masks the
file type bits.</p>

<p valign="top">0140000</p>

<p style="margin-left:34%; margin-top: 1em">File type value
for sockets.</p>

<p valign="top">0120000</p>

<p style="margin-left:34%; margin-top: 1em">File type value
for symbolic links. For symbolic links, the link body is
stored as file data.</p>

<p valign="top">0100000</p>

<p style="margin-left:34%; margin-top: 1em">File type value
for regular files.</p>

<p valign="top">0060000</p>

<p style="margin-left:34%; margin-top: 1em">File type value
for block special devices.</p>

<p valign="top">0040000</p>

<p style="margin-left:34%; margin-top: 1em">File type value
for directories.</p>

<p valign="top">0020000</p>

<p style="margin-left:34%; margin-top: 1em">File type value
for character special devices.</p>

<p valign="top">0010000</p>

<p style="margin-left:34%; margin-top: 1em">File type value
for named pipes or FIFOs.</p>

<p valign="top">0004000</p>

<p style="margin-left:34%; margin-top: 1em">SUID bit.</p>

<p valign="top">0002000</p>

<p style="margin-left:34%; margin-top: 1em">SGID bit.</p>

<p valign="top">0001000</p>

<p style="margin-left:34%; margin-top: 1em">Sticky bit. On
some systems, this modifies the behavior of executables
and/or directories.</p>

<p valign="top">0000777</p>

<p style="margin-left:34%; margin-top: 1em">The lower 9
bits specify read/write/execute permissions for world,
group, and user following standard POSIX conventions.</p>

<p style="margin-top: 1em" valign="top"><i>uid</i>,
<i>gid</i></p>

<p style="margin-left:20%;">The numeric user id and group
id of the owner.</p>

<p style="margin-top: 1em" valign="top"><i>nlink</i></p>

<p style="margin-left:20%; margin-top: 1em">The number of
links to this file. Directories always have a value of at
least two here. Note that hardlinked files include file data
with every copy in the archive.</p>

<p style="margin-top: 1em" valign="top"><i>rdev</i></p>

<p style="margin-left:20%; margin-top: 1em">For block
special and character special entries, this field contains
the associated device number. For all other entry types, it
should be set to zero by writers and ignored by readers.</p>

<p style="margin-top: 1em" valign="top"><i>mtime</i></p>

<p style="margin-left:20%; margin-top: 1em">Modification
time of the file, indicated as the number of seconds since
the start of the epoch, 00:00:00 UTC January 1, 1970. The
four-byte integer is stored with the most-significant 16
bits first followed by the least-significant 16 bits. Each
of the two 16 bit values are stored in machine-native byte
order.</p>


<p style="margin-top: 1em" valign="top"><i>namesize</i></p>

<p style="margin-left:20%;">The number of bytes in the
pathname that follows the header. This count includes the
trailing NUL byte.</p>


<p style="margin-top: 1em" valign="top"><i>filesize</i></p>

<p style="margin-left:20%;">The size of the file. Note that
this archive format is limited to four gigabyte file sizes.
See <i>mtime</i> above for a description of the storage of
four-byte integers.</p>

<p style="margin-left:8%; margin-top: 1em">The pathname
immediately follows the fixed header. If the <b>namesize</b>
is odd, an additional NUL byte is added after the pathname.
The file data is then appended, padded with NUL bytes to an
even length.</p>

<p style="margin-left:8%; margin-top: 1em">Hardlinked files
are not given special treatment; the full file contents are
included with each copy of the file.</p>

<p style="margin-left:8%; margin-top: 1em"><b>Portable
ASCII Format</b> <br>
Version&nbsp;2 of the Single UNIX Specification
(&lsquo;&lsquo;SUSv2&rsquo;&rsquo;) standardized an ASCII
variant that is portable across all platforms. It is
commonly known as the &lsquo;&lsquo;old
character&rsquo;&rsquo; format or as the
&lsquo;&lsquo;odc&rsquo;&rsquo; format. It stores the same
numeric fields as the old binary format, but represents them
as 6-character or 11-character octal values.</p>

<p style="margin-left:17%; margin-top: 1em">struct
cpio_odc_header { <br>
char c_magic[6]; <br>
char c_dev[6]; <br>
char c_ino[6]; <br>
char c_mode[6]; <br>
char c_uid[6]; <br>
char c_gid[6]; <br>
char c_nlink[6]; <br>
char c_rdev[6]; <br>
char c_mtime[11]; <br>
char c_namesize[6]; <br>
char c_filesize[11]; <br>
};</p>

<p style="margin-left:8%; margin-top: 1em">The fields are
identical to those in the old binary format. The name and
file body follow the fixed header. Unlike the old binary
format, there is no additional padding after the pathname or
file contents. If the files being archived are themselves
entirely ASCII, then the resulting archive will be entirely
ASCII, except for the NUL byte that terminates the name
field.</p>

<p style="margin-left:8%; margin-top: 1em"><b>New ASCII
Format</b> <br>
The &quot;new&quot; ASCII format uses 8-byte hexadecimal
fields for all numbers and separates device numbers into
separate fields for major and minor numbers.</p>

<p style="margin-left:17%; margin-top: 1em">struct
cpio_newc_header { <br>
char c_magic[6]; <br>
char c_ino[8]; <br>
char c_mode[8]; <br>
char c_uid[8]; <br>
char c_gid[8]; <br>
char c_nlink[8]; <br>
char c_mtime[8]; <br>
char c_filesize[8]; <br>
char c_devmajor[8]; <br>
char c_devminor[8]; <br>
char c_rdevmajor[8]; <br>
char c_rdevminor[8]; <br>
char c_namesize[8]; <br>
char c_check[8]; <br>
};</p>

<p style="margin-left:8%; margin-top: 1em">Except as
specified below, the fields here match those specified for
the old binary format above.</p>

<p style="margin-top: 1em" valign="top"><i>magic</i></p>

<p style="margin-left:20%; margin-top: 1em">The string
&lsquo;&lsquo;070701&rsquo;&rsquo;.</p>

<p style="margin-top: 1em" valign="top"><i>check</i></p>

<p style="margin-left:20%; margin-top: 1em">This field is
always set to zero by writers and ignored by readers. See
the next section for more details.</p>

<p style="margin-left:8%; margin-top: 1em">The pathname is
followed by NUL bytes so that the total size of the fixed
header plus pathname is a multiple of four. Likewise, the
file data is padded to a multiple of four bytes. Note that
this format supports only 4 gigabyte files (unlike the older
ASCII format, which supports 8 gigabyte files).</p>

<p style="margin-left:8%; margin-top: 1em">In this format,
hardlinked files are handled by setting the filesize to zero
for each entry except the last one that appears in the
archive.</p>

<p style="margin-left:8%; margin-top: 1em"><b>New CRC
Format</b> <br>
The CRC format is identical to the new ASCII format
described in the previous section except that the magic
field is set to &lsquo;&lsquo;070702&rsquo;&rsquo; and the
<i>check</i> field is set to the sum of all bytes in the
file data. This sum is computed treating all bytes as
unsigned values and using unsigned arithmetic. Only the
least-significant 32 bits of the sum are stored.</p>

<p style="margin-left:8%; margin-top: 1em"><b>HP
variants</b> <br>
The <b>cpio</b> implementation distributed with HPUX used
XXXX but stored device numbers differently XXX.</p>

<p style="margin-left:8%; margin-top: 1em"><b>Other
Extensions and Variants</b> <br>
Sun Solaris uses additional file types to store extended
file data, including ACLs and extended attributes, as
special entries in cpio archives.</p>

<p style="margin-left:8%; margin-top: 1em">XXX Others?
XXX</p>

<p style="margin-top: 1em" valign="top"><b>BUGS</b></p>

<p style="margin-left:8%;">The
&lsquo;&lsquo;CRC&rsquo;&rsquo; format is mis-named, as it
uses a simple checksum and not a cyclic redundancy
check.</p>

<p style="margin-left:8%; margin-top: 1em">The old binary
format is limited to 16 bits for user id, group id, device,
and inode numbers. It is limited to 4 gigabyte file
sizes.</p>

<p style="margin-left:8%; margin-top: 1em">The old ASCII
format is limited to 18 bits for the user id, group id,
device, and inode numbers. It is limited to 8 gigabyte file
sizes.</p>

<p style="margin-left:8%; margin-top: 1em">The new ASCII
format is limited to 4 gigabyte file sizes.</p>

<p style="margin-left:8%; margin-top: 1em">None of the cpio
formats store user or group names, which are essential when
moving files between systems with dissimilar user or group
numbering.</p>

<p style="margin-left:8%; margin-top: 1em">Especially when
writing older cpio variants, it may be necessary to map
actual device/inode values to synthesized values that fit
the available fields. With very large filesystems, this may
be necessary even for the newer formats.</p>

<p style="margin-top: 1em" valign="top"><b>SEE ALSO</b></p>

<p style="margin-left:8%;">cpio(1), tar(5)</p>


<p style="margin-top: 1em" valign="top"><b>STANDARDS</b></p>

<p style="margin-left:8%;">The <b>cpio</b> utility is no
longer a part of POSIX or the Single Unix Standard. It last
appeared in Version&nbsp;2 of the Single UNIX Specification
(&lsquo;&lsquo;SUSv2&rsquo;&rsquo;). It has been supplanted
in subsequent standards by pax(1). The portable ASCII format
is currently part of the specification for the pax(1)
utility.</p>

<p style="margin-top: 1em" valign="top"><b>HISTORY</b></p>

<p style="margin-left:8%;">The original cpio utility was
written by Dick Haight while working in AT&amp;T&rsquo;s
Unix Support Group. It appeared in 1977 as part of PWB/UNIX
1.0, the &lsquo;&lsquo;Programmer&rsquo;s Work
Bench&rsquo;&rsquo; derived from Version&nbsp;6 AT&amp;T
UNIX that was used internally at AT&amp;T. Both the old
binary and old character formats were in use by 1980,
according to the System III source released by SCO under
their &lsquo;&lsquo;Ancient Unix&rsquo;&rsquo; license. The
character format was adopted as part of IEEE Std 1003.1-1988
(&lsquo;&lsquo;POSIX.1&rsquo;&rsquo;). XXX when did
&quot;newc&quot; appear? Who invented it? When did HP come
out with their variant? When did Sun introduce ACLs and
extended attributes? XXX</p>


<p style="margin-left:8%; margin-top: 1em">FreeBSD&nbsp;9.0
October&nbsp;5, 2007 FreeBSD&nbsp;9.0</p>
<hr>
</body>
</html>
@


1.1.1.4
log
@Import libarchive-2.8.4:
- Improved reliability of hash function detection
- Fix issues on ancient FreeBSD, QNX, ancient NetBSD and Minix
@
text
@d1 422
a422 769
%!PS-Adobe-3.0
%%Creator: groff version 1.19.2
%%CreationDate: Wed Jun 30 11:55:52 2010
%%DocumentNeededResources: font Times-Roman
%%DocumentSuppliedResources: procset grops 1.19 2
%%Pages: 60
%%PageOrder: Ascend
%%DocumentMedia: Default 612 792 0 () ()
%%Orientation: Portrait
%%EndComments
%%BeginDefaults
%%PageMedia: Default
%%EndDefaults
%%BeginProlog
%%BeginResource: procset grops 1.19 2
%!PS-Adobe-3.0 Resource-ProcSet
/setpacking where{
pop
currentpacking
true setpacking
}if
/grops 120 dict dup begin
/SC 32 def
/A/show load def
/B{0 SC 3 -1 roll widthshow}bind def
/C{0 exch ashow}bind def
/D{0 exch 0 SC 5 2 roll awidthshow}bind def
/E{0 rmoveto show}bind def
/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def
/G{0 rmoveto 0 exch ashow}bind def
/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
/I{0 exch rmoveto show}bind def
/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def
/K{0 exch rmoveto 0 exch ashow}bind def
/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
/M{rmoveto show}bind def
/N{rmoveto 0 SC 3 -1 roll widthshow}bind def
/O{rmoveto 0 exch ashow}bind def
/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def
/Q{moveto show}bind def
/R{moveto 0 SC 3 -1 roll widthshow}bind def
/S{moveto 0 exch ashow}bind def
/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def
/SF{
findfont exch
[exch dup 0 exch 0 exch neg 0 0]makefont
dup setfont
[exch/setfont cvx]cvx bind def
}bind def
/MF{
findfont
[5 2 roll
0 3 1 roll
neg 0 0]makefont
dup setfont
[exch/setfont cvx]cvx bind def
}bind def
/level0 0 def
/RES 0 def
/PL 0 def
/LS 0 def
/MANUAL{
statusdict begin/manualfeed true store end
}bind def
/PLG{
gsave newpath clippath pathbbox grestore
exch pop add exch pop
}bind def
/BP{
/level0 save def
1 setlinecap
1 setlinejoin
72 RES div dup scale
LS{
90 rotate
}{
0 PL translate
}ifelse
1 -1 scale
}bind def
/EP{
level0 restore
showpage
}def
/DA{
newpath arcn stroke
}bind def
/SN{
transform
.25 sub exch .25 sub exch
round .25 add exch round .25 add exch
itransform
}bind def
/DL{
SN
moveto
SN
lineto stroke
}bind def
/DC{
newpath 0 360 arc closepath
}bind def
/TM matrix def
/DE{
TM currentmatrix pop
translate scale newpath 0 0 .5 0 360 arc closepath
TM setmatrix
}bind def
/RC/rcurveto load def
/RL/rlineto load def
/ST/stroke load def
/MT/moveto load def
/CL/closepath load def
/Fr{
setrgbcolor fill
}bind def
/setcmykcolor where{
pop
/Fk{
setcmykcolor fill
}bind def
}if
/Fg{
setgray fill
}bind def
/FL/fill load def
/LW/setlinewidth load def
/Cr/setrgbcolor load def
/setcmykcolor where{
pop
/Ck/setcmykcolor load def
}if
/Cg/setgray load def
/RE{
findfont
dup maxlength 1 index/FontName known not{1 add}if dict begin
{
1 index/FID ne{def}{pop pop}ifelse
}forall
/Encoding exch def
dup/FontName exch def
currentdict end definefont pop
}bind def
/DEFS 0 def
/EBEGIN{
moveto
DEFS begin
}bind def
/EEND/end load def
/CNT 0 def
/level1 0 def
/PBEGIN{
/level1 save def
translate
div 3 1 roll div exch scale
neg exch neg exch translate
0 setgray
0 setlinecap
1 setlinewidth
0 setlinejoin
10 setmiterlimit
[]0 setdash
/setstrokeadjust where{
pop
false setstrokeadjust
}if
/setoverprint where{
pop
false setoverprint
}if
newpath
/CNT countdictstack def
userdict begin
/showpage{}def
/setpagedevice{}def
}bind def
/PEND{
countdictstack CNT sub{end}repeat
level1 restore
}bind def
end def
/setpacking where{
pop
setpacking
}if
%%EndResource
%%EndProlog
%%BeginSetup
%%BeginFeature: *PageSize Default
<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
%%EndFeature
%%IncludeResource: font Times-Roman
grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex
/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y
/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft
/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl
/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut
/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash
/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen
/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft
/logicalnot/minus/registered/macron/degree/plusminus/twosuperior
/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior
/ordmasculine/guilsinglright/onequarter/onehalf/threequarters
/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE
/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash
/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def
/Times-Roman@@0 ENC0/Times-Roman RE
%%EndSetup
%%Page: 1 1
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<html>)0 12 Q(<head>)0 24 Q(<title>)36 36 Q
(October 5, 2007 CPIO 5)74.5 48 Q(</title>)36 72 Q 0 Cg EP
%%Page: 2 2
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<style type="te)36 12 Q(xt/css">)-.15 E(<!--)36
24 Q(body { mar)72 36 Q(gin-left:4%; })-.18 E(H1, H2, H3, H4, H5 {)72 48
Q(color: maroon; padding: 4pt; mar)108 60 Q(gin-left: -4%;)-.18 E
(border: solid; border)108 72 Q(-width: thin; width: 100%;)-.2 E 0 Cg EP
%%Page: 3 3
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(background: r)108 12 Q(gb\(204,204,255\))-.18 E
(})72 24 Q(-->)36 36 Q(</style>)36 48 Q(</head>)0 60 Q
(<body bgcolor="#FFFFFF" te)0 72 Q(xt="#000000">)-.15 E 0 Cg EP
%%Page: 4 4
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<h3 id="N)36 12 Q(AME">)-.35 E -.35(NA)36 24 S
(ME).35 E(</h3>)36 36 Q(<b>cpio</b>)0 48 Q 2.5(-f)0 60 S
(ormat of cpio archi)-2.5 E .3 -.15(ve \214)-.25 H(les).15 E
(<h3 id="DESCRIPTION">)36 72 Q 0 Cg EP
%%Page: 5 5
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(DESCRIPTION)36 12 Q(</h3>)36 24 Q(The)0 36 Q
(<b>cpio</b>)0 48 Q(archi)0 60 Q .3 -.15(ve f)-.25 H(ormat collects an)
.15 E 2.5(yn)-.15 G(umber of \214les, directories, and other)-2.5 E
(\214le system objects \(symbolic links, de)0 72 Q
(vice nodes, etc.\) into a single)-.25 E 0 Cg EP
%%Page: 6 6
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(stream of bytes.)0 12 Q(<h4 id="General F)36 24
Q(ormat">)-.15 E(General F)36 36 Q(ormat)-.15 E(</h4>)36 48 Q
(Each \214le system object in a)0 60 Q(<b>cpio</b>)0 72 Q 0 Cg EP
%%Page: 7 7
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(archi)0 12 Q .3 -.15(ve c)-.25 H
(omprises a header record with basic numeric metadata).15 E(follo)0 24 Q
(wed by the full pathname of the entry and the \214le data.)-.25 E
(The header record stores a series of inte)0 36 Q(ger v)-.15 E
(alues that generally)-.25 E(follo)0 48 Q 2.5(wt)-.25 G(he \214elds in)
-2.5 E(<i></i><i>struct</i><i> stat</i>.)0 60 Q(\(See)0 72 Q 0 Cg EP
%%Page: 8 8
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<a href="../html2/stat.html">stat\(2\)</a>)0 12
Q(for details.\))0 24 Q(The v)0 36 Q(ariants dif)-.25 E
(fer primarily in ho)-.25 E 2.5(wt)-.25 G(he)-2.5 E 2.5(ys)-.15 G
(tore those inte)-2.5 E(gers)-.15 E(\(binary)0 48 Q 2.5(,o)-.65 G
(ctal, or he)-2.5 E(xadecimal\).)-.15 E(The header is follo)0 60 Q
(wed by the pathname of the)-.25 E
(entry \(the length of the pathname is stored in the header\))0 72 Q 0
Cg EP
%%Page: 9 9
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(and an)0 12 Q 2.5<798c>-.15 G(le data.)-2.5 E
(The end of the archi)0 24 Q .3 -.15(ve i)-.25 H 2.5(si).15 G
(ndicated by a special record with)-2.5 E(the pathname)0 36 Q -.74(``)0
48 S(TRAILER!!!').74 E('.)-.74 E(<h4 id="PWB format">)36 60 Q
(PWB format)36 72 Q 0 Cg EP
%%Page: 10 10
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(</h4>)36 12 Q(XXX An)0 24 Q 2.5(yd)-.15 G
(ocumentation of the original PWB/UNIX 1.0 format? XXX)-2.5 E
(<h4 id="Old Binary F)36 36 Q(ormat">)-.15 E(Old Binary F)36 48 Q(ormat)
-.15 E(</h4>)36 60 Q(The old binary)0 72 Q 0 Cg EP
%%Page: 11 11
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<b>cpio</b>)0 12 Q
(format stores numbers as 2-byte and 4-byte binary v)0 24 Q(alues.)-.25
E(Each entry be)0 36 Q(gins with a header in the follo)-.15 E
(wing format:)-.25 E(<dl compact><dt><dd>)0 48 Q(<code>)0 60 Q(<pre>)0
72 Q 0 Cg EP
%%Page: 12 12
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(struct header_old_cpio {)0 12 Q(unsigned short)
20 24 Q(c_magic;)7.5 E(unsigned short)20 36 Q(c_de)7.5 E(v;)-.25 E
(unsigned short)20 48 Q(c_ino;)7.5 E(unsigned short)20 60 Q(c_mode;)7.5
E(unsigned short)20 72 Q(c_uid;)7.5 E 0 Cg EP
%%Page: 13 13
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(unsigned short)20 12 Q(c_gid;)7.5 E
(unsigned short)20 24 Q(c_nlink;)7.5 E(unsigned short)20 36 Q(c_rde)7.5
E(v;)-.25 E(unsigned short)36 48 Q(c_mtime[2];)7.5 E(unsigned short)20
60 Q(c_namesize;)7.5 E(unsigned short)36 72 Q(c_\214lesize[2];)7.5 E 0
Cg EP
%%Page: 14 14
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(};)0 12 Q(</pre>)0 24 Q(</code>)0 36 Q(</dl>)0
48 Q(<p>)36 60 Q(The)0 72 Q 0 Cg EP
%%Page: 15 15
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<i></i><i>unsigned</i><i> short</i>)0 12 Q
(\214elds here are 16-bit inte)0 24 Q(ger v)-.15 E(alues; the)-.25 E
(<i></i><i>unsigned</i><i> int</i>)0 36 Q(\214elds are 32-bit inte)0 48
Q(ger v)-.15 E(alues.)-.25 E(The \214elds are as follo)0 60 Q(ws)-.25 E
(<dl compact>)0 72 Q 0 Cg EP
%%Page: 16 16
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<p><dt><i></i><i>magic</i><dd>)0 12 Q(The inte)0
24 Q(ger v)-.15 E(alue octal 070707.)-.25 E(This v)0 36 Q
(alue can be used to determine whether this archi)-.25 E .3 -.15(ve i)
-.25 H(s).15 E(written with little-endian or big-endian inte)0 48 Q
(gers.)-.15 E(<p><dt><i></i><i>de)0 60 Q(v</i><i></i>,<i> ino</i><dd>)
-.25 E(The de)0 72 Q(vice and inode numbers from the disk.)-.25 E 0 Cg
EP
%%Page: 17 17
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(These are used by programs that read)0 12 Q
(<b>cpio</b>)0 24 Q(archi)0 36 Q -.15(ve)-.25 G 2.5(st).15 G 2.5(od)-2.5
G(etermine when tw)-2.5 E 2.5(oe)-.1 G(ntries refer to the same \214le.)
-2.5 E(Programs that synthesize)0 48 Q(<b>cpio</b>)0 60 Q(archi)0 72 Q
-.15(ve)-.25 G 2.5(ss).15 G(hould be careful to set these to distinct v)
-2.5 E(alues for each entry)-.25 E(.)-.65 E 0 Cg EP
%%Page: 18 18
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<p><dt><i></i><i>mode</i><dd>)0 12 Q
(The mode speci\214es both the re)0 24 Q
(gular permissions and the \214le type.)-.15 E(It consists of se)0 36 Q
-.15(ve)-.25 G(ral bit \214elds as follo).15 E(ws:)-.25 E(<dl compact>)0
48 Q(<dt>0170000<dd>)0 60 Q(This masks the \214le type bits.)0 72 Q 0 Cg
EP
%%Page: 19 19
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<dt>0140000<dd>)0 12 Q(File type v)0 24 Q
(alue for sock)-.25 E(ets.)-.1 E(<dt>0120000<dd>)0 36 Q(File type v)0 48
Q(alue for symbolic links.)-.25 E -.15(Fo)0 60 S 2.5(rs).15 G
(ymbolic links, the link body is stored as \214le data.)-2.5 E
(<dt>0100000<dd>)0 72 Q 0 Cg EP
%%Page: 20 20
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(File type v)0 12 Q(alue for re)-.25 E
(gular \214les.)-.15 E(<dt>0060000<dd>)0 24 Q(File type v)0 36 Q
(alue for block special de)-.25 E(vices.)-.25 E(<dt>0040000<dd>)0 48 Q
(File type v)0 60 Q(alue for directories.)-.25 E(<dt>0020000<dd>)0 72 Q
0 Cg EP
%%Page: 21 21
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(File type v)0 12 Q
(alue for character special de)-.25 E(vices.)-.25 E(<dt>0010000<dd>)0 24
Q(File type v)0 36 Q(alue for named pipes or FIFOs.)-.25 E
(<dt>0004000<dd>)0 48 Q(SUID bit.)0 60 Q(<dt>0002000<dd>)0 72 Q 0 Cg EP
%%Page: 22 22
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(SGID bit.)0 12 Q(<dt>0001000<dd>)0 24 Q(Stick)0
36 Q 2.5(yb)-.15 G(it.)-2.5 E(On some systems, this modi\214es the beha)
0 48 Q(vior of e)-.2 E -.15(xe)-.15 G(cutables and/or directories.).15 E
(<dt>0000777<dd>)0 60 Q(The lo)0 72 Q(wer 9 bits specify read/write/e)
-.25 E -.15(xe)-.15 G(cute permissions).15 E 0 Cg EP
%%Page: 23 23
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(for w)0 12 Q(orld, group, and user follo)-.1 E
(wing standard POSIX con)-.25 E -.15(ve)-.4 G(ntions.).15 E(</dl>)0 24 Q
(<p><dt><i></i><i>uid</i><i></i>,<i> gid</i><dd>)0 36 Q
(The numeric user id and group id of the o)0 48 Q(wner)-.25 E(.)-.55 E
(<p><dt><i></i><i>nlink</i><dd>)0 60 Q
(The number of links to this \214le.)0 72 Q 0 Cg EP
%%Page: 24 24
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(Directories al)0 12 Q -.1(wa)-.1 G(ys ha).1 E .3
-.15(ve a v)-.2 H(alue of at least tw)-.1 E 2.5(oh)-.1 G(ere.)-2.5 E
(Note that hardlink)0 24 Q(ed \214les include \214le data with e)-.1 E
-.15(ve)-.25 G(ry cop).15 E 2.5(yi)-.1 G 2.5(nt)-2.5 G(he archi)-2.5 E
-.15(ve)-.25 G(.).15 E(<p><dt><i></i><i>rde)0 36 Q(v</i><dd>)-.25 E -.15
(Fo)0 48 S 2.5(rb).15 G(lock special and character special entries,)-2.5
E(this \214eld contains the associated de)0 60 Q(vice number)-.25 E(.)
-.55 E -.15(Fo)0 72 S 2.5(ra).15 G
(ll other entry types, it should be set to zero by writers)-2.5 E 0 Cg
EP
%%Page: 25 25
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(and ignored by readers.)0 12 Q
(<p><dt><i></i><i>mtime</i><dd>)0 24 Q
(Modi\214cation time of the \214le, indicated as the number)0 36 Q
(of seconds since the start of the epoch,)0 48 Q
(00:00:00 UTC January 1, 1970.)0 60 Q(The four)0 72 Q(-byte inte)-.2 E
(ger is stored with the most-signi\214cant 16 bits \214rst)-.15 E 0 Cg
EP
%%Page: 26 26
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(follo)0 12 Q
(wed by the least-signi\214cant 16 bits.)-.25 E(Each of the tw)0 24 Q
2.5(o1)-.1 G 2.5(6b)-2.5 G(it v)-2.5 E(alues are stored in machine-nati)
-.25 E .3 -.15(ve b)-.25 H(yte order).15 E(.)-.55 E
(<p><dt><i></i><i>namesize</i><dd>)0 36 Q
(The number of bytes in the pathname that follo)0 48 Q(ws the header)
-.25 E(.)-.55 E(This count includes the trailing NUL byte.)0 60 Q
(<p><dt><i></i><i>\214lesize</i><dd>)0 72 Q 0 Cg EP
%%Page: 27 27
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(The size of the \214le.)0 12 Q
(Note that this archi)0 24 Q .3 -.15(ve f)-.25 H(ormat is limited to).15
E(four gig)0 36 Q(abyte \214le sizes.)-.05 E(See)0 48 Q
(<i></i><i>mtime</i>)0 60 Q(abo)0 72 Q .3 -.15(ve f)-.15 H
(or a description of the storage of four).15 E(-byte inte)-.2 E(gers.)
-.15 E 0 Cg EP
%%Page: 28 28
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(</dl>)0 12 Q(<p>)36 24 Q
(The pathname immediately follo)0 36 Q(ws the \214x)-.25 E(ed header)
-.15 E(.)-.55 E(If the)0 48 Q(<b></b><b>namesize</b>)0 60 Q
(is odd, an additional NUL byte is added after the pathname.)0 72 Q 0 Cg
EP
%%Page: 29 29
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF
(The \214le data is then appended, padded with NUL)0 12 Q(bytes to an e)
0 24 Q -.15(ve)-.25 G 2.5(nl).15 G(ength.)-2.5 E(<p>)36 36 Q(Hardlink)0
48 Q(ed \214les are not gi)-.1 E -.15(ve)-.25 G 2.5(ns).15 G
(pecial treatment;)-2.5 E
(the full \214le contents are included with each cop)0 60 Q 2.5(yo)-.1 G
2.5(ft)-2.5 G(he)-2.5 E(\214le.)0 72 Q 0 Cg EP
%%Page: 30 30
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<h4 id="Portable ASCII F)36 12 Q(ormat">)-.15 E
(Portable ASCII F)36 24 Q(ormat)-.15 E(</h4>)36 36 Q -1.11(Ve)2.5 48 S
(rsion 2 of the Single UNIX Speci\214cation \(`)1.11 E(`SUSv2')-.74 E
('\))-.74 E(standardized an ASCII v)0 60 Q
(ariant that is portable across all)-.25 E(platforms.)0 72 Q 0 Cg EP
%%Page: 31 31
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(It is commonly kno)0 12 Q(wn as the)-.25 E -.74
(``)0 24 S(old character').74 E(')-.74 E(format or as the)0 36 Q -.74
(``)0 48 S(odc').74 E(')-.74 E(format.)0 60 Q
(It stores the same numeric \214elds as the old binary format, b)0 72 Q
(ut)-.2 E 0 Cg EP
%%Page: 32 32
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF
(represents them as 6-character or 11-character octal v)0 12 Q(alues.)
-.25 E(<dl compact><dt><dd>)0 24 Q(<code>)0 36 Q(<pre>)0 48 Q
(struct cpio_odc_header {)0 60 Q 7.5(char c_magic[6];)20 72 R 0 Cg EP
%%Page: 33 33
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF 7.5(char c_de)20 12 R(v[6];)-.25 E 7.5
(char c_ino[6];)20 24 R 7.5(char c_mode[6];)20 36 R 7.5(char c_uid[6];)
20 48 R 7.5(char c_gid[6];)20 60 R 7.5(char c_nlink[6];)20 72 R 0 Cg EP
%%Page: 34 34
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF 7.5(char c_rde)20 12 R(v[6];)-.25 E 7.5
(char c_mtime[11];)20 24 R 7.5(char c_namesize[6];)20 36 R 7.5
(char c_\214lesize[11];)20 48 R(};)0 60 Q(</pre>)0 72 Q 0 Cg EP
%%Page: 35 35
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(</code>)0 12 Q(</dl>)0 24 Q(<p>)36 36 Q
(The \214elds are identical to those in the old binary format.)0 48 Q
(The name and \214le body follo)0 60 Q 2.5(wt)-.25 G(he \214x)-2.5 E
(ed header)-.15 E(.)-.55 E(Unlik)0 72 Q 2.5(et)-.1 G
(he old binary format, there is no additional padding)-2.5 E 0 Cg EP
%%Page: 36 36
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(after the pathname or \214le contents.)0 12 Q
(If the \214les being archi)0 24 Q -.15(ve)-.25 G 2.5(da).15 G
(re themselv)-2.5 E(es entirely ASCII, then)-.15 E(the resulting archi)0
36 Q .3 -.15(ve w)-.25 H(ill be entirely ASCII, e).15 E(xcept for the)
-.15 E(NUL byte that terminates the name \214eld.)0 48 Q(<h4 id="Ne)36
60 Q 2.5(wA)-.25 G(SCII F)-2.5 E(ormat">)-.15 E(Ne)36 72 Q 2.5(wA)-.25 G
(SCII F)-2.5 E(ormat)-.15 E 0 Cg EP
%%Page: 37 37
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(</h4>)36 12 Q(The "ne)0 24 Q
(w" ASCII format uses 8-byte he)-.25 E(xadecimal \214elds for)-.15 E
(all numbers and separates de)0 36 Q
(vice numbers into separate \214elds)-.25 E
(for major and minor numbers.)0 48 Q(<dl compact><dt><dd>)0 60 Q(<code>)
0 72 Q 0 Cg EP
%%Page: 38 38
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<pre>)0 12 Q(struct cpio_ne)0 24 Q(wc_header {)
-.25 E 7.5(char c_magic[6];)20 36 R 7.5(char c_ino[8];)20 48 R 7.5
(char c_mode[8];)20 60 R 7.5(char c_uid[8];)20 72 R 0 Cg EP
%%Page: 39 39
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF 7.5(char c_gid[8];)20 12 R 7.5(char c_nlink[8];)
20 24 R 7.5(char c_mtime[8];)20 36 R 7.5(char c_\214lesize[8];)20 48 R
7.5(char c_de)20 60 R(vmajor[8];)-.25 E 7.5(char c_de)20 72 R
(vminor[8];)-.25 E 0 Cg EP
%%Page: 40 40
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF 7.5(char c_rde)20 12 R(vmajor[8];)-.25 E 7.5
(char c_rde)20 24 R(vminor[8];)-.25 E 7.5(char c_namesize[8];)20 36 R
7.5(char c_check[8];)20 48 R(};)0 60 Q(</pre>)0 72 Q 0 Cg EP
%%Page: 41 41
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(</code>)0 12 Q(</dl>)0 24 Q(<p>)36 36 Q
(Except as speci\214ed belo)0 48 Q 1.3 -.65(w, t)-.25 H
(he \214elds here match those speci\214ed).65 E
(for the old binary format abo)0 60 Q -.15(ve)-.15 G(.).15 E
(<dl compact>)0 72 Q 0 Cg EP
%%Page: 42 42
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<p><dt><i></i><i>magic</i><dd>)0 12 Q
(The string)0 24 Q -.74(``)0 36 S(070701').74 E('.)-.74 E
(<p><dt><i></i><i>check</i><dd>)0 48 Q(This \214eld is al)0 60 Q -.1(wa)
-.1 G(ys set to zero by writers and ignored by readers.).1 E(See the ne)
0 72 Q(xt section for more details.)-.15 E 0 Cg EP
%%Page: 43 43
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(</dl>)0 12 Q(<p>)36 24 Q(The pathname is follo)0
36 Q(wed by NUL bytes so that the total size)-.25 E(of the \214x)0 48 Q
(ed header plus pathname is a multiple of four)-.15 E(.)-.55 E(Lik)0 60
Q -.25(ew)-.1 G
(ise, the \214le data is padded to a multiple of four bytes.).25 E
(Note that this format supports only 4 gig)0 72 Q(abyte \214les \(unlik)
-.05 E 2.5(et)-.1 G(he)-2.5 E 0 Cg EP
%%Page: 44 44
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(older ASCII format, which supports 8 gig)0 12 Q
(abyte \214les\).)-.05 E(<p>)36 24 Q(In this format, hardlink)0 36 Q
(ed \214les are handled by setting the)-.1 E
(\214lesize to zero for each entry e)0 48 Q(xcept the last one that)-.15
E(appears in the archi)0 60 Q -.15(ve)-.25 G(.).15 E(<h4 id="Ne)36 72 Q
2.5(wC)-.25 G(RC F)-2.5 E(ormat">)-.15 E 0 Cg EP
%%Page: 45 45
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(Ne)36 12 Q 2.5(wC)-.25 G(RC F)-2.5 E(ormat)-.15
E(</h4>)36 24 Q(The CRC format is identical to the ne)0 36 Q 2.5(wA)-.25
G(SCII format described)-2.5 E(in the pre)0 48 Q(vious section e)-.25 E
(xcept that the magic \214eld is set)-.15 E(to)0 60 Q -.74(``)0 72 S
(070702').74 E(')-.74 E 0 Cg EP
%%Page: 46 46
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(and the)0 12 Q(<i></i><i>check</i>)0 24 Q
(\214eld is set to the sum of all bytes in the \214le data.)0 36 Q
(This sum is computed treating all bytes as unsigned v)0 48 Q(alues)-.25
E(and using unsigned arithmetic.)0 60 Q
(Only the least-signi\214cant 32 bits of the sum are stored.)0 72 Q 0 Cg
EP
%%Page: 47 47
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<h4 id="HP v)36 12 Q(ariants">)-.25 E(HP v)36 24
Q(ariants)-.25 E(</h4>)36 36 Q(The)0 48 Q(<b>cpio</b>)0 60 Q
(implementation distrib)0 72 Q(uted with HPUX used XXXX b)-.2 E
(ut stored)-.2 E 0 Cg EP
%%Page: 48 48
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(de)0 12 Q(vice numbers dif)-.25 E(ferently XXX.)
-.25 E(<h4 id="Other Extensions and V)36 24 Q(ariants">)-1.11 E
(Other Extensions and V)36 36 Q(ariants)-1.11 E(</h4>)36 48 Q
(Sun Solaris uses additional \214le types to store e)0 60 Q
(xtended \214le)-.15 E(data, including A)0 72 Q(CLs and e)-.4 E
(xtended attrib)-.15 E(utes, as special)-.2 E 0 Cg EP
%%Page: 49 49
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(entries in cpio archi)0 12 Q -.15(ve)-.25 G(s.)
.15 E(<p>)36 24 Q(XXX Others? XXX)0 36 Q(<h3 id="B)36 48 Q(UGS">)-.1 E
-.1(BU)36 60 S(GS).1 E(</h3>)36 72 Q 0 Cg EP
%%Page: 50 50
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(The)0 12 Q -.74(``)0 24 S(CRC').74 E(')-.74 E
(format is mis-named, as it uses a simple checksum and)0 36 Q(not a c)0
48 Q(yclic redundanc)-.15 E 2.5(yc)-.15 G(heck.)-2.5 E(<p>)36 60 Q
(The old binary format is limited to 16 bits for user id,)0 72 Q 0 Cg EP
%%Page: 51 51
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(group id, de)0 12 Q(vice, and inode numbers.)
-.25 E(It is limited to 4 gig)0 24 Q(abyte \214le sizes.)-.05 E(<p>)36
36 Q(The old ASCII format is limited to 18 bits for)0 48 Q
(the user id, group id, de)0 60 Q(vice, and inode numbers.)-.25 E
(It is limited to 8 gig)0 72 Q(abyte \214le sizes.)-.05 E 0 Cg EP
%%Page: 52 52
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<p>)36 12 Q(The ne)0 24 Q 2.5(wA)-.25 G
(SCII format is limited to 4 gig)-2.5 E(abyte \214le sizes.)-.05 E(<p>)
36 36 Q(None of the cpio formats store user or group names,)0 48 Q
(which are essential when mo)0 60 Q(ving \214les between systems with)
-.15 E(dissimilar user or group numbering.)0 72 Q 0 Cg EP
%%Page: 53 53
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<p>)36 12 Q
(Especially when writing older cpio v)0 24 Q
(ariants, it may be necessary)-.25 E(to map actual de)0 36 Q
(vice/inode v)-.25 E(alues to synthesized v)-.25 E(alues that)-.25 E
(\214t the a)0 48 Q -.25(va)-.2 G(ilable \214elds.).25 E -.4(Wi)0 60 S
(th v).4 E(ery lar)-.15 E(ge \214lesystems, this may be necessary e)-.18
E -.15(ve)-.25 G 2.5(nf).15 G(or)-2.5 E(the ne)0 72 Q(wer formats.)-.25
E 0 Cg EP
%%Page: 54 54
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<h3 id="SEE ALSO">)36 12 Q(SEE ALSO)36 24 Q
(</h3>)36 36 Q(<a href="../html1/cpio.html">cpio\(1\)</a>,)0 48 Q
(<a href="../html5/tar)0 60 Q(.html">tar\(5\)</a>)-.55 E(<h3 id="ST)36
72 Q(AND)-.93 E(ARDS">)-.4 E 0 Cg EP
%%Page: 55 55
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(ST)36 12 Q(AND)-.93 E(ARDS)-.4 E(</h3>)36 24 Q
(The)0 36 Q(<b>cpio</b>)0 48 Q
(utility is no longer a part of POSIX or the Single Unix Standard.)0 60
Q(It last appeared in)0 72 Q 0 Cg EP
%%Page: 56 56
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF -1.11(Ve)2.5 12 S
(rsion 2 of the Single UNIX Speci\214cation \(`)1.11 E(`SUSv2')-.74 E
('\) .)-.74 E(It has been supplanted in subsequent standards by)0 24 Q
(<a href="../html1/pax.html">pax\(1\)</a>.)0 36 Q(The portable ASCII fo\
rmat is currently part of the speci\214cation for the)0 48 Q
(<a href="../html1/pax.html">pax\(1\)</a>)0 60 Q(utility)0 72 Q(.)-.65 E
0 Cg EP
%%Page: 57 57
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(<h3 id="HIST)36 12 Q(OR)-.18 E(Y">)-.65 E(HIST)
36 24 Q(OR)-.18 E(Y)-.65 E(</h3>)36 36 Q(The original cpio utility w)0
48 Q(as written by Dick Haight)-.1 E(while w)0 60 Q(orking in A)-.1 E
(T&T')-1.11 E 2.5(sU)-.55 G(nix Support Group.)-2.5 E
(It appeared in 1977 as part of PWB/UNIX 1.0, the)0 72 Q 0 Cg EP
%%Page: 58 58
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF -.74(``)0 12 S(Programmer').74 E 2.5(sW)-.55 G
(ork Bench')-3.3 E(')-.74 E(deri)0 24 Q -.15(ve)-.25 G 2.5(df).15 G(rom)
-2.5 E -1.11(Ve)0 36 S(rsion 6 <code>A)1.11 E(T&T UNIX</code>)-1.11 E
(that w)0 48 Q(as used internally at A)-.1 E(T&T)-1.11 E(.)-.74 E
(Both the old binary and old character formats were in use)0 60 Q
(by 1980, according to the System III source released)0 72 Q 0 Cg EP
%%Page: 59 59
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(by SCO under their)0 12 Q -.74(``)0 24 S
(Ancient Unix')-.06 E(')-.74 E(license.)0 36 Q(The character format w)0
48 Q(as adopted as part of)-.1 E(IEEE Std 1003.1-1988 \(`)2.5 60 Q
(`<font size="-1">POSIX</font>.1')-.74 E('\) .)-.74 E(XXX when did "ne)0
72 Q(wc" appear?)-.25 E(Who in)5 E -.15(ve)-.4 G(nted it?).15 E
(When did HP come out with their v)5 E 2.5(ariant? When)-.25 F
(did Sun introduce A)2.5 E(CLs and e)-.4 E(xtended attrib)-.15 E
(utes? XXX)-.2 E 0 Cg EP
%%Page: 60 60
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@@0 SF(</body>)0 12 Q(</html>)0 24 Q 0 Cg EP
%%Trailer
end
%%EOF
@


1.1.1.5
log
@Import libarchive-3.2.1:
- security fixes and other bugfixes
- support for multhreading in xz 5.2+
@
text
@d1 769
a769 415
<!-- Creator     : groff version 1.22.3 -->
<!-- CreationDate: Sun Jun 19 19:54:08 2016 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="generator" content="groff -Thtml, see www.gnu.org">
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta name="Content-Style" content="text/css">
<style type="text/css">
       p       { margin-top: 0; margin-bottom: 0; vertical-align: top }
       pre     { margin-top: 0; margin-bottom: 0; vertical-align: top }
       table   { margin-top: 0; margin-bottom: 0; vertical-align: top }
       h1      { text-align: center }
</style>
<title></title>
</head>
<body>

<hr>


<p>CPIO(5) BSD File Formats Manual CPIO(5)</p>

<p style="margin-top: 1em"><b>NAME</b></p>

<p style="margin-left:6%;"><b>cpio</b> &mdash; format of
cpio archive files</p>

<p style="margin-top: 1em"><b>DESCRIPTION</b></p>

<p style="margin-left:6%;">The <b>cpio</b> archive format
collects any number of files, directories, and other file
system objects (symbolic links, device nodes, etc.) into a
single stream of bytes.</p>

<p style="margin-left:6%; margin-top: 1em"><b>General
Format</b> <br>
Each file system object in a <b>cpio</b> archive comprises a
header record with basic numeric metadata followed by the
full pathname of the entry and the file data. The header
record stores a series of integer values that generally
follow the fields in <i>struct stat</i>. (See stat(2) for
details.) The variants differ primarily in how they store
those integers (binary, octal, or hexadecimal). The header
is followed by the pathname of the entry (the length of the
pathname is stored in the header) and any file data. The end
of the archive is indicated by a special record with the
pathname &rsquo;&rsquo;TRAILER!!!&rsquo;&rsquo;.</p>

<p style="margin-left:6%; margin-top: 1em"><b>PWB
format</b> <br>
XXX Any documentation of the original PWB/UNIX 1.0 format?
XXX</p>

<p style="margin-left:6%; margin-top: 1em"><b>Old Binary
Format</b> <br>
The old binary <b>cpio</b> format stores numbers as 2-byte
and 4-byte binary values. Each entry begins with a header in
the following format:</p>

<p style="margin-left:14%; margin-top: 1em">struct
header_old_cpio { <br>
unsigned short c_magic; <br>
unsigned short c_dev; <br>
unsigned short c_ino; <br>
unsigned short c_mode; <br>
unsigned short c_uid; <br>
unsigned short c_gid; <br>
unsigned short c_nlink; <br>
unsigned short c_rdev;</p>

<table width="100%" border="0" rules="none" frame="void"
       cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="24%"></td>
<td width="11%">


<p>unsigned short c_mtime[2];</p></td>
<td width="65%">
</td></tr>
</table>

<p style="margin-left:14%;">unsigned short c_namesize;</p>

<table width="100%" border="0" rules="none" frame="void"
       cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="24%"></td>
<td width="76%">


<p>unsigned short c_filesize[2];</p></td></tr>
</table>

<p style="margin-left:14%;">};</p>

<p style="margin-left:6%; margin-top: 1em">The <i>unsigned
short</i> fields here are 16-bit integer values; the
<i>unsigned int</i> fields are 32-bit integer values. The
fields are as follows</p>

<p style="margin-top: 1em"><i>magic</i></p>

<p style="margin-left:17%; margin-top: 1em">The integer
value octal 070707. This value can be used to determine
whether this archive is written with little-endian or
big-endian integers.</p>

<p style="margin-top: 1em"><i>dev</i>, <i>ino</i></p>

<p style="margin-left:17%;">The device and inode numbers
from the disk. These are used by programs that read
<b>cpio</b> archives to determine when two entries refer to
the same file. Programs that synthesize <b>cpio</b> archives
should be careful to set these to distinct values for each
entry.</p>

<p style="margin-top: 1em"><i>mode</i></p>

<p style="margin-left:17%; margin-top: 1em">The mode
specifies both the regular permissions and the file type. It
consists of several bit fields as follows:</p>

<p>0170000</p>

<p style="margin-left:28%; margin-top: 1em">This masks the
file type bits.</p>

<p>0140000</p>

<p style="margin-left:28%; margin-top: 1em">File type value
for sockets.</p>

<p>0120000</p>

<p style="margin-left:28%; margin-top: 1em">File type value
for symbolic links. For symbolic links, the link body is
stored as file data.</p>

<p>0100000</p>

<p style="margin-left:28%; margin-top: 1em">File type value
for regular files.</p>

<p>0060000</p>

<p style="margin-left:28%; margin-top: 1em">File type value
for block special devices.</p>

<p>0040000</p>

<p style="margin-left:28%; margin-top: 1em">File type value
for directories.</p>

<p>0020000</p>

<p style="margin-left:28%; margin-top: 1em">File type value
for character special devices.</p>

<p>0010000</p>

<p style="margin-left:28%; margin-top: 1em">File type value
for named pipes or FIFOs.</p>

<p>0004000</p>

<p style="margin-left:28%; margin-top: 1em">SUID bit.</p>

<p>0002000</p>

<p style="margin-left:28%; margin-top: 1em">SGID bit.</p>

<p>0001000</p>

<p style="margin-left:28%; margin-top: 1em">Sticky bit. On
some systems, this modifies the behavior of executables
and/or directories.</p>

<p>0000777</p>

<p style="margin-left:28%; margin-top: 1em">The lower 9
bits specify read/write/execute permissions for world,
group, and user following standard POSIX conventions.</p>

<p style="margin-top: 1em"><i>uid</i>, <i>gid</i></p>

<p style="margin-left:17%;">The numeric user id and group
id of the owner.</p>

<p style="margin-top: 1em"><i>nlink</i></p>

<p style="margin-left:17%; margin-top: 1em">The number of
links to this file. Directories always have a value of at
least two here. Note that hardlinked files include file data
with every copy in the archive.</p>

<p style="margin-top: 1em"><i>rdev</i></p>

<p style="margin-left:17%; margin-top: 1em">For block
special and character special entries, this field contains
the associated device number. For all other entry types, it
should be set to zero by writers and ignored by readers.</p>

<p style="margin-top: 1em"><i>mtime</i></p>

<p style="margin-left:17%; margin-top: 1em">Modification
time of the file, indicated as the number of seconds since
the start of the epoch, 00:00:00 UTC January 1, 1970. The
four-byte integer is stored with the most-significant 16
bits first followed by the least-significant 16 bits. Each
of the two 16 bit values are stored in machine-native byte
order.</p>

<p style="margin-top: 1em"><i>namesize</i></p>

<p style="margin-left:17%;">The number of bytes in the
pathname that follows the header. This count includes the
trailing NUL byte.</p>

<p style="margin-top: 1em"><i>filesize</i></p>

<p style="margin-left:17%;">The size of the file. Note that
this archive format is limited to four gigabyte file sizes.
See <i>mtime</i> above for a description of the storage of
four-byte integers.</p>

<p style="margin-left:6%; margin-top: 1em">The pathname
immediately follows the fixed header. If the <b>namesize</b>
is odd, an additional NUL byte is added after the pathname.
The file data is then appended, padded with NUL bytes to an
even length.</p>

<p style="margin-left:6%; margin-top: 1em">Hardlinked files
are not given special treatment; the full file contents are
included with each copy of the file.</p>

<p style="margin-left:6%; margin-top: 1em"><b>Portable
ASCII Format</b> <br>
Version&nbsp;2 of the Single UNIX Specification
(&rsquo;&rsquo;SUSv2&rsquo;&rsquo;) standardized an ASCII
variant that is portable across all platforms. It is
commonly known as the &rsquo;&rsquo;old
character&rsquo;&rsquo; format or as the
&rsquo;&rsquo;odc&rsquo;&rsquo; format. It stores the same
numeric fields as the old binary format, but represents them
as 6-character or 11-character octal values.</p>

<p style="margin-left:14%; margin-top: 1em">struct
cpio_odc_header { <br>
char c_magic[6]; <br>
char c_dev[6]; <br>
char c_ino[6]; <br>
char c_mode[6]; <br>
char c_uid[6]; <br>
char c_gid[6]; <br>
char c_nlink[6]; <br>
char c_rdev[6]; <br>
char c_mtime[11]; <br>
char c_namesize[6]; <br>
char c_filesize[11]; <br>
};</p>

<p style="margin-left:6%; margin-top: 1em">The fields are
identical to those in the old binary format. The name and
file body follow the fixed header. Unlike the old binary
format, there is no additional padding after the pathname or
file contents. If the files being archived are themselves
entirely ASCII, then the resulting archive will be entirely
ASCII, except for the NUL byte that terminates the name
field.</p>

<p style="margin-left:6%; margin-top: 1em"><b>New ASCII
Format</b> <br>
The &quot;new&quot; ASCII format uses 8-byte hexadecimal
fields for all numbers and separates device numbers into
separate fields for major and minor numbers.</p>

<p style="margin-left:14%; margin-top: 1em">struct
cpio_newc_header { <br>
char c_magic[6]; <br>
char c_ino[8]; <br>
char c_mode[8]; <br>
char c_uid[8]; <br>
char c_gid[8]; <br>
char c_nlink[8]; <br>
char c_mtime[8]; <br>
char c_filesize[8]; <br>
char c_devmajor[8]; <br>
char c_devminor[8]; <br>
char c_rdevmajor[8]; <br>
char c_rdevminor[8]; <br>
char c_namesize[8]; <br>
char c_check[8]; <br>
};</p>

<p style="margin-left:6%; margin-top: 1em">Except as
specified below, the fields here match those specified for
the old binary format above.</p>

<p style="margin-top: 1em"><i>magic</i></p>

<p style="margin-left:17%; margin-top: 1em">The string
&rsquo;&rsquo;070701&rsquo;&rsquo;.</p>

<p style="margin-top: 1em"><i>check</i></p>

<p style="margin-left:17%; margin-top: 1em">This field is
always set to zero by writers and ignored by readers. See
the next section for more details.</p>

<p style="margin-left:6%; margin-top: 1em">The pathname is
followed by NUL bytes so that the total size of the fixed
header plus pathname is a multiple of four. Likewise, the
file data is padded to a multiple of four bytes. Note that
this format supports only 4 gigabyte files (unlike the older
ASCII format, which supports 8 gigabyte files).</p>

<p style="margin-left:6%; margin-top: 1em">In this format,
hardlinked files are handled by setting the filesize to zero
for each entry except the last one that appears in the
archive.</p>

<p style="margin-left:6%; margin-top: 1em"><b>New CRC
Format</b> <br>
The CRC format is identical to the new ASCII format
described in the previous section except that the magic
field is set to &rsquo;&rsquo;070702&rsquo;&rsquo; and the
<i>check</i> field is set to the sum of all bytes in the
file data. This sum is computed treating all bytes as
unsigned values and using unsigned arithmetic. Only the
least-significant 32 bits of the sum are stored.</p>

<p style="margin-left:6%; margin-top: 1em"><b>HP
variants</b> <br>
The <b>cpio</b> implementation distributed with HPUX used
XXXX but stored device numbers differently XXX.</p>

<p style="margin-left:6%; margin-top: 1em"><b>Other
Extensions and Variants</b> <br>
Sun Solaris uses additional file types to store extended
file data, including ACLs and extended attributes, as
special entries in cpio archives.</p>

<p style="margin-left:6%; margin-top: 1em">XXX Others?
XXX</p>

<p style="margin-top: 1em"><b>SEE ALSO</b></p>

<p style="margin-left:6%;">cpio(1), tar(5)</p>

<p style="margin-top: 1em"><b>STANDARDS</b></p>

<p style="margin-left:6%;">The <b>cpio</b> utility is no
longer a part of POSIX or the Single Unix Standard. It last
appeared in Version&nbsp;2 of the Single UNIX Specification
(&rsquo;&rsquo;SUSv2&rsquo;&rsquo;). It has been supplanted
in subsequent standards by pax(1). The portable ASCII format
is currently part of the specification for the pax(1)
utility.</p>

<p style="margin-top: 1em"><b>HISTORY</b></p>

<p style="margin-left:6%;">The original cpio utility was
written by Dick Haight while working in AT&amp;T&rsquo;s
Unix Support Group. It appeared in 1977 as part of PWB/UNIX
1.0, the &rsquo;&rsquo;Programmer&rsquo;s Work
Bench&rsquo;&rsquo; derived from Version&nbsp;6 AT&amp;T
UNIX that was used internally at AT&amp;T. Both the old
binary and old character formats were in use by 1980,
according to the System III source released by SCO under
their &rsquo;&rsquo;Ancient Unix&rsquo;&rsquo; license. The
character format was adopted as part of IEEE Std 1003.1-1988
(&rsquo;&rsquo;POSIX.1&rsquo;&rsquo;). XXX when did
&quot;newc&quot; appear? Who invented it? When did HP come
out with their variant? When did Sun introduce ACLs and
extended attributes? XXX</p>

<p style="margin-top: 1em"><b>BUGS</b></p>

<p style="margin-left:6%;">The
&rsquo;&rsquo;CRC&rsquo;&rsquo; format is mis-named, as it
uses a simple checksum and not a cyclic redundancy
check.</p>

<p style="margin-left:6%; margin-top: 1em">The old binary
format is limited to 16 bits for user id, group id, device,
and inode numbers. It is limited to 4 gigabyte file
sizes.</p>

<p style="margin-left:6%; margin-top: 1em">The old ASCII
format is limited to 18 bits for the user id, group id,
device, and inode numbers. It is limited to 8 gigabyte file
sizes.</p>

<p style="margin-left:6%; margin-top: 1em">The new ASCII
format is limited to 4 gigabyte file sizes.</p>

<p style="margin-left:6%; margin-top: 1em">None of the cpio
formats store user or group names, which are essential when
moving files between systems with dissimilar user or group
numbering.</p>

<p style="margin-left:6%; margin-top: 1em">Especially when
writing older cpio variants, it may be necessary to map
actual device/inode values to synthesized values that fit
the available fields. With very large filesystems, this may
be necessary even for the newer formats.</p>

<p style="margin-left:6%; margin-top: 1em">BSD
December&nbsp;23, 2011 BSD</p>
<hr>
</body>
</html>
@


1.1.1.6
log
@Import libarchive-3.3.1.
@
text
@d2 1
a2 1
<!-- CreationDate: Sat Feb 25 11:22:06 2017 -->
d49 1
a49 1
pathname &lsquo;&lsquo;TRAILER!!!&rsquo;&rsquo;.</p>
d242 1
a242 1
(&lsquo;&lsquo;SUSv2&rsquo;&rsquo;) standardized an ASCII
d244 1
a244 1
commonly known as the &lsquo;&lsquo;old
d246 1
a246 1
&lsquo;&lsquo;odc&rsquo;&rsquo; format. It stores the same
d305 1
a305 1
&lsquo;&lsquo;070701&rsquo;&rsquo;.</p>
d329 1
a329 1
field is set to &lsquo;&lsquo;070702&rsquo;&rsquo; and the
d358 1
a358 1
(&lsquo;&lsquo;SUSv2&rsquo;&rsquo;). It has been supplanted
d368 1
a368 1
1.0, the &lsquo;&lsquo;Programmer&rsquo;s Work
d373 1
a373 1
their &lsquo;&lsquo;Ancient Unix&rsquo;&rsquo; license. The
d375 1
a375 1
(&lsquo;&lsquo;POSIX.1&rsquo;&rsquo;). XXX when did
d383 1
a383 1
&lsquo;&lsquo;CRC&rsquo;&rsquo; format is mis-named, as it
@


1.1.1.7
log
@Import libarchive-3.3.2 + 9de5f3 + f9dacbf:
- Support NFS4 ACLs on Linux
- Bugfixes
@
text
@d2 1
a2 1
<!-- CreationDate: Mon Jul 10 02:32:57 2017 -->
d49 1
a49 1
pathname &rsquo;&rsquo;TRAILER!!!&rsquo;&rsquo;.</p>
d242 1
a242 1
(&rsquo;&rsquo;SUSv2&rsquo;&rsquo;) standardized an ASCII
d244 1
a244 1
commonly known as the &rsquo;&rsquo;old
d246 1
a246 1
&rsquo;&rsquo;odc&rsquo;&rsquo; format. It stores the same
d305 1
a305 1
&rsquo;&rsquo;070701&rsquo;&rsquo;.</p>
d329 1
a329 1
field is set to &rsquo;&rsquo;070702&rsquo;&rsquo; and the
d358 1
a358 1
(&rsquo;&rsquo;SUSv2&rsquo;&rsquo;). It has been supplanted
d368 1
a368 1
1.0, the &rsquo;&rsquo;Programmer&rsquo;s Work
d373 1
a373 1
their &rsquo;&rsquo;Ancient Unix&rsquo;&rsquo; license. The
d375 1
a375 1
(&rsquo;&rsquo;POSIX.1&rsquo;&rsquo;). XXX when did
d383 1
a383 1
&rsquo;&rsquo;CRC&rsquo;&rsquo; format is mis-named, as it
@


1.1.1.8
log
@Import libarchive-3.3.3 as should have done originally.
@
text
@d2 1
a2 1
<!-- CreationDate: Mon Sep  3 22:55:09 2018 -->
@


1.1.1.9
log
@Import libarchive 3.4.0
@
text
@d1 2
a2 2
<!-- Creator     : groff version 1.22.4 -->
<!-- CreationDate: Wed Jun 12 21:10:18 2019 -->
d49 1
a49 1
pathname &ldquo;TRAILER!!!&rdquo;.</p>
d242 7
a248 6
(&ldquo;SUSv2&rdquo;) standardized an ASCII variant that is
portable across all platforms. It is commonly known as the
&ldquo;old character&rdquo; format or as the
&ldquo;odc&rdquo; format. It stores the same numeric fields
as the old binary format, but represents them as 6-character
or 11-character octal values.</p>
d305 1
a305 1
&ldquo;070701&rdquo;.</p>
d329 5
a333 5
field is set to &ldquo;070702&rdquo; and the <i>check</i>
field is set to the sum of all bytes in the file data. This
sum is computed treating all bytes as unsigned values and
using unsigned arithmetic. Only the least-significant 32
bits of the sum are stored.</p>
d358 4
a361 3
(&ldquo;SUSv2&rdquo;). It has been supplanted in subsequent
standards by pax(1). The portable ASCII format is currently
part of the specification for the pax(1) utility.</p>
d368 8
a375 7
1.0, the &ldquo;Programmer&rsquo;s Work Bench&rdquo; derived
from Version&nbsp;6 AT&amp;T UNIX that was used internally
at AT&amp;T. Both the old binary and old character formats
were in use by 1980, according to the System III source
released by SCO under their &ldquo;Ancient Unix&rdquo;
license. The character format was adopted as part of IEEE
Std 1003.1-1988 (&ldquo;POSIX.1&rdquo;). XXX when did
d382 4
a385 3
<p style="margin-left:6%;">The &ldquo;CRC&rdquo; format is
mis-named, as it uses a simple checksum and not a cyclic
redundancy check.</p>
@


1.1.1.10
log
@Import libarchive 3.7.2
@
text
@d2 1
a2 1
<!-- CreationDate: Mon Sep 11 22:06:21 2023 -->
d53 8
a60 5
The PWB binary <b>cpio</b> format is the original format,
when cpio was introduced as part of the Programmer&rsquo;s
Work Bench system, a variant of 6th Edition UNIX. It stores
numbers as 2-byte and 4-byte binary values. Each entry
begins with a header in the following format:</p>
d63 40
a102 13
header_pwb_cpio { <br>
short h_magic; <br>
short h_dev; <br>
short h_ino; <br>
short h_mode; <br>
short h_uid; <br>
short h_gid; <br>
short h_nlink; <br>
short h_majmin; <br>
long h_mtime; <br>
short h_namesize; <br>
long h_filesize; <br>
};</p>
d104 1
a104 11
<p style="margin-left:6%; margin-top: 1em">The <i>short</i>
fields here are 16-bit integer values, while the <i>long</i>
fields are 32 bit integers. Since PWB UNIX, like the 6th
Edition UNIX it was based on, only ran on PDP-11 computers,
they are in PDP-endian format, which has little-endian
shorts, and big-endian longs. That is, the long integer
whose hexadecimal representation is 0x12345678 would be
stored in four successive bytes as 0x34, 0x12, 0x78, 0x56.
The fields are as follows:</p>

<p style="margin-top: 1em"><i>h_magic</i></p>
d106 4
a109 2
<p style="margin-left:17%;">The integer value octal
070707.</p>
d111 1
a111 1
<p style="margin-top: 1em"><i>h_dev</i>, <i>h_ino</i></p>
d120 1
a120 1
<p style="margin-top: 1em"><i>h_mode</i></p>
d123 9
a131 8
specifies both the regular permissions and the file type,
and it also holds a couple of bits that are irrelevant to
the cpio format, because the field is actually a raw copy of
the mode field in the inode representing the file. These are
the IALLOC flag, which shows that the inode entry is in use,
and the ILARG flag, which shows that the file it represents
is large enough to have indirect blocks pointers in the
inode. The mode is decoded as follows:</p>
d133 2
a134 1
<p style="margin-top: 1em">0100000</p>
d136 10
a145 2
<p style="margin-left:28%; margin-top: 1em">IALLOC flag -
irrelevant to cpio.</p>
d149 2
a150 2
<p style="margin-left:28%; margin-top: 1em">This masks the
file type bits.</p>
d162 1
a162 1
<p>0060000</p>
d165 1
a165 6
for block special devices.</p>

<p>0010000</p>

<p style="margin-left:28%; margin-top: 1em">ILARG flag -
irrelevant to cpio.</p>
d177 3
a179 1
<p style="margin-left:28%; margin-top: 1em">Sticky bit.</p>
d187 1
a187 1
<p style="margin-top: 1em"><i>h_uid</i>, <i>h_gid</i></p>
d192 1
a192 1
<p style="margin-top: 1em"><i>h_nlink</i></p>
d194 10
a203 11
<p style="margin-left:17%;">The number of links to this
file. Directories always have a value of at least two here.
Note that hardlinked files include file data with every copy
in the archive.</p>

<p style="margin-top: 1em"><i>h_majmin</i></p>

<p style="margin-left:17%;">For block special and character
special entries, this field contains the associated device
number, with the major number in the high byte, and the
minor number in the low byte. For all other entry types, it
d206 1
a206 1
<p style="margin-top: 1em"><i>h_mtime</i></p>
d208 7
a214 3
<p style="margin-left:17%;">Modification time of the file,
indicated as the number of seconds since the start of the
epoch, 00:00:00 UTC January 1, 1970.</p>
d216 1
a216 1
<p style="margin-top: 1em"><i>h_namesize</i></p>
d222 1
a222 1
<p style="margin-top: 1em"><i>h_filesize</i></p>
d225 3
a227 3
this archive format is limited to 16 megabyte file sizes,
because PWB UNIX, like 6th Edition, only used an unsigned 24
bit integer for the file size internally.</p>
d230 1
a230 1
immediately follows the fixed header. If <b>h_namesize</b>
d232 2
a233 3
The file data is then appended, again with an additional NUL
appended if needed to get the next header at an even
offset.</p>
a238 101
<p style="margin-left:6%; margin-top: 1em"><b>New Binary
Format</b> <br>
The new binary <b>cpio</b> format showed up when cpio was
adopted into late 7th Edition UNIX. It is exactly like the
PWB binary format, described above, except for three
changes:</p>

<p style="margin-left:6%; margin-top: 1em">First, UNIX now
ran on more than one hardware type, so the endianness of 16
bit integers must be determined by observing the magic
number at the start of the header. The 32 bit integers are
still always stored with the most significant word first,
though, so each of those two, in the struct shown above, was
stored as an array of two 16 bit integers, in the
traditional order. Those 16 bit integers, like all the
others in the struct, were accessed using a macro that byte
swapped them if necessary.</p>

<p style="margin-left:6%; margin-top: 1em">Next, 7th
Edition had more file types to store, and the IALLOC and
ILARG flag bits were re-purposed to accommodate these. The
revised use of the various bits is as follows:</p>

<p style="margin-top: 1em">0170000</p>

<p style="margin-left:18%; margin-top: 1em">This masks the
file type bits.</p>

<p>0140000</p>

<p style="margin-left:18%; margin-top: 1em">File type value
for sockets.</p>

<p>0120000</p>

<p style="margin-left:18%; margin-top: 1em">File type value
for symbolic links. For symbolic links, the link body is
stored as file data.</p>

<p>0100000</p>

<p style="margin-left:18%; margin-top: 1em">File type value
for regular files.</p>

<p>0060000</p>

<p style="margin-left:18%; margin-top: 1em">File type value
for block special devices.</p>

<p>0040000</p>

<p style="margin-left:18%; margin-top: 1em">File type value
for directories.</p>

<p>0020000</p>

<p style="margin-left:18%; margin-top: 1em">File type value
for character special devices.</p>

<p>0010000</p>

<p style="margin-left:18%; margin-top: 1em">File type value
for named pipes or FIFOs.</p>

<p>0004000</p>

<p style="margin-left:18%; margin-top: 1em">SUID bit.</p>

<p>0002000</p>

<p style="margin-left:18%; margin-top: 1em">SGID bit.</p>

<p>0001000</p>

<p style="margin-left:18%; margin-top: 1em">Sticky bit.</p>

<p>0000777</p>

<p style="margin-left:18%; margin-top: 1em">The lower 9
bits specify read/write/execute permissions for world,
group, and user following standard POSIX conventions.</p>

<p style="margin-left:6%; margin-top: 1em">Finally, the
file size field now represents a signed 32 bit integer in
the underlying file system, so the maximum file size has
increased to 2 gigabytes.</p>

<p style="margin-left:6%; margin-top: 1em">Note that there
is no obvious way to tell which of the two binary formats an
archive uses, other than to see which one makes more sense.
The typical error scenario is that a PWB format archive
unpacked as if it were in the new format will create named
sockets instead of directories, and then fail to unpack
files that should go in those directories. Running
<i>bsdcpio -itv</i> on an unknown archive will make it
obvious which it is: if it&rsquo;s PWB format, directories
will be listed with an &rsquo;s&rsquo; instead of a
&rsquo;d&rsquo; as the first character of the mode string,
and the larger files will have a &rsquo;?&rsquo; in that
position.</p>

d265 4
a268 4
identical to those in the new binary format. The name and
file body follow the fixed header. Unlike the binary
formats, there is no additional padding after the pathname
or file contents. If the files being archived are themselves
d299 1
a299 1
the new binary format above.</p>
d321 1
a321 1
for each entry except the first one that appears in the
d368 1
a368 1
at AT&amp;T. Both the new binary and old character formats
d383 4
a386 5
<p style="margin-left:6%; margin-top: 1em">The binary
formats are limited to 16 bits for user id, group id,
device, and inode numbers. They are limited to 16 megabyte
and 2 gigabyte file sizes for the older and newer variants,
respectively.</p>
@


1.1.1.11
log
@libarchive: import version 3.7.3
@
text
@d2 1
a2 1
<!-- CreationDate: Sun Apr  7 22:36:27 2024 -->
@


1.1.1.12
log
@Libarchive 3.7.4 is a bugfix and security release

Security fixes:

rar: Fix OOB in rar e8 filter (CVE-2024-26256)
zip: Fix out of boundary access

Important bugfixes:

7zip: Limit amount of properties
bsdtar: Fix error handling around strtol() usages
passphrase: Improve newline handling on Windows
passphrase: Never allow empty passwords
rar: Fix "File CRC Error" when extracting specific rar4 archives
xar: Avoid infinite link loop
zip: Update AppleDouble support for directories
zstd: Implement core detection
@
text
@d2 1
a2 1
<!-- CreationDate: Fri Apr 26 09:23:47 2024 -->
@


1.1.1.13
log
@libarchive: imported version 3.7.5

Libarchive 3.7.5

Security fixes:

fix multiple vulnerabilities identified by SAST
cpio: ignore out-of-range gid/uid/size/ino and harden AFIO parsing
lzop: prevent integer overflow
rar4: protect copy_from_lzss_window_to_unp()
rar4: fix CVE-2024-26256
rar4: fix OOB in delta and audio filter
rar4: fix out of boundary access with large files
rar4: add boundary checks to rgb filter
rar4: fix OOB access with unicode filenames
rar5: clear 'data ready' cache on window buffer reallocs
rpm: calculate huge header sizes correctly
unzip: unify EOF handling
util: fix out of boundary access in mktemp functions
uu: stop processing if lines are too long

Important bugfixes:

7zip: fix issue when skipping first file in 7zip archive that is a multiple of 65536 bytes
ar: fix archive entries having no type
lha: do not allow negative file sizes
lha: fix integer truncation on 32-bit systems
shar: check strdup return value
rar5: don't try to read rediculously long names
xar: fix another infinite loop and expat error handling
many Windows fixes, cleanups and improvements
@
text
@d2 1
a2 1
<!-- CreationDate: Fri Sep 13 20:31:06 2024 -->
@


1.1.1.14
log
@libarchove: import version 3.7.7
@
text
@d1 2
a2 2
<!-- Creator     : groff version 1.23.0 -->
<!-- CreationDate: Sun Oct 13 08:12:10 2024 -->
d23 1
a23 1
<p><i>CPIO</i>(5) File Formats Manual <i>CPIO</i>(5)</p>
d27 2
a28 2
<p style="margin-left:9%;">cpio &mdash; format of cpio
archive files</p>
d32 1
a32 1
<p style="margin-left:9%;">The <b>cpio</b> archive format
d37 21
a57 2
<p style="margin-left:4%; margin-top: 1em"><b>General
Format</b></p>
d59 1
a59 24
<p style="margin-left:9%;">Each file system object in a
<b>cpio</b> archive comprises a header record with basic
numeric metadata followed by the full pathname of the entry
and the file data. The header record stores a series of
integer values that generally follow the fields in <i>struct
stat</i>. (See <i>stat</i>(2) for details.) The variants
differ primarily in how they store those integers (binary,
octal, or hexadecimal). The header is followed by the
pathname of the entry (the length of the pathname is stored
in the header) and any file data. The end of the archive is
indicated by a special record with the pathname
&ldquo;TRAILER!!!&rdquo;.</p>

<p style="margin-left:4%; margin-top: 1em"><b>PWB
format</b></p>

<p style="margin-left:9%;">The PWB binary <b>cpio</b>
format is the original format, when cpio was introduced as
part of the Programmer&rsquo;s Work Bench system, a variant
of 6th Edition UNIX. It stores numbers as 2-byte and 4-byte
binary values. Each entry begins with a header in the
following format:</p>

<p style="margin-left:17%; margin-top: 1em">struct
d74 1
a74 1
<p style="margin-left:9%; margin-top: 1em">The <i>short</i>
d86 1
a86 1
<p style="margin-left:19%;">The integer value octal
d91 1
a91 1
<p style="margin-left:19%;">The device and inode numbers
d100 1
a100 1
<p style="margin-left:19%; margin-top: 1em">The mode
d112 1
a112 1
<p style="margin-left:31%; margin-top: 1em">IALLOC flag -
d117 1
a117 1
<p style="margin-left:31%; margin-top: 1em">This masks the
d122 1
a122 1
<p style="margin-left:31%; margin-top: 1em">File type value
d127 1
a127 1
<p style="margin-left:31%; margin-top: 1em">File type value
d132 1
a132 1
<p style="margin-left:31%; margin-top: 1em">File type value
d137 1
a137 1
<p style="margin-left:31%; margin-top: 1em">ILARG flag -
d142 1
a142 1
<p style="margin-left:31%; margin-top: 1em">SUID bit.</p>
d146 1
a146 1
<p style="margin-left:31%; margin-top: 1em">SGID bit.</p>
d150 1
a150 1
<p style="margin-left:31%; margin-top: 1em">Sticky bit.</p>
d154 1
a154 1
<p style="margin-left:31%; margin-top: 1em">The lower 9
d160 1
a160 1
<p style="margin-left:19%;">The numeric user id and group
d165 1
a165 1
<p style="margin-left:19%;">The number of links to this
d172 1
a172 1
<p style="margin-left:19%;">For block special and character
d180 1
a180 1
<p style="margin-left:19%;">Modification time of the file,
d186 1
a186 1
<p style="margin-left:19%;">The number of bytes in the
d192 1
a192 1
<p style="margin-left:19%;">The size of the file. Note that
d197 1
a197 1
<p style="margin-left:9%; margin-top: 1em">The pathname
d204 1
a204 1
<p style="margin-left:9%; margin-top: 1em">Hardlinked files
d208 6
a213 7
<p style="margin-left:4%; margin-top: 1em"><b>New Binary
Format</b></p>

<p style="margin-left:9%;">The new binary <b>cpio</b>
format showed up when cpio was adopted into late 7th Edition
UNIX. It is exactly like the PWB binary format, described
above, except for three changes:</p>
d215 1
a215 1
<p style="margin-left:9%; margin-top: 1em">First, UNIX now
d226 1
a226 1
<p style="margin-left:9%; margin-top: 1em">Next, 7th
d233 1
a233 1
<p style="margin-left:21%; margin-top: 1em">This masks the
d238 1
a238 1
<p style="margin-left:21%; margin-top: 1em">File type value
d243 1
a243 1
<p style="margin-left:21%; margin-top: 1em">File type value
d249 1
a249 1
<p style="margin-left:21%; margin-top: 1em">File type value
d254 1
a254 1
<p style="margin-left:21%; margin-top: 1em">File type value
d259 1
a259 1
<p style="margin-left:21%; margin-top: 1em">File type value
d264 1
a264 1
<p style="margin-left:21%; margin-top: 1em">File type value
d269 1
a269 1
<p style="margin-left:21%; margin-top: 1em">File type value
d274 1
a274 1
<p style="margin-left:21%; margin-top: 1em">SUID bit.</p>
d278 1
a278 1
<p style="margin-left:21%; margin-top: 1em">SGID bit.</p>
d282 1
a282 1
<p style="margin-left:21%; margin-top: 1em">Sticky bit.</p>
d286 1
a286 1
<p style="margin-left:21%; margin-top: 1em">The lower 9
d290 1
a290 1
<p style="margin-left:9%; margin-top: 1em">Finally, the
d295 1
a295 1
<p style="margin-left:9%; margin-top: 1em">Note that there
d309 9
a317 10
<p style="margin-left:4%; margin-top: 1em"><b>Portable
ASCII Format</b></p>

<p style="margin-left:9%;">Version&nbsp;2 of the Single
UNIX Specification (&ldquo;SUSv2&rdquo;) standardized an
ASCII variant that is portable across all platforms. It is
commonly known as the &ldquo;old character&rdquo; format or
as the &ldquo;odc&rdquo; format. It stores the same numeric
fields as the old binary format, but represents them as
6-character or 11-character octal values.</p>
d319 1
a319 1
<p style="margin-left:17%; margin-top: 1em">struct
d334 1
a334 1
<p style="margin-left:9%; margin-top: 1em">The fields are
d343 5
a347 2
<p style="margin-left:4%; margin-top: 1em"><b>New ASCII
Format</b></p>
d349 1
a349 6
<p style="margin-left:9%;">The &quot;new&quot; ASCII format
uses 8-byte hexadecimal fields for all numbers and separates
device numbers into separate fields for major and minor
numbers.</p>

<p style="margin-left:17%; margin-top: 1em">struct
d367 1
a367 1
<p style="margin-left:9%; margin-top: 1em">Except as
d373 1
a373 1
<p style="margin-left:19%; margin-top: 1em">The string
d378 1
a378 1
<p style="margin-left:19%; margin-top: 1em">This field is
d382 1
a382 1
<p style="margin-left:9%; margin-top: 1em">The pathname is
d389 1
a389 1
<p style="margin-left:9%; margin-top: 1em">In this format,
d394 20
a413 25
<p style="margin-left:4%; margin-top: 1em"><b>New CRC
Format</b></p>

<p style="margin-left:9%;">The CRC format is identical to
the new ASCII format described in the previous section
except that the magic field is set to &ldquo;070702&rdquo;
and the <i>check</i> field is set to the sum of all bytes in
the file data. This sum is computed treating all bytes as
unsigned values and using unsigned arithmetic. Only the
least-significant 32 bits of the sum are stored.</p>

<p style="margin-left:4%; margin-top: 1em"><b>HP
variants</b></p>

<p style="margin-left:9%;">The <b>cpio</b> implementation
distributed with HPUX used XXXX but stored device numbers
differently XXX.</p>

<p style="margin-left:4%; margin-top: 1em"><b>Other
Extensions and Variants</b></p>

<p style="margin-left:9%;">Sun Solaris uses additional file
types to store extended file data, including ACLs and
extended attributes, as special entries in cpio
archives.</p>
d415 1
a415 1
<p style="margin-left:9%; margin-top: 1em">XXX Others?
d420 1
a420 2
<p style="margin-left:9%;"><i>cpio</i>(1),
<i>tar</i>(5)</p>
d424 1
a424 1
<p style="margin-left:9%;">The <b>cpio</b> utility is no
d428 2
a429 3
standards by <i>pax</i>(1). The portable ASCII format is
currently part of the specification for the <i>pax</i>(1)
utility.</p>
d433 1
a433 1
<p style="margin-left:9%;">The original cpio utility was
d449 1
a449 1
<p style="margin-left:9%;">The &ldquo;CRC&rdquo; format is
d453 1
a453 1
<p style="margin-left:9%; margin-top: 1em">The binary
d459 1
a459 1
<p style="margin-left:9%; margin-top: 1em">The old ASCII
d464 1
a464 1
<p style="margin-left:9%; margin-top: 1em">The new ASCII
d467 1
a467 1
<p style="margin-left:9%; margin-top: 1em">None of the cpio
d472 1
a472 1
<p style="margin-left:9%; margin-top: 1em">Especially when
d476 4
a479 2
be necessary even for the newer formats. Debian December 23,
2011 <i>CPIO</i>(5)</p>
@


1.1.1.15
log
@libarchive: imported version 3.7.9
@
text
@d2 1
a2 1
<!-- CreationDate: Sun Mar 30 20:07:38 2025 -->
@


1.1.1.16
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
@d2 1
a2 1
<!-- CreationDate: Tue May 20 09:02:20 2025 -->
@


1.1.1.17
log
@libarchive: import version 3.8.1
@
text
@d2 1
a2 1
<!-- CreationDate: Sun Jun  1 19:29:41 2025 -->
@


1.1.1.18
log
@libarchive: imported version 3.8.2
@
text
@d2 1
a2 1
<!-- CreationDate: Wed Oct 15 21:49:46 2025 -->
@


1.1.1.19
log
@libarchive: import version 3.8.3
@
text
@d2 1
a2 1
<!-- CreationDate: Mon Nov 17 22:19:03 2025 -->
@


1.1.1.20
log
@libarchive: import 3.8.4
@
text
@d2 1
a2 1
<!-- CreationDate: Mon Dec  1 12:42:38 2025 -->
@


1.1.1.21
log
@libarchive: import version 3.8.5
@
text
@d2 1
a2 1
<!-- CreationDate: Mon Jan  5 10:42:45 2026 -->
@


1.1.1.22
log
@libarchive: imported version 3.8.6
@
text
@d2 1
a2 1
<!-- CreationDate: Tue Mar 10 09:57:29 2026 -->
@


1.1.1.23
log
@libarchive: imported version 3.8.7
@
text
@d2 1
a2 1
<!-- CreationDate: Mon Apr 13 12:57:34 2026 -->
@


1.1.1.24
log
@libarchive: import 3.8.8
@
text
@d2 1
a2 1
<!-- CreationDate: Tue Jun 23 09:58:14 2026 -->
@


