1502 Remove conversion cruft from manpages
[unleashed.git] / usr / src / man / man1 / ppriv.1
blobf565d90d38d1f7bb97f9d79956180277af5e7f7c
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-M\fR\fR
76 .ad
77 .RS 11n
78 When a system is configured with Trusted Extensions, this option turns on the
79 \fBNET_MAC_AWARE\fR and \fBNET_MAC_AWARE_INHERIT\fR process attributes.
80 .sp
81 A process with these attributes and the \fBnet_mac_aware\fR privilege can
82 communicate with lower-level remote peers.
83 .RE
85 .sp
86 .ne 2
87 .na
88 \fB\fB-N\fR\fR
89 .ad
90 .RS 11n
91 Turns off privilege debugging for the processes or command supplied.
92 .RE
94 .sp
95 .ne 2
96 .na
97 \fB\fB-s\fR \fIspec\fR\fR
98 .ad
99 .RS 11n
100 Modifies a process's privilege sets according to \fIspec\fR, a specification
101 with the format \fB[AEILP][+-=]\fR\fIprivsetspec\fR, containing no spaces,
102 where:
104 .ne 2
106 \fB\fBAEILP\fR\fR
108 .RS 15n
109 Indicates one or more letters indicating which privilege sets to change. These
110 are case insensitive, for example, either \fBa\fR or \fBA\fR indicates all
111 privilege sets.
115 .ne 2
117 \fB\fB+-=\fR\fR
119 .RS 15n
120 Indicates a modifier to respectively add (\fB+\fR), remove (\fB-\fR), or assign
121 (\fB=\fR) the listed privileges to the specified set(s) in \fIprivsetspec\fR.
125 .ne 2
127 \fB\fIprivsetspec\fR\fR
129 .RS 15n
130 Indicates a comma-separated privilege set specification
131 (\fBpriv1\fR,\fBpriv2\fR, and so on), as described in
132 \fBpriv_str_to_set\fR(3C).
135 Modifying the same set with multiple \fB-s\fR options is possible as long as
136 there is either precisely one assignment to an individual set or any number of
137 additions and removals. That is, assignment and addition or removal for one set
138 are mutually exclusive.
142 .ne 2
144 \fB\fB-S\fR\fR
146 .RS 11n
147 Short. Reports the shortest possible output strings for sets. The default is
148 portable output. See \fBpriv_str_to_set\fR(3C).
152 .ne 2
154 \fB\fB-v\fR\fR
156 .RS 11n
157 Verbose. Reports privilege sets using privilege names.
160 .SH USAGE
163 The \fBppriv\fR utility examines processes and core files and prints or changes
164 their privilege sets.
167 \fBppriv\fR can run commands with privilege debugging on or off or with fewer
168 privileges than the invoking process.
171 When executing a sub process, the only sets that can be modified are \fBL\fR
172 and \fBI\fR. Privileges can only be removed from \fBL\fR and \fBI\fR as
173 \fBppriv\fR starts with \fBP=E=I\fR.
176 \fBppriv\fR can also be used to remove privileges from processes or to convey
177 privileges to other processes. In order to control a process, the effective set
178 of the \fBppriv\fR utility must be a super set of the controlled process's
179 \fBE\fR, \fBI\fR, and \fBP\fR. The utility's limit set must be a super set of
180 the target's limit set. If the target's process uids do not match, the
181 \fB{PRIV_PROC_OWNER}\fR privilege must be asserted in the utility's effective
182 set. If the controlled processes have any uid with the value \fB0\fR, more
183 restrictions might exist. See \fBprivileges\fR(5).
184 .SH EXAMPLES
186 \fBExample 1 \fRObtaining the Process Privileges of the Current Shell
189 The following example obtains the process privileges of the current shell:
192 .in +2
194 example$ \fBppriv $$\fR
195 387:   -sh
196 flags = <none>
197          E: basic
198          I: basic
199          P: basic
200          L: all
202 .in -2
206 \fBExample 2 \fRRemoving a Privilege From Your Shell's Inheritable and
207 Effective Set
210 The following example removes a privilege from your shell's inheritable and
211 effective set.
214 .in +2
216 example$ \fBppriv -s EI-proc_session $$\fR
218 .in -2
223 The subprocess can still inspect the parent shell but it can no longer
224 influence the parent because the parent has more privileges in its Permitted
225 set than the \fBppriv\fR child process:
228 .in +2
230 example$ \fBtruss -p $$\fR
231 truss: permission denied: 387
233 example$ \fBppriv $$\fR
234 387:   -sh
235 flags = <none>
236          E: basic,!proc_session
237          I: basic,!proc_session
238          P: basic
239          L: all
241 .in -2
245 \fBExample 3 \fRRunning a Process with Privilege Debugging
248 The following example runs a process with privilege debugging:
251 .in +2
253 example$ \fBppriv -e -D cat /etc/shadow\fR
254 cat[418]: missing privilege "file_dac_read" (euid = 21782),
255                     needed at ufs_access+0x3c
256 cat: cannot open /etc/shadow
258 .in -2
263 The privilege debugging error messages are sent to the controlling terminal of
264 the current process. The \fBneeded at\fR address specification is an artifact
265 of the kernel implementation and it can be changed at any time after a software
266 update.
270 The system call number can be mapped to a system call using
271 \fB/etc/name_to_sysnum\fR.
274 \fBExample 4 \fRListing the Privileges Available in the Current Zone
277 The following example lists the privileges available in the current zone (see
278 \fBzones\fR(5)). When run in the global zone, all defined privileges are
279 listed.
282 .in +2
284 example$ \fBppriv -l zone\fR
285  ... listing of all privileges elided ...
287 .in -2
291 \fBExample 5 \fRExamining a Privilege Aware Process
294 The following example examines a privilege aware process:
297 .in +2
299 example$ \fBppriv -S `pgrep rpcbind`\fR
302 928:    /usr/sbin/rpcbind
303 flags = PRIV_AWARE
304         E: net_privaddr,proc_fork,sys_nfs
305         I: none
306         P: net_privaddr,proc_fork,sys_nfs
307         L: none
309 .in -2
314 See \fBsetpflags\fR(2) for explanations of the flags.
316 .SH EXIT STATUS
319 The following exit values are returned:
321 .ne 2
323 \fB\fB0\fR\fR
325 .RS 12n
326 Successful operation.
330 .ne 2
332 \fBnon-zero\fR
334 .RS 12n
335 An error has occurred.
338 .SH FILES
340 .ne 2
342 \fB\fB/proc/*\fR\fR
344 .RS 23n
345 Process files
349 .ne 2
351 \fB\fB/etc/name_to_sysnum\fR\fR
353 .RS 23n
354 system call name to number mapping
357 .SH ATTRIBUTES
360 See \fBattributes\fR(5) for descriptions of the following attributes:
365 box;
366 c | c
367 l | l .
368 ATTRIBUTE TYPE  ATTRIBUTE VALUE
370 Interface Stability     See below.
375 The invocation is Committed. The output is Uncommitted.
376 .SH SEE ALSO
379 \fBgcore\fR(1), \fBtruss\fR(1), \fBsetpflags\fR(2), \fBpriv_str_to_set\fR(3C),
380 \fBproc\fR(4), \fBattributes\fR(5), \fBprivileges\fR(5), \fBzones\fR(5)