Seth Woolley's Man Viewer

Manual for attr - man 5 attr

([section] manual, -k keyword, -K [section] search, -f whatis)
man plain no title

ATTR(5)                                                                ATTR(5)



NAME
       attr(1,5) - Extended attributes

DESCRIPTION
       Extended  attributes  are  name:value pairs associated permanently with
       files and directories, similar to the  environment  strings  associated
       with  a  process.   An attribute may be defined or undefined.  If it is
       defined, its value may be empty or non-empty.

       Extended attributes are extensions to the normal attributes  which  are
       associated with all inodes in(1,8) the system (i.e. the stat(1,2)(2) data).  They
       are often used to provide additional functionality to  a  filesystem  -
       for  example, additional security features such as Access Control Lists
       (ACLs) may be implemented using extended attributes.

       Users with search access(2,5) to a file(1,n) or directory may retrieve a list  of
       attribute names defined for that file(1,n) or directory.

       Extended  attributes are accessed as atomic objects.  Reading retrieves
       the whole value of an attribute and stores it  in(1,8)  a  buffer.   Writing
       replaces any previous value with the new value.

       Space consumed for extended attributes is counted towards the disk quo-
       tas of the file(1,n) owner and file(1,n) group.

       Currently, support for extended attributes is implemented on  Linux  by
       the ext2, ext3 and XFS filesystem patches, which can be downloaded from
       http://acl.bestbits.at/  and  http://oss.sgi.com/projects/xfs/  respec-
       tively.

EXTENDED ATTRIBUTE NAMESPACES
       Attribute  names  are  zero-terminated  strings.  The attribute name is
       always specified in(1,8) the fully qualified namespace.attribute  form,  eg.
       user.mime_type,   trusted.md5sum,   system.posix_acl_access,  or  secu-
       rity.selinux.

       The namespace mechanism is used to define different classes of extended
       attributes.   These  different  classes exist for several reasons, e.g.
       the permissions and capabilities  required  for  manipulating  extended
       attributes of one namespace may differ to another.

       Currently  the  security,  system, trusted, and user extended attribute
       classes are defined as described below. Additional classes may be added
       in(1,8) the future.

   Extended security attributes
       The  security  attribute  namespace is used by kernel security modules,
       such as Security Enhanced Linux.  Read and write(1,2) access(2,5) permissions  to
       security  attributes depend on the policy implemented for each security
       attribute by the security module.  When no security module  is  loaded,
       all  processes  have  read(2,n,1 builtins)  access(2,5) to extended security attributes, and
       write(1,2) access(2,5) is limited to processes that have the CAP_SYS_ADMIN  capa-
       bility.

   Extended system attributes
       Extended  system  attributes  are  used  by  the kernel to store system
       objects such as Access Control Lists and Capabilities.  Read and  write(1,2)
       access(2,5)  permissions  to  system  attributes depend on the policy imple-
       mented for each system attribute implemented by filesystems in(1,8) the ker-
       nel.

   Trusted extended attributes
       Trusted  extended  attributes  are  visible and accessible only to pro-
       cesses that have the CAP_SYS_ADMIN capability (the super  user  usually
       has  this  capability).  Attributes in(1,8) this class are used to implement
       mechanisms in(1,8) user space (i.e., outside the kernel) which keep informa-
       tion in(1,8) extended attributes to which ordinary processes should not have
       access.

   Extended user attributes
       Extended user attributes may be assigned to files and  directories  for
       storing arbitrary additional information such as the mime type, charac-
       ter set(7,n,1 builtins) or  encoding(3,n)  of  a  file.  The  access(2,5)  permissions  for  user
       attributes are defined by the file(1,n) permission bits.

       The  file(1,n)  permission  bits of regular files and directories are inter-
       preted differently from the file(1,n) permission bits of special  files  and
       symbolic  links.  For regular files and directories the file(1,n) permission
       bits define access(2,5) to the file(1,n)'s contents,  while  for  device  special
       files  they  define access(2,5) to the device described by the special file.
       The file(1,n) permissions of symbolic links are not used in(1,8)  access(2,5)  checks.
       These  differences would allow users(1,5) to consume filesystem resources in(1,8)
       a way not controllable by disk quotas for group or world writable  spe-
       cial files and directories.

       For  this reason, extended user attributes are only allowed for regular
       files and directories,  and  access(2,5)  to  extended  user  attributes  is
       restricted  to the owner and to users(1,5) with appropriate capabilities for
       directories with the sticky bit set(7,n,1 builtins) (see the chmod(1,2)(1) manual  page  for
       an explanation of Sticky Directories).

FILESYSTEM DIFFERENCES
       The  kernel  and  the filesystem may place limits on the maximum number
       and size of extended attributes that can be associated with a file.

       In the current ext2 and ext3 filesystem implementations,  all  extended
       attributes  must  fit  on a single filesystem block (1024, 2048 or 4096
       bytes, depending on the block size specified when  the  filesystem  was
       created). This limit may be removed in(1,8) a future version.

       In  the  XFS  filesystem implementation, there is no practical limit on
       the number of extended attributes associated with a file(1,n), and the algo-
       rithms  used  to store extended attribute information on disk are scal-
       able (stored either inline in(1,8) the inode, as  an  extent,  or  in(1,8)  a  B+
       tree).

ADDITIONAL NOTES
       Since  the  filesystems  on  which extended attributes are stored might
       also be used on architectures with a different byte order  and  machine
       word  size, care should be taken to store attribute values in(1,8) an archi-
       tecture independent format.

AUTHORS
       Andreas Gruenbacher, <a.gruenbacher@bestbits.at> and the SGI XFS devel-
       opment team, <linux-xfs@oss.sgi.com>.

SEE ALSO
       getfattr(1), setfattr(1).



                                                                       ATTR(5)

References for this manual (incoming links)