INN commit: trunk (lib/sendpass.c scripts/inncheck.in)

INN Commit rra at isc.org
Thu Jul 7 11:43:41 UTC 2011


    Date: Thursday, July 7, 2011 @ 04:43:41
  Author: iulius
Revision: 9229

improve checks on passwd.nntp

Improve the error message when the parsed lined is in wrong format:
"Argument list too long" (E2BIG) instead of "Numerical argument out
of domain" (EDOM).

Also catch a new kind of error in passwd.nntp:  any line prior to a matching
<hostname>, which is not empty or starts with a hash, but contains a third
colon somewhere that is not followed by "authinfo".

Thanks to Florian Schlichting for the patch.

Modified:
  trunk/lib/sendpass.c
  trunk/scripts/inncheck.in

---------------------+
 lib/sendpass.c      |    2 +-
 scripts/inncheck.in |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Modified: lib/sendpass.c
===================================================================
--- lib/sendpass.c	2011-07-07 11:12:26 UTC (rev 9228)
+++ lib/sendpass.c	2011-07-07 11:43:41 UTC (rev 9229)
@@ -62,7 +62,7 @@
 	if ((style = strchr(pass, ':')) != NULL) {
 	    *style++ = '\0';
 	    if (strcmp(style, "authinfo") != 0) {
-		errno = EDOM;
+		errno = E2BIG;
 		break;
 	    }
 	}

Modified: scripts/inncheck.in
===================================================================
--- scripts/inncheck.in	2011-07-07 11:12:26 UTC (rev 9228)
+++ scripts/inncheck.in	2011-07-07 11:43:41 UTC (rev 9229)
@@ -890,7 +890,7 @@
     input: while ( <$IN> ) {
 	next input if &spacious($file, ++$line);
 
-	unless ( ($name, $pass) = /[\w\-\.]+:(.*):(.*)(:authinfo)?$/ ) {
+	unless ( ($name, $pass) = /[\w\-\.]+:([^:]*):([^:]*)(:authinfo)?$/ ) {
 	    eprint "$file:$line: malformed line.\n";
 	    next input;
 	}




More information about the inn-committers mailing list