summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorviega1998-06-03 01:36:28 +0000
committerviega1998-06-03 01:36:28 +0000
commit18427cf8d1da60d3f242017aea3689d2be5ffee6 (patch)
treea8deed26c661eeb38adbda175b96f1a1977b4490
parent7060c865a8a20dc921a6ebdd65f57933a34a5b8a (diff)
downloadmailman-18427cf8d1da60d3f242017aea3689d2be5ffee6.tar.gz
mailman-18427cf8d1da60d3f242017aea3689d2be5ffee6.tar.zst
mailman-18427cf8d1da60d3f242017aea3689d2be5ffee6.zip
The guy I got to do a test install once got the following on the admin pages:
File "/usr/lib/python1.5/base64.py", line 32, in decode s = binascii.a2b_base64(line) Error: Incorrect padding So I put a try... except... around the line, and have it return 0 if the exception fires.
-rwxr-xr-xcgi/admin9
1 files changed, 6 insertions, 3 deletions
diff --git a/cgi/admin b/cgi/admin
index 17ff21a47..44505dcaf 100755
--- a/cgi/admin
+++ b/cgi/admin
@@ -21,7 +21,7 @@
To run stand-alone for debugging, set env var PATH_INFO to name of list
and, optionally, options category."""
-__version__ = "$Revision: 655 $"
+__version__ = "$Revision: 686 $"
import sys
import os, cgi, string, crypt, types, time
@@ -100,8 +100,11 @@ def isAuthenticated(list, password=None, SECRET="SECRET"):
if os.environ.has_key('HTTP_COOKIE'):
c = Cookie.Cookie( os.environ['HTTP_COOKIE'] )
if c.has_key(list_name + "-admin"):
- inp = base64.decodestring(c[list_name + "-admin"].value)
- check = md5.new(SECRET+list_name+SECRET).digest()
+ try:
+ inp = base64.decodestring(c[list_name + "-admin"].value)
+ check = md5.new(SECRET+list_name+SECRET).digest()
+ except Error: # the decodestring may return incorrect padding?
+ return 0
if inp == check:
return 1
else: