INN commit: trunk/samples (3 files)

INN Commit Russ_Allbery at isc.org
Fri Sep 26 21:11:02 UTC 2008


    Date: Friday, September 26, 2008 @ 14:11:02
  Author: iulius
Revision: 8051

When authentication fails, return 481 and not 502 in nnrpd hooks.

Modified:
  trunk/samples/nnrpd_auth.pl.in
  trunk/samples/nnrpd_auth.py
  trunk/samples/nnrpd_auth_wrapper.py

-----------------------+
 nnrpd_auth.pl.in      |    2 +-
 nnrpd_auth.py         |   11 ++---------
 nnrpd_auth_wrapper.py |    2 +-
 3 files changed, 4 insertions(+), 11 deletions(-)

Modified: nnrpd_auth.pl.in
===================================================================
--- nnrpd_auth.pl.in	2008-09-26 19:45:47 UTC (rev 8050)
+++ nnrpd_auth.pl.in	2008-09-26 21:11:02 UTC (rev 8051)
@@ -30,7 +30,7 @@
 use vars qw(%attributes %authcodes %users);
 
 # These codes are a widely implemented de facto standard.
-%authcodes = ('allowed' => 281, 'denied' => 502);
+%authcodes = ('allowed' => 281, 'denied' => 481);
 
 # This sub should perform any initialization work that the
 # authentication stuff needs.

Modified: nnrpd_auth.py
===================================================================
--- nnrpd_auth.py	2008-09-26 19:45:47 UTC (rev 8050)
+++ nnrpd_auth.py	2008-09-26 21:11:02 UTC (rev 8051)
@@ -45,16 +45,9 @@
         """This is a good place to initialize variables or open a
            database connection."""
 
-        # Create a list of NNTP codes to respond on connect.
-        self.connectcodes = {   'READPOST':200,
-                                'READ':201,
-                                'AUTHNEEDED':480,
-                                'PERMDENIED':502
-        }
-
         # Create a list of NNTP codes to respond on authentication.
-        self.authcodes = {  'ALLOWED':281,
-                            'DENIED':502
+        self.authcodes = {  'ALLOWED': 281,
+                            'DENIED': 481
         }
 
         syslog('notice', 'nnrpd authentication class instance created')

Modified: nnrpd_auth_wrapper.py
===================================================================
--- nnrpd_auth_wrapper.py	2008-09-26 19:45:47 UTC (rev 8050)
+++ nnrpd_auth_wrapper.py	2008-09-26 21:11:02 UTC (rev 8051)
@@ -35,7 +35,7 @@
         attributes['type'] = buffer('authinfo')
         perm = (self.old).authenticate(attributes)
         err_str = "No error"
-        if perm[0] == 502:
+        if perm[0] == 481:
                 err_str = "Python authentication error!"        
         return (perm[0],err_str)                
 



More information about the inn-committers mailing list