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 manipulate 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 manipulate the named extended attributes on files and 68directories. 69The 70.Ar attrnamespace 71argument should be the namespace of the attribute to retrieve: legal 72values are 73.Cm user 74and 75.Cm system . 76The 77.Ar attrname 78argument should be the name of the attribute, 79.Ar filename 80the name of the target file or directory, 81.Ar attrvalue 82a string to store in the attribute. 83.Pp 84The following options are available: 85.Bl -tag -width indent 86.It Fl f 87(Force.) 88Ignore errors on individual filenames and continue with 89the remaining arguments. 90.It Fl h 91(No follow.) 92If the file is a symbolic link, perform the operation on the 93link itself rather than the file that the link points to. 94.It Fl n 95.Dv ( NUL Ns 96-terminate.) 97.Dv NUL Ns 98-terminate the extent content written out. 99.It Fl q 100(Quiet.) 101Do not print out the pathname and suppress error messages. 102.It Fl s 103(Stringify.) 104Escape nonprinting characters and put quotes around the output. 105.It Fl x 106(Hex.) 107Print the output in hexadecimal. 108.El 109.Sh EXAMPLES 110.Bd -literal 111setextattr system md5 `md5 -q /boot/kernel/kernel` /boot/kernel/kernel 112getextattr system md5 /boot/kernel/kernel 113lsextattr system /boot/kernel/kernel 114rmextattr system md5 /boot/kernel/kernel 115.Ed 116.Sh SEE ALSO 117.Xr extattr 2 , 118.Xr extattr 3 , 119.Xr extattrctl 8 , 120.Xr extattr 9 121.Sh HISTORY 122Extended attribute support was developed as part of the 123.Tn TrustedBSD 124Project, 125and introduced in 126.Fx 5.0 . 127It was developed to support security extensions requiring additional labels 128to be associated with each file or directory. 129.Sh AUTHORS 130.An Robert N M Watson 131.An Poul-Henning Kamp 132.Sh BUGS 133The 134.Nm setextattr 135utility can only be used to set attributes to strings. 136