home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Tools / lynx-2.4 / WWW / Library / Implementation / HTACL.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-06-28  |  3.5 KB  |  111 lines

  1. /*                                ACCESS CONTROL LIST ROUTINES
  2.                                              
  3.  */
  4.  
  5. #ifndef HTACL_H
  6. #define HTACL_H
  7.  
  8. #ifndef HTUTILS_H
  9. #include "HTUtils.h"
  10. #endif /* HTUTILS_H */
  11. #include "HTAAUtil.h"
  12. #include "HTGroup.h"
  13.  
  14. #ifdef SHORT_NAMES
  15. #define HTAAgAFn        HTAA_getAclFilename
  16. #define HTAAoACL        HTAA_openAcl
  17. #define HTAAcACL        HTAA_closeAcl
  18. #define HTAAgAEn        HTAA_getAclEntry
  19. #endif /* SHORT_NAMES */
  20.  
  21. /*
  22.  
  23. Opening Access Control List File
  24.  
  25.  */
  26.  
  27. /* PUBLIC                                               HTAA_openAcl()
  28. **              OPEN THE ACL FILE FOR THE GIVEN DOCUMENT
  29. ** ON ENTRY:
  30. **      pathname        is the absolute pathname of
  31. **                      the file to be accessed.
  32. **
  33. ** ON EXIT:
  34. **      returns         the FILE* to open ACL.
  35. **                      NULL, if ACL not found.
  36. */
  37. PUBLIC FILE *HTAA_openAcl PARAMS((CONST char * pathname));
  38.  
  39.  
  40. /* PUBLIC                                               HTAA_closeAcl()
  41. **                      CLOSE ACL FILE
  42. ** ON ENTRY:
  43. **      acl_file is Access Control List file to close.
  44. **
  45. ** ON EXIT:
  46. **      returns nothing.
  47. */
  48. PUBLIC void HTAA_closeAcl PARAMS((FILE * acl_file));
  49. /*
  50.  
  51. Getting ACL Entry
  52.  
  53.  */
  54.  
  55. /* PUBLIC                                               HTAA_getAclEntry()
  56. **                      CONSULT THE ACCESS CONTROL LIST AND
  57. **                      GIVE A LIST OF GROUPS (AND USERS)
  58. **                      AUTHORIZED TO ACCESS A GIVEN FILE
  59. ** ON ENTRY:
  60. **      acl_file        is an open ACL file.
  61. **      pathname        is the absolute pathname of
  62. **                      the file to be accessed.
  63. **      method          is the method for which access is wanted.
  64. **
  65. ** ALC FILE FORMAT:
  66. **
  67. **      template : method, method, ... : group@addr, user, group, ...
  68. **
  69. **      The last item is in fact in exactly the same format as
  70. **      group definition in group file, i.e. everything that
  71. **      follows the 'groupname:' part,
  72. **      e.g.
  73. **              user, group, user@address, group@address,
  74. **              (user,group,...)@(address, address, ...)
  75. **
  76. ** ON EXIT:
  77. **      returns         NULL, if there is no entry for the file in the ACL,
  78. **                      or ACL doesn't exist.
  79. **                      If there is, a GroupDef object containing the
  80. **                      group and user names allowed to access the file
  81. **                      is returned (this is automatically freed
  82. **                      next time this function is called).
  83. ** IMPORTANT:
  84. **      Returns the first entry with matching template and
  85. **      method. This function should be called multiple times
  86. **      to process all the valid entries (until it returns NULL).
  87. **      This is because there can be multiple entries like:
  88. **
  89. **              *.html : get,put : ari,timbl,robert
  90. **              *.html : get     : jim,james,jonathan,jojo
  91. **
  92. ** NOTE:
  93. **      The returned group definition may well contain references
  94. **      to groups defined in group file. Therefore these references
  95. **      must be resolved according to that rule file by function
  96. **      HTAA_resolveGroupReferences() (group file is read in by
  97. **      HTAA_readGroupFile()) and after that access authorization
  98. **      can be checked with function HTAA_userAndInetGroup().
  99. */
  100. PUBLIC GroupDef *HTAA_getAclEntry PARAMS((FILE *        acl_file,
  101.                                           CONST char *  pathname,
  102.                                           HTAAMethod    method));
  103. /*
  104.  
  105.  */
  106.  
  107. #endif /* not HTACL_H */
  108. /*
  109.  
  110.    End of file HTACL.h.  */
  111.