diff options
| author | viega | 1998-06-14 18:01:14 +0000 |
|---|---|---|
| committer | viega | 1998-06-14 18:01:14 +0000 |
| commit | 7db9c87dca513d5662e36465994bf460c2cef17c (patch) | |
| tree | d486385ae051dba4d5a94576e2f303ac020020c6 /modules/Cgi/private.py | |
| parent | 2b3256843447fa2d17cb47fa1aa67462d9f45dd8 (diff) | |
| download | mailman-7db9c87dca513d5662e36465994bf460c2cef17c.tar.gz mailman-7db9c87dca513d5662e36465994bf460c2cef17c.tar.zst mailman-7db9c87dca513d5662e36465994bf460c2cef17c.zip | |
From the error message, and what I've learned about base64, my best
guess about the transient errors (ie, some people get them, some
people do not) is that sometimes the base64 encoding can cause \n's to
get in the string, which the mime stuff will treat as a newline. So I
replace \n w/ @ before putting it in the cookie, and do the reverse
before checking the cookie. Hopefully we won't hear about this
problem again.
Diffstat (limited to 'modules/Cgi/private.py')
| -rwxr-xr-x | modules/Cgi/private.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/Cgi/private.py b/modules/Cgi/private.py index 4a06a7270..eb1352ded 100755 --- a/modules/Cgi/private.py +++ b/modules/Cgi/private.py @@ -110,7 +110,7 @@ def isAuthenticated(list_name): if c.has_key(list_name): # The user has a token like 'c++-sig=AE23446AB...'; verify # that it's correct. - token = c[list_name].value + token = string.replace(c[list_name].value,"@","\n") import base64, md5 if base64.decodestring(token) != md5.new(SECRET + list_name @@ -152,7 +152,7 @@ def isAuthenticated(list_name): import base64, md5 token = md5.new(SECRET + list_name + SECRET).digest() token = base64.encodestring(token) - token = string.strip(token) + token = string.replace(token, "\n", "@") c = Cookie.Cookie() c[list_name] = token print c # Output the cookie |
