Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought



     GETPRDFENT(S)             UNIX System V             GETPRDFENT(S)



     Name
          getprdfent, getprdfnam, setprdfent, endprdfent, putprdfnam -
          manipulate default control database entry

     Syntax
          #include <sys/types.h>
          #include <sys/security.h>
          #include <sys/audit.h>
          #include <prot.h>

          struct pr_default *getprdfent ()

          struct pr_default *getprdfnam (name);
          char *name;

          void setprdfent ();

          void endprdfent ();

          int putprdfnam (name, pr)
          char *name;
          struct pr_default *pr;

     Description
          getprdfent and getprdfnam each returns a pointer to an
          object with the following structure containing the broken-
          out fields of a line in the default control database.  Only
          entries in the database dealing with users are scanned.
          Each line in the database contains a ``pr_default''
          structure, declared in the <prot.h> header file:

          struct    pr_default  {
               char dd_name[20];
               char dg_name;
               struct pr_field prd;
               struct pr_flag prg;
               struct t_field tcd;
               struct t_flag tcg;
               struct f_field fid;
               struct f_flag fig;
               struct c_field cmd;
               struct c_flag cmg;
          };

          This structure is declared in <prot.h> so it is not
          necessary to redeclare it.

          getprdfent when first called returns a pointer to the first
          user pr_default structure in the database; thereafter, it
          returns a pointer to the next pr_default structure in the
          database; so successive calls can be used to search the
          database.  getprdfnam searches from the beginning of the
          file until a login name matching name is found, and returns
          a pointer to the particular structure in which it was found.
          If an end-of-file or an error is encountered on reading,
          these functions return a NULL pointer.

          A call to setprdfent has the effect of rewinding the default
          control file to allow repeated searches.  Endprdfent may be
          called to close the default control file when processing is
          complete.

          Putprdfnam puts a new or replaced default control entry pr
          with key name into the appropriate files(s), If the
          "uflg.fg_name" field is 0, the requested entry is deleted
          from the default control database.  Putprdfnam locks the
          database for all update operations, and performs a
          endprdfent after the update or failed attempt.

     Files
          /etc/auth/defaults

     See Also
          getprpwent(S), getprtcent(S), getprfient(S), getprdfent(S),
          authcap(S), authcap(F)

     Diagnostics
          A NULL pointer is returned on EOF or error.

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

     Value Added
          endprdfent, getprdfent, getprdfnam, putprdfnam and
          setprdfent are extensions of AT&T System V provided by the
          Santa Cruz Operation.

                                             (printed 6/20/89)



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026