Blame libarchive/mtree.5

Packit 08bd4c
.\" Copyright (c) 1989, 1990, 1993
Packit 08bd4c
.\"     The Regents of the University of California.  All rights reserved.
Packit 08bd4c
.\"
Packit 08bd4c
.\" Redistribution and use in source and binary forms, with or without
Packit 08bd4c
.\" modification, are permitted provided that the following conditions
Packit 08bd4c
.\" are met:
Packit 08bd4c
.\" 1. Redistributions of source code must retain the above copyright
Packit 08bd4c
.\"    notice, this list of conditions and the following disclaimer.
Packit 08bd4c
.\" 2. Redistributions in binary form must reproduce the above copyright
Packit 08bd4c
.\"    notice, this list of conditions and the following disclaimer in the
Packit 08bd4c
.\"    documentation and/or other materials provided with the distribution.
Packit 08bd4c
.\" 4. Neither the name of the University nor the names of its contributors
Packit 08bd4c
.\"    may be used to endorse or promote products derived from this software
Packit 08bd4c
.\"    without specific prior written permission.
Packit 08bd4c
.\"
Packit 08bd4c
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
Packit 08bd4c
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Packit 08bd4c
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
Packit 08bd4c
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
Packit 08bd4c
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Packit 08bd4c
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
Packit 08bd4c
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
Packit 08bd4c
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
Packit 08bd4c
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
Packit 08bd4c
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
Packit 08bd4c
.\" SUCH DAMAGE.
Packit 08bd4c
.\"
Packit 08bd4c
.\"     From: @(#)mtree.8       8.2 (Berkeley) 12/11/93
Packit 08bd4c
.\" $FreeBSD$
Packit 08bd4c
.\"
Packit 08bd4c
.Dd September 4, 2013
Packit 08bd4c
.Dt MTREE 5
Packit 08bd4c
.Os
Packit 08bd4c
.Sh NAME
Packit 08bd4c
.Nm mtree
Packit 08bd4c
.Nd format of mtree dir hierarchy files
Packit 08bd4c
.Sh DESCRIPTION
Packit 08bd4c
The
Packit 08bd4c
.Nm
Packit 08bd4c
format is a textual format that describes a collection of filesystem objects.
Packit 08bd4c
Such files are typically used to create or verify directory hierarchies.
Packit 08bd4c
.Ss General Format
Packit 08bd4c
An
Packit 08bd4c
.Nm
Packit 08bd4c
file consists of a series of lines, each providing information
Packit 08bd4c
about a single filesystem object.
Packit 08bd4c
Leading whitespace is always ignored.
Packit 08bd4c
.Pp
Packit 08bd4c
When encoding file or pathnames, any backslash character or
Packit 08bd4c
character outside of the 95 printable ASCII characters must be
Packit 08bd4c
encoded as a backslash followed by three
Packit 08bd4c
octal digits.
Packit 08bd4c
When reading mtree files, any appearance of a backslash
Packit 08bd4c
followed by three octal digits should be converted into the
Packit 08bd4c
corresponding character.
Packit 08bd4c
.Pp
Packit 08bd4c
Each line is interpreted independently as one of the following types:
Packit 08bd4c
.Bl -tag -width Cm
Packit 08bd4c
.It Blank
Packit 08bd4c
Blank lines are ignored.
Packit 08bd4c
.It Comment
Packit 08bd4c
Lines beginning with
Packit 08bd4c
.Cm #
Packit 08bd4c
are ignored.
Packit 08bd4c
.It Special
Packit 08bd4c
Lines beginning with
Packit 08bd4c
.Cm /
Packit 08bd4c
are special commands that influence
Packit 08bd4c
the interpretation of later lines.
Packit 08bd4c
.It Relative
Packit 08bd4c
If the first whitespace-delimited word has no
Packit 08bd4c
.Cm /
Packit 08bd4c
characters,
Packit 08bd4c
it is the name of a file in the current directory.
Packit 08bd4c
Any relative entry that describes a directory changes the
Packit 08bd4c
current directory.
Packit 08bd4c
.It dot-dot
Packit 08bd4c
As a special case, a relative entry with the filename
Packit 08bd4c
.Pa ..
Packit 08bd4c
changes the current directory to the parent directory.
Packit 08bd4c
Options on dot-dot entries are always ignored.
Packit 08bd4c
.It Full
Packit 08bd4c
If the first whitespace-delimited word has a
Packit 08bd4c
.Cm /
Packit 08bd4c
character after
Packit 08bd4c
the first character, it is the pathname of a file relative to the
Packit 08bd4c
starting directory.
Packit 08bd4c
There can be multiple full entries describing the same file.
Packit 08bd4c
.El
Packit 08bd4c
.Pp
Packit 08bd4c
Some tools that process
Packit 08bd4c
.Nm
Packit 08bd4c
files may require that multiple lines describing the same file
Packit 08bd4c
occur consecutively.
Packit 08bd4c
It is not permitted for the same file to be mentioned using
Packit 08bd4c
both a relative and a full file specification.
Packit 08bd4c
.Ss Special commands
Packit 08bd4c
Two special commands are currently defined:
Packit 08bd4c
.Bl -tag -width Cm
Packit 08bd4c
.It Cm /set
Packit 08bd4c
This command defines default values for one or more keywords.
Packit 08bd4c
It is followed on the same line by one or more whitespace-separated
Packit 08bd4c
keyword definitions.
Packit 08bd4c
These definitions apply to all following files that do not specify
Packit 08bd4c
a value for that keyword.
Packit 08bd4c
.It Cm /unset
Packit 08bd4c
This command removes any default value set by a previous
Packit 08bd4c
.Cm /set
Packit 08bd4c
command.
Packit 08bd4c
It is followed on the same line by one or more keywords
Packit 08bd4c
separated by whitespace.
Packit 08bd4c
.El
Packit 08bd4c
.Ss Keywords
Packit 08bd4c
After the filename, a full or relative entry consists of zero
Packit 08bd4c
or more whitespace-separated keyword definitions.
Packit 08bd4c
Each such definition consists of a key from the following
Packit 08bd4c
list immediately followed by an '=' sign
Packit 08bd4c
and a value.
Packit 08bd4c
Software programs reading mtree files should warn about
Packit 08bd4c
unrecognized keywords.
Packit 08bd4c
.Pp
Packit 08bd4c
Currently supported keywords are as follows:
Packit 08bd4c
.Bl -tag -width Cm
Packit 08bd4c
.It Cm cksum
Packit 08bd4c
The checksum of the file using the default algorithm specified by
Packit 08bd4c
the
Packit 08bd4c
.Xr cksum 1
Packit 08bd4c
utility.
Packit 08bd4c
.It Cm device
Packit 08bd4c
The device number for
Packit 08bd4c
.Sy block
Packit 08bd4c
or
Packit 08bd4c
.Sy char
Packit 08bd4c
file types.
Packit 08bd4c
The value must be one of the following forms:
Packit 08bd4c
.Pp
Packit 08bd4c
.Bl -tag -width 4n
Packit 08bd4c
.It Ar format , Ns Ar major , Ns Ar minor Ns Bo , Ns Ar subunit Bc
Packit 08bd4c
A device with
Packit 08bd4c
.Ar major , minor
Packit 08bd4c
and optional
Packit 08bd4c
.Ar subunit
Packit 08bd4c
fields.
Packit 08bd4c
Their meaning is specified by the operating's system
Packit 08bd4c
.Ar format .
Packit 08bd4c
See below for valid formats.
Packit 08bd4c
.It Ar number
Packit 08bd4c
Opaque number (as stored on the file system).
Packit 08bd4c
.El
Packit 08bd4c
.Pp
Packit 08bd4c
The following values for
Packit 08bd4c
.Ar format
Packit 08bd4c
are recognized:
Packit 08bd4c
.Sy native ,
Packit 08bd4c
.Sy 386bsd ,
Packit 08bd4c
.Sy 4bsd ,
Packit 08bd4c
.Sy bsdos ,
Packit 08bd4c
.Sy freebsd ,
Packit 08bd4c
.Sy hpux ,
Packit 08bd4c
.Sy isc ,
Packit 08bd4c
.Sy linux ,
Packit 08bd4c
.Sy netbsd ,
Packit 08bd4c
.Sy osf1 ,
Packit 08bd4c
.Sy sco ,
Packit 08bd4c
.Sy solaris ,
Packit 08bd4c
.Sy sunos ,
Packit 08bd4c
.Sy svr3 ,
Packit 08bd4c
.Sy svr4 ,  
Packit 08bd4c
and 
Packit 08bd4c
.Sy ultrix .
Packit 08bd4c
.Pp
Packit 08bd4c
See
Packit 08bd4c
.Xr mknod 8
Packit 08bd4c
for more details.
Packit 08bd4c
.It Cm contents
Packit 08bd4c
The full pathname of a file that holds the contents of this file.
Packit 08bd4c
.It Cm flags
Packit 08bd4c
The file flags as a symbolic name.
Packit 08bd4c
See
Packit 08bd4c
.Xr chflags 1
Packit 08bd4c
for information on these names.
Packit 08bd4c
If no flags are to be set the string
Packit 08bd4c
.Dq none
Packit 08bd4c
may be used to override the current default.
Packit 08bd4c
.It Cm gid
Packit 08bd4c
The file group as a numeric value.
Packit 08bd4c
.It Cm gname
Packit 08bd4c
The file group as a symbolic name.
Packit 08bd4c
.It Cm ignore
Packit 08bd4c
Ignore any file hierarchy below this file.
Packit 08bd4c
.It Cm inode
Packit 08bd4c
The inode number.
Packit 08bd4c
.It Cm link
Packit 08bd4c
The target of the symbolic link when type=link.
Packit 08bd4c
.It Cm md5
Packit 08bd4c
The MD5 message digest of the file.
Packit 08bd4c
.It Cm md5digest
Packit 08bd4c
A synonym for
Packit 08bd4c
.Cm md5 .
Packit 08bd4c
.It Cm mode
Packit 08bd4c
The current file's permissions as a numeric (octal) or symbolic
Packit 08bd4c
value.
Packit 08bd4c
.It Cm nlink
Packit 08bd4c
The number of hard links the file is expected to have.
Packit 08bd4c
.It Cm nochange
Packit 08bd4c
Make sure this file or directory exists but otherwise ignore all attributes.
Packit 08bd4c
.It Cm optional
Packit 08bd4c
The file is optional; do not complain about the file if it is not in
Packit 08bd4c
the file hierarchy.
Packit 08bd4c
.It Cm resdevice
Packit 08bd4c
The
Packit 08bd4c
.Dq resident
Packit 08bd4c
device number of the file, e.g. the ID of the device that
Packit 08bd4c
contains the file.
Packit 08bd4c
Its format is the same as the one for
Packit 08bd4c
.Cm device .
Packit 08bd4c
.It Cm ripemd160digest
Packit 08bd4c
The
Packit 08bd4c
.Tn RIPEMD160
Packit 08bd4c
message digest of the file.
Packit 08bd4c
.It Cm rmd160
Packit 08bd4c
A synonym for
Packit 08bd4c
.Cm ripemd160digest .
Packit 08bd4c
.It Cm rmd160digest
Packit 08bd4c
A synonym for
Packit 08bd4c
.Cm ripemd160digest .
Packit 08bd4c
.It Cm sha1
Packit 08bd4c
The
Packit 08bd4c
.Tn FIPS
Packit 08bd4c
160-1
Packit 08bd4c
.Pq Dq Tn SHA-1
Packit 08bd4c
message digest of the file.
Packit 08bd4c
.It Cm sha1digest
Packit 08bd4c
A synonym for
Packit 08bd4c
.Cm sha1 .
Packit 08bd4c
.It Cm sha256
Packit 08bd4c
The
Packit 08bd4c
.Tn FIPS
Packit 08bd4c
180-2
Packit 08bd4c
.Pq Dq Tn SHA-256
Packit 08bd4c
message digest of the file.
Packit 08bd4c
.It Cm sha256digest
Packit 08bd4c
A synonym for
Packit 08bd4c
.Cm sha256 .
Packit 08bd4c
.It Cm sha384
Packit 08bd4c
The
Packit 08bd4c
.Tn FIPS
Packit 08bd4c
180-2
Packit 08bd4c
.Pq Dq Tn SHA-384
Packit 08bd4c
message digest of the file.
Packit 08bd4c
.It Cm sha384digest
Packit 08bd4c
A synonym for
Packit 08bd4c
.Cm sha384 .
Packit 08bd4c
.It Cm sha512
Packit 08bd4c
The
Packit 08bd4c
.Tn FIPS
Packit 08bd4c
180-2
Packit 08bd4c
.Pq Dq Tn SHA-512
Packit 08bd4c
message digest of the file.
Packit 08bd4c
.It Cm sha512digest
Packit 08bd4c
A synonym for
Packit 08bd4c
.Cm sha512 .
Packit 08bd4c
.It Cm size
Packit 08bd4c
The size, in bytes, of the file.
Packit 08bd4c
.It Cm time
Packit 08bd4c
The last modification time of the file.
Packit 08bd4c
.It Cm type
Packit 08bd4c
The type of the file; may be set to any one of the following:
Packit 08bd4c
.Pp
Packit 08bd4c
.Bl -tag -width Cm -compact
Packit 08bd4c
.It Cm block
Packit 08bd4c
block special device
Packit 08bd4c
.It Cm char
Packit 08bd4c
character special device
Packit 08bd4c
.It Cm dir
Packit 08bd4c
directory
Packit 08bd4c
.It Cm fifo
Packit 08bd4c
fifo
Packit 08bd4c
.It Cm file
Packit 08bd4c
regular file
Packit 08bd4c
.It Cm link
Packit 08bd4c
symbolic link
Packit 08bd4c
.It Cm socket
Packit 08bd4c
socket
Packit 08bd4c
.El
Packit 08bd4c
.It Cm uid
Packit 08bd4c
The file owner as a numeric value.
Packit 08bd4c
.It Cm uname
Packit 08bd4c
The file owner as a symbolic name.
Packit 08bd4c
.El
Packit 08bd4c
.Pp
Packit 08bd4c
.Sh SEE ALSO
Packit 08bd4c
.Xr cksum 1 ,
Packit 08bd4c
.Xr find 1 ,
Packit 08bd4c
.Xr mtree 8
Packit 08bd4c
.Sh BUGS
Packit 08bd4c
.Sh HISTORY
Packit 08bd4c
The
Packit 08bd4c
.Nm
Packit 08bd4c
utility appeared in
Packit 08bd4c
.Bx 4.3 Reno .
Packit 08bd4c
The
Packit 08bd4c
.Tn MD5
Packit 08bd4c
digest capability was added in
Packit 08bd4c
.Fx 2.1 ,
Packit 08bd4c
in response to the widespread use of programs which can spoof
Packit 08bd4c
.Xr cksum 1 .
Packit 08bd4c
The
Packit 08bd4c
.Tn SHA-1
Packit 08bd4c
and
Packit 08bd4c
.Tn RIPEMD160
Packit 08bd4c
digests were added in
Packit 08bd4c
.Fx 4.0 ,
Packit 08bd4c
as new attacks have demonstrated weaknesses in
Packit 08bd4c
.Tn MD5 .
Packit 08bd4c
The
Packit 08bd4c
.Tn SHA-256
Packit 08bd4c
digest was added in
Packit 08bd4c
.Fx 6.0 .
Packit 08bd4c
Support for file flags was added in
Packit 08bd4c
.Fx 4.0 ,
Packit 08bd4c
and mostly comes from
Packit 08bd4c
.Nx .
Packit 08bd4c
The
Packit 08bd4c
.Dq full
Packit 08bd4c
entry format was added by
Packit 08bd4c
.Nx .