1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
|
'\" te
.\" Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved
.\" 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.
.\" 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.
.\" 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]
.TH PFEXEC 1 "Jul 8, 2016"
.SH NAME
pfexec, pfsh, pfcsh, pfksh \- execute a command in a profile
.SH SYNOPSIS
.LP
.nf
\fB/usr/bin/pfexec\fR \fIcommand\fR
.fi
.LP
.nf
\fB/usr/bin/pfexec\fR \fB-P\fR \fIprivspec\fR \fIcommand\fR [ \fIarg\fR ]...
.fi
.LP
.nf
\fB/usr/bin/pfsh\fR [ \fIoptions\fR ] [ \fIargument\fR ]...
.fi
.LP
.nf
\fB/usr/bin/pfcsh\fR [ \fIoptions\fR ] [ \fIargument\fR ]...
.fi
.LP
.nf
\fB/usr/bin/pfksh\fR [ \fIoptions\fR ] [ \fIargument\fR ]...
.fi
.SH DESCRIPTION
.LP
The \fBpfexec\fR program is used to execute commands with the attributes
specified by the user's profiles in the \fBexec_attr\fR(4) database. It is
invoked by the profile shells, \fBpfsh\fR, \fBpfcsh\fR, and \fBpfksh\fR which
are linked to the Bourne shell, C shell, and Korn shell, respectively.
.sp
.LP
Profiles are searched in the order specified in the user's entry in the
\fBuser_attr\fR(4) database. If the same command appears in more than one
profile, the profile shell uses the first matching entry.
.sp
.LP
The second form, \fBpfexec\fR \fB-P\fR \fIprivspec\fR, allows a user to obtain
the additional privileges awarded to the user's profiles in \fBprof_attr\fR(4).
The privileges specification on the commands line is parsed using
\fBpriv_str_to_set\fR(3C). The resulting privileges are intersected with the
union of the privileges specified using the "\fBprivs\fR" keyword in
\fBprof_attr\fR(4) for all the user's profiles and added to the inheritable set
before executing the command.
.sp
.LP
For \fBpfexec\fR to function correctly, the \fBpfexecd\fR daemon must be running
in the current zone. This is normally managed by the
"\fBsvc:/system/pfexec:default\fR" SMF service (see \fBsmf\fR(5)).
.SH USAGE
.LP
\fBpfexec\fR is used to execute commands with predefined process attributes,
such as specific user or group \fBID\fRs.
.sp
.LP
Refer to the \fBsh\fR(1), \fBcsh\fR(1), and \fBksh\fR(1) man pages for complete
usage descriptions of the profile shells.
.SH EXAMPLES
.LP
\fBExample 1 \fRObtaining additional user privileges
.sp
.in +2
.nf
example% \fBpfexec -P all chown user file\fR
.fi
.in -2
.sp
.sp
.LP
This command runs \fBchown user file\fR with all privileges assigned to the
current user, not necessarily all privileges.
.SH EXIT STATUS
.LP
The following exit values are returned:
.sp
.ne 2
.na
\fB\fB0\fR \fR
.ad
.RS 6n
Successful completion.
.RE
.sp
.ne 2
.na
\fB\fB1\fR \fR
.ad
.RS 6n
An error occurred.
.RE
.SH SEE ALSO
.LP
\fBcsh\fR(1), \fBksh\fR(1), \fBprofiles\fR(1), \fBsh\fR(1), \fBexec_attr\fR(4),
\fBprof_attr\fR(4), \fBuser_attr\fR(4), \fBattributes\fR(5), \fBsmf\fR(5)
|