home *** CD-ROM | disk | FTP | other *** search
/ Super Net 1 / SUPERNET_1.iso / PC / OTROS / EXTRAS / UUCODE / UUPC / TEST / UPC12ES1.ZIP / LIB / security.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-10-11  |  4.7 KB  |  106 lines

  1. #ifndef _SECURITY
  2. #define _SECURITY
  3.  
  4. /*--------------------------------------------------------------------*/
  5. /*       s e c u r i t y . h                                          */
  6. /*--------------------------------------------------------------------*/
  7.  
  8. /*--------------------------------------------------------------------*/
  9. /*       Changes Copyright (c) 1989-1993 by Kendra Electronic         */
  10. /*       Wonderworks.                                                 */
  11. /*                                                                    */
  12. /*       All rights reserved except those explicitly granted by       */
  13. /*       the UUPC/extended license agreement.                         */
  14. /*--------------------------------------------------------------------*/
  15.  
  16. /*--------------------------------------------------------------------*/
  17. /*                          RCS Information                           */
  18. /*--------------------------------------------------------------------*/
  19.  
  20. /*
  21.  *    $Id: security.h 1.3 1993/10/12 01:22:27 ahd Exp $
  22.  *
  23.  *    Revision history:
  24.  *    $Log: security.h $
  25.  *     Revision 1.3  1993/10/12  01:22:27  ahd
  26.  *     Normalize comments to PL/I style
  27.  *
  28.  *     Revision 1.2  1993/09/20  04:51:31  ahd
  29.  *     TCP Support from Dave Watt
  30.  *     't' protocol support
  31.  *     OS/2 2.x support (BC++ 1.0 for OS/2 support)
  32.  *
  33.  */
  34.  
  35. #define ANY_HOST     "OTHER"
  36. #define ANY_COMMAND  "ALL"
  37.  
  38. /*--------------------------------------------------------------------*/
  39. /*             Directory list structed used by host table             */
  40. /*--------------------------------------------------------------------*/
  41.  
  42. typedef enum {
  43.    ALLOW_READ,
  44.    ALLOW_WRITE
  45.    } REMOTE_ACCESS;
  46.  
  47. struct DIRLIST {
  48.    char *path;                /* Directory we are authorizing        */
  49.    REMOTE_ACCESS priv;        /* ALLOW_READ/ALLOW_WRITE              */
  50.    boolean grant;             /* TRUE = excplitly Allow access,
  51.                                  FALSE = explicit deny access        */
  52.    } ;
  53.  
  54. /*--------------------------------------------------------------------*/
  55. /*                        Security information                        */
  56. /*--------------------------------------------------------------------*/
  57.  
  58. struct HostSecurity {
  59.       char **validate;           /* List of machines allowed to use
  60.                                     logname when calling in            */
  61.       char *myname;              /* Name to use when communicating with
  62.                                     this remote system                 */
  63.       char *pubdir;              /* Public directory to use for this
  64.                                     system                             */
  65.       char **commands;           /* Commands allowed for this system   */
  66.       struct DIRLIST *dirlist;   /* List of directories this system
  67.                                     can access                         */
  68.       size_t dirsize;            /* Size of the directory list         */
  69.       boolean request;           /* TRUE = Remote system can request
  70.                                     files FROM local system            */
  71.       boolean sendfiles;         /* TRUE = Send locally queued requests
  72.                                     when other system has called us;
  73.                                     default is FALSE, only send files
  74.                                     when we are the caller.  (Stupid
  75.                                     default if you fill in other para-
  76.                                     meters properly, but that's UUCP   */
  77.       boolean callback;          /* TRUE = Do not process work for
  78.                                     system when it calls in, but rather
  79.                                     call it back    */
  80.       boolean local;             /* TRUE = Local system, grant all
  81.                                     requests                           */
  82.       } ; /* HostSecurity */
  83.  
  84. /*--------------------------------------------------------------------*/
  85. /*                             Prototypes                             */
  86. /*--------------------------------------------------------------------*/
  87.  
  88. boolean ValidateFile( const char *input,  /* Full path name          */
  89.                       const REMOTE_ACCESS needed );
  90.  
  91. boolean ValidateHost( const char *host );
  92.  
  93. boolean ValidateCommand( const char *command);
  94.  
  95. boolean LoadSecurity( void );
  96.  
  97. struct HostSecurity *GetSecurity( struct HostTable *hostp);
  98.  
  99. /*--------------------------------------------------------------------*/
  100. /*                          Global variables                          */
  101. /*--------------------------------------------------------------------*/
  102.  
  103. extern struct HostSecurity *securep;
  104.  
  105. #endif /* ifdef _SECURITY */
  106.