inews -h fails to post when authinfo is required

Julien ÉLIE julien at trigofacile.com
Sun Apr 13 08:06:18 UTC 2008


Hi,

> And what should we do regarding inews?  Shouldn't it also try to
> authenticate if 440 is returned?

In order to be sure we cannot post, I reckon it is better to try :)

===================================================================
--- frontends/inews.c   (révision 7765)
+++ frontends/inews.c   (copie de travail)
@@ -989,8 +989,12 @@
        if ((j = atoi(buff)) != NNTP_BAD_COMMAND_VAL)
            i = j;

-       if (i != NNTP_POSTOK_VAL)
-            die("you do not have permission to post");
+        if (i != NNTP_POSTOK_VAL) {
+            /* We try to authenticate in case it is all the same possible
+             * to post. */
+            if (NNTPsendpassword((char *)NULL, FromServer, ToServer) < 0)
+                die("you do not have permission to post");
+        }
        deadfile = NULL;
     }


Indeed, this code has also the advantage to work with that:

9:59 news at trigofacile ~% telnet localhost 1190
Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
200 test-INN-2.4.4 InterNetNews server INN 2.4.4 (20080411 prerelease) ready
mode reader
201 test-INN-2.4.4 InterNetNews NNRP server INN 2.4.4 (20080411 prerelease) ready (no posting).
post
440 Posting not allowed
authinfo user xxx
381 PASS required
authinfo pass xxx
281 Ok
post
340 Ok, recommended ID <ftsehb$di0$1 at news.trigofacile.com>
.
441 Article has no body -- just headers
quit
205 .



Without the patch, no article can be sent (because of the *201* return answer).
By the way, as we have afterwards *440* (and not 480), inews would also not
have tried to authenticate by itself!

-- 
Julien ÉLIE

« En fait, je n'ai qu'une prétention, c'est de ne pas
  plaire à tout le monde. Plaire à tout le monde, c'est plaire
  à n'importe qui. » (Sacha Guitry) 



More information about the inn-workers mailing list