Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ucred(3perl) [sunos man page]

Ucred(3PERL)						      Perl Library Functions						      Ucred(3PERL)

NAME
Ucred - Perl interface to User Credentials SYNOPSIS
use Sun::Solaris::Ucred qw(:ALL); DESCRIPTION
This module provides wrappers for the Ucred-related system and library calls. Constants None. Functions ucred_get($pid) This function returns the credential of the process specified by $pid if the process exists and the calling process is permitted to obtain the credentials of that process. getpeerucred($fd) If $fd is a connected connection-oriented TLI endpoint, a connected SOCK_STREAM, or a SOCK_SEQPKT socket, getpeerucred() returns the user credential of the peer at the time the connection was established, if availble. ucred_geteuid($ucred) This function returns the effective uid of a user credential, if available. ucred_getruid($ucred) This function returns the real uid of a user credential, if available. ucred_getsuid($ucred) This function returns the saved uid of a user credential, if available. ucred_getegid($ucred) This function returns the effective group of a user credential, if available. ucred_getrgid($ucred) This function returns the real group of a user credential, if available. ucred_getsgid($ucred) This function returns the saved group of a user credential, if available. ucred_getgroups($ucred) This function returns the list of supplemental groups of a user credential, if available.An array of groups is returned in ARRAY con- text; the number of groups is returned in SCALAR context. ucred_getprivset($ucred, $which) This function returns the privilege set specified by $which of a user credential, if available. ucred_getpflags($ucred, $flags) This function returns the value of a specific process flag of a user credential, if available. ucred_getpid($ucred) This function returns the process ID of a user credential, if available. ucred_getprojid($ucred) This function returns the project ID of a user credential, if available. ucred_getzoneid($ucred) This function returns the zone ID of a user credential, if available. Class methods None. Object methods None. Exports By default nothing is exported from this module. The following tags can be used to selectively import constants and functions defined in this module: :SYSCALLS ucred_get(), getpeerucred() :LIBCALLS ucred_geteuid(), ucred_getruid(), ucred_getsuid(), ucred_getegid(), ucred_getrgid(), ucred_getsgid(), ucred_getgroups(), ucred_getprivset(), ucred_getpflags(), ucred_getpid(), ucred_getzone() :ALL :SYSCALLS(), :LIBCALLS() ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWpl5u | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ SEE ALSO
getpeerucred(3C), ucred_get(3C), attributes(5) SunOS 5.10 30 Jan 2004 Ucred(3PERL)

Check Out this Related Man Page

ucred_get(3C)						   Standard C Library Functions 					     ucred_get(3C)

NAME
ucred_get, ucred_free, ucred_geteuid, ucred_getruid, ucred_getsuid, ucred_getegid, ucred_getrgid, ucred_getsgid, ucred_getgroups, ucred_getprivset, ucred_getpid, ucred_getprojid, ucred_getzoneid, ucred_getpflags, ucred_size - user credential functions SYNOPSIS
#include <ucred.h> ucred_t *ucred_get(pid_t pid); void ucred_free(const ucred_t *uc); uid_t ucred_geteuid(const ucred_t *uc); uid_t ucred_getruid(const ucred_t *uc); uid_t ucred_getsuid(const ucred_t *uc); gid_t ucred_getegid(const ucred_t *uc); gid_t ucred_getrgid(const ucred_t *uc); gid_t ucred_getsgid(const ucred_t *uc); int ucred_getgroups(const ucred_t *uc, const gid_t **groups); const priv_set_t *ucred_getprivset(const ucred_t *uc, const char * set); pid_t ucred_getpid(const ucred_t *uc); projid_t ucred_getprojid(const ucred_t *uc); zoneid_t ucred_getzoneid(const ucred_t *uc); uint_t ucred_getpflags(const ucred_t *uc, uint_t flags); size_t ucred_size(void); DESCRIPTION
These functions return or act on a user credential, ucred_t. User credentials are returned by various functions and describe the creden- tials of a process. Information about the process can then be obtained by calling the access functions. Access functions can fail if the underlying mechanism did not return sufficient information. The ucred_get() function returns the user credential of the specified pid or NULL if none can be obtained. A pid value of P_MYID returns information about the calling process. The return value is dynamically allocated and must be freed using ucred_free(). The ucred_geteuid(), ucred_getruid(), ucred_getsuid(), ucred_getegid(), ucred_getrgid(), and ucred_getsgid() functions return the effective UID, real UID, saved UID, effective GID, real GID, saved GID, respectively, or -1 if the user credential does not contain sufficient infor- mation. The ucred_getgroups() function stores a pointer to the group list in the gid_t * pointed to by the second argument and returns the number of groups in the list. It returns -1 if the information is not available. The returned group list is valid until ucred_free() is called on the user credential given as argument. The ucred_getpid() function returns the process ID of the process or -1 if the process ID is not available. The process ID returned in a user credential is only guaranteed to be correct in a very limited number of cases when returned by door_ucred(3DOOR) and ucred_get(). In all other cases, the process in question might have handed of the file descriptor, the process might have exited or executed another pro- gram, or the process ID might have been reused by a completely unrelated process after the original program exited. The ucred_getprojid() function returns the project ID of the process or -1 if the project ID is not available. The ucred_getzoneid() function returns the zone ID of the process or -1 if the zone ID is not available. The ucred_getprivset() function returns the specified privilege set specified as second argument, or NULL if either the requested informa- tion is not available or the priv_ptype_t argument is invalid. The returned privilege set is valid until ucred_free() is called on the specified user credential. The ucred_getpflags() function returns the value of the specified privilege flags from the ucred structure, or (uint_t)-1 if none was present. The ucred_free() function frees the memory allocated for the specified user credential. The ucred_size() function returns sizeof(ucred_t). This value is constant only until the next boot, at which time it could change. The ucred_size() function can be used to determine the size of the buffer needed to receive a credential option with SO_RECVUCRED. See socket.h(3HEAD). RETURN VALUES
See DESCRIPTION. ERRORS
The ucred_get() function will fail if: EAGAIN There is not enough memory available to allocate sufficient memory to hold a user credential. The application can try again later. EACCES The caller does not have sufficient privileges to examine the target process. EMFILE The calling process cannot open any more files. ENFILE ENOMEM The physical limits of the system are exceeded by the memory allocation needed to hold a user credential. ESRCH The target process does not exist. The ucred_getprivset() function will fail if: EINVAL The privilege set argument is invalid. The ucred_geteuid(), ucred_getruid(), ucred_getsuid(), ucred_getegid(), ucred_getrgid(), ucred_getsgid(), ucred_getgroups(), ucred_getpflags(), ucred_getprivset(), ucred_getprojid(), and ucred_getpid() functions will fail if: EINVAL The requested user credential attribute is not available in the specified user credential. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
getpflags(2), getppriv(2), door_ucred(3DOOR), priv_set(3C), socket.h(3HEAD), attributes(5), privileges(5) SunOS 5.10 27 Jul 2004 ucred_get(3C)
Man Page