tar: Extended File Attributes

1 
1 4.3.2 Extended File Attributes
1 ------------------------------
1 
1 Extended file attributes are name-value pairs that can be associated
1 with each node in a file system.  Despite the fact that POSIX.1e draft
1 which proposed them has been withdrawn, the extended file attributes are
1 supported by many file systems.  GNU 'tar' can store extended file
1 attributes along with the files.  This feature is controlled by the
1 following command line arguments:
1 
1 '--xattrs'
1      Enable extended attributes support.  When used with '--create',
1      this option instructs GNU 'tar' to store extended file attribute in
1      the created archive.  This implies POSIX.1-2001 archive format
1      ('--format=pax').
1 
1      When used with '--extract', this option tells 'tar', for each file
1      extracted, to read stored attributes from the archive and to apply
1      them to the file.
1 
1 '--no-xattrs'
1      Disable extended attributes support.  This is the default.
1 
1    Attribute names are strings prefixed by a "namespace" name and a dot.
1 Currently, four namespaces exist: 'user', 'trusted', 'security' and
1 'system'.  By default, when '--xattr' is used, all names are stored in
1 the archive (or extracted, if using '--extract').  This can be
1 controlled using the following options:
1 
1 '--xattrs-exclude=PATTERN'
1      Specify exclude pattern for extended attributes.
1 
1 '--xattrs-include=PATTERN'
1      Specify include pattern for extended attributes.
1 
1    Here, the PATTERN is a globbing pattern.  For example, the following
1 command:
1 
1      $ tar --xattrs --xattrs-exclude='user.*' -c a.tar .
1 
1    will include in the archive 'a.tar' all attributes, except those from
1 the 'user' namespace.
1 
1    Any number of these options can be given, thereby creating lists of
1 include and exclude patterns.
1 
1    When both options are used, first '--xattrs-include' is applied to
1 select the set of attribute names to keep, and then '--xattrs-exclude'
1 is applied to the resulting set.  In other words, only those attributes
1 will be stored, whose names match one of the regexps in
1 '--xattrs-include' and don't match any of the regexps from
1 '--xattrs-exclude'.
1 
1    When listing the archive, if both '--xattrs' and '--verbose' options
1 are given, files that have extended attributes are marked with an
1 asterisk following their permission mask.  For example:
1 
1      -rw-r--r--* smith/users      110 2016-03-16 16:07 file
1 
1    When two or more '--verbose' options are given, a detailed listing of
1 extended attributes is printed after each file entry.  Each attribute is
1 listed on a separate line, which begins with two spaces and the letter
1 'x' indicating extended attribute.  It is followed by a colon, length of
1 the attribute and its name, e.g.:
1 
1      -rw-r--r--* smith/users      110 2016-03-16 16:07 file
1        x:  7 user.mime_type
1        x: 32 trusted.md5sum
1 
1    File access control lists ("ACL") are another actively used feature
1 proposed by the POSIX.1e standard.  Each ACL consists of a set of ACL
1 entries, each of which describes the access permissions on the file for
1 an individual user or a group of users as a combination of read, write
1 and search/execute permissions.
1 
1    Whether or not to use ACLs is controlled by the following two
1 options:
1 
1 '--acls'
1      Enable POSIX ACLs support.  When used with '--create', this option
1      instructs GNU 'tar' to store ACLs in the created archive.  This
1      implies POSIX.1-2001 archive format ('--format=pax').
1 
1      When used with '--extract', this option tells 'tar', to restore
1      ACLs for each file extracted (provided they are present in the
1      archive).
1 
1 '--no-acls'
1      Disable POSIX ACLs support.  This is the default.
1 
1    When listing the archive, if both '--acls' and '--verbose' options
1 are given, files that have ACLs are marked with a plus sing following
1 their permission mask.  For example:
1 
1      -rw-r--r--+ smith/users      110 2016-03-16 16:07 file
1 
1    When two or more '--verbose' options are given, a detailed listing of
1 ACL is printed after each file entry:
1 
1      -rw-r--r--+ smith/users      110 2016-03-16 16:07 file
1        a: user::rw-,user:gray:-w-,group::r--,mask::rw-,other::r--
1 
1    "Security-Enhanced Linux" ("SELinux" for short) is a Linux kernel
1 security module that provides a mechanism for supporting access control
1 security policies, including so-called mandatory access controls
1 ("MAC"). Support for SELinux attributes is controlled by the following
1 command line options:
1 
1 '--selinux'
1      Enable the SELinux context support.
1 
1 '--no-selinux'
1      Disable SELinux context support.
1