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 UCRED 3PERL "Jan 30, 2004"
   7 .SH NAME
   8 Ucred \- Perl interface to User Credentials
   9 .SH SYNOPSIS
  10 .LP
  11 .nf
  12 use Sun::Solaris::Ucred qw(:ALL);
  13 .fi
  14 
  15 .SH DESCRIPTION
  16 .sp
  17 .LP
  18 This module provides wrappers for the Ucred-related system and library calls.
  19 .SS "Constants"
  20 .sp
  21 .LP
  22 None.
  23 .SS "Functions"
  24 .sp
  25 .ne 2
  26 .na
  27 \fB\fBucred_get($pid)\fR\fR
  28 .ad
  29 .sp .6
  30 .RS 4n
  31 This function returns the credential of the process specified by \fB$pid\fR if
  32 the process exists and the calling process is permitted to obtain the
  33 credentials of that process.
  34 .RE
  35 
  36 .sp
  37 .ne 2
  38 .na
  39 \fB\fBgetpeerucred($fd)\fR\fR
  40 .ad
  41 .sp .6
  42 .RS 4n
  43 If \fB$fd\fR is a connected connection-oriented TLI endpoint, a connected
  44 \fBSOCK_STREAM\fR, or a \fBSOCK_SEQPKT\fR socket, \fBgetpeerucred()\fR returns
  45 the user credential of the peer at the time the connection was established, if
  46 availble.
  47 .RE
  48 
  49 .sp
  50 .ne 2
  51 .na
  52 \fB\fBucred_geteuid($ucred)\fR\fR
  53 .ad
  54 .sp .6
  55 .RS 4n
  56 This function returns the effective uid of a user credential, if available.
  57 .RE
  58 
  59 .sp
  60 .ne 2
  61 .na
  62 \fB\fBucred_getruid($ucred)\fR\fR
  63 .ad
  64 .sp .6
  65 .RS 4n
  66 This function returns the real uid of a user credential, if available.
  67 .RE
  68 
  69 .sp
  70 .ne 2
  71 .na
  72 \fB\fBucred_getsuid($ucred)\fR\fR
  73 .ad
  74 .sp .6
  75 .RS 4n
  76 This function returns the saved uid of a user credential, if available.
  77 .RE
  78 
  79 .sp
  80 .ne 2
  81 .na
  82 \fB\fBucred_getegid($ucred)\fR\fR
  83 .ad
  84 .sp .6
  85 .RS 4n
  86 This function returns the effective group of a user credential, if available.
  87 .RE
  88 
  89 .sp
  90 .ne 2
  91 .na
  92 \fB\fBucred_getrgid($ucred)\fR\fR
  93 .ad
  94 .sp .6
  95 .RS 4n
  96 This function returns the real group of a user credential, if available.
  97 .RE
  98 
  99 .sp
 100 .ne 2
 101 .na
 102 \fB\fBucred_getsgid($ucred)\fR\fR
 103 .ad
 104 .sp .6
 105 .RS 4n
 106 This function returns the saved group of a user credential, if available.
 107 .RE
 108 
 109 .sp
 110 .ne 2
 111 .na
 112 \fB\fBucred_getgroups($ucred)\fR\fR
 113 .ad
 114 .sp .6
 115 .RS 4n
 116 This function returns the list of supplemental groups of a user credential, if
 117 available.An array of groups is returned in \fBARRAY\fR context; the number of
 118 groups is returned in \fBSCALAR\fR context.
 119 .RE
 120 
 121 .sp
 122 .ne 2
 123 .na
 124 \fB\fBucred_getprivset($ucred, $which)\fR\fR
 125 .ad
 126 .sp .6
 127 .RS 4n
 128 This function returns the privilege set specified by \fB$which\fR of a user
 129 credential, if available.
 130 .RE
 131 
 132 .sp
 133 .ne 2
 134 .na
 135 \fB\fBucred_getpflags($ucred, $flags)\fR\fR
 136 .ad
 137 .sp .6
 138 .RS 4n
 139 This function returns the value of a specific process flag of a user
 140 credential, if available.
 141 .RE
 142 
 143 .sp
 144 .ne 2
 145 .na
 146 \fB\fBucred_getpid($ucred)\fR\fR
 147 .ad
 148 .sp .6
 149 .RS 4n
 150 This function returns the process ID of a user credential, if available.
 151 .RE
 152 
 153 .sp
 154 .ne 2
 155 .na
 156 \fB\fBucred_getprojid($ucred)\fR\fR
 157 .ad
 158 .sp .6
 159 .RS 4n
 160 This function returns the project ID of a user credential, if available.
 161 .RE
 162 
 163 .sp
 164 .ne 2
 165 .na
 166 \fB\fBucred_getzoneid($ucred)\fR\fR
 167 .ad
 168 .sp .6
 169 .RS 4n
 170 This function returns the zone ID of a user credential, if available.
 171 .RE
 172 
 173 .SS "Class methods"
 174 .sp
 175 .LP
 176 None.
 177 .SS "Object methods"
 178 .sp
 179 .LP
 180 None.
 181 .SS "Exports"
 182 .sp
 183 .LP
 184 By default nothing is exported from this module. The following tags can be used
 185 to selectively import constants and functions defined in this module:
 186 .sp
 187 .ne 2
 188 .na
 189 \fB\fB:SYSCALLS\fR\fR
 190 .ad
 191 .RS 13n
 192 \fBucred_get()\fR, \fBgetpeerucred()\fR
 193 .RE
 194 
 195 .sp
 196 .ne 2
 197 .na
 198 \fB\fB:LIBCALLS\fR\fR
 199 .ad
 200 .RS 13n
 201 \fBucred_geteuid()\fR, \fBucred_getruid()\fR, \fBucred_getsuid()\fR,
 202 \fBucred_getegid()\fR, \fBucred_getrgid()\fR, \fBucred_getsgid()\fR,
 203 \fBucred_getgroups()\fR, \fBucred_getprivset()\fR, \fBucred_getpflags()\fR,
 204 \fBucred_getpid()\fR, \fBucred_getzone()\fR
 205 .RE
 206 
 207 .sp
 208 .ne 2
 209 .na
 210 \fB\fB:ALL\fR\fR
 211 .ad
 212 .RS 13n
 213 \fB:SYSCALLS()\fR, \fB:LIBCALLS()\fR
 214 .RE
 215 
 216 .SH ATTRIBUTES
 217 .sp
 218 .LP
 219 See \fBattributes\fR(5) for descriptions of the following attributes:
 220 .sp
 221 
 222 .sp
 223 .TS
 224 box;
 225 c | c
 226 l | l .
 227 ATTRIBUTE TYPE  ATTRIBUTE VALUE
 228 _
 229 Interface Stability     Evolving
 230 .TE
 231 
 232 .SH SEE ALSO
 233 .sp
 234 .LP
 235 \fBgetpeerucred\fR(3C), \fBucred_get\fR(3C), \fBattributes\fR(5)