1setfiles(8) setfiles(8)
2
3
4
6 setfiles - set file SELinux security contexts.
7
8
10 setfiles [-c policy ] [-d] [-l] [-n] [-e directory ] [-o filename ]
11 [-q] [-s] [-v] [-vv] [-W] [-F] spec_file pathname...
12
14 This manual page describes the setfiles program.
15
16 This program is primarily used to initialize the security context data‐
17 base (extended attributes) on one or more filesystems. This program is
18 initially run as part of the SE Linux installation process.
19
20 It can also be run at any time to correct errors, to add support for
21 new policy, or with the -n option it can just check whether the file
22 contexts are all as you expect.
23
24
26 -c check the validity of the contexts against the specified binary
27 policy.
28
29 -d show what specification matched each file.
30
31 -l log changes in file labels to syslog.
32
33 -n don't change any file labels.
34
35 -p show progress by printing * every 1000 files.
36
37 -q suppress non-error output.
38
39 -r rootpath
40 use an alternate root path
41
42 -e directory
43 directory to exclude (repeat option for more than one direc‐
44 tory.)
45
46 -F Force reset of context to match file_context for customizable
47 files
48
49 -o filename
50 save list of files with incorrect context in filename.
51
52 -s take a list of files from standard input instead of using a
53 pathname on the command line.
54
55 -v show changes in file labels, if type or role are changing.
56
57 -vv show changes in file labels, if type, role, or user are chang‐
58 ing.
59
60 -W display warnings about entries that had no matching files.
61
62 -0 Input items are terminated by a null character instead of by
63 whitespace, and the quotes and backslash are not special (every
64 character is taken literally). Disables the end of file string,
65 which is treated like any other argument. Useful when input
66 items might contain white space, quote marks, or back‐
67 slashes.The GNU find -print0 option produces input suitable
68 for this mode.
69
70
72 spec_file The specification file which contains lines of the following
73 form
74 regexp [ -type ] ( context | <<none>> )
75 The regular expression is anchored at both ends. The optional type
76 field specifies the file type as shown in the mode field by the ls(1)
77 program, e.g. -- to match only regular files or -d to match only direc‐
78 tories. The context can be an ordinary security context or the string
79 <<none>> to specify that the file is not to have its context changed.
80 The last matching specification is used. If there are multiple hard
81 links to a file that match different specifications and those specifi‐
82 cations indicate different security contexts, then a warning is dis‐
83 played but the file is still labeled based on the last matching speci‐
84 fication other than <<none>>.
85
86 pathname...
87 The pathname for the root directory of each file system to be
88 relabeled. Not used if the -s option is used.
89
90
92 This man page was written by Russell Coker <russell@coker.com.au>. The
93 program was written by Stephen Smalley <sds@epoch.ncsc.mil>
94
95
97 load_policy(8), checkpolicy(8)
98
99
100
101 2002031409 setfiles(8)