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