Merge commit '008b34be09d7b9c3e7a18d3ce9ef8b5c4f4ff8b8'
[unleashed.git] / share / man / man1 / ppriv.1
blob4d463e57881c845e9069fdef8794dd8fd8de2a00
1 '\" te
2 .\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH PPRIV 1 "Feb 24, 2008"
7 .SH NAME
8 ppriv \- inspect or modify process privilege sets and attributes
9 .SH SYNOPSIS
10 .LP
11 .nf
12 \fB/usr/bin/ppriv\fR \fB-e\fR [\fB-D\fR | \fB-N\fR] [\fB-M\fR] [\fB-s\fR \fIspec\fR] \fIcommand\fR [\fIarg\fR]...
13 .fi
15 .LP
16 .nf
17 \fB/usr/bin/ppriv\fR [\fB-v\fR] [\fB-S\fR] [\fB-D\fR | \fB-N\fR] [\fB-s\fR \fIspec\fR]
18      [\fIpid\fR | \fIcore\fR]...
19 .fi
21 .LP
22 .nf
23 \fB/usr/bin/ppriv\fR \fB-l\fR [\fB-v\fR] [\fIprivilege-specification\fR]...
24 .fi
26 .SH DESCRIPTION
27 .sp
28 .LP
29 The first invocation of the \fBppriv\fR command runs the \fIcommand\fR
30 specified with the privilege sets and flags modified according to the arguments
31 on the command line.
32 .sp
33 .LP
34 The second invocation examines or changes the privilege state of running
35 process and core files.
36 .sp
37 .LP
38 The third invocation lists the privileges defined and information about
39 specified privileges or privileges set specifications.
40 .SH OPTIONS
41 .sp
42 .LP
43 The following options are supported:
44 .sp
45 .ne 2
46 .na
47 \fB\fB-D\fR\fR
48 .ad
49 .RS 11n
50 Turns on privilege debugging for the processes or command supplied.
51 .RE
53 .sp
54 .ne 2
55 .na
56 \fB\fB-e\fR\fR
57 .ad
58 .RS 11n
59 Interprets the remainder of the arguments as a command line and runs the
60 command line with specified privilege attributes and sets.
61 .RE
63 .sp
64 .ne 2
65 .na
66 \fB\fB-l\fR\fR
67 .ad
68 .RS 11n
69 Lists all currently defined privileges on stdout.
70 .RE
72 .sp
73 .ne 2
74 .na
75 \fB\fB-N\fR\fR
76 .ad
77 .RS 11n
78 Turns off privilege debugging for the processes or command supplied.
79 .RE
81 .sp
82 .ne 2
83 .na
84 \fB\fB-s\fR \fIspec\fR\fR
85 .ad
86 .RS 11n
87 Modifies a process's privilege sets according to \fIspec\fR, a specification
88 with the format \fB[AEILP][+-=]\fR\fIprivsetspec\fR, containing no spaces,
89 where:
90 .sp
91 .ne 2
92 .na
93 \fB\fBAEILP\fR\fR
94 .ad
95 .RS 15n
96 Indicates one or more letters indicating which privilege sets to change. These
97 are case insensitive, for example, either \fBa\fR or \fBA\fR indicates all
98 privilege sets.
99 .RE
102 .ne 2
104 \fB\fB+-=\fR\fR
106 .RS 15n
107 Indicates a modifier to respectively add (\fB+\fR), remove (\fB-\fR), or assign
108 (\fB=\fR) the listed privileges to the specified set(s) in \fIprivsetspec\fR.
112 .ne 2
114 \fB\fIprivsetspec\fR\fR
116 .RS 15n
117 Indicates a comma-separated privilege set specification
118 (\fBpriv1\fR,\fBpriv2\fR, and so on), as described in
119 \fBpriv_str_to_set\fR(3C).
122 Modifying the same set with multiple \fB-s\fR options is possible as long as
123 there is either precisely one assignment to an individual set or any number of
124 additions and removals. That is, assignment and addition or removal for one set
125 are mutually exclusive.
129 .ne 2
131 \fB\fB-S\fR\fR
133 .RS 11n
134 Short. Reports the shortest possible output strings for sets. The default is
135 portable output. See \fBpriv_str_to_set\fR(3C).
139 .ne 2
141 \fB\fB-v\fR\fR
143 .RS 11n
144 Verbose. Reports privilege sets using privilege names.
147 .SH USAGE
150 The \fBppriv\fR utility examines processes and core files and prints or changes
151 their privilege sets.
154 \fBppriv\fR can run commands with privilege debugging on or off or with fewer
155 privileges than the invoking process.
158 When executing a sub process, the only sets that can be modified are \fBL\fR
159 and \fBI\fR. Privileges can only be removed from \fBL\fR and \fBI\fR as
160 \fBppriv\fR starts with \fBP=E=I\fR.
163 \fBppriv\fR can also be used to remove privileges from processes or to convey
164 privileges to other processes. In order to control a process, the effective set
165 of the \fBppriv\fR utility must be a super set of the controlled process's
166 \fBE\fR, \fBI\fR, and \fBP\fR. The utility's limit set must be a super set of
167 the target's limit set. If the target's process uids do not match, the
168 \fB{PRIV_PROC_OWNER}\fR privilege must be asserted in the utility's effective
169 set. If the controlled processes have any uid with the value \fB0\fR, more
170 restrictions might exist. See \fBprivileges\fR(5).
171 .SH EXAMPLES
173 \fBExample 1 \fRObtaining the Process Privileges of the Current Shell
176 The following example obtains the process privileges of the current shell:
179 .in +2
181 example$ \fBppriv $$\fR
182 387:   -sh
183 flags = <none>
184          E: basic
185          I: basic
186          P: basic
187          L: all
189 .in -2
193 \fBExample 2 \fRRemoving a Privilege From Your Shell's Inheritable and
194 Effective Set
197 The following example removes a privilege from your shell's inheritable and
198 effective set.
201 .in +2
203 example$ \fBppriv -s EI-proc_session $$\fR
205 .in -2
210 The subprocess can still inspect the parent shell but it can no longer
211 influence the parent because the parent has more privileges in its Permitted
212 set than the \fBppriv\fR child process:
215 .in +2
217 example$ \fBtruss -p $$\fR
218 truss: permission denied: 387
220 example$ \fBppriv $$\fR
221 387:   -sh
222 flags = <none>
223          E: basic,!proc_session
224          I: basic,!proc_session
225          P: basic
226          L: all
228 .in -2
232 \fBExample 3 \fRRunning a Process with Privilege Debugging
235 The following example runs a process with privilege debugging:
238 .in +2
240 example$ \fBppriv -e -D cat /etc/shadow\fR
241 cat[418]: missing privilege "file_dac_read" (euid = 21782),
242                     needed at ufs_access+0x3c
243 cat: cannot open /etc/shadow
245 .in -2
250 The privilege debugging error messages are sent to the controlling terminal of
251 the current process. The \fBneeded at\fR address specification is an artifact
252 of the kernel implementation and it can be changed at any time after a software
253 update.
257 The system call number can be mapped to a system call using
258 \fB/etc/name_to_sysnum\fR.
261 \fBExample 4 \fRListing the Privileges Available in the Current Zone
264 The following example lists the privileges available in the current zone (see
265 \fBzones\fR(5)). When run in the global zone, all defined privileges are
266 listed.
269 .in +2
271 example$ \fBppriv -l zone\fR
272  ... listing of all privileges elided ...
274 .in -2
278 \fBExample 5 \fRExamining a Privilege Aware Process
281 The following example examines a privilege aware process:
284 .in +2
286 example$ \fBppriv -S `pgrep rpcbind`\fR
289 928:    /usr/sbin/rpcbind
290 flags = PRIV_AWARE
291         E: net_privaddr,proc_fork,sys_nfs
292         I: none
293         P: net_privaddr,proc_fork,sys_nfs
294         L: none
296 .in -2
301 See \fBsetpflags\fR(2) for explanations of the flags.
303 .SH EXIT STATUS
306 The following exit values are returned:
308 .ne 2
310 \fB\fB0\fR\fR
312 .RS 12n
313 Successful operation.
317 .ne 2
319 \fBnon-zero\fR
321 .RS 12n
322 An error has occurred.
325 .SH FILES
327 .ne 2
329 \fB\fB/proc/*\fR\fR
331 .RS 23n
332 Process files
336 .ne 2
338 \fB\fB/etc/name_to_sysnum\fR\fR
340 .RS 23n
341 system call name to number mapping
344 .SH ATTRIBUTES
347 See \fBattributes\fR(5) for descriptions of the following attributes:
352 box;
353 c | c
354 l | l .
355 ATTRIBUTE TYPE  ATTRIBUTE VALUE
357 Interface Stability     See below.
362 The invocation is Committed. The output is Uncommitted.
363 .SH SEE ALSO
366 \fBgcore\fR(1), \fBtruss\fR(1), \fBsetpflags\fR(2), \fBpriv_str_to_set\fR(3C),
367 \fBproc\fR(4), \fBattributes\fR(5), \fBprivileges\fR(5), \fBzones\fR(5)