home *** CD-ROM | disk | FTP | other *** search
/ ftp.wwiv.com / ftp.wwiv.com.zip / ftp.wwiv.com / pub / INTERNET / UPC2S1.ZIP / SECURITY.H < prev    next >
C/C++ Source or Header  |  1993-09-20  |  5KB  |  103 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.2 1993/09/20 04:51:31 ahd Exp $
  22.  *
  23.  *    Revision history:
  24.  *    $Log: security.h $
  25.  *     Revision 1.2  1993/09/20  04:51:31  ahd
  26.  *     TCP Support from Dave Watt
  27.  *     't' protocol support
  28.  *     OS/2 2.x support (BC++ 1.0 for OS/2 support)
  29.  *
  30.  */
  31.  
  32. #define ANY_HOST     "OTHER"
  33. #define ANY_COMMAND  "ALL"
  34.  
  35. /*--------------------------------------------------------------------*/
  36. /*             Directory list structed used by host table             */
  37. /*--------------------------------------------------------------------*/
  38.  
  39. typedef enum {
  40.    ALLOW_READ,
  41.    ALLOW_WRITE
  42.    } REMOTE_ACCESS;
  43.  
  44. struct DIRLIST {
  45.    char *path;                /* Directory we are authorizing        */
  46.    REMOTE_ACCESS priv;        /* ALLOW_READ/ALLOW_WRITE              */
  47.    boolean grant;             /* TRUE = excplitly Allow access,
  48.                                  FALSE = explicit deny access        */
  49.    } ;
  50.  
  51. /*--------------------------------------------------------------------*/
  52. /*                        Security information                        */
  53. /*--------------------------------------------------------------------*/
  54.  
  55. struct HostSecurity {
  56.       char **validate;           /* List of machines allowed to use
  57.                                     logname when calling in             */
  58.       char *myname;              /* Name to use when communicating with
  59.                                     this remote system                  */
  60.       char *pubdir;              /* Public directory to use for this
  61.                                     system                              */
  62.       char **commands;           /* Commands allowed for this system    */
  63.       struct DIRLIST *dirlist;   /* List of directories this system
  64.                                     can access                          */
  65.       size_t dirsize;            /* Size of the directory list          */
  66.       boolean request;           /* TRUE = Remote system can request
  67.                                     files FROM local system             */
  68.       boolean sendfiles;         /* TRUE = Send locally queued requests
  69.                                     when other system has called us;
  70.                                     default is FALSE, only send files
  71.                                     when we are the caller.  (Stupid
  72.                                     default if you fill in other para-
  73.                                     meters properly, but that's UUCP    */
  74.       boolean callback;          /* TRUE = Do not process work for
  75.                                     system when it calls in, but rather
  76.                                     call it back    */
  77.       boolean local;             /* TRUE = Local system, grant all
  78.                                     requests                            */
  79.       } ; /* HostSecurity */
  80.  
  81. /*--------------------------------------------------------------------*/
  82. /*                             Prototypes                             */
  83. /*--------------------------------------------------------------------*/
  84.  
  85. boolean ValidateFile( const char *input,  /* Full path name          */
  86.                       const REMOTE_ACCESS needed );
  87.  
  88. boolean ValidateHost( const char *host );
  89.  
  90. boolean ValidateCommand( const char *command);
  91.  
  92. boolean LoadSecurity( void );
  93.  
  94. struct HostSecurity *GetSecurity( struct HostTable *hostp);
  95.  
  96. /*--------------------------------------------------------------------*/
  97. /*                          Global variables                          */
  98. /*--------------------------------------------------------------------*/
  99.  
  100. extern struct HostSecurity *securep;
  101.  
  102. #endif /* ifdef _SECURITY */
  103.