Gnus development mailing list
 help / color / mirror / Atom feed
From: Steinar Bang <sb@metis.no>
Subject: Attempted forced authentication on an NNTP server
Date: 08 Feb 1998 17:53:31 +0100	[thread overview]
Message-ID: <whbtwi11is.fsf@norne.oslo.metis.no> (raw)
In-Reply-To: Steinar Bang's message of "05 Feb 1998 15:54:52 +0100"

[-- Attachment #1: Type: text/plain, Size: 2221 bytes --]

Platform: qgnus 0.22, GNU emacs 19.34, SPARC Solaris 2.5

Attached is an attempt at forcing authinfo on an NNTP server that
doesn't demand it, but allows access to more groups if you
authenticate. 

The questions that the information in this email leads up to, are:
 1. why doesn't this work? (And why doesn't nntp-send-nosy-authinfo
    work either?)
 2. where would be a good place to put the username/password pairs?

OK.  Information follows:

I'm trying to do
	(add-hook 'nntp-server-opened-hook 'nntp-force-unsecure-authinfo)
where nntp-force-unsecure-authinfo is the function in the patch
attached below.

But I get the same kind of flaky behaviour as when I'm using
nntp-send-nosy-authinfo here, ie.: it didn't work at first, I just got
an "error: 411 No such group".

But with nntp-send-nosy-authinfo (after the first demon fetch of mail
and news?), it started asking for username and password on all foreign
NNTP servers after a while.  Maybe this one will start working after a
while, too...?

The problems with this, are:
 1. the flaky behaviour (it doesn't work at first, and then suddenly
    starts working)
 2. asking for username and passwords, makes it impossible to use
    demonical retrieval of mail and news

My "solution" also do what I expect is a no-no: I'm adding new group
parameters.

I suspect this is a no-no for two reasons:
 1. one should not add group parameters beyond the standard ones (at
    least that's what I think larsi told John Prevost a long time
    back) 
 2. one should not put username/password pairs in clear text in files 

My answer to 1 above, is that I have no idea where else to put it.  Is
there a standard file with a standard format that takes tuples of 
	server-name username password
?

My answer to 2 above, is that the NNTP servers I want to access in
this way aren't terribly secure.  They're mainly private discussion
fora that we want to keep away from the eyes of idle net surfers.

As to the question of why I've hacked nntp.el, instead of putting this
in my ~/.emacs or whereever:
 I hated the fact that the cookbook receipe for getting Gnus to work
 with this server was more complex looking than the receipes for
 Agent, Netscape et al.


- Steinar




[-- Attachment #2: force-auth-patch --]
[-- Type: text/plain, Size: 1115 bytes --]

*** nntp.el	1998/02/08 16:27:15	1.1
--- nntp.el	1998/02/08 16:28:08
***************
*** 729,734 ****
--- 729,752 ----
         "^.*\r?\n" "AUTHINFO PASS"
         (buffer-substring (point) (progn (end-of-line) (point)))))))
  
+ (defun nntp-force-unsecure-authinfo ()
+   "If the symbols `authuser' and `authpass' are defined in Group Parameters,
+ send AUTHINFO to the nntp server, whether it asks for it or not.
+ This function is supposed to be called from `nntp-server-opened-hook'.
+ Note that this is not very secure.  Its primary use, is allowing access
+ to unlisted groups on a server that doesn't normally request
+ authentication"
+   (if (and
+        (gnus-group-find-parameter gnus-newsgroup-name 'authuser)
+        (gnus-group-find-parameter gnus-newsgroup-name 'authpass))
+       (progn
+ 	(nntp-send-command
+ 	 "^.*\r?\n" "AUTHINFO USER"
+ 	 (gnus-group-find-parameter gnus-newsgroup-name 'authuser))
+ 	(nntp-send-command
+ 	 "^.*\r?\n" "AUTHINFO PASS"
+ 	 (gnus-group-find-parameter gnus-newsgroup-name 'authpass)))))
+ 
  ;;; Internal functions.
  
  (defun nntp-make-process-buffer (buffer)

  parent reply	other threads:[~1998-02-08 16:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-02-05 14:54 Forcing authentication on a server Steinar Bang
1998-02-05 15:32 ` Andy Eskilsson
1998-02-05 16:38 ` Steinar Bang
1998-02-06 10:09   ` Steinar Bang
1998-02-08 16:53 ` Steinar Bang [this message]
1998-02-08 20:02   ` Attempted forced authentication on an NNTP server Lars Magne Ingebrigtsen
1998-02-09  8:13     ` Steinar Bang
1998-02-09 16:29       ` Steinar Bang
1998-02-10 10:17         ` Lars Magne Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=whbtwi11is.fsf@norne.oslo.metis.no \
    --to=sb@metis.no \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).