xref: /netbsd/share/man/man9/extattr.9 (revision 6550d01e)
1.\"	$NetBSD: extattr.9,v 1.4 2009/03/09 19:24:32 joerg Exp $
2.\"
3.\" Copyright (c) 1999, 2000, 2001, 2003 Robert N. M. Watson
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\"
15.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25.\" SUCH DAMAGE.
26.\"
27.\" FreeBSD: src/share/man/man9/extattr.9,v 1.14 2003/10/23 02:33:03 hmp Exp
28.\"
29.Dd January 2, 2005
30.Dt EXTATTR 9
31.Os
32.Sh NAME
33.Nm extattr
34.Nd file system extended attributes
35.Sh SYNOPSIS
36.In sys/param.h
37.In sys/vnode.h
38.In sys/extattr.h
39.Sh DESCRIPTION
40Extended attributes allow additional meta-data to be associated
41with vnodes representing files and directories.
42The semantics of this additional data is that of a
43.Dq name=value
44pair, where a name may be defined or undefined, and if defined,
45associated with zero or more bytes of arbitrary binary data.
46Extended attribute names exist within a set of namespaces; each operation
47on an extended attribute is required to provide the namespace to which the
48operation refers.
49If the same name is present in multiple namespaces, the extended attributes
50associated with the names are stored and manipulated independently.
51The following two namespaces are defined universally, although individual
52file systems may implement additional namespaces, or not implement
53these namespaces:
54.Dv EXTATTR_NAMESPACE_USER ,
55.Dv EXTATTR_NAMESPACE_SYSTEM .
56The semantics of these attributes are intended to be as follows: user
57attribute data is protected according the normal discretionary
58and mandatory protections associated with the data in the file or
59directory; system attribute data is protected such that appropriate
60privilege is required to directly access or manipulate these attributes.
61.Pp
62Reads of extended attribute data may return specific contiguous regions of
63the meta-data, in the style of
64.Xr VOP_READ 9 ,
65but writes will replace the entire current
66.Dq value
67associated with a given name.
68As there are a plethora of file systems with differing extended attributes,
69availability and functionality of these functions may be limited, and they
70should be used with awareness of the underlying semantics of the supporting
71file system.
72Authorization schemes for extended attribute data may also vary by file
73system, as well as maximum attribute size, and whether or not any or
74specific new attributes may be defined.
75.Pp
76Extended attributes are named using a nul-terminated character string.
77Depending on underlying file system semantics, this name may or may not be
78case-sensitive.
79Appropriate vnode extended attribute calls are:
80.Xr VOP_GETEXTATTR 9 ,
81.Xr VOP_LISTEXTATTR 9 ,
82and
83.Xr VOP_SETEXTATTR 9 .
84.Sh SEE ALSO
85.Xr vfsops 9 ,
86.Xr vnodeops 9
87