xref: /freebsd/usr.sbin/setfmac/setfsmac.8 (revision 7660b554bc59a07be0431c17e0e33815818baa69)
1.\" Copyright (c) 2003 Networks Associates Technology, Inc.
2.\" All rights reserved.
3.\"
4.\" This software was developed for the FreeBSD Project by Chris Costello
5.\" at Safeport Network Services and Network Associates Labs, the
6.\" Security Research Division of Network Associates, Inc. under
7.\" DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the
8.\" DARPA CHATS research program.
9.\"
10.\" Redistribution and use in source and binary forms, with or without
11.\" modification, are permitted provided that the following conditions
12.\" are met:
13.\" 1. Redistributions of source code must retain the above copyright
14.\"    notice, this list of conditions and the following disclaimer.
15.\" 2. Redistributions in binary form must reproduce the above copyright
16.\"    notice, this list of conditions and the following disclaimer in the
17.\"    documentation and/or other materials provided with the distribution.
18.\"
19.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
20.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
23.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29.\" SUCH DAMAGE.
30.\"
31.\" $FreeBSD$
32.\"
33.Dd March 13, 2003
34.Os
35.Dt SETFSMAC 8
36.Sh NAME
37.Nm setfsmac
38.Nd set MAC label for a file hierarchy
39.Sh SYNOPSIS
40.Nm
41.Op Fl ehvx
42.Oo Fl f Ar specfile Oc ...
43.Oo Fl s Ar specfile Oc ...
44.Ar
45.Sh DESCRIPTION
46The
47.Nm
48utility accepts a list of specification files as input and sets the MAC
49labels on the specified file system hierarchies.
50Path names specified will be visited in order as given on the command
51line, and each tree will be traversed in pre-order.
52(Generally, it will not be very useful to use relative paths instead of
53absolute paths.)
54Multiple entries matching a single file will be combined and applied in
55a single transaction.
56.Pp
57The following options are available:
58.Bl -tag -width indent
59.It Fl e
60Treat any file systems encountered which do not support MAC labelling as
61errors, instead of warning and skipping them.
62.It Fl f Ar specfile
63Apply the specifications in
64.Ar specfile
65to the specified paths.
66.\" XXX
67.Bf -emphasis
68NOTE: Only the first entry for each file is applied;
69all others are disregarded and silently dropped.
70.Ef
71Multiple
72.Fl f
73arguments may be specified to include multiple
74specification files.
75.It Fl h
76When a symbolic link is encountered, change the label of the link rather
77than the file the link points to.
78.It Fl s Ar specfile
79Apply the specifications in
80.Ar specfile ,
81but assume the specification format is compatible with the SELinux
82.Ar specfile
83format.
84.\" XXX
85.Bf -emphasis
86NOTE: Only the first entry for each file is applied;
87all others are disregarded and silently dropped.
88.Ef
89The prefix
90.Dq Li sebsd/
91will be automatically prepended to the labels in
92.Ar specfile .
93Labels matching
94.Dq Li <<none>>
95will be explicitly not relabeled.
96This permits SEBSD to reuse existing SELinux policy specification files.
97.It Fl v
98Increase the degree of verbosity.
99.It Fl x
100Do not recurse into new file systems when traversing them.
101.El
102.Sh FILES
103.Bl -tag -width ".Pa /usr/share/security/lomac-policy.contexts" -compact
104.It Pa /usr/share/security/lomac-policy.contexts
105Sample specfile containing LOMAC policy entries.
106.El
107.Sh EXAMPLES
108See
109.Sx FILES .
110.Sh AUTHORS
111This software was contributed to the
112.Fx
113Project by Network Associates Labs,
114the Security Research Division of Network Associates
115Inc. under DARPA/SPAWAR contract N66001-01-C-8035
116.Pq Dq CBOSS ,
117as part of the DARPA CHATS research program.
118.Sh SEE ALSO
119.Xr mac 3 ,
120.Xr mac_set_file 3 ,
121.Xr mac_set_link 3 ,
122.Xr mac 4 ,
123.Xr re_format 7 ,
124.Xr getfmac 8 ,
125.Xr setfmac 8 ,
126.Xr mac 9
127