getgrset_r Subroutine

Purpose

Obtains group set information in the user database.

Library

Threadsafe C Library (libc.a)

Syntax

#include <sys/types.h>

#include <grp.h>

#define _THREAD_SAFE

int getgrset_r (char *nam, struct _grjunk * grp)

Description

The getgrset_r subroutine populates group data into the structure pointed by group for the named user. It returns TS_SUCCESS if the group information is populated.

If the Network Information Service (NIS) is enabled on the system, these subroutines attempt to retrieve the user information from the NIS authentication server.

Note: If the domainlessgroups attribute is set in the /etc/secvars.cfg file, all the group IDs are fetched from the Lightweight Directory Access Protocol (LDAP) and files domains, if the user belongs to any one of these domains.

Parameters

Item Description
User Specifies the user name.

Return Values

If successful, the getgrset_r subroutine fills the group-related information into the second parameter and returns 0.

Error Codes

The getgrset_r subroutine returns -1 when it is unable to populate the struct_grjunk *grp structure.

File

Item Description
/etc/group Contains basic group attributes.