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