2002-08-30 08:53:03 +00:00
|
|
|
.\"-
|
|
|
|
.\" 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$
|
|
|
|
.\"
|
2016-05-04 20:20:55 +00:00
|
|
|
.Dd April 27, 2016
|
2002-08-30 08:53:03 +00:00
|
|
|
.Dt RMEXTATTR 8
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm getextattr ,
|
|
|
|
.Nm lsextattr ,
|
|
|
|
.Nm rmextattr ,
|
|
|
|
.Nm setextattr
|
2003-02-24 22:53:26 +00:00
|
|
|
.Nd manipulate extended attributes
|
2002-08-30 08:53:03 +00:00
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Nm getextattr
|
2002-10-10 16:47:21 +00:00
|
|
|
.Op Fl fhqsx
|
2002-08-30 08:53:03 +00:00
|
|
|
.Ar attrnamespace
|
|
|
|
.Ar attrname
|
|
|
|
.Ar filename ...
|
|
|
|
.Nm lsextattr
|
2002-10-10 16:47:21 +00:00
|
|
|
.Op Fl fhq
|
2002-08-30 08:53:03 +00:00
|
|
|
.Ar attrnamespace
|
|
|
|
.Ar filename ...
|
|
|
|
.Nm rmextattr
|
2002-10-10 16:47:21 +00:00
|
|
|
.Op Fl fhq
|
2002-08-30 08:53:03 +00:00
|
|
|
.Ar attrnamespace
|
|
|
|
.Ar attrname
|
|
|
|
.Ar filename ...
|
|
|
|
.Nm setextattr
|
2002-10-10 17:19:43 +00:00
|
|
|
.Op Fl fhnq
|
2002-08-30 08:53:03 +00:00
|
|
|
.Ar attrnamespace
|
|
|
|
.Ar attrname
|
|
|
|
.Ar attrvalue
|
|
|
|
.Ar filename ...
|
2016-05-04 20:20:55 +00:00
|
|
|
.Nm setextattr
|
|
|
|
.Fl i
|
|
|
|
.Op Fl fhnq
|
|
|
|
.Ar attrnamespace
|
|
|
|
.Ar attrname
|
|
|
|
.Ar filename ...
|
2002-08-30 08:53:03 +00:00
|
|
|
.Sh DESCRIPTION
|
|
|
|
These
|
|
|
|
utilities
|
2003-02-24 22:53:26 +00:00
|
|
|
are user tools to manipulate the named extended attributes on files and
|
2002-08-30 08:53:03 +00:00
|
|
|
directories.
|
|
|
|
The
|
|
|
|
.Ar attrnamespace
|
|
|
|
argument should be the namespace of the attribute to retrieve: legal
|
2003-02-24 22:53:26 +00:00
|
|
|
values are
|
|
|
|
.Cm user
|
|
|
|
and
|
|
|
|
.Cm system .
|
2002-08-30 08:53:03 +00:00
|
|
|
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:
|
2003-02-24 22:53:26 +00:00
|
|
|
.Bl -tag -width indent
|
2002-10-10 17:19:43 +00:00
|
|
|
.It Fl f
|
2003-02-24 22:53:26 +00:00
|
|
|
(Force.)
|
|
|
|
Ignore errors on individual filenames and continue with
|
2002-08-30 08:53:03 +00:00
|
|
|
the remaining arguments.
|
2002-10-10 17:19:43 +00:00
|
|
|
.It Fl h
|
2003-02-24 22:53:26 +00:00
|
|
|
(No follow.)
|
|
|
|
If the file is a symbolic link, perform the operation on the
|
2002-10-10 16:47:21 +00:00
|
|
|
link itself rather than the file that the link points to.
|
2016-05-04 20:20:55 +00:00
|
|
|
.It Fl i
|
|
|
|
(From stdin.)
|
|
|
|
Read attribute data from stdin instead of as an argument.
|
2002-10-10 17:19:43 +00:00
|
|
|
.It Fl n
|
2003-02-24 22:53:26 +00:00
|
|
|
.Dv ( NUL Ns
|
|
|
|
-terminate.)
|
|
|
|
.Dv NUL Ns
|
|
|
|
-terminate the extent content written out.
|
2002-10-10 17:19:43 +00:00
|
|
|
.It Fl q
|
2003-02-24 22:53:26 +00:00
|
|
|
(Quiet.)
|
|
|
|
Do not print out the pathname and suppress error messages.
|
2016-05-26 14:26:49 +00:00
|
|
|
When given twice, print only the attribute value, with no trailing newline.
|
2002-10-10 17:19:43 +00:00
|
|
|
.It Fl s
|
2003-02-24 22:53:26 +00:00
|
|
|
(Stringify.)
|
|
|
|
Escape nonprinting characters and put quotes around the output.
|
2002-10-10 17:19:43 +00:00
|
|
|
.It Fl x
|
2003-02-24 22:53:26 +00:00
|
|
|
(Hex.)
|
|
|
|
Print the output in hexadecimal.
|
2002-08-30 08:53:03 +00:00
|
|
|
.El
|
|
|
|
.Sh EXAMPLES
|
2003-02-24 22:53:26 +00:00
|
|
|
.Bd -literal
|
|
|
|
setextattr system md5 `md5 -q /boot/kernel/kernel` /boot/kernel/kernel
|
2016-05-04 20:20:55 +00:00
|
|
|
md5 -q /boot/kernel/kernel | setextattr -i system md5 /boot/kernel/kernel
|
2003-02-24 22:53:26 +00:00
|
|
|
getextattr system md5 /boot/kernel/kernel
|
2016-05-26 14:26:49 +00:00
|
|
|
getextattr -qq system md5 /boot/kernel/kernel | od -x
|
2003-02-24 22:53:26 +00:00
|
|
|
lsextattr system /boot/kernel/kernel
|
|
|
|
rmextattr system md5 /boot/kernel/kernel
|
|
|
|
.Ed
|
2002-08-30 08:53:03 +00:00
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr extattr 2 ,
|
|
|
|
.Xr extattr 3 ,
|
|
|
|
.Xr extattrctl 8 ,
|
|
|
|
.Xr extattr 9
|
|
|
|
.Sh HISTORY
|
2003-02-24 22:53:26 +00:00
|
|
|
Extended attribute support was developed as part of the
|
|
|
|
.Tn TrustedBSD
|
|
|
|
Project,
|
2002-08-30 08:53:03 +00:00
|
|
|
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
|
2003-02-24 22:53:26 +00:00
|
|
|
.An Robert N M Watson
|
|
|
|
.An Poul-Henning Kamp
|