Handles the group network entries.
Standard C Library (libc.a)
#include<netdb.h>
int getnetgrent_r(machinep, namep, domainp, ptr)
char **machinep, **namep, **domainp;
void **ptr;
The getnetgrent_r subroutine internally calls the getnetgrent subroutine and stores the information in the structure data. This subroutine returns 1 or 0, depending if netgroup contains the machine, user, and domain triple as a member. Any of these three strings can be NULL, in which case it signifies a wild card.
The getnetgrent_r subroutine returns the next member of a network group. After the call, the machinep parameter contains a pointer to a string containing the name of the machine part of the network group member. The namep and domainp parameters contain similar pointers. If machinep, namep, or domainp is returned as a NULL pointer, it signifies a wild card.
The getnetgrent subroutine overwrites the static data returned in subsequent calls. The getnetgrent_r subroutine does not.
Item | Description |
---|---|
machinep | Points to the string containing the machine part of the network group. |
namep | Points to the string containing the user part of the network group. |
domainp | Points to the string containing the domain name. |
ptr | Keeps the function threadsafe. |
The function returns a 0 if successful and a -1 if unsuccessful.
Item | Description |
---|---|
/etc/netgroup | Contains network groups recognized by the system. |
/usr/include/netdb.h | Contains the network database structures. |