INN commit: trunk/scripts (innreport_inn.pm)

INN Commit Russ_Allbery at isc.org
Wed Dec 31 18:58:09 UTC 2008


    Date: Wednesday, December 31, 2008 @ 10:58:09
  Author: iulius
Revision: 8269

RFC 4643 states that usernames and passwords can contain spaces.
More generally, they are bytes strings (without NUL, CR and LF).

Now that AUTHINFO SASL is implemented, nnrpd supports that.
This patch fixes the decoding of the news.notice file:  innreport
couldn't see usernames with spaces.

Also see #30 (for AUTHINFO USER/PASS where both usernames
and passwords could contain spaces).

Modified:
  trunk/scripts/innreport_inn.pm

------------------+
 innreport_inn.pm |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

Modified: innreport_inn.pm
===================================================================
--- innreport_inn.pm	2008-12-30 22:24:37 UTC (rev 8268)
+++ innreport_inn.pm	2008-12-31 18:58:09 UTC (rev 8269)
@@ -1243,7 +1243,7 @@
       return 1;
     }
     # times
-    if ($left =~ /(\S+) times user (\S+) system (\S+) elapsed (\S+)$/o) {
+    if ($left =~ /(\S+) times user (.+) system (\S+) elapsed (\S+)$/o) {
       my ($server, $user, $system, $elapsed) = ($1, $2, $3, $4);
       $server = lc $server unless $CASE_SENSITIVE;
       $innxmit_times{$server} += $elapsed;
@@ -1453,7 +1453,7 @@
       return 1;
     }
     # xmit
-    if ($left =~ /(\S+) xmit user (\S+) system (\S+) elapsed (\S+)$/o) {
+    if ($left =~ /(\S+) xmit user (.+) system (\S+) elapsed (\S+)$/o) {
       my ($server, $user, $system, $elapsed) = ($1, $2, $3, $4);
       $server = lc $server unless $CASE_SENSITIVE;
       $nntplink_times{$server} += $elapsed;
@@ -1601,8 +1601,9 @@
     # User not known to the underlying authentication module
     return 1 if $left =~ / ckpasswd: pam_authenticate failed: /o;
     return 1 if $left =~ / ckpasswd: user .+ unknown$/o;
-    # authinfo
-    if ($left =~ /\S+ user (\S+)$/o) {
+    # AUTHINFO (a username is a bytes string)
+    if (($left =~ /\S+ user (.+)$/o) &&
+        ($left !~ /\S+ times user .+ system \S+ idle \S+ elapsed \S+$/o)) {
       my $user = $1;
       $nnrpd_auth{$user}++;
       return 1;
@@ -1635,7 +1636,7 @@
       return 1;
     }
     # times
-    if ($left =~ /(\S+) times user (\S+) system (\S+) idle (\S+) elapsed (\S+)$/o) {
+    if ($left =~ /(\S+) times user (.+) system (\S+) idle (\S+) elapsed (\S+)$/o) {
       my ($cust, $user, $system, $idle, $elapsed) = ($1, $2, $3, $4, $5);
       $cust = lc $cust unless $CASE_SENSITIVE;
       my $dom = &host2dom($cust);
@@ -1794,7 +1795,7 @@
   ## batcher
   if ($prog eq "batcher") {
     # times
-    if ($left =~ /(\S+) times user (\S+) system (\S+) elapsed (\S+)$/o) {
+    if ($left =~ /(\S+) times user (.+) system (\S+) elapsed (\S+)$/o) {
       my ($server, $user, $system, $elapsed) = ($1, $2, $3, $4);
       $server = lc $server unless $CASE_SENSITIVE;
       # $batcher_user{$server} += $user;




More information about the inn-committers mailing list