Switch to SpeakEasy.net DSL

The Modular Manual Browser

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

GETPWAENT(3)               Library Functions Manual               GETPWAENT(3)

       getpwaent,  getpwanam,  setpwaent, endpwaent, fgetpwaent - get password
       adjunct file entry

       #include <&lt;sys/types.h>&gt;
       #include <&lt;sys/label.h>&gt;
       #include <&lt;sys/audit.h>&gt;
       #include <&lt;pwdadj.h>&gt;

       struct passwd_adjunct *getpwaent()

       struct passwd_adjunct *getpwanam(name)
       char *name;

       struct passwd_adjunct *fgetpwaent(f)
       FILE *f;

       void setpwaent()

       void endpwaent()

       Both getpwaent() and getpwanam() return a pointer to an object with the
       following  structure  containing the broken-out fields of a line in the
       password adjunct file.  Each line in the file contains a passwd_adjunct
       structure, declared in the <&lt;pwdadj.h>&gt; header file:

              struct  passwd_adjunct {
                     char            *pwa_name;
                     char            *pwa_passwd;
                     blabel_t        pwa_minimum;
                     blabel_t        pwa_maximum;
                     blabel_t        pwa_def;
                     audit_state_t   pwa_au_always;
                     audit_state_t   pwa_au_never;
                     int             pwa_version;

       When  first  called,  getpwaent() returns a pointer to a passwd_adjunct
       structure describing data from the first line in the file.  Thereafter,
       it returns a pointer to a passwd_adjunct structure describing data from
       the next line in the file.  So successive calls can be used  to  search
       the entire file.

       getpwanam()  searches  from  the beginning of the file until it finds a
       login name matching name, then returns  a  pointer  to  the  particular
       structure in which it was found.

       Calling setpwaent() rewinds the password adjunct file to allow repeated
       searches.  Calling endpwaent() closes the password  adjunct  file  when
       processing is complete.

       Because  read access is required on /etc/security/passwd.adjunct, getp-
       waent() and getpwanam() will fail unless the calling process has effec-
       tive UID of root.


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

       getpwent(3V), getgrent(3V), passwd.adjunct(5), ypserv(8)

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

                               7 September 1988                   GETPWAENT(3)