ObIdent: I've finally got a patch to add RFC931 (or whatever) support to News (or rather NNTP v1.5.11). Again it's based on someone else's work (Nick Sayer - nsayer@uop.edu) but I've extended it somewhat. I'll append the patch. Dave ------------------------------------------------------------------------------- Dave Shield Janet: D.T.Shield@uk.ac.liverpool.compsci Dept. of Computer Science, I'net: D.T.Shield@compsci.liverpool.ac.uk Liverpool University, "I _order_ you to help! PO Box 147, You're a machine and you must do Liverpool, L69 3BX what you're told." T. Pratchett, _Diggers_ *** server/access.c.cln Sat Feb 9 19:18:08 1991 --- server/access.c Wed May 26 12:51:39 1993 *************** *** 46,51 **** --- 46,58 ---- 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 **** --- 129,160 ---- if (isupper(*cp)) *cp = tolower(*cp); + #ifdef RFC931 + { + unsigned long in; + unsigned short local; + unsigned short remote; + 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); *** server/common.h.cln Sat Feb 2 21:55:37 1991 --- server/common.h Wed May 26 12:46:06 1993 *************** *** 190,195 **** --- 190,199 ---- extern char hostname[]; extern int debug; + #ifdef RFC931 + extern char username[]; + #endif + #ifdef LOG extern int grps_acsd, arts_acsd; *** server/post.c.cln Sun Dec 23 17:50:02 1990 --- server/post.c Wed May 26 13:07:25 1993 *************** *** 64,70 **** --- 64,75 ---- (void) fflush(stdout); #ifdef LOG + #ifdef RFC931 + syslog(LOG_INFO, "%s post %s (%s)", hostname, + retcode == 1 ? "succeeded" : "failed", username); + #else syslog(LOG_INFO, "%s post %s", hostname, retcode == 1 ? "succeeded" : "failed"); + #endif #endif } *** server/spawn.c.cln Sat Feb 9 00:30:43 1991 --- server/spawn.c Wed May 26 12:50:42 1993 *************** *** 92,97 **** --- 92,105 ---- if (cont_code == CONT_POST) fprintf(fp, "Nntp-Posting-Host: %s\n", hostname); #endif AUTH + #ifdef RFC931 + /* + * If this is a posting, rather than an XFER, mention + * who it really came from. + */ + if (cont_code == CONT_POST) + fprintf(fp, "Nntp-Posting-User: %s\n", username); + #endif RFC931 printf("%d Ok\r\n", cont_code); (void) fflush(stdout); *** common/conf.h.dist Sat Feb 9 00:31:07 1991 --- common/conf.h Wed Jun 9 10:35:49 1993 *************** *** 201,207 **** --- 201,216 ---- /* 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, * too.