Table of Contents
The format is a textual
format that describes a collection of filesystem objects. Such files are
typically used to create or verify directory heirarchies. An file consists
of a series of lines, each providing information about a single filesystem
object. Leading whitespace is always ignored. When encoding file or pathnames,
any backslash character or character outside of the 95 printable ASCII
characters must be encoded as a a backslash followed by three octal digits.
When reading mtree files, any appearance of a backslash followed by three
octal digits should be converted into the corresponding character. Each
line is interpreted independently as one of the following types: The
first line of any mtree file must begin with If a file contains any full
path entries, the first line should begin with otherwise, the first line
should begin with Blank lines are ignored. Lines beginning with are
ignored. Lines beginning with are special commands that influence the
interpretation of later lines. If the first whitespace-delimited word has
no characters, it is the name of a file in the current directory. Any relative
entry that describes a directory changes the current directory. As a special
case, a relative entry with the filename changes the current directory
to the parent directory. Options on dot-dot entries are always ignored. If
the first whitespace-delimited word has a character after the first character,
it is the pathname of a file relative to the starting directory. There can
be multiple full entries describing the same file. Some tools that process
files may require that multiple lines describing the same file occur consecutively.
It is not permitted for the same file to be mentioned using both a relative
and a full file specification. Two special commands are currently defined:
This command defines default values for one or more keywords. It is followed
on the same line by one or more whitespace-separated keyword definitions.
These definitions apply to all following files that do not specify a value
for that keyword. This command removes any default value set by a previous
command. It is followed on the same line by one or more keywords separated
by whitespace. After the filename, a full or relative entry consists of
zero or more whitespace-separated keyword definitions. Each such definitions
consists of a key from the following list immediately followed by an ’=’
sign and a value. Software programs reading mtree files should warn about
unrecognized keywords. Currently supported keywords are as follows: The
checksum of the file using the default algorithm specified by the utility.
The full pathname of a file whose contents should be compared to the contents
of this file. The file flags as a symbolic name. See for information on
these names. If no flags are to be set the string may be used to override
the current default. Ignore any file hierarchy below this file. The file
group as a numeric value. The file group as a symbolic name. The MD5 message
digest of the file. A synonym for The 160-1 message digest of the file.
A synonym for The 180-2 message digest of the file. A synonym for
The message digest of the file. A synonym for A synonym for The current
file’s permissions as a numeric (octal) or symbolic value. The number of
hard links the file is expected to have. Make sure this file or directory
exists but otherwise ignore all attributes. The file owner as a numeric
value. The file owner as a symbolic name. The size, in bytes, of the file.
The file the symbolic link is expected to reference. The last modification
time of the file. The type of the file; may be set to any one of the following:
block special device character special device directory fifo regular
file symbolic link socket
The implementation of mtree
does not currently support the 2.0 format. The requirement for a signature
line is new and not yet widely implemented.
The utility appeared
in The digest capability was added in in response to the widespread
use of programs which can spoof The and digests were added in as new
attacks have demonstrated weaknesses in The digest was added in Support
for file flags was added in and mostly comes from The entry format was
added by
Table of Contents