summaryrefslogtreecommitdiff
path: root/src/mailman/commands
diff options
context:
space:
mode:
authorBarry Warsaw2015-04-15 00:14:41 -0400
committerBarry Warsaw2015-04-15 00:14:41 -0400
commit3e7dffa750a3e7bb15ac10b711832696554ba03a (patch)
tree2fa2d361385ee5fda45c63f3101020d5fa714561 /src/mailman/commands
parent2d5b67078e68b64543cf0a1ff18c7674ce3bb3e0 (diff)
downloadmailman-3e7dffa750a3e7bb15ac10b711832696554ba03a.tar.gz
mailman-3e7dffa750a3e7bb15ac10b711832696554ba03a.tar.zst
mailman-3e7dffa750a3e7bb15ac10b711832696554ba03a.zip
Prevent replay attacks with the confirmation token.
Diffstat (limited to 'src/mailman/commands')
-rw-r--r--src/mailman/commands/eml_confirm.py2
-rw-r--r--src/mailman/commands/tests/test_confirm.py5
2 files changed, 2 insertions, 5 deletions
diff --git a/src/mailman/commands/eml_confirm.py b/src/mailman/commands/eml_confirm.py
index 2ee48e938..077fab9a6 100644
--- a/src/mailman/commands/eml_confirm.py
+++ b/src/mailman/commands/eml_confirm.py
@@ -53,7 +53,7 @@ class Confirm:
tokens.add(token)
results.confirms = tokens
try:
- succeeded = IRegistrar(mlist).confirm(token)
+ succeeded = (IRegistrar(mlist).confirm(token) is None)
except LookupError:
# The token must not exist in the database.
succeeded = False
diff --git a/src/mailman/commands/tests/test_confirm.py b/src/mailman/commands/tests/test_confirm.py
index 2f6a8088f..98a26bf7d 100644
--- a/src/mailman/commands/tests/test_confirm.py
+++ b/src/mailman/commands/tests/test_confirm.py
@@ -31,7 +31,7 @@ from mailman.interfaces.command import ContinueProcessing
from mailman.interfaces.registrar import IRegistrar
from mailman.interfaces.usermanager import IUserManager
from mailman.runners.command import Results
-from mailman.testing.helpers import get_queue_messages, reset_the_world
+from mailman.testing.helpers import get_queue_messages
from mailman.testing.layers import ConfigLayer
from zope.component import getUtility
@@ -51,9 +51,6 @@ class TestConfirm(unittest.TestCase):
# Clear the virgin queue.
get_queue_messages('virgin')
- def tearDown(self):
- reset_the_world()
-
def test_welcome_message(self):
# A confirmation causes a welcome message to be sent to the member, if
# enabled by the mailing list.