xref: /freebsd/usr.sbin/setfmac/setfsmac.8 (revision 729362425c09cf6b362366aabc6fb547eee8035a)
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.Dd March 13, 2003
33.Os
34.Dt SETFSMAC 8
35.Sh NAME
36.Nm setfsmac
37.Nd set MAC label for a file hierarchy
38.Sh SYNOPSIS
39.Nm
40.Op Fl ehvx
41.Op Fl f Ar specfile
42.Op Fl s Ar specfile
43.Ar path ...
44.Sh DESCRIPTION
45The
46.Nm
47utility accepts a list of specification files as input and sets the MAC
48labels on the specified file system hierarchies.
49Path names specified will be visited in order as given in the command
50line, and each tree will be traversed in pre-order.
51(Generally, it will not be very useful to use relative paths instead of
52absolute paths.)
53Multiple entries matching a single file will be combined and applied in
54a single transaction.
55.Pp
56The following options are available:
57.Bl -tag -width indent
58.It Fl e
59Treat any file systems encountered which do not support MAC labelling as
60errors, instead of warning and skipping them.
61.It Fl f Ar specfile
62Apply the specifications in
63.Ar specfile
64to the specified paths.
65.\" XXX
66.Bf -emphasis
67NOTE: Only the first entry for each file is applied;
68all others are disregarded and silently dropped.
69.Ef
70Multiple
71.Fl f
72arguments may be specified to include multiple
73specification files.
74.It Fl h
75When a symbolic link is encountered, change the label of the link rather
76than the file the link points to.
77.It Fl s Ar specfile
78Apply the specifications in
79.Ar specfile ,
80but assume the specification format is compatible with the SELinux
81.Ar specfile
82format.
83.\" XXX
84.Bf -emphasis
85NOTE: Only the first entry for each file is applied;
86all others are disregarded and silently dropped.
87.Ef
88The prefix
89.Dq sebsd/
90will be automatically prepended to the labels in
91.Ar specfile .
92Labels matching
93.Dq <<none>>
94will be explicitly not relabeled.
95This permits SEBSD to reuse existing SELinux policy specification files.
96.It Fl v
97Increase the degree of verbosity.
98.It Fl x
99Do not recurse into new file systems when traversing them.
100.El
101.Sh FILES
102.Bl -tag -width /usr/share/security/lomac-policy.contexts -compact
103.It Pa /usr/share/security/lomac-policy.contexts
104Sample specfile containing LOMAC policy entries.
105.El
106.Sh EXAMPLES
107See
108.Sx FILES .
109.Sh AUTHORS
110This software was contributed to the
111.Fx
112Project by Network Associates Labs,
113the Security Research Division of Network Associates
114Inc. under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"),
115as part of the DARPA CHATS research program.
116.Sh SEE ALSO
117.Xr mac 3 ,
118.Xr mac_set_file 3 ,
119.Xr mac_set_link 3 ,
120.Xr mac 4 ,
121.Xr re_format 7 ,
122.Xr getfmac 8 ,
123.Xr setfmac 8 ,
124.Xr mac 9
125