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 PRIVILEGE 3PERL "Jan 30, 2004"
8 Privilege \- Perl interface to Privileges
12 use Sun::Solaris::Privilege qw(:ALL);
18 This module provides wrappers for the Privilege-related system and library
19 calls. Also provided are constants from the various Privilege-related headers
20 and dynamically-generated constants for all the privileges and privilege sets.
24 \fBPRIV_STR_SHORT\fR, \fBPRIV_STR_LIT\fR, \fBPRIV_STR_PORT\fR, \fBPRIV_ON\fR,
25 \fBPRIV_OFF\fR, \fBPRIV_SET\fR, \fBPRIV_AWARE\fR, and \fBPRIV_DEBUG\fR.
30 \fB\fBgetppriv($which)\fR\fR
34 This function returns the process privilege set specified by
41 \fB\fBsetppriv($op, $which, $set)\fR\fR
45 This function modified the privilege set specified by $which in the as
46 specified by the \fB$op\fR and \fB$set\fR arguments. If \fB$op\fR is
47 \fBPRIV_ON\fR, the privileges in \fB$set\fR are added to the set specified. If
48 \fB$op\fR is \fBPRIV_OFF\fR, the privileges in \fB$set\fR are removed from the
49 set specified. If \fB$op\fR is \fBPRIV_SET\fR, the specified set is made equal
56 \fB\fBgetpflags($flag)\fR\fR
60 This function returns the value associated with process \fB$flag\fR or
61 \fBundef\fR on error. Possible values for \fB$flag\fR are \fBPRIV_AWARE\fR and
68 \fB\fBsetppflags($flag, $val)\fR\fR
72 This function sets the process flag \fB$flag\fR to \fB$val\fR.
78 \fB\fBpriv_fillset()\fR\fR
82 This function returns a new privilege set with all privileges set.
88 \fB\fBpriv_emptyset()\fR\fR
92 This function returns a new empty privilege set.
98 \fB\fBpriv_isemptyset($set)\fR\fR
102 This function returns whether or not \fB$set\fR is empty.
108 \fB\fBpriv_isfullset($set)\fR\fR
112 This function returns whether or not \fB$set\fR is full.
118 \fB\fBpriv_isequalset($a, $b)\fR\fR
122 This function returns whether sets \fB$a\fR and \fB$b\fR are equal.
128 \fB\fBpriv_issubset($a, $b)\fR\fR
132 This function returns whether set \fB$a\fR is a subset of \fB$b\fR.
138 \fB\fBpriv_ismember($set, $priv)\fR\fR
142 This function returns whether \fB$priv\fR is a member of \fB$set\fR.
148 \fB\fBpriv_ineffect($priv)\fR\fR
152 This function returned whether \fB$priv\fR is in the process's effective set.
158 \fB\fBpriv_intersect($a, $b)\fR\fR
162 This function returns a new privilege set which is the intersection of \fB$a\fR
169 \fB\fBpriv_union($a, $b)\fR\fR
173 This function returns a new privilege set which is the union of \fB$a\fR and
180 \fB\fBpriv_inverse($a)\fR\fR
184 This function returns a new privilege set which is the inverse of \fB$a\fR.
190 \fB\fBpriv_addset($set, $priv)\fR\fR
194 This functon adds the privilege \fB$priv\fR to \fB$set\fR.
200 \fB\fBpriv_copyset($a)\fR\fR
204 This function returns a copy of the privilege set \fB$a\fR.
210 \fB\fBpriv_delset($set, $priv)\fR\fR
214 This function remove the privilege \fB$priv\fR from \fB$set\fR.
228 By default nothing is exported from this module. The following tags can be used
229 to selectively import constants and functions defined in this module:
233 \fB\fB:SYSCALLS\fR\fR
236 \fBgetppriv()\fR, \fBsetppriv()\fR
242 \fB\fB:LIBCALLS\fR\fR
245 \fBpriv_addset()\fR, \fBpriv_copyset()\fR, \fBpriv_delset()\fR,
246 \fBpriv_emptyset()\fR, \fBpriv_fillset()\fR, \fBpriv_intersect()\fR,
247 \fBpriv_inverse()\fR, \fBpriv_isemptyset()\fR, \fBpriv_isequalset()\fR,
248 \fBpriv_isfullset()\fR, \fBpriv_ismember()\fR, \fBpriv_issubset()\fR,
249 \fBpriv_gettext()\fR, \fBpriv_union()\fR, \fBpriv_set_to_str()\fR,
250 \fBpriv_str_to_set()\fR
256 \fB\fB:CONSTANTS\fR\fR
259 \fBPRIV_STR_SHORT\fR, \fBPRIV_STR_LIT\fR, \fBPRIV_STR_PORT\fR, \fBPRIV_ON\fR,
260 \fBPRIV_OFF\fR, \fBPRIV_SET\fR, \fBPRIV_AWARE\fR, \fBPRIV_DEBUG\fR, plus
261 constants for all privileges and privilege sets.
267 \fB\fB:VARIABLES\fR\fR
270 \fB%PRIVILEGES\fR, \fB%PRIVSETS\fR
279 \fB:SYSCALLS\fR, \fB:LIBCALLS\fR, \fB:CONSTANTS\fR, \fB:VARIABLES\fR
285 See \fBattributes\fR(5) for descriptions of the following attributes:
293 ATTRIBUTE TYPE ATTRIBUTE VALUE
295 Interface Stability Evolving
301 \fBgetpflags\fR(2), \fBgetppriv\fR(2), \fBpriv_addset\fR(3C),
302 \fBpriv_set\fR(3C), \fBpriv_str_to_set\fR(3C), \fBattributes\fR(5),