xref: /freebsd/share/man/man9/extattr.9 (revision 571dba6ec9f25ecf7582dc2192daf1ceea70065f)
132900e82SRobert Watson.\"-
2d1605766SRobert Watson.\" Copyright (c) 1999, 2000, 2001, 2003 Robert N. M. Watson
332900e82SRobert Watson.\" All rights reserved.
432900e82SRobert Watson.\"
532900e82SRobert Watson.\" Redistribution and use in source and binary forms, with or without
632900e82SRobert Watson.\" modification, are permitted provided that the following conditions
732900e82SRobert Watson.\" are met:
832900e82SRobert Watson.\" 1. Redistributions of source code must retain the above copyright
932900e82SRobert Watson.\"    notice, this list of conditions and the following disclaimer.
1032900e82SRobert Watson.\" 2. Redistributions in binary form must reproduce the above copyright
1132900e82SRobert Watson.\"    notice, this list of conditions and the following disclaimer in the
1232900e82SRobert Watson.\"    documentation and/or other materials provided with the distribution.
1332900e82SRobert Watson.\"
1432900e82SRobert Watson.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1532900e82SRobert Watson.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1632900e82SRobert Watson.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1732900e82SRobert Watson.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1832900e82SRobert Watson.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1932900e82SRobert Watson.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2032900e82SRobert Watson.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2132900e82SRobert Watson.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2232900e82SRobert Watson.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2332900e82SRobert Watson.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2432900e82SRobert Watson.\" SUCH DAMAGE.
2532900e82SRobert Watson.\"
2632900e82SRobert Watson.\" $FreeBSD$
2732900e82SRobert Watson.\"
2832900e82SRobert Watson.Dd December 23, 1999
2932900e82SRobert Watson.Os
3032900e82SRobert Watson.Dt EXTATTR 9
3132900e82SRobert Watson.Sh NAME
3232900e82SRobert Watson.Nm extattr
3332900e82SRobert Watson.Nd virtual file system named extended attributes
3432900e82SRobert Watson.Sh SYNOPSIS
3532eef9aeSRuslan Ermilov.In sys/param.h
3632eef9aeSRuslan Ermilov.In sys/vnode.h
3732eef9aeSRuslan Ermilov.In sys/extattr.h
3832900e82SRobert Watson.Sh DESCRIPTION
3932900e82SRobert WatsonNamed extended attributes allow additional meta-data to be associated
4050b19f19SRobert Watsonwith vnodes representing files and directories.
4150b19f19SRobert WatsonThe semantics of this additional data is that of a "name=value" pair, where
4250b19f19SRobert Watsona name may be defined or undefined, and if defined, associated with zero or
4350b19f19SRobert Watsonmore bytes of arbitrary binary data.
4450b19f19SRobert WatsonExtended attribute names exist within a set of namespaces; each operation
4550b19f19SRobert Watsonon an extended attribute is required to provide the namespace to which to
4650b19f19SRobert Watsonoperation refers.
4750b19f19SRobert WatsonIf the same name is present in multiple namespaces, the extended attributes
4850b19f19SRobert Watsonassociated with the names are stored and manipulated independently.
4950b19f19SRobert WatsonThe following two namespaces are defined universally, although individual
5050b19f19SRobert Watsonfile systems may implement additional namespaces, or not implement
51e2cd9aedSRobert Watsonthese namespaces:
52e2cd9aedSRobert Watson.Dv EXTATTR_NAMESPACE_USER ,
53e2cd9aedSRobert Watson.Dv EXTATTR_NAMESPACE_SYSTEM .
5450b19f19SRobert WatsonThe semantics of these attributes are intended to be as follows: user
55a910f192SDima Dorfmanattribute data is protected according the normal discretionary
5650b19f19SRobert Watsonand mandatory protections associated with the data in the file or
5750b19f19SRobert Watsondirectory; system attribute data is protected such that appropriate
5850b19f19SRobert Watsonprivilege is required to directly access or manipulate these attributes.
59ef994422SRuslan Ermilov.Pp
6050b19f19SRobert WatsonReads of extended attribute data may return specific contiguous regions of
6150b19f19SRobert Watsonthe meta-data, in the style of
6232900e82SRobert Watson.Xr VOP_READ 9 ,
6332900e82SRobert Watsonbut writes will replace the entire current "value" associated with
6450b19f19SRobert Watsona given name.
6550b19f19SRobert WatsonAs there are a plethora of file systems with differing extended attributes,
6650b19f19SRobert Watsonavailability and functionality of these functions may be limited, and they
6750b19f19SRobert Watsonshould be used with awareness of the underlying semantics of the supporting
6850b19f19SRobert Watsonfile system.
6950b19f19SRobert WatsonAuthorization schemes for extended attribute data may also vary by file
7050b19f19SRobert Watsonsystem, as well as maximum attribute size, and whether or not any or
7150b19f19SRobert Watsonspecific new attributes may be defined.
723136363fSRuslan Ermilov.Pp
7332900e82SRobert WatsonExtended attributes are named using a null-terminated character string.
7450b19f19SRobert WatsonDepending on underlying file system semantics, this name may or may not be
75559eb8d2SHiten Pandyacase-sensitive.
76559eb8d2SHiten PandyaAppropriate vnode extended attribute calls are:
771792c88dSRobert Watson.Xr VOP_GETEXTATTR 9 ,
781792c88dSRobert Watson.Xr VOP_LISTEXTATTR 9 ,
7932900e82SRobert Watsonand
8032900e82SRobert Watson.Xr VOP_SETEXTATTR 9 .
8132900e82SRobert Watson.Sh SEE ALSO
8232900e82SRobert Watson.Xr VFS 9 ,
8350b19f19SRobert Watson.Xr VFS_EXTATTRCTL 9 ,
8432900e82SRobert Watson.Xr VOP_GETEXTATTR 9 ,
851792c88dSRobert Watson.Xr VOP_LISTEXTATTR 9 ,
866fe89339SBen Smithurst.Xr VOP_SETEXTATTR 9
8732900e82SRobert Watson.Sh AUTHORS
88571dba6eSHiten PandyaThis manual page was written by
8932900e82SRobert Watson.An Robert Watson .
9050b19f19SRobert Watson.Sh BUGS
9150b19f19SRobert WatsonIn addition, the interface does not provide a mechanism to retrieve
9250b19f19SRobert Watsonthe current set of available attributes; it has been suggested that
93e2cd9aedSRobert Watsonproviding a
94e2cd9aedSRobert Watson.Dv NULL
95e2cd9aedSRobert Watsonattribute name should cause a list of defined attributes for the passed file
96e2cd9aedSRobert Watsonor directory, but this is not currently implemented.
97