xref: /onnv-gate/usr/src/cmd/perl/contrib/Sun/Solaris/Ucred/pod/Ucred.pod (revision 12388:1bc8d55b0dfd)
10Sstevel@tonic-gate#
2*12388SJohn.Sonnenschein@Sun.COM# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
30Sstevel@tonic-gate#
4*12388SJohn.Sonnenschein@Sun.COM
50Sstevel@tonic-gate#
60Sstevel@tonic-gate# Sun::Solaris::Ucred documentation.
70Sstevel@tonic-gate#
80Sstevel@tonic-gate
90Sstevel@tonic-gate=head1 NAME
100Sstevel@tonic-gate
110Sstevel@tonic-gateSun::Solaris::Ucred - Perl interface to User Credentials
120Sstevel@tonic-gate
130Sstevel@tonic-gate=head1 SYNOPSIS
140Sstevel@tonic-gate
150Sstevel@tonic-gate use Sun::Solaris::Ucred qw(:ALL);
160Sstevel@tonic-gate
170Sstevel@tonic-gateThis module provides wrappers for the Ucred-related system and
180Sstevel@tonic-gatelibrary calls.
190Sstevel@tonic-gate
200Sstevel@tonic-gate=head2 Functions
210Sstevel@tonic-gate
220Sstevel@tonic-gateB<C<ucred_get($pid)>>
230Sstevel@tonic-gate
240Sstevel@tonic-gateThis function returns the credential of the process specified by $pid,
250Sstevel@tonic-gateif the process exists and the calling process is permitted to obtain
260Sstevel@tonic-gatethe credentials of that process.
270Sstevel@tonic-gate
280Sstevel@tonic-gateB<C<getpeerucred($fd)>>
290Sstevel@tonic-gate
300Sstevel@tonic-gateIf $fd is a connected connection oriented TLI endpoint, a connected
310Sstevel@tonic-gateSOCK_STREAM or SOCK_SEQPKT socket, getpeerucred will return the user
320Sstevel@tonic-gatecredential of the peer at the time the connection was established,
330Sstevel@tonic-gateif availble.
340Sstevel@tonic-gate
350Sstevel@tonic-gateB<C<ucred_geteuid($ucred)>>
360Sstevel@tonic-gate
370Sstevel@tonic-gateThis function returns the effective uid of a user credential, if available.
380Sstevel@tonic-gate
390Sstevel@tonic-gateB<C<ucred_getruid($ucred)>>
400Sstevel@tonic-gate
410Sstevel@tonic-gateThis function returns the real uid of a user credential, if available.
420Sstevel@tonic-gate
430Sstevel@tonic-gateB<C<ucred_getsuid($ucred)>>
440Sstevel@tonic-gate
450Sstevel@tonic-gateThis function returns the saved uid of a user credential, if available.
460Sstevel@tonic-gate
470Sstevel@tonic-gateB<C<ucred_getegid($ucred)>>
480Sstevel@tonic-gate
490Sstevel@tonic-gateThis function returns the effective group of a user credential, if available.
500Sstevel@tonic-gate
510Sstevel@tonic-gateB<C<ucred_getrgid($ucred)>>
520Sstevel@tonic-gate
530Sstevel@tonic-gateThis function returns the real group of a user credential, if available.
540Sstevel@tonic-gate
550Sstevel@tonic-gateB<C<ucred_getsgid($ucred)>>
560Sstevel@tonic-gate
570Sstevel@tonic-gateThis function returns the saved group of a user credential, if available.
580Sstevel@tonic-gate
590Sstevel@tonic-gateB<C<ucred_getgroups($ucred)>>
600Sstevel@tonic-gate
610Sstevel@tonic-gateThis function returns the list of supplemental groups of a user
620Sstevel@tonic-gatecredential, if available.  An array of groups is returned in ARRAY
630Sstevel@tonic-gatecontext; the number of groups is returned in SCALAR context.
640Sstevel@tonic-gate
650Sstevel@tonic-gateB<C<ucred_getprivset($ucred, $which)>>
660Sstevel@tonic-gate
670Sstevel@tonic-gateThis function returns the privilege set specified by $which of a user
680Sstevel@tonic-gatecredential, if available.
690Sstevel@tonic-gate
700Sstevel@tonic-gateB<C<ucred_getpflags($ucred, $flags)>>
710Sstevel@tonic-gate
720Sstevel@tonic-gateThis function returns the value of a specific process flag of a user
730Sstevel@tonic-gatecredential, if available.
740Sstevel@tonic-gate
750Sstevel@tonic-gateB<C<ucred_getpid($ucred)>>
760Sstevel@tonic-gate
770Sstevel@tonic-gateThis function returns the process id of a user credential, if available.
780Sstevel@tonic-gate
790Sstevel@tonic-gateB<C<ucred_getzoneid($ucred)>>
800Sstevel@tonic-gate
810Sstevel@tonic-gateThis function returns the zone id of a user credential, if available.
820Sstevel@tonic-gate
830Sstevel@tonic-gateB<C<ucred_getprojid($ucred)>>
840Sstevel@tonic-gate
850Sstevel@tonic-gateThis function returns the project id of a user credential, if available.
860Sstevel@tonic-gate
870Sstevel@tonic-gate=head2 Class methods
880Sstevel@tonic-gate
890Sstevel@tonic-gateNone.
900Sstevel@tonic-gate
910Sstevel@tonic-gate=head2 Object methods
920Sstevel@tonic-gate
930Sstevel@tonic-gateNone.
940Sstevel@tonic-gate
950Sstevel@tonic-gate=head2 Exports
960Sstevel@tonic-gate
970Sstevel@tonic-gateBy default nothing is exported from this module. The following tags can be
980Sstevel@tonic-gateused to selectively import constants and functions defined in this module:
990Sstevel@tonic-gate
1000Sstevel@tonic-gate :SYSCALLS    ucred_get(), getpeerucred()
1010Sstevel@tonic-gate
1020Sstevel@tonic-gate :LIBCALLS    ucred_geteuid(), ucred_getruid(), ucred_getsuid(),
1030Sstevel@tonic-gate	      ucred_getegid(), ucred_getrgid(), ucred_getsgid(),
1040Sstevel@tonic-gate	      ucred_getgroups(), ucred_getprivset(), ucred_getpflags(),
1050Sstevel@tonic-gate	      ucred_getpid(), ucred_getzoneid(), ucred_getprojid()
1060Sstevel@tonic-gate
1070Sstevel@tonic-gate :CONSTANTS
1080Sstevel@tonic-gate
1090Sstevel@tonic-gate :VARIABLES   %PRIVILEGES, %PRIVSETS
1100Sstevel@tonic-gate
1110Sstevel@tonic-gate :ALL         :SYSCALLS, :LIBCALLS, and :CONSTANTS
1120Sstevel@tonic-gate
1130Sstevel@tonic-gate=head1 ATTRIBUTES
1140Sstevel@tonic-gate
1150Sstevel@tonic-gateSee C<attributes(5)> for descriptions of the following attributes:
1160Sstevel@tonic-gate
1170Sstevel@tonic-gate  ___________________________________________________________
1180Sstevel@tonic-gate |       ATTRIBUTE TYPE        |       ATTRIBUTE VALUE       |
1190Sstevel@tonic-gate |_____________________________|_____________________________|
1200Sstevel@tonic-gate | Availability                | CPAN (http://www.cpan.org)  |
1210Sstevel@tonic-gate |_____________________________|_____________________________|
1220Sstevel@tonic-gate | Interface Stability         | Evolving                    |
1230Sstevel@tonic-gate |_____________________________|_____________________________|
1240Sstevel@tonic-gate
1250Sstevel@tonic-gate=head1 SEE ALSO
1260Sstevel@tonic-gate
1270Sstevel@tonic-gateC<getpeerucred(2)>, C<ucred_get(3C)>, C<attributes(5)>
128