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