xref: /freebsd/usr.sbin/extattrctl/extattrctl.8 (revision 77a0943ded95b9e6438f7db70c4a28e4d93946d4)
1.\"-
2.\" Copyright (c) 2000 Robert N. M. Watson
3.\" All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright
9.\"    notice, this list of conditions and the following disclaimer.
10.\" 2. Redistributions in binary form must reproduce the above copyright
11.\"    notice, this list of conditions and the following disclaimer in the
12.\"    documentation and/or other materials provided with the distribution.
13.\"
14.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24.\" SUCH DAMAGE.
25.\"
26.\"       $FreeBSD$
27.\"
28.Dd March 30, 2000
29.Dt EXTATTRCTL 8
30.Os
31.Sh NAME
32.Nm extattrctl
33.Nd manage FFS extended attributes
34.Sh SYNOPSIS
35.Nm
36.Cm start
37.Ar path
38.Nm
39.Cm stop
40.Ar path
41.Nm
42.Cm initattr
43.Op Fl f
44.Op Fl p Ar path
45.Ar attrsize
46.Ar attrfile
47.Nm
48.Cm enable
49.Ar path
50.Ar attrname
51.Ar attrfile
52.Nm
53.Cm disable
54.Ar path
55.Ar attrname
56.Sh DESCRIPTION
57.Nm
58is the management utility for extended attributes over the FFS file system.
59.Nm
60allows the starting and stopping of extended attributes on a file system,
61as well as initialization of attribute backing files, and enabling and
62disabling of specific extended attributes on a file system.
63.Pp
64The first argument on the command line indicates the operation to be
65performed.
66Operation must be one of the following:
67.Bl -tag -width indent
68.It Cm start Ar path
69Start extended attribute support on the file system named using
70.Ar path .
71The file system must be an FFS file system, and the FFS_EXTATTR kernel
72option must have been enabled.
73.It Cm stop Ar path
74Stop extended attribute support on the file system named using
75.Ar path .
76Extended attribute support must previously have been started.
77.It Xo
78.Cm initattr
79.Op Fl f
80.Op Fl p Ar path
81.Ar attrsize attrfile
82.Xc
83Create and initialize a file to use as an attribute backing file.
84You must specify a maximum per-inode size for the attribute in bytes in
85.Ar attrsize ,
86as well as the file where the attribute will be stored, using
87.Ar attrfile .
88.Pp
89The
90.Fl f
91argument may be used to indicate that it is alright to overwrite an
92existing attribute backing file; otherwise, if the target file exists,
93an error will be returned.
94.Pp
95The
96.Fl p Ar path
97argument may be used to preallocate space for all attributes rather than
98relying on sparse files to conserve space.
99This has the advantage of guaranteeing that space will be available
100for attributes when they are written, preventing low disk space conditions
101from denying attribute service.
102.Pp
103This file should not exist before running
104.Cm initattr.
105.It Cm enable Ar path Ar attrname Ar attrfile
106Enable an attribute named
107.Ar attrname
108on the file system identified using
109.Ar path ,
110and backed by initialized attribute file
111.Ar attrfile .
112The backing file must have been initialized using
113.Cm initattr
114before its first use.
115Attributes must have been started on the file system prior to the
116enabling of any attributes.
117.It Cm disable Ar path Ar attrname
118Disable the attributed named
119.Ar attrname
120on the file system identified by
121.Ar path .
122The file system must have attributes started on it, and the attribute
123most have been enabled using
124.Cm enable .
125.Sh EXAMPLES
126.Pp
127.Dl extattrctl start /
128.Pp
129Start extended attributes on the root file system.
130.Pp
131.Dl extattrctl initattr 17 /.attribute/md5
132.Pp
133Create an attribute backing file in /.attribute/md5, and set the maximum
134size of each attribute to 17 bytes, with a sparse file used for storing
135the attributes.
136.Pp
137.Dl extattrctl enable / md5 /.attribute/md5
138.Pp
139Enable an attribute named md5 on the root file system, backed from the file
140/.attribute/md5.
141.Pp
142.Dl extattrctl disable / md5
143.Pp
144Disable the attribute named md5 on the root file system.
145.Pp
146.Dl extattrctl stop /
147.Pp
148Stop extended attributes on the root file system.
149.Sh SEE ALSO
150.Xr getextattr 8 ,
151.Xr setextattr 8 ,
152.Xr extattr 9
153.Sh HISTORY
154Extended attribute support was developed as part of the TrustedBSD Project,
155and introduced in
156.Fx 5.0 .
157It was developed to support security extensions requiring additional labels
158to be associated with each file or directory.
159.Sh AUTHORS
160Robert N M Watson
161