home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 2 / 2746 < prev    next >
Internet Message Format  |  1991-02-12  |  3KB

  1. From: nsayer@uop.edu (Nick Sayer)
  2. Newsgroups: news.software.nntp,alt.sources
  3. Subject: Unofficial RFC931 patches to nntp
  4. Message-ID: <27b84fd7.403e@uop.uop.edu>
  5. Date: 12 Feb 91 20:28:08 GMT
  6.  
  7. [repost: Moved the auth data after the word "connect" so the nntp_awk
  8. report generator will still work without modification]
  9.  
  10. This patch will make nntpd log the results of an RFC931 style user
  11. authentication attempt for each incoming connection. If authentication
  12. is not possible, it is logged as "[unauthenticated]". No access
  13. restriction/denial based on the results is implemented, it's simply
  14. logged.
  15.  
  16. *** /home/staff-uop/nsayer/onntp/server/Makefile    Sat Dec 22 08:16:13 1990
  17. --- server/Makefile    Tue Feb  5 11:05:03 1991
  18. ***************
  19. *** 19,25 ****
  20.   SRCS    = ${SRVRSRC}
  21.   
  22.   # -ldbm here if you've #define'ed DBM in ../common/conf.h
  23. ! LIBS    = -ldbm
  24.   
  25.   CFLAGS    = -O
  26.   
  27. --- 19,25 ----
  28.   SRCS    = ${SRVRSRC}
  29.   
  30.   # -ldbm here if you've #define'ed DBM in ../common/conf.h
  31. ! LIBS    = -ldbm -lauthuser
  32.   
  33.   CFLAGS    = -O
  34.   
  35. *** /home/staff-uop/nsayer/onntp/server/access.c    Fri Aug 10 20:59:02 1990
  36. --- server/access.c    Tue Feb 12 10:44:28 1991
  37. ***************
  38. *** 46,51 ****
  39. --- 46,57 ----
  40.   extern    int Needauth;
  41.   #endif AUTH
  42.   
  43. + #ifdef RFC931
  44. + char username[32];
  45. + char *auth_tcpuser();
  46. + int auth_fd();
  47. + #endif
  48.   host_access(canread, canpost, canxfer, gdlist)
  49.       int        *canread, *canpost, *canxfer;
  50.       char        *gdlist;
  51. ***************
  52. *** 122,129 ****
  53. --- 128,159 ----
  54.           if (isupper(*cp))
  55.               *cp = tolower(*cp);
  56.   
  57. + #ifdef RFC931
  58. + {
  59. +   register unsigned long in;
  60. +   register unsigned short local;
  61. +   register unsigned short remote;
  62. +   register char *ruser;
  63. +   ruser=NULL;
  64. +   if (auth_fd(0,&in,&local,&remote) != -1)
  65. +     ruser = auth_tcpuser(in,local,remote);
  66. +   if (ruser == NULL)
  67. +     ruser = "[unauthenticated]";
  68. +   strcpy(username,ruser);
  69. + }
  70.   #ifdef LOG
  71. +     syslog(LOG_INFO, "%s connect (%s)\n", host_name,username);
  72. + #endif
  73. + #else
  74. + #ifdef LOG
  75.       syslog(LOG_INFO, "%s connect\n", host_name);
  76. + #endif
  77.   #endif
  78.       (void) strcpy(hostname, host_name);
  79.   
  80. *** /home/staff-uop/nsayer/onntp/server/common.h    Sat Feb  2 13:55:37 1991
  81. --- server/common.h    Tue Feb 12 10:31:16 1991
  82. ***************
  83. *** 190,195 ****
  84. --- 190,199 ----
  85.   extern    char    hostname[];
  86.   extern    int    debug;
  87.   
  88. + #ifdef RFC931
  89. + extern    char    username[];
  90. + #endif
  91.   #ifdef LOG
  92.   extern    int    grps_acsd, arts_acsd;
  93.   
  94. *** /home/staff-uop/nsayer/onntp/common/conf.h.dist    Sun Feb  3 22:46:37 1991
  95. --- common/conf.h.dist    Tue Feb 12 10:54:03 1991
  96. ***************
  97. *** 201,206 ****
  98. --- 201,215 ----
  99.   /* Things that relate to authentication and access */
  100.   /* Define AUTH to use the proposed NNTP Version 2 authentication protocol. */
  101.   #define    AUTH    
  102. + /*
  103. +  * Will we do RFC931 authentication?
  104. +  * If so, the makefiles for nntpd need to be fixed to add -lauthuser.
  105. +  * Currently RFC931 data is just logged. After all, it really can't
  106. +  * be trusted very far.
  107. +  */
  108. + #define RFC931
  109.   /*
  110.    * A file containing the name of the host which is running
  111.    * the news server.  This will have to match what rrn thinks,
  112.  
  113.  
  114. -- 
  115. Nick Sayer               | Disclaimer: "Don't try this at home, | RIP: Mel Blanc
  116. mrapple@quack.sac.ca.us  | kids. This should only be done by    |   1908-1989
  117. N6QQQ  [44.2.1.17]       | trained, professional idiots."       |  May he never
  118. 209-952-5347 (Telebit)   |                     --Plucky Duck    |  be silenced.
  119.