1replcon(1) General Commands Manual replcon(1)
2
3
4
6 replcon - SELinux file context replacement tool
7
9 replcon NEW_CONTEXT DIR [OPTIONS] [EXPRESSION]
10
12 replcon allows the user to find and replace file contexts. Replace‐
13 ments can be filtered by object class as described below.
14
16 NEW_CONTEXT
17 The replacement context as expressed as a partial context,
18 described below.
19
20 DIR Initial directory to begin searching. The tool will recurse
21 into any subdirectories, so be sure there are no circular mounts
22 within it.
23
25 The following options allow the user to specify which files to find. A
26 file must meet all specified criteria for its context to be replaced.
27 If no expression is provided, all files' contexts are replaced.
28
29 -t TYPE, --type=TYPE
30 Search for files with a context containing the type TYPE.
31
32 -u USER, --user=USER
33 Search for files with a context containing the user USER.
34
35 -r ROLE, --role=ROLE
36 Search for files with a context containing the role ROLE.
37
38 -m RANGE, --mls-range=RANGE
39 Search for files with a context with the MLS range of RANGE.
40 Note that replcon ignores the SELinux translation library, if
41 present. In addition, this flag is ignored if DIR has no MLS
42 information.
43
44 --context=CONTEXT
45 Search for files matching this partial context. This flag over‐
46 rides -t, -u, -r, and -m.
47
48 -p PATH, --path=PATH
49 Search for files which include PATH.
50
51 -c CLASS, --class=CLASS
52 Search only files of object class CLASS.
53
55 -v, --verbose
56 Display context info during replacement.
57
58 -h, --help
59 Print help information and exit.
60
61 -V, --version
62 Print version information and exit.
63
65 The --context flag and NEW_CONTEXT argument specify a partial context,
66 which is a a colon separated list of user, role, and type. If the sys‐
67 tem supports MLS, the context may have a fourth field that gives the
68 range. With --context if a field is not specified or is the literal
69 asterisk, then the query will always match the field. With NEW_CONTEXT
70 if a field is not specified or is the literal asterisk, then that por‐
71 tion of the context will not be modified.
72
74 Valid object class strings are
75
76 block, char, dir, fifo, file, link, or sock.
77
79 The replcon utility always operates on "raw" SELinux file contexts. If
80 the system has an installed translation library (i.e., libsetrans),
81 those translations are ignored in favor of reading the original con‐
82 texts from the filesystem.
83
85 replcon ::type_t: .
86 Replace every context's type in the current directory with
87 type_t. The user and role portion remain unchanged.
88
89 replcon -u user_u *:role_r:* .
90 Replace every context's role with user user_u in the current
91 directory with role_r. The user and type portion remain
92 unchanged.
93
94 replcon --context ::type_t:s0 :::s0:c0 /tmp
95 Replace every context with type type_t and MLS range s0 in /tmp
96 with MLS range s0:c0.
97
99 This manual page was written by Jeremy A. Mowery <jmowery@tresys.com>.
100
102 Copyright(C) 2003-2007 Tresys Technology, LLC
103
105 Please report bugs via an email to setools-bugs@tresys.com.
106
108 findcon(1), indexcon(1)
109
110
111
112 replcon(1)