Thread View: news.software.nn
1 messages
1 total messages
Started by Heiko W.Rupp
Mon, 26 Sep 1994 12:45
Authinfo Patch for nn 6.5.0.b3
Author: Heiko W.Rupp
Date: Mon, 26 Sep 1994 12:45
Date: Mon, 26 Sep 1994 12:45
116 lines
3130 bytes
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)
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads