xref: /freebsd/usr.sbin/extattr/rmextattr.8 (revision fa46e218c7ddfa8bdf9b848d69a19b7303d0bb78)
1.\"-
2.\" Copyright (c) 2000, 2001 Robert N. M. Watson
3.\" Copyright (c) 2002 Networks Associates Technology, Inc.
4.\" All rights reserved.
5.\"
6.\" This software was developed for the FreeBSD Project by Poul-Henning
7.\" Kamp and Network Associates Laboratories, the Security Research Division
8.\" of Network Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035
9.\" ("CBOSS"), as part of the DARPA CHATS research program
10.\"
11.\" Redistribution and use in source and binary forms, with or without
12.\" modification, are permitted provided that the following conditions
13.\" are met:
14.\" 1. Redistributions of source code must retain the above copyright
15.\"    notice, this list of conditions and the following disclaimer.
16.\" 2. Redistributions in binary form must reproduce the above copyright
17.\"    notice, this list of conditions and the following disclaimer in the
18.\"    documentation and/or other materials provided with the distribution.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" $FreeBSD$
33.\"
34.Dd August 30, 2000
35.Dt RMEXTATTR 8
36.Os
37.Sh NAME
38.Nm getextattr ,
39.Nm lsextattr ,
40.Nm rmextattr ,
41.Nm setextattr
42.Nd manipulated extended attributes
43.Sh SYNOPSIS
44.Nm getextattr
45.Op Fl fhqsx
46.Ar attrnamespace
47.Ar attrname
48.Ar filename ...
49.Nm lsextattr
50.Op Fl fhq
51.Ar attrnamespace
52.Ar filename ...
53.Nm rmextattr
54.Op Fl fhq
55.Ar attrnamespace
56.Ar attrname
57.Ar filename ...
58.Nm setextattr
59.Op Fl fhnq
60.Ar attrnamespace
61.Ar attrname
62.Ar attrvalue
63.Ar filename ...
64.Sh DESCRIPTION
65These
66utilities
67are user tools to manipulated a named extended attributes on files and
68directories.
69The
70.Ar attrnamespace
71argument should be the namespace of the attribute to retrieve: legal
72values are "user" and "system".
73The
74.Ar attrname
75argument should be the name of the attribute,
76.Ar filename
77the name of the target file or directory,
78.Ar attrvalue
79a string to store in the attribute.
80.Pp
81The following options are available:
82.Bl -tag -width flag
83.It Fl f
84(Force) Ignore errors on individual filenames and continue with
85the remaining arguments.
86.It Fl h
87(No follow) If the file is a symbolic link, perform the operation on the
88link itself rather than the file that the link points to.
89.It Fl n
90(Nul-terminate) Nul-terminate the extent content written out.
91.It Fl q
92(Quiet) Do not print out the pathname and suppress error messages.
93.It Fl s
94(Stringify) Escape nonprinting characters and put quotes around the output.
95.It Fl x
96(Hex) Print the output in hexadecimal.
97.El
98.Sh EXAMPLES
99.Dl # setextattr system md5 `md5 -q /boot/kernel/kernel` /boot/kernel/kernel
100.Dl # getextattr system md5 /boot/kernel/kernel
101.Dl # lsextattr system /boot/kernel/kernel
102.Dl # rmextattr system md5 /boot/kernel/kernel
103.Sh SEE ALSO
104.Xr extattr 2 ,
105.Xr extattr 3 ,
106.Xr extattrctl 8 ,
107.Xr extattr 9
108.Sh HISTORY
109Extended attribute support was developed as part of the TrustedBSD Project,
110and introduced in
111.Fx 5.0 .
112It was developed to support security extensions requiring additional labels
113to be associated with each file or directory.
114.Sh AUTHORS
115Robert N M Watson and
116Poul-Henning Kamp
117.Sh BUGS
118The
119.Nm setextattr
120utility can only be used to set attributes to strings.
121