star archives use the extended headers of POSIX.1-2001: members of type
x or g whose data is a list of key and value records. star(5)
defines the exustar form as one that “always includes x-headers and g-headers”, and
star keeps much of what its header cannot hold in records of its own, under the prefix
SCHILY..
Extended headers
An extended header is an ordinary 512-byte
header with type flag
x, followed by data blocks holding the records; its
t_size is their length. It applies to the member straight after it, whose
header follows the records, and its records replace the matching fields of that
header.
0Extended header type flagx512 bytes512Records padded with zeros to a multiple of 512size rounded up…Member header the star header the records apply to512 bytes…Member datasize rounded up
The extended header’s own name is not used for anything; POSIX’s default is
%d/PaxHeaders.%p/%f, the member’s folder, PaxHeaders. and the
process ID, then its file name. Solaris’s type X is read the same way as x.
Global headers
A header with type flag g holds records in the same form, applying to
every member that follows until another g header changes them. A record in
a member’s own x header takes priority over a global one. star puts
volume information in global headers, in the SCHILY.volhdr. keys (see
SCHILY keys).
POSIX’s default name for a global header is $TMPDIR/GlobalHead.%p.%n.
Records
Each record is a line of text, in the form "%d %s=%s\n": a decimal
length, a space, the keyword, =, the value and a line feed. The length
counts the whole record in bytes, its own digits, the space and the line feed
included.
30 mtime=1730851200.123456789
To read the records:
- Read decimal digits up to a space: the length n.
- The record is the n bytes from the first digit. Its last byte must be a line feed.
- After the space, the keyword runs to the first
=; keywords are UTF-8 and cannot contain=. - The value is everything after the
=up to the final line feed, and may hold any byte. - Move on n bytes and repeat, until the header’s size is used up.
Values are UTF-8 unless a hdrcharset record says otherwise. Numbers are
decimal text, and times are seconds since 1970 with an optional fraction. A record with
an empty value deletes the field or the value an earlier record set.
Standard keys
| Keyword | Meaning |
|---|---|
path | The member’s full path, replacing t_name and t_prefix. |
linkpath | The full link target, replacing t_linkname. |
size | The size of the data. |
uid, gid | The numeric owner and group. |
uname, gname | The owner and group names, of any length. |
mtime, atime | The modification and access times, with an optional fraction, replacing t_mtime and t_atime. |
ctime | The status change time. Not in POSIX’s list, but written by several programs and read by libarchive. |
comment | Free text, ignored when extracting. |
charset | The character set of the file’s contents, for information only (the 17 values). star ignores it. |
hdrcharset | The character set of path, linkpath, uname and gname: ISO-IR 10646 2000 UTF-8 (the default) or BINARY for raw bytes (details). |
realtime.…, security.… | Reserved by POSIX for future standardisation. |
When a value is set in several places, the x record wins over a
g record, and both win over the header itself. POSIX’s full order also
places the -o options of the pax command among them.
POSIX reserves keywords made only of lower-case letters, digits and periods for
future standardisation. star(5) names the convention for the rest:
VENDOR.keyword, with the vendor’s name in capitals.
Sparse files
star(5) says that the real size and the volume offset of a file, which star’s
sparse header once held, are
now kept in the records SCHILY.realsize and SCHILY.offset, and
that t_size holds “the sum of the sparse hole descriptors plus the size of
the compacted file data”.
A reader may also meet GNU tar’s sparse records in a star archive. GNU tar has three versions of them, named by the release of GNU tar that wrote them:
| Version | GNU tar | Records | Where the map is |
|---|---|---|---|
| 0.0 | 1.14 to 1.15.1 | GNU.sparse.size, GNU.sparse.numblocks, then repeated GNU.sparse.offset and GNU.sparse.numbytes | in the records |
| 0.1 | 1.15.2 | GNU.sparse.size, GNU.sparse.numblocks, GNU.sparse.map, GNU.sparse.name | in one record, a comma-separated list of offset and size |
| 1.0 | 1.15.92 | GNU.sparse.major=1, GNU.sparse.minor=0, GNU.sparse.name, GNU.sparse.realsize | at the start of the data: decimal numbers, each ended by a line feed, first the count, then each offset and size, padded to a whole block |
Versions 0.1 and 1.0 name the member with the pattern
%d/GNUSparseFile.%p/%f and keep the real name in
GNU.sparse.name. See the
pax sparse formats for the
details. The explorer lists each map and each stored stretch, and can open the
rebuilt file with its holes back, for GNU’s records and for star’s own
S members.
SCHILY keys
The keys star defines, from star(5). A reader that does not know a key skips it.
Unless noted, the keys are for each file (x headers).
| Keyword | Meaning |
|---|---|
SCHILY.acl.access | The file’s access control list: a POSIX 1003.1e draft ACL in its short text form, with the numeric ID as a fourth field for named users and groups. |
SCHILY.acl.default | A folder’s default access control list, in the same form. |
SCHILY.acl.ace | An NFSv4 access control list, in one of three text forms: the compact form with dashes (acl_totext with ACL_COMPACT_FMT | ACL_APPEND_ID | ACL_SID_FMT), the same with the dashes removed, or the long form (ACL_APPEND_ID | ACL_SID_FMT). Numeric IDs are appended. |
SCHILY.acl.type | The kind of list, POSIX draft or NFSv4. star accepts it but does not write it. |
SCHILY.ddev | Device IDs for the names in SCHILY.dir, in dump mode. star(5) notes this is not yet implemented. |
SCHILY.dev | The file’s device number (st_dev), in dump mode. Signed. |
SCHILY.devmajor, SCHILY.devminor | The device numbers of a special file (from st_rdev), without the header’s limits. Signed. |
SCHILY.devminorbits | The number of minor bits in st_dev, for systems such as SunOS that split device numbers unusually. |
SCHILY.dino | Inode numbers for the names in SCHILY.dir, in dump mode. Unsigned. |
SCHILY.ino | The file’s inode number (st_ino), in dump mode. Unsigned. |
SCHILY.dir | For a directory in dump mode, the names in it, in UTF-8, as a list (see below). |
SCHILY.fflags | The file’s flags, as comma-separated names (see below). |
SCHILY.filetype | The kind of file, as a name (see below). |
SCHILY.fsdevmajor, SCHILY.fsdevminor | The major and minor numbers of the device holding the file (st_dev), in dump mode. |
SCHILY.nlink | The link count, in dump mode. |
SCHILY.offset | For a file split across volumes, where this part starts in the whole file. |
SCHILY.realsize | The file’s real size when it differs from the archived size: a sparse file, or a multi-volume continuation. |
SCHILY.tarfiletype | The kind of member: the file types, plus hardlink, dumpdir, multivol continuation and meta. |
SCHILY.xattr.name | An extended attribute of Linux and its raw value, stored in the style of POSIX.1-2001 tags. Not portable. |
Volume information goes in global headers:
| Keyword | Meaning |
|---|---|
SCHILY.archtype | The textual version of the archive type: xustar or exustar among others. It should be in the first 512 bytes of the first global header. |
SCHILY.release | The star version string and the platform it was compiled for. |
SCHILY.volhdr.blockoff | The offset of this volume in the whole archive, in blocks. |
SCHILY.volhdr.blocksize | The blocking factor, in 512-byte units. |
SCHILY.volhdr.tapesize | The size of the tape, in 512-byte units. |
SCHILY.volhdr.volume | The number of this volume. star(5) uses the name volno in its multi-volume section. |
SCHILY.volhdr.cwd, .device, .filesys, .hostname | Dump mode: the working directory, the device, the file system and the host. |
SCHILY.volhdr.dumpdate, .refdate | Dump mode: the dump’s date and the date of the dump it is relative to. |
SCHILY.volhdr.dumplevel, .reflevel | Dump mode: the dump’s level and that of the reference dump, small non-negative integers. |
SCHILY.volhdr.dumptype | Dump mode: the dump’s type, full or partial. |
SCHILY.volhdr.label | The volume label, the same across a volume set. |
SCHILY.fflags names
The names star writes, with their aliases in brackets:
| Name | Meaning | Name | Meaning |
|---|---|---|---|
arch (archived) | Archived | nodump | Do not dump |
compressed (ucompressed) | Compressed | offline (uoffline) | Offline |
hidden (uhidden) | Hidden | opaque | Opaque |
rdonly (readonly, urdonly) | Read-only | reparse (ureparse) | Reparse point |
sappnd (sappend) | System append-only | schg (schange, simmutable) | System immutable |
sparse (usparse) | Sparse | sunlnk (sunlink) | System undeletable |
system (usystem) | System | uappnd (uappend) | User append-only |
uchg (uchange, uimmutable) | User immutable | uunlnk (uunlink) | User undeletable |
Linux’s own flags, also accepted: compress, dirsync,
journal-data, noatime, nocow,
notail, projinherit, secdel,
sync, topdir, undel.
ACL text
A POSIX draft entry, in SCHILY.acl.access or
SCHILY.acl.default, is a tag, a name, permissions and, for a named user or
group, the numeric ID: user::rwx for the owner,
user:lisa:rw-:1001, group::r-x, mask::r-- and
other::---, comma-separated. r, w and
x are read, write and execute, and a dash means the permission is not
given. Solaris’s text routine, in acltext.c, also writes a folder’s
default entries with their own tags: defaultuser:,
defaultgroup:, defaultmask: and
defaultother:, followed by the same fields.
An NFSv4 entry, in SCHILY.acl.ace, is who it is for, the permissions, the
inheritance flags, then allow, deny, audit or
alarm, with a numeric ID appended for a named user or group:
owner@:rwxp--aARWcCos:-------:allow or
user:lisa:rw-p--aARWcCos:fd-----:deny:1001. The first field is
owner@, group@, everyone@, or user:,
group:, usersid:, groupsid: or sid:
and a name. The letters of the compact forms, from the illumos
acl manual page; the long form spells each one out, separated by
slashes:
| Letter | Permission | Letter | Permission |
|---|---|---|---|
r | read_data | w | write_data |
p | append_data | x | execute |
d | delete | D | delete_child |
a | read_attributes | A | write_attributes |
R | read_xattr | W | write_xattr |
c | read_acl | C | write_acl |
o | write_owner | s | synchronize |
| Flag letter | Inheritance flag | Flag letter | Inheritance flag |
|---|---|---|---|
f | file_inherit | d | dir_inherit |
i | inherit_only | n | no_propagate |
I | inherited | S | successful_access |
F | failed_access |
The explorer spells out each entry of both kinds, and does the same for the text of
a Solaris type A member.
SCHILY.filetype and SCHILY.tarfiletype values
SCHILY.filetype is one of: unallocated,
regular, contiguous, symlink,
directory, character special, block special,
fifo, socket, mpx character special,
mpx block special, XENIX nsem, XENIX nshd,
door, eventcount, whiteout,
sparse, volheader or unknown/bad.
SCHILY.tarfiletype adds hardlink, dumpdir,
multivol continuation and meta.
The SCHILY.dir list
Each name is preceded by a flag byte and ended by a NUL, and a second NUL, in place of the next flag byte, ends the list. The flag bytes:
| Byte | Meaning | Byte | Meaning |
|---|---|---|---|
^A (001) | Default, or the file type is unknown | ^I (011) | Regular file |
^B (002) | FIFO | ^J (012) | Contiguous file |
^C (003) | Character special | ^K (013) | Symbolic link |
^D (004) | Reserved (XENIX multiplexed character special) | ^L (014) | Reserved (Solaris shadow inode) |
^E (005) | Directory | ^M (015) | Socket |
^F (006) | Reserved (XENIX named file) | ^N (016) | Solaris door |
^G (007) | Block special | ^O (017) | BSD whiteout entry |
^H (010) | Reserved (XENIX multiplexed block special) | ^P (020) | Reserved (UNOS eventcount) |
Letters mark membership in the current incremental dump: Y a non-directory
file in it, N a non-directory file not in it, D a directory in
it, d a directory not in it.
Other programs’ keys may appear too: LIBARCHIVE. keys from libarchive
(creationtime, symlinktype and xattr. keys with
a URL-encoded name and a base-64 value), SUN. keys from Solaris tar
(SUN.devmajor, SUN.devminor, which star also reads, and
SUN.holesdata), and GNU. keys from GNU tar (see
the ustar page).