2 .\" Copyright (c) 2004, 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 GETPPRIV 2 "Sep 10, 2004"
8 getppriv, setppriv \- get or set a privilege set
14 \fBint\fR \fBgetppriv\fR(\fBpriv_ptype_t\fR \fIwhich\fR, \fBpriv_set_t *\fR\fIset\fR);
19 \fBint\fR \fBsetppriv\fR(\fBpriv_op_t\fR \fIop\fR, \fBpriv_ptype_t\fR \fIwhich\fR, \fBpriv_set_t *\fR\fIset\fR);
25 The \fBgetppriv()\fR function returns the process privilege set specified by
26 \fIwhich\fR in the set pointed to by \fIset\fR. The memory for \fIset\fR is
27 allocated with \fBpriv_allocset()\fR and freed with \fBpriv_freeset()\fR. Both
28 functions are documented on the \fBpriv_addset\fR(3C) manual page.
31 The \fBsetppriv()\fR function sets or changes the process privilege set. The
32 \fIop\fR argument specifies the operation and can be one of \fBPRIV_OFF\fR,
33 \fBPRIV_ON\fR or \fBPRIV_SET\fR. The \fIwhich\fR argument specifies the name of
34 the privilege set. The \fIset\fR argument specifies the set.
37 If \fIop\fR is \fBPRIV_OFF\fR, the privileges in \fIset\fR are removed from the
38 process privilege set specified by \fIwhich\fR. There are no restrictions on
39 removing privileges from process privileges sets, but the following apply:
44 Privileges removed from \fBPRIV_PERMITTED\fR are silently removed from
51 If privileges are removed from \fBPRIV_LIMIT\fR, they are not removed from the
52 other sets until one of \fBexec\fR(2) functions has successfully completed.
56 If \fIop\fR is \fBPRIV_ON\fR, the privileges in \fIset\fR are added to the
57 process privilege set specified by \fIwhich\fR. The following operations are
63 Privileges in \fBPRIV_PERMITTED\fR can be added to \fBPRIV_EFFECTIVE\fR without
70 Privileges in \fBPRIV_PERMITTED\fR can be added to \fBPRIV_INHERITABLE\fR
77 All operations that attempt to add privileges that are already present are
82 If \fIop\fR is \fBPRIV_SET\fR, the privileges in \fIset\fR replace completely
83 the process privilege set specified by \fIwhich\fR. \fBPRIV_SET\fR is
84 implemented in terms of \fBPRIV_OFF\fR and \fBPRIV_ON\fR. The same restrictions
89 Upon successful completion, 0 is returned. Otherwise, -1 is returned and
90 \fBerrno\fR is set to indicate the error.
94 The \fBgetppriv()\fR and \fBsetppriv()\fR functions will fail if:
101 The value of \fIop\fR or \fIwhich\fR is out of range.
110 The \fIset\fR argument points to an illegal address.
115 The \fBsetppriv()\fR function will fail if:
122 The application attempted to add privileges to \fBPRIV_LIMIT\fR or
123 \fBPRIV_PERMITTED\fR, or the application attempted to add privileges to
124 \fBPRIV_INHERITABLE\fR or \fBPRIV_EFFECTIVE\fR which were not in
125 \fBPRIV_PERMITTED\fR.
131 See \fBattributes\fR(5) for descriptions of the following attributes:
139 ATTRIBUTE TYPE ATTRIBUTE VALUE
141 Interface Stability Evolving
149 \fBpriv_addset\fR(3C), \fBattributes\fR(5), \fBprivileges\fR(5)