19754f5b6SRobert Watson.\"- 2a8843addSRobert Watson.\" Copyright (c) 2000-2001 Robert N. M. Watson 39754f5b6SRobert Watson.\" All rights reserved. 49754f5b6SRobert Watson.\" 5a8843addSRobert Watson.\" This software was developed by Robert Watson for the TrustedBSD Project. 6a8843addSRobert Watson.\" 79754f5b6SRobert Watson.\" Redistribution and use in source and binary forms, with or without 89754f5b6SRobert Watson.\" modification, are permitted provided that the following conditions 99754f5b6SRobert Watson.\" are met: 109754f5b6SRobert Watson.\" 1. Redistributions of source code must retain the above copyright 119754f5b6SRobert Watson.\" notice, this list of conditions and the following disclaimer. 129754f5b6SRobert Watson.\" 2. Redistributions in binary form must reproduce the above copyright 139754f5b6SRobert Watson.\" notice, this list of conditions and the following disclaimer in the 149754f5b6SRobert Watson.\" documentation and/or other materials provided with the distribution. 159754f5b6SRobert Watson.\" 169754f5b6SRobert Watson.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 179754f5b6SRobert Watson.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 189754f5b6SRobert Watson.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 199754f5b6SRobert Watson.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 209754f5b6SRobert Watson.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 219754f5b6SRobert Watson.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 229754f5b6SRobert Watson.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 239754f5b6SRobert Watson.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 249754f5b6SRobert Watson.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 259754f5b6SRobert Watson.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 269754f5b6SRobert Watson.\" SUCH DAMAGE. 279754f5b6SRobert Watson.\" 28a8843addSRobert Watson.\" Developed by the TrustedBSD Project. 29a8843addSRobert Watson.\" Support for file system extended attribute. 30a8843addSRobert Watson.\" 319754f5b6SRobert Watson.Dd March 30, 2000 329754f5b6SRobert Watson.Dt EXTATTRCTL 8 3377f6aff1SSheldon Hearn.Os 349754f5b6SRobert Watson.Sh NAME 359754f5b6SRobert Watson.Nm extattrctl 366afa7793SRobert Watson.Nd manage UFS1 extended attributes 379754f5b6SRobert Watson.Sh SYNOPSIS 38e97407b4SRuslan Ermilov.Nm 399754f5b6SRobert Watson.Cm start 409754f5b6SRobert Watson.Ar path 41e97407b4SRuslan Ermilov.Nm 429754f5b6SRobert Watson.Cm stop 439754f5b6SRobert Watson.Ar path 44e97407b4SRuslan Ermilov.Nm 459754f5b6SRobert Watson.Cm initattr 468f0dcdabSRobert Watson.Op Fl f 47aa1d263eSRobert Watson.Op Fl p Ar path 489754f5b6SRobert Watson.Ar attrsize 499754f5b6SRobert Watson.Ar attrfile 50e97407b4SRuslan Ermilov.Nm 51566726dbSRobert Watson.Cm showattr 52566726dbSRobert Watson.Ar attrfile 53566726dbSRobert Watson.Nm 549754f5b6SRobert Watson.Cm enable 559754f5b6SRobert Watson.Ar path 56de5660b0SRobert Watson.Ar attrnamespace 579754f5b6SRobert Watson.Ar attrname 589754f5b6SRobert Watson.Ar attrfile 59e97407b4SRuslan Ermilov.Nm 609754f5b6SRobert Watson.Cm disable 619754f5b6SRobert Watson.Ar path 62de5660b0SRobert Watson.Ar attrnamespace 639754f5b6SRobert Watson.Ar attrname 649754f5b6SRobert Watson.Sh DESCRIPTION 65490d5836SPhilippe CharnierThe 669754f5b6SRobert Watson.Nm 67490d5836SPhilippe Charnierutility 686afa7793SRobert Watsonis the management utility for extended attributes over the UFS1 file system. 69490d5836SPhilippe CharnierIt allows the starting and stopping of extended attributes on a file system, 709754f5b6SRobert Watsonas well as initialization of attribute backing files, and enabling and 719754f5b6SRobert Watsondisabling of specific extended attributes on a file system. 729754f5b6SRobert Watson.Pp 739754f5b6SRobert WatsonThe first argument on the command line indicates the operation to be 745f435a08SSheldon Hearnperformed. 755f435a08SSheldon HearnOperation must be one of the following: 769754f5b6SRobert Watson.Bl -tag -width indent 779754f5b6SRobert Watson.It Cm start Ar path 789754f5b6SRobert WatsonStart extended attribute support on the file system named using 799754f5b6SRobert Watson.Ar path . 806afa7793SRobert WatsonThe file system must be an UFS1 file system, and the UFS_EXTATTR kernel 819754f5b6SRobert Watsonoption must have been enabled. 829754f5b6SRobert Watson.It Cm stop Ar path 839754f5b6SRobert WatsonStop extended attribute support on the file system named using 849754f5b6SRobert Watson.Ar path . 859754f5b6SRobert WatsonExtended attribute support must previously have been started. 866c50ada1SRobert Watson.It Xo 876c50ada1SRobert Watson.Cm initattr 888f0dcdabSRobert Watson.Op Fl f 896c50ada1SRobert Watson.Op Fl p Ar path 906c50ada1SRobert Watson.Ar attrsize attrfile 916c50ada1SRobert Watson.Xc 929754f5b6SRobert WatsonCreate and initialize a file to use as an attribute backing file. 939754f5b6SRobert WatsonYou must specify a maximum per-inode size for the attribute in bytes in 949754f5b6SRobert Watson.Ar attrsize , 959754f5b6SRobert Watsonas well as the file where the attribute will be stored, using 969754f5b6SRobert Watson.Ar attrfile . 976c50ada1SRobert Watson.Pp 986c50ada1SRobert WatsonThe 998f0dcdabSRobert Watson.Fl f 1001fec210aSRobert Watsonargument may be used to indicate that it is alright to overwrite an 1011fec210aSRobert Watsonexisting attribute backing file; otherwise, if the target file exists, 1021fec210aSRobert Watsonan error will be returned. 1031fec210aSRobert Watson.Pp 1041fec210aSRobert WatsonThe 1056c50ada1SRobert Watson.Fl p Ar path 1066c50ada1SRobert Watsonargument may be used to preallocate space for all attributes rather than 1076c50ada1SRobert Watsonrelying on sparse files to conserve space. 1086c50ada1SRobert WatsonThis has the advantage of guaranteeing that space will be available 1096c50ada1SRobert Watsonfor attributes when they are written, preventing low disk space conditions 1106c50ada1SRobert Watsonfrom denying attribute service. 1116c50ada1SRobert Watson.Pp 1129754f5b6SRobert WatsonThis file should not exist before running 1139754f5b6SRobert Watson.Cm initattr . 114566726dbSRobert Watson.It Cm showattr Ar attrfile 115566726dbSRobert WatsonShow the attribute header values in the attribute file named by 116566726dbSRobert Watson.Ar attrfile . 117de5660b0SRobert Watson.It Cm enable Ar path attrnamespace attrname attrfile 1189754f5b6SRobert WatsonEnable an attribute named 1199754f5b6SRobert Watson.Ar attrname 120bf6afea7SRobert Watsonin the namespace 121de5660b0SRobert Watson.Ar attrnamespace 1229754f5b6SRobert Watsonon the file system identified using 1239754f5b6SRobert Watson.Ar path , 1249754f5b6SRobert Watsonand backed by initialized attribute file 1259754f5b6SRobert Watson.Ar attrfile . 126bf6afea7SRobert WatsonAvailable namespaces are "user" and "system". 1279754f5b6SRobert WatsonThe backing file must have been initialized using 1289754f5b6SRobert Watson.Cm initattr 1299754f5b6SRobert Watsonbefore its first use. 1309754f5b6SRobert WatsonAttributes must have been started on the file system prior to the 1319754f5b6SRobert Watsonenabling of any attributes. 132de5660b0SRobert Watson.It Cm disable Ar path attrnamespace attrname 1339754f5b6SRobert WatsonDisable the attributed named 1349754f5b6SRobert Watson.Ar attrname 135bf6afea7SRobert Watsonin namespace 136de5660b0SRobert Watson.Ar attrnamespace 1379754f5b6SRobert Watsonon the file system identified by 1389754f5b6SRobert Watson.Ar path . 139bf6afea7SRobert WatsonAvailable namespaces are "user" and "system". 1409754f5b6SRobert WatsonThe file system must have attributes started on it, and the attribute 1419754f5b6SRobert Watsonmost have been enabled using 1429754f5b6SRobert Watson.Cm enable . 1438b5c4af3SRuslan Ermilov.El 1449754f5b6SRobert Watson.Sh EXAMPLES 1459754f5b6SRobert Watson.Dl extattrctl start / 1469754f5b6SRobert Watson.Pp 1479754f5b6SRobert WatsonStart extended attributes on the root file system. 1489754f5b6SRobert Watson.Pp 1496f1695d8SRobert Watson.Dl extattrctl initattr 17 /.attribute/system/md5 1509754f5b6SRobert Watson.Pp 1516f1695d8SRobert WatsonCreate an attribute backing file in /.attribute/system/md5, and set the maximum 152bbf06077SRobert Watsonsize of each attribute to 17 bytes, with a sparse file used for storing 153bbf06077SRobert Watsonthe attributes. 1549754f5b6SRobert Watson.Pp 1556f1695d8SRobert Watson.Dl extattrctl enable / system md5 /.attribute/system/md5 1569754f5b6SRobert Watson.Pp 1579754f5b6SRobert WatsonEnable an attribute named md5 on the root file system, backed from the file 1586f1695d8SRobert Watson/.attribute/system/md5. 1599754f5b6SRobert Watson.Pp 1609754f5b6SRobert Watson.Dl extattrctl disable / md5 1619754f5b6SRobert Watson.Pp 1629754f5b6SRobert WatsonDisable the attribute named md5 on the root file system. 1639754f5b6SRobert Watson.Pp 1649754f5b6SRobert Watson.Dl extattrctl stop / 1659754f5b6SRobert Watson.Pp 1669754f5b6SRobert WatsonStop extended attributes on the root file system. 1679754f5b6SRobert Watson.Sh SEE ALSO 168*1a720cbeSAlexander Ziaee.Xr ffs 4 , 1699754f5b6SRobert Watson.Xr getextattr 8 , 1709754f5b6SRobert Watson.Xr setextattr 8 , 1719754f5b6SRobert Watson.Xr extattr 9 1729754f5b6SRobert Watson.Sh HISTORY 1739754f5b6SRobert WatsonExtended attribute support was developed as part of the TrustedBSD Project, 174eb569950SChris Costelloand introduced in 175eb569950SChris Costello.Fx 5.0 . 1769754f5b6SRobert WatsonIt was developed to support security extensions requiring additional labels 1779754f5b6SRobert Watsonto be associated with each file or directory. 1789754f5b6SRobert Watson.Sh AUTHORS 1796d6d6c36SGordon Bergling.An Robert N M Watson 180