🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nn
Article #6452

Authinfo Patch for nn 6.5.0.b3

#6452
From: Heiko W.Rupp
Date: Mon, 26 Sep 1994 12:45
116 lines
3130 bytes
Hi,
I here have a little patch, which allows nn to read news from Servers
which protect some/all groups via authinfo from INN.

To use the authinfo, one needs to have a file ~/.nn/authinfo which
contains the following data

user<blank>pass<return>

Here user is the username to authenticate and pass the password.
Normally these must be checked with the news administrator.
If the file does not exist, nn works as usual.


*** nntp.c,1	Mon Sep 19 21:04:28 1994
--- nntp.c	Wed Sep 21 18:08:26 1994
***************
*** 473,483 ****
--- 473,488 ----
  	msg("Connecting to NNTP server %s ... ok (%s)",
  	    nntp_server, can_post ? "posting is allowed" : "no posting");
  
+ 
      is_connected = 1;
      group_is_set = 0;
      nntp_failed = 0;
      try_again = 0;
+ #ifdef NNTP
+ 	return send_user_info();	
+ #else
      return 0;
+ #endif
  }
  
  
***************
*** 1189,1195 ****
  struct novgroup *
  nntp_get_overview(gh, first, last)
  group_header *gh;
! article_number first, last;
  {
    int	n;
  
--- 1194,1201 ----
  struct novgroup *
  nntp_get_overview(gh, first, last)
  group_header *gh;
! /* article_number first, last; */
! int first, last;
  {
    int	n;
  
***************
*** 1278,1283 ****
--- 1284,1338 ----
  }
  
  #endif /* NOV */
+ 
+ 
+ 
+ int send_user_info()
+ {
+ 	int n;
+ 
+ 	char auth_path[255];
+ 	char auth_user[50],auth_pass[50];
+ 	FILE *fp;
+ 
+ 	fp=fopen(relative(nn_directory, "authinfo"),"r");
+ 	if (fp!=NULL) {
+ 		int i,j;
+ 		n=0;i=0;
+ 		while((i=fgetc(fp))!=EOF) {
+ 			if (i==' ') {
+ 				auth_user[n]='\0';
+ 				break;
+ 			}
+ 			auth_user[n++]=(char)i;
+ 		}
+ 		auth_user[n]='\0';
+ 
+ 		n=0;
+ 		while((i=fgetc(fp))!=EOF) {
+ 			if (i=='\n') {
+ 				auth_pass[n]='\0';
+ 				break;
+ 			}
+ 			auth_pass[n++]=(char)i;
+ 		}
+ 		fclose(fp);
+ 
+ 		ask_server("authinfo user %s", auth_user);
+ 		n = ask_server("authinfo pass %s", auth_pass);	
+ 
+ 		if (n== 281) { /* OK */
+ 			msg(" Authentication to server succesfull ");
+ 		}
+ 		else {
+ 			msg (" Authentication to server unsuccesfull ");
+ 			return -1;
+ 		}
+ 			
+ 	}
+ 			return 0;
+ }
+ 
  
  #endif /* NNTP */
  

-- 
Heiko W.Rupp        Gerwigstr.5        D-76131  Karlsruhe    +49 721 9661521
Usenet is "the last uncensored mass medium."
      - Steve Crocker (aq817@cleveland.Freenet.Edu)
Technical Details
Message-ID: <366fq7$f2d@pilhuhn.pilhuhn.sub.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.nn.mbox.zip!bga.com!news.sprintlink.net!howland.reston.ans.net!swiss.ans.net!news.dfn.de!news.belwue.de!news.uni-ulm.de!rz.uni-karlsruhe.de!subnet.sub.net!flatlin!snert!not-4-mail

Show Full Headers
Complete Article Headers
Message-ID: <366fq7$f2d@pilhuhn.pilhuhn.sub.org>
Subject: Authinfo Patch for nn 6.5.0.b3
Date: Mon, 26 Sep 1994 12:45:59 +0000
From: hwr@pilhuhn.de (Heiko W.Rupp)
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.nn.mbox.zip!bga.com!news.sprintlink.net!howland.reston.ans.net!swiss.ans.net!news.dfn.de!news.belwue.de!news.uni-ulm.de!rz.uni-karlsruhe.de!subnet.sub.net!flatlin!snert!not-4-mail
Newsgroups: news.software.nn
Organization: The Home Of The Pilhuhn
Lines: 116
Reply-To: hwr@pilhuhn.sub.org
NNTP-Posting-Host: pilhuhn.de