Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ authcap(S) — System V/386 Software Development System 3.2.2b

Media Vault

Software Library

Restoration Projects

Artifacts Sought



     AUTHCAP(S)                UNIX System V                AUTHCAP(S)



     Name
          authcap - get information from the authentication database

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

          int agetuser (user)
          char *user;

          int agetfile (filepos, fd)
          long *filepos;
          int fd;

          int agetcommand (filepos, fd)
          long *filepos;
          int fd;

          int agetty (filepos, fd)
          long *filepos;
          int fd;

          int agetdefault (filepos, fd)
          long *filepos;
          int fd;

          char *agetstr (id, area)
          char *id;
          char **area;

          int agetnum (id)
          char *id;

          int agetflag (id)
          char *id;

          void asetdefaults (new_defaults)
          int new_defaults;

     Description
          These routines manage ASCII database files in hierarchies as
          described in authcap(F).  All program references to the
          database should use these routines.  Also, these routines
          are the ones that understand the authcap(F) format and are
          guaranteed to provide the same interface, even if the
          database format or name designations change.

          Agetuser finds the entry associated with the user name
          argument.  Agetcommand finds the next command entry in the
          file described by fd starting at the file position filepos
          within the file.  Filepos should point to the beginning of a
          valid entry or at the end of the file.  Agetfile finds the
          next file entry in the file in the same way as agetcommand .
          Similarly, agettty finds the next tty entry in the file in
          the same way as agetcommand . Tty names are the components
          without the /dev part.  Example tty names in the database
          are console , and tty3 . Agetdefault finds the next default
          entry in the file in the same way as agetcommand .

          Each of the above routines returns a status indicator.  A
          return value of 1 means the entry was found.  A return value
          of 0 means the entry was not found in the file.  The calls
          with the filepos argument may update the position referenced
          by filepos .

          Once one of the above routines obtains an entry, the next
          three routines obtain capabilities from that most recently
          chosen entry.  Agetnum returns the number associated with
          the id argument.  It returns -1 if the capability cannot be
          found.  Agetstr returns the string associated with the id
          argument.  The place the string goes is referenced by the
          area argument.  Not the area argument is a pointer to an
          allocated string, not merely a string.  The 0 pointer ((char
          *) 0) is returned when the capability cannot be found.  A
          null string is returned as an empty string (**area == '\0').
          Agetflag returns the flag associated with the id argument.
          If the flag is set, 1 is returned.  If the flag is not set
          (the @ attribute appears with the id in the file), 0 is
          returned.  If the capability flag cannot be found at all
          (different from not set), -1 is returned.

          Asetdefaults sets the place to find system values.  It is
          set to one of the following values for all system refernes
          of the database until it is reset again by asetdefaults .
          Initially it is NORMAL, where system values are found in te
          site-selectable part of the database.  The value WEAK uses
          an insecure version, while the value STRONG uses a secure
          version of the system-wide values.  When none of these
          values is used, the value STRONG is used.

     Notes
          Agetuser, agetcommand, agetfile, agettty and agetdefault
          make use of static areas for an entry.  Successive calls to
          any of these routines will overwrite that data used by later
          calls to agetstr, agetnum and agetflag.

          A numeric capability of -1 cannot be easily assimilated
          because -1 is the agetnum error indicator.

     See Also
          getprpwent(S), getprtcent(S), getprfient(S), getprcment(S),
          fields(S), authcap(F)
     Value Added
          authcap is an extension of AT&T System V provided by the
          Santa Cruz Operation.


                                                     (printed 6/20/89)



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