summaryrefslogtreecommitdiff
path: root/Mailman/SecurityManager.py
diff options
context:
space:
mode:
authorbwarsaw1999-09-04 03:10:18 +0000
committerbwarsaw1999-09-04 03:10:18 +0000
commita80977720940802b23a994df58e9c72a98e7c5d9 (patch)
treec09adc5024edfa321b90739da2d38d45c2e8475c /Mailman/SecurityManager.py
parentd3219f6279e9e1a6e7978536ff64495b05b75e1c (diff)
downloadmailman-a80977720940802b23a994df58e9c72a98e7c5d9.tar.gz
mailman-a80977720940802b23a994df58e9c72a98e7c5d9.tar.zst
mailman-a80977720940802b23a994df58e9c72a98e7c5d9.zip
Diffstat (limited to 'Mailman/SecurityManager.py')
-rw-r--r--Mailman/SecurityManager.py20
1 files changed, 9 insertions, 11 deletions
diff --git a/Mailman/SecurityManager.py b/Mailman/SecurityManager.py
index 4654aa513..97f81b459 100644
--- a/Mailman/SecurityManager.py
+++ b/Mailman/SecurityManager.py
@@ -53,18 +53,17 @@ class SecurityManager:
# Configurable, however, we don't pass this back in GetConfigInfo
# because it's a special case as it requires confirmation to change.
self.password = crypted_password
-
# Non configurable
self.passwords = {}
def ValidAdminPassword(self, pw):
if self.CheckSiteAdminPassword(pw):
return 1
- return ((type(pw) == types.StringType) and
- (Crypt.crypt(pw, self.password) == self.password))
+ return type(pw) == types.StringType and \
+ Crypt.crypt(pw, self.password) == self.password
def ConfirmAdminPassword(self, pw):
- if(not self.ValidAdminPassword(pw)):
+ if not self.ValidAdminPassword(pw):
raise Errors.MMBadPasswordError
return 1
@@ -109,10 +108,9 @@ class SecurityManager:
# TBD: At least some versions of MS Internet Explorer stores cookies
# without the double quotes. This has been verified for MSIE 4.01,
# although MSIE 5 is fixed. The bug (see PR#80) is that if these
- # double quotes are missing, the cookie data does not unpickle
- # into the list that we expect. The kludge given here (slightly
- # modified) was initially provided by Evaldas Auryla
- # <evaldas.auryla@pheur.org>
+ # double quotes are missing, the cookie data does not unpickle into
+ # the list that we expect. The kludge given here (slightly modified)
+ # was initially provided by Evaldas Auryla <evaldas.auryla@pheur.org>
#
## self.LogMsg('debug', 'Browser Cookie: ' + cookiedata)
keylen = len(key)
@@ -168,10 +166,10 @@ class SecurityManager:
def ExtractApproval(self, msg):
"""True if message has valid administrator approval.
- Approval line is always stripped from message as a side effect."""
-
+ Approval line is always stripped from message as a side effect.
+ """
p = msg.getheader('approved')
- if p == None:
+ if p is None:
return 0
del msg['approved'] # Mustn't deliver this line!!
return self.ValidAdminPassword(p)