1 '\" te 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" 7 .SH NAME 8 Privilege \- Perl interface to Privileges 9 .SH SYNOPSIS 10 .LP 11 .nf 12 use Sun::Solaris::Privilege qw(:ALL); 13 .fi 14 15 .SH DESCRIPTION 16 .sp 17 .LP 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. 21 .SS "Constants" 22 .sp 23 .LP 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. 26 .SS "Functions" 27 .sp 28 .ne 2 29 .na 30 \fB\fBgetppriv($which)\fR\fR 31 .ad 32 .sp .6 33 .RS 4n 34 This function returns the process privilege set specified by 35 \fB\fR\fB$which\fR. 36 .RE 37 38 .sp 39 .ne 2 40 .na 41 \fB\fBsetppriv($op, $which, $set)\fR\fR 42 .ad 43 .sp .6 44 .RS 4n 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 50 to \fB$set\fR. 51 .RE 52 53 .sp 54 .ne 2 55 .na 56 \fB\fBgetpflags($flag)\fR\fR 57 .ad 58 .sp .6 59 .RS 4n 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 62 \fBPRIV_DEBUG\fR. 63 .RE 64 65 .sp 66 .ne 2 67 .na 68 \fB\fBsetppflags($flag, $val)\fR\fR 69 .ad 70 .sp .6 71 .RS 4n 72 This function sets the process flag \fB$flag\fR to \fB$val\fR. 73 .RE 74 75 .sp 76 .ne 2 77 .na 78 \fB\fBpriv_fillset()\fR\fR 79 .ad 80 .sp .6 81 .RS 4n 82 This function returns a new privilege set with all privileges set. 83 .RE 84 85 .sp 86 .ne 2 87 .na 88 \fB\fBpriv_emptyset()\fR\fR 89 .ad 90 .sp .6 91 .RS 4n 92 This function returns a new empty privilege set. 93 .RE 94 95 .sp 96 .ne 2 97 .na 98 \fB\fBpriv_isemptyset($set)\fR\fR 99 .ad 100 .sp .6 101 .RS 4n 102 This function returns whether or not \fB$set\fR is empty. 103 .RE 104 105 .sp 106 .ne 2 107 .na 108 \fB\fBpriv_isfullset($set)\fR\fR 109 .ad 110 .sp .6 111 .RS 4n 112 This function returns whether or not \fB$set\fR is full. 113 .RE 114 115 .sp 116 .ne 2 117 .na 118 \fB\fBpriv_isequalset($a, $b)\fR\fR 119 .ad 120 .sp .6 121 .RS 4n 122 This function returns whether sets \fB$a\fR and \fB$b\fR are equal. 123 .RE 124 125 .sp 126 .ne 2 127 .na 128 \fB\fBpriv_issubset($a, $b)\fR\fR 129 .ad 130 .sp .6 131 .RS 4n 132 This function returns whether set \fB$a\fR is a subset of \fB$b\fR. 133 .RE 134 135 .sp 136 .ne 2 137 .na 138 \fB\fBpriv_ismember($set, $priv)\fR\fR 139 .ad 140 .sp .6 141 .RS 4n 142 This function returns whether \fB$priv\fR is a member of \fB$set\fR. 143 .RE 144 145 .sp 146 .ne 2 147 .na 148 \fB\fBpriv_ineffect($priv)\fR\fR 149 .ad 150 .sp .6 151 .RS 4n 152 This function returned whether \fB$priv\fR is in the process's effective set. 153 .RE 154 155 .sp 156 .ne 2 157 .na 158 \fB\fBpriv_intersect($a, $b)\fR\fR 159 .ad 160 .sp .6 161 .RS 4n 162 This function returns a new privilege set which is the intersection of \fB$a\fR 163 and \fB$b\fR. 164 .RE 165 166 .sp 167 .ne 2 168 .na 169 \fB\fBpriv_union($a, $b)\fR\fR 170 .ad 171 .sp .6 172 .RS 4n 173 This function returns a new privilege set which is the union of \fB$a\fR and 174 \fB$b\fR. 175 .RE 176 177 .sp 178 .ne 2 179 .na 180 \fB\fBpriv_inverse($a)\fR\fR 181 .ad 182 .sp .6 183 .RS 4n 184 This function returns a new privilege set which is the inverse of \fB$a\fR. 185 .RE 186 187 .sp 188 .ne 2 189 .na 190 \fB\fBpriv_addset($set, $priv)\fR\fR 191 .ad 192 .sp .6 193 .RS 4n 194 This functon adds the privilege \fB$priv\fR to \fB$set\fR. 195 .RE 196 197 .sp 198 .ne 2 199 .na 200 \fB\fBpriv_copyset($a)\fR\fR 201 .ad 202 .sp .6 203 .RS 4n 204 This function returns a copy of the privilege set \fB$a\fR. 205 .RE 206 207 .sp 208 .ne 2 209 .na 210 \fB\fBpriv_delset($set, $priv)\fR\fR 211 .ad 212 .sp .6 213 .RS 4n 214 This function remove the privilege \fB$priv\fR from \fB$set\fR. 215 .RE 216 217 .SS "Class methods" 218 .sp 219 .LP 220 None. 221 .SS "Object methods" 222 .sp 223 .LP 224 None. 225 .SS "Exports" 226 .sp 227 .LP 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: 230 .sp 231 .ne 2 232 .na 233 \fB\fB:SYSCALLS\fR\fR 234 .ad 235 .RS 14n 236 \fBgetppriv()\fR, \fBsetppriv()\fR 237 .RE 238 239 .sp 240 .ne 2 241 .na 242 \fB\fB:LIBCALLS\fR\fR 243 .ad 244 .RS 14n 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 251 .RE 252 253 .sp 254 .ne 2 255 .na 256 \fB\fB:CONSTANTS\fR\fR 257 .ad 258 .RS 14n 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. 262 .RE 263 264 .sp 265 .ne 2 266 .na 267 \fB\fB:VARIABLES\fR\fR 268 .ad 269 .RS 14n 270 \fB%PRIVILEGES\fR, \fB%PRIVSETS\fR 271 .RE 272 273 .sp 274 .ne 2 275 .na 276 \fB\fB:ALL\fR\fR 277 .ad 278 .RS 14n 279 \fB:SYSCALLS\fR, \fB:LIBCALLS\fR, \fB:CONSTANTS\fR, \fB:VARIABLES\fR 280 .RE 281 282 .SH ATTRIBUTES 283 .sp 284 .LP 285 See \fBattributes\fR(5) for descriptions of the following attributes: 286 .sp 287 288 .sp 289 .TS 290 box; 291 c | c 292 l | l . 293 ATTRIBUTE TYPE ATTRIBUTE VALUE 294 _ 295 Interface Stability Evolving 296 .TE 297 298 .SH SEE ALSO 299 .sp 300 .LP 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), 303 \fBprivileges\fR(5)