unixdev.net


Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (SunOS-4.1.3)
Page:
Section:
Apropos / Subsearch:
optional field

GETGRAENT(3)               Library Functions Manual               GETGRAENT(3)



NAME
       getgraent,  getgranam,  setgraent,  endgraent,  fgetgraent  - get group
       adjunct file entry

SYNOPSIS
       #include <&lt;stdio.h>&gt;
       #include <&lt;grpadj.h>&gt;

       struct group_adjunct *getgraent()

       struct group_adjunct *getgranam(name)
       char *name;

       struct group_adjunct *fgetgraent(f)
       FILE *f;

       void setgraent()

       void endgraent()

DESCRIPTION
       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 <&lt;grpadj.h>&gt; 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 struc-
       ture.

       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,  get-
       graent()  and  getgranam()  will  fail  unless  the calling process has
       effective UID of root.

FILES
       /etc/security/group.adjunct
       /var/yp/domainname/group.adjunct

SEE ALSO
       getlogin(3V), getgrent(3V), getpwaent(3), getpwent(3V), ypserv(8)

DIAGNOSTICS
       A NULL pointer is returned on end-of-file or error.

BUGS
       All information is contained in a static area, so it must be copied  if
       it is to be saved.



                               7 September 1988                   GETGRAENT(3)