Unofficial RFC931 patches to nntp

Nick Sayer nsayer at uop.edu
Wed Feb 13 07:28:08 AEST 1991


[repost: Moved the auth data after the word "connect" so the nntp_awk
report generator will still work without modification]

This patch will make nntpd log the results of an RFC931 style user
authentication attempt for each incoming connection. If authentication
is not possible, it is logged as "[unauthenticated]". No access
restriction/denial based on the results is implemented, it's simply
logged.

*** /home/staff-uop/nsayer/onntp/server/Makefile	Sat Dec 22 08:16:13 1990
--- server/Makefile	Tue Feb  5 11:05:03 1991
***************
*** 19,25 ****
  SRCS	= ${SRVRSRC}
  
  # -ldbm here if you've #define'ed DBM in ../common/conf.h
! LIBS	= -ldbm
  
  CFLAGS	= -O
  
--- 19,25 ----
  SRCS	= ${SRVRSRC}
  
  # -ldbm here if you've #define'ed DBM in ../common/conf.h
! LIBS	= -ldbm -lauthuser
  
  CFLAGS	= -O
  
*** /home/staff-uop/nsayer/onntp/server/access.c	Fri Aug 10 20:59:02 1990
--- server/access.c	Tue Feb 12 10:44:28 1991
***************
*** 46,51 ****
--- 46,57 ----
  extern	int Needauth;
  #endif AUTH
  
+ #ifdef RFC931
+ char username[32];
+ char *auth_tcpuser();
+ int auth_fd();
+ #endif
+ 
  host_access(canread, canpost, canxfer, gdlist)
  	int		*canread, *canpost, *canxfer;
  	char		*gdlist;
***************
*** 122,129 ****
--- 128,159 ----
  		if (isupper(*cp))
  			*cp = tolower(*cp);
  
+ #ifdef RFC931
+ {
+   register unsigned long in;
+   register unsigned short local;
+   register unsigned short remote;
+   register char *ruser;
+ 
+   ruser=NULL;
+ 
+   if (auth_fd(0,&in,&local,&remote) != -1)
+     ruser = auth_tcpuser(in,local,remote);
+ 
+   if (ruser == NULL)
+     ruser = "[unauthenticated]";
+ 
+   strcpy(username,ruser);
+ 
+ }
+ 
  #ifdef LOG
+ 	syslog(LOG_INFO, "%s connect (%s)\n", host_name,username);
+ #endif
+ #else
+ #ifdef LOG
  	syslog(LOG_INFO, "%s connect\n", host_name);
+ #endif
  #endif
  	(void) strcpy(hostname, host_name);
  
*** /home/staff-uop/nsayer/onntp/server/common.h	Sat Feb  2 13:55:37 1991
--- server/common.h	Tue Feb 12 10:31:16 1991
***************
*** 190,195 ****
--- 190,199 ----
  extern	char	hostname[];
  extern	int	debug;
  
+ #ifdef RFC931
+ extern	char	username[];
+ #endif
+ 
  #ifdef LOG
  extern	int	grps_acsd, arts_acsd;
  
*** /home/staff-uop/nsayer/onntp/common/conf.h.dist	Sun Feb  3 22:46:37 1991
--- common/conf.h.dist	Tue Feb 12 10:54:03 1991
***************
*** 201,206 ****
--- 201,215 ----
  /* Things that relate to authentication and access */
  /* Define AUTH to use the proposed NNTP Version 2 authentication protocol. */
  #define	AUTH	
+ 
+ /*
+  * Will we do RFC931 authentication?
+  * If so, the makefiles for nntpd need to be fixed to add -lauthuser.
+  * Currently RFC931 data is just logged. After all, it really can't
+  * be trusted very far.
+  */
+ #define RFC931
+ 
  /*
   * A file containing the name of the host which is running
   * the news server.  This will have to match what rrn thinks,


-- 
Nick Sayer               | Disclaimer: "Don't try this at home, | RIP: Mel Blanc
mrapple at quack.sac.ca.us  | kids. This should only be done by    |   1908-1989
N6QQQ  [44.2.1.17]       | trained, professional idiots."       |  May he never
209-952-5347 (Telebit)   |                     --Plucky Duck    |  be silenced.



More information about the Alt.sources mailing list