INN commit: trunk/nnrpd (commands.c)

INN Commit Russ_Allbery at isc.org
Tue Aug 26 19:04:33 UTC 2008


    Date: Tuesday, August 26, 2008 @ 12:04:33
  Author: iulius
Revision: 7975

MODE READER cannot be used after a successful authentication.

Modified:
  trunk/nnrpd/commands.c

------------+
 commands.c |   15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

Modified: commands.c
===================================================================
--- commands.c	2008-08-26 18:51:43 UTC (rev 7974)
+++ commands.c	2008-08-26 19:04:33 UTC (rev 7975)
@@ -301,12 +301,17 @@
 CMDmode(int ac UNUSED, char *av[])
 {
     if (strcasecmp(av[1], "reader") == 0)
-	Reply("%d %s InterNetNews NNRP server %s ready (%s).\r\n",
-	       PERMcanpost ? NNTP_OK_BANNER_POST : NNTP_OK_BANNER_NOPOST,
-               PERMaccessconf->pathhost, INN_VERSION_STRING,
-	       PERMcanpost ? "posting ok" : "no posting");
+        if (PERMcanauthenticate) {
+            Reply("%d %s InterNetNews NNRP server %s ready (%s).\r\n",
+                   PERMcanpost ? NNTP_OK_BANNER_POST : NNTP_OK_BANNER_NOPOST,
+                   PERMaccessconf->pathhost, INN_VERSION_STRING,
+                   PERMcanpost ? "posting ok" : "no posting");
+        } else {
+            /* AUTHINFO has already been successfully used. */
+            Reply("%d Permission denied\r\n", NNTP_ERR_ACCESS);
+        }
     else
-	Reply("%d What?\r\n", NNTP_ERR_SYNTAX);
+        Reply("%d What?\r\n", NNTP_ERR_SYNTAX);
 }
 
 static int GroupCompare(const void *a1, const void* b1) {



More information about the inn-committers mailing list