Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

initgroups(3c) [sunos man page]

initgroups(3C)						   Standard C Library Functions 					    initgroups(3C)

NAME
initgroups - initialize the supplementary group access list SYNOPSIS
#include <grp.h> #include <sys/types.h> int initgroups(const char *name, gid_t basegid); DESCRIPTION
The initgroups() function reads the group database to get the group membership for the user specified by name, and initializes the supple- mentary group access list of the calling process (see getgrnam(3C) and getgroups(2)). The basegid group ID is also included in the supple- mentary group access list. This is typically the real group ID from the user database. While scanning the group database, if the number of groups, including the basegid entry, exceeds NGROUPS_MAX, subsequent group entries are ignored. RETURN VALUES
Upon successful completion, 0 is returned. Otherwise, -1 is returned and errno is set to indicate the error. ERRORS
The initgroups() function will fail and not change the supplementary group access list if: EPERM The {PRIV_PROC_SETID} privilege is not asserted in the effective set of the calling process. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
getgroups(2), getgrnam(3C), attributes(5) SunOS 5.10 22 Mar 2004 initgroups(3C)

Check Out this Related Man Page

initgroups(3)						     Library Functions Manual						     initgroups(3)

NAME
initgroups - Initializes concurrent group set LIBRARY
Standard C Library (libc.a) SYNOPSIS
int initgroups ( char *user, gid_t base_gid ); PARAMETERS
Specifies the user whose groups are to be used to initialize the group set. Specifies an additional group to include in the group set. DESCRIPTION
The initgroups() function reads the defined group membership of the specified user and sets the concurrent group set of the current process to that value. The base_gid parameter is always included in the concurrent group set, and is normally the principal user's group. If the user is in more than NGROUPS_MAX groups, only NGROUPS_MAX groups are set, including the base_gid group. CAUTION
The initgroups() function uses the sia_get_groups() function to set up the group array. If the program that invokes initgroups() uses any of these functions, then calling initgroups() overwrites the static group structure. RETURN VALUES
Upon successful completion, the initgroups() function returns 0 (zero). If the initgroups() function fails, 1 is returned and errno is set to indicate the error. ERRORS
If the initgroups() function fails, errno may be set to the following value: The calling process does not have the appropriate privilege in its current effective privilege set. RELATED INFORMATION
Functions: getgroups(2), setgroups(2), getgid(2) sia_get_groups(3) Commands: groups(1) delim off initgroups(3)
Man Page