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"
8 ppriv \- inspect or modify process privilege sets and attributes
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]...
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]...
23 \fB/usr/bin/ppriv\fR \fB-l\fR [\fB-v\fR] [\fIprivilege-specification\fR]...
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
34 The second invocation examines or changes the privilege state of running
35 process and core files.
38 The third invocation lists the privileges defined and information about
39 specified privileges or privileges set specifications.
43 The following options are supported:
50 Turns on privilege debugging for the processes or command supplied.
59 Interprets the remainder of the arguments as a command line and runs the
60 command line with specified privilege attributes and sets.
69 Lists all currently defined privileges on stdout.
78 Turns off privilege debugging for the processes or command supplied.
84 \fB\fB-s\fR \fIspec\fR\fR
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,
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
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.
114 \fB\fIprivsetspec\fR\fR
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.
134 Short. Reports the shortest possible output strings for sets. The default is
135 portable output. See \fBpriv_str_to_set\fR(3C).
144 Verbose. Reports privilege sets using privilege names.
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).
173 \fBExample 1 \fRObtaining the Process Privileges of the Current Shell
176 The following example obtains the process privileges of the current shell:
181 example$ \fBppriv $$\fR
193 \fBExample 2 \fRRemoving a Privilege From Your Shell's Inheritable and
197 The following example removes a privilege from your shell's inheritable and
203 example$ \fBppriv -s EI-proc_session $$\fR
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:
217 example$ \fBtruss -p $$\fR
218 truss: permission denied: 387
220 example$ \fBppriv $$\fR
223 E: basic,!proc_session
224 I: basic,!proc_session
232 \fBExample 3 \fRRunning a Process with Privilege Debugging
235 The following example runs a process with privilege debugging:
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
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
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
271 example$ \fBppriv -l zone\fR
272 ... listing of all privileges elided ...
278 \fBExample 5 \fRExamining a Privilege Aware Process
281 The following example examines a privilege aware process:
286 example$ \fBppriv -S `pgrep rpcbind`\fR
289 928: /usr/sbin/rpcbind
291 E: net_privaddr,proc_fork,sys_nfs
293 P: net_privaddr,proc_fork,sys_nfs
301 See \fBsetpflags\fR(2) for explanations of the flags.
306 The following exit values are returned:
313 Successful operation.
322 An error has occurred.
338 \fB\fB/etc/name_to_sysnum\fR\fR
341 system call name to number mapping
347 See \fBattributes\fR(5) for descriptions of the following attributes:
355 ATTRIBUTE TYPE ATTRIBUTE VALUE
357 Interface Stability See below.
362 The invocation is Committed. The output is Uncommitted.
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)