HELP! Auth bug in tin 2.4 ?
Hi! I am experimenting with USENET again - after a 20 year gap - and have both built tin 2.4.0 and also used the version from brew.sh / Homebrew on OSX. I have a INN server with the capabilities below*, and something about them seems to trigger Tin into believing that the server needs/wants the user to authenticate; entering a blank username and password causes Tin to disconnect and quit. I can guarantee that authentication is not needed - I run the server - and that slrn, gnus, nn, seamonkey all work fine. Presumably something about the capabilities is triggering the authentication code. I ran dtruss on the execution of tin to establish how far in the connection process it gets, which I have recreated below. Is there a way to convince Tin that auth is not required? I skimmed auth.c and found the following comment: * At this point, either authentication with username/password pair from * .newsauth has failed or there's no .newsauth file respectively no * matching username/password for the current server. If we are not at * startup we ask the user to enter such a pair by hand. Don't ask him * at startup except if requested by -A option because if he doesn't need * to authenticate (we don't know), the "Server expects authentication" * messages are annoying (and even wrong). * UNSURE: Maybe we want to make this decision configurable in the * options menu, too, so that the user doesn't need -A. * TODO: Put questions into do_authinfo_user() because it is possible * that the server doesn't want a password; so only ask for it if needed. ...but I can't establish the current / expected behaviour from the code. Thanks! - alec -- *for reference 200 usenet InterNetNews server INN 2.6.0 ready (transit mode) CAPABILITIES 101 Capability list: VERSION 2 IMPLEMENTATION INN 2.6.0 AUTHINFO USER MODE-READER . MODE READER 200 usenet InterNetNews NNRP server INN 2.6.0 ready (posting ok) CAPABILITIES 101 Capability list: VERSION 2 IMPLEMENTATION INN 2.6.0 AUTHINFO SASL HDR LIST ACTIVE ACTIVE.TIMES COUNTS DISTRIB.PATS DISTRIBUTIONS HEADERS MODERATORS MOTD NEWSGROUPS OVERVIEW.FMT SUBSCRIPTIONS OVER POST READER SASL DIGEST-MD5 NTLM CRAM-MD5 STARTTLS . -- http://dropsafe.crypticide.com/aboutalecm
On Wed, Sep 21, 2016 at 02:33:22PM +0100, Alec Muffett wrote:
I ran dtruss on the execution of tin to establish how far in the connection process it gets, which I have recreated below.
Is there a way to convince Tin that auth is not required?
no, but if you run tin in debug mode ("-D 1") the reason for trying to auth should show up in the log.
no, but if you run tin in debug mode ("-D 1") the reason for trying to auth should show up in the log.
Hi Urs! This appears substantially similar to what I sent previously. The message "nntp_open() authenticate()" corresponds with auth.c line 1432 ...and if I read it right it has decided to authenticate on the basis of: if (force_auth_on_conn_open || (nntp_caps.type == CAPABILITIES && !nntp_caps.reader && (nntp_caps.authinfo_user || (nntp_caps.authinfo_sasl & SASL_PLAIN)))) Adding some extra debug statements shows that this expression evaluates to True because all of: * nntp_caps.type == CAPABILITIES * !nntp_caps.reader * nntp_caps.authinfo_user ...are true (and the other expressions are false) but I don't follow why this tuple of booleans should require Tin to authenticate? There is a comment in the code: * If the user wants us to authenticate on connection startup, do it now. * Some news servers return "201 no posting" first, but after successful * authentication you get a "200 posting allowed". To find out if we are * allowed to post after authentication issue a "MODE READER" again and * interpret the response code. ...but again this seems not relevant to the situation? I am wondering whether this is a bug/not commonly encountered case, because I am connecting to INN from an IP which also _feeds_ the server, so article Feeding requires Auth but article Reading/Posting does not? That might line up because, Gnus, etc, all do MODE READER and _then_ check whether they need to authenticate - which, in this case, they do not. -a nntp_open() BEGIN nntp_open() usenet:119 <<< [16:22:36.471330] 200 usenet InterNetNews server INN 2.6.0 ready (transit mode) nntp_open() usenet InterNetNews server INN 2.6.0 ready (transit mode) new_nntp_command(CAPABILITIES)
[16:22:36.472123] CAPABILITIES <<< [16:22:36.664325] 101 Capability list: new_nntp_command(CAPABILITIES) OK <<< [16:22:36.690737] VERSION 2 <<< [16:22:36.690945] IMPLEMENTATION INN 2.6.0 <<< [16:22:36.691058] AUTHINFO USER <<< [16:22:36.691162] MODE-READER nntp_open() authenticate() nntp_open() MODE READER [16:22:36.691528] MODE READER <<< [16:22:37.959359] 200 usenet InterNetNews NNRP server INN 2.6.0 ready (posting ok) new_nntp_command(CAPABILITIES) [16:22:37.960847] CAPABILITIES <<< [16:22:38.092218] 101 Capability list: new_nntp_command(CAPABILITIES) OK <<< [16:22:38.119069] VERSION 2 <<< [16:22:38.119294] IMPLEMENTATION INN 2.6.0 <<< [16:22:38.145393] AUTHINFO SASL <<< [16:22:38.145623] HDR <<< [16:22:38.145822] LIST ACTIVE ACTIVE.TIMES COUNTS DISTRIB.PATS DISTRIBUTIONS HEADERS MODERATORS MOTD NEWSGROUPS OVERVIEW.FMT SUBSCRIPTIONS <<< [16:22:38.145961] OVER <<< [16:22:38.146076] POST <<< [16:22:38.146204] READER <<< [16:22:38.146329] SASL DIGEST-MD5 NTLM CRAM-MD5 <<< [16:22:38.146462] STARTTLS authorization failed nntp_close() END nntp_command(QUIT) [16:22:41.994303] QUIT <<< [16:22:42.128402] 205 Bye! nntp_command(QUIT) OK
On Wed, Sep 21, 2016 at 05:45:03PM +0100, Alec Muffett wrote:
The message "nntp_open() authenticate()" corresponds with auth.c line 1432
...and if I read it right it has decided to authenticate on the basis of:
if (force_auth_on_conn_open || (nntp_caps.type == CAPABILITIES && !nntp_caps.reader && (nntp_caps.authinfo_user || (nntp_caps.authinfo_sasl & SASL_PLAIN))))
Adding some extra debug statements shows that this expression evaluates to True because all of:
* nntp_caps.type == CAPABILITIES * !nntp_caps.reader * nntp_caps.authinfo_user
...are true (and the other expressions are false) but I don't follow why this tuple of booleans should require Tin to authenticate?
in transit mode tin does expect AUTHINFO to have an agrument listed in the CAPABILITIES response (as in RFC 4643 2.1): | The server MAY list the AUTHINFO capability with no arguments, which | indicates that it complies with this specification and does not | permit any authentication commands in its current state. In this | case, the client MUST NOT attempt to utilize any AUTHINFO commands, | even if it contains logic that might otherwise cause it to do so the nntp dialog then looks like
[21:34:09.288267] CAPABILITIES <<< [21:34:09.289039] 101 Capability list: <<< [21:34:09.328976] VERSION 2 <<< [21:34:09.329151] IMPLEMENTATION INN 2.6.0 <<< [21:34:09.329291] AUTHINFO <<< [21:34:09.329399] IHAVE <<< [21:34:09.329516] LIST ACTIVE ACTIVE.TIMES MOTD NEWSGROUPS <<< [21:34:09.329638] MODE-READER <<< [21:34:09.329751] STREAMING [21:34:09.329965] MODE READER <<< [21:34:09.376830] 200 ok [21:34:09.377109] CAPABILITIES [...]
the logic should probabely be more like [nntplib.c:nntp_open() ~1432]: if (nntp_caps.type == CAPABILITIES && !nntp_caps.reader) { if (nntp_caps.mode_reader) { char buf[NNTP_STRLEN]; put_server("MODE READER"); switch (get_only_respcode(buf, sizeof(buf))) { case ERR_GOODBYE: case ERR_ACCESS: return -1; default: break; } check_extensions(); } if (force_auth_on_conn_open) { if (!authenticate(nntp_server, userid, FALSE)) return -1; check_extensions(); } /* ... */ could you try the attached patch?
could you try the attached patch?
It now connects and appears to function. -a -- http://dropsafe.crypticide.com/aboutalecm
On 22 September 2016 at 21:00, Alec Muffett <alec.muffett@gmail.com> wrote:
could you try the attached patch?
It now connects and appears to function.
Confirming: it does appear to work, and for reference here is the new NNTP debug. -a nntp_open() BEGIN nntp_open() usenet:119 <<< [07:22:41.180603] 200 usenet InterNetNews server INN 2.6.0 ready (transit mode) nntp_open() usenet InterNetNews server INN 2.6.0 ready (transit mode) new_nntp_command(CAPABILITIES)
[07:22:41.183019] CAPABILITIES <<< [07:22:41.303691] 101 Capability list: new_nntp_command(CAPABILITIES) OK <<< [07:22:41.351593] VERSION 2 <<< [07:22:41.351813] IMPLEMENTATION INN 2.6.0 <<< [07:22:41.352087] AUTHINFO USER <<< [07:22:41.352288] MODE-READER nntp_open() MODE READER [07:22:41.352517] MODE READER <<< [07:22:42.585521] 200 usenet InterNetNews NNRP server INN 2.6.0 ready (posting ok) new_nntp_command(CAPABILITIES) [07:22:42.586943] CAPABILITIES <<< [07:22:42.708201] 101 Capability list: new_nntp_command(CAPABILITIES) OK <<< [07:22:42.759884] VERSION 2 <<< [07:22:42.760058] IMPLEMENTATION INN 2.6.0 <<< [07:22:42.781026] AUTHINFO SASL <<< [07:22:42.781181] HDR <<< [07:22:42.781349] LIST ACTIVE ACTIVE.TIMES COUNTS DISTRIB.PATS DISTRIBUTIONS HEADERS MODERATORS MOTD NEWSGROUPS OVERVIEW.FMT SUBSCRIPTIONS <<< [07:22:42.781486] OVER <<< [07:22:42.782045] POST <<< [07:22:42.782299] READER <<< [07:22:42.782406] SASL DIGEST-MD5 NTLM CRAM-MD5 <<< [07:22:42.782547] STARTTLS new_nntp_command(LIST MOTD) [07:22:42.782786] LIST MOTD <<< [07:22:42.897227] 503 No message of the day available new_nntp_command(LIST MOTD) NOT_OK - Expected: 215, got: 503 ACTIVE host=[usenet] time=[1474615338] nntp_command(LIST OVERVIEW.FMT) [07:22:42.898907] LIST OVERVIEW.FMT <<< [07:22:43.017016] 215 Order of fields in overview database nntp_command(LIST OVERVIEW.FMT) OK ...
participants (2)
-
Alec Muffett -
Urs Janßen