#include <stdio.h> #include <grpadj.h>
struct group_adjunct *getgraent()
struct group_adjunct *getgranam(name) char *name;
struct group_adjunct *fgetgraent(f) FILE *f;
void setgraent()
void endgraent()
getgraent() and getgranam() each return pointers to an object with the following structure containing the broken-out fields of a line in the group adjunct file. Each line contains a group_adjunct structure, defined in the <grpadj.h> header file.
struct group_adjunct {
char *gra_name; /* the name of the group */ char *gra_passwd; /* the encrypted group password */
};
When first called, getgraent() returns a pointer to a group_adjunct structure corresponding to the first line in the file. Thereafter, it returns a pointer to the next group_adjunct structure in the file. So successive calls may be used to traverse the entire file.
For locating a particular group, getgranam() searches through the file until it finds group filename, then returns a pointer to that structure.
A call to getgraent() rewinds the group adjunct file to allow repeated searches. A call to endgraent() closes the group adjunct file when processing is complete.
Because read access is required on /etc/security/group.adjunct, getgraent() and getgranam() will fail unless the calling process has effective UID of root.
A NULL pointer is returned on end-of-file or error.
All information is contained in a static area, so it must be copied if it is to be saved.
Created by unroff & hp-tools. © somebody (See intro for details). All Rights Reserved. Last modified 11/5/97