[Python-bugs-list] [Bug #123625] "authinfo" belongs before "mode reader" in nntplib.py

noreply@sourceforge.net noreply@sourceforge.net
Wed, 03 Jan 2001 15:52:51 -0800


Bug #123625, was updated on 2000-Nov-27 12:20
Here is a current snapshot of the bug.

Project: Python
Category: Python Library
Status: Open
Resolution: None
Bug Group: None
Priority: 5
Submitted by: mogul
Assigned to : twouters
Summary: "authinfo" belongs before "mode reader" in nntplib.py

Details: On some secure news servers (Netcape Collabra in this case), a
client cannot even set "mode reader" before providing authentication
information.  If you have Mailman attempt to gate news from such a server,
it will error with an entry such as this in the logs: 

Nov 27 11:01:44 2000 gate_news(9768): Traceback (innermost last):
Nov 27 11:01:44 2000 gate_news(9768):   File
"/usr/share/mailman/cron/gate_news", line 222, in ?
Nov 27 11:01:44 2000 gate_news(9768):      main()
Nov 27 11:01:44 2000 gate_news(9768):   File
"/usr/share/mailman/cron/gate_news", line 203, in main
Nov 27 11:01:44 2000 gate_news(9768):      process_lists(lock)
Nov 27 11:01:44 2000 gate_news(9768):   File
"/usr/share/mailman/cron/gate_news", line 148, in process_lists
Nov 27 11:01:44 2000 gate_news(9768):      conn, first, last =
open_newsgroup(mlist)
Nov 27 11:01:44 2000 gate_news(9768):   File
"/usr/share/mailman/cron/gate_news", line 75, in open_newsgroup
Nov 27 11:01:44 2000 gate_news(9768):      password=mm_cfg.NNTP_PASSWORD)
Nov 27 11:01:44 2000 gate_news(9768):   File
"/usr/share/mailman/Mailman/pythonlib/nntplib.py", line 117, in __init__
Nov 27 11:01:44 2000 gate_news(9768):      self.welcome =
self.shortcmd('mode reader')
Nov 27 11:01:44 2000 gate_news(9768):   File
"/usr/share/mailman/Mailman/pythonlib/nntplib.py", line 210, in shortcmd
Nov 27 11:01:44 2000 gate_news(9768):      return self.getresp()
Nov 27 11:01:44 2000 gate_news(9768):   File
"/usr/share/mailman/Mailman/pythonlib/nntplib.py", line 184, in getresp
Nov 27 11:01:44 2000 gate_news(9768):      raise NNTPTemporaryError(resp)
Nov 27 11:01:44 2000 gate_news(9768): Mailman.pythonlib.nntplib .
NNTPTemporaryError :  480 Authentication required for command 


My solution: Move these lines...

	if readermode:
		try:
                         	self.welcome = self.shortcmd('mode reader')
	except NNTPPermanentError:
	# error 500, probably 'not implemented'
            		pass

to the end of NNTP's constructor, in other words, after the authinfo
exchange is done.

Bret

Follow-Ups:

Date: 2001-Jan-03 15:52
By: twouters

Comment:
It's not so simple :-( I already forgot all this stuff again, but here's
what I remember: The reader-mode isn't covered by the RFC on NNTP (which is
pretty old) but is basically yet another addition by INN (IIRC, that is).
We had one particular setup where readmode really was necessary before
anything else, including, IIRC, authinfo. That was because the nnrpd that
could handle all that wasn't spawned until you gave the 'mode reader'
command, and it couldn't pass that info. However, I need to doublecheck to
be sure. I think we dropped most of that intricate setup when we built our
new set of top-of-the-line newsservers using Diablo rather than INN.

I'll consult with a couple of local news guru's tomorrow, see if I'm not
remembering wrong. If I'm not, we may have to do some dancing around by
sending readermode, catching autherror, and re-sending after authinfo in
that case.

-------------------------------------------------------

Date: 2001-Jan-03 14:08
By: gvanrossum

Comment:
Thomas, you seem to be the author of the readermode code.

I was going to just check in the suggested change, but when I read the CVS
logs, it mentioned that "mode reader" was sent before authentication, so
perhaps there's a reason.

If you agree with the suggestion here, please go ahead and check it in --
no need to go through the patch manager.
-------------------------------------------------------

Date: 2001-Jan-02 22:30
By: bwarsaw

Comment:
This is more accurately a bug in Python's nntplib.py
-------------------------------------------------------

For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=123625&group_id=5470