aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Sapiro <mark@msapiro.net>2018-03-08 16:00:54 -0800
committerMark Sapiro <mark@msapiro.net>2018-03-08 16:00:54 -0800
commite61719889de7b570adb19af5e223c66f1e09e8bc (patch)
treee68135144f2e9c710c218ee432122a528ec5fcd5
parentf10605db754277a509f99ae35538cd066d0143e2 (diff)
downloadmailman2-e61719889de7b570adb19af5e223c66f1e09e8bc.tar.gz
mailman2-e61719889de7b570adb19af5e223c66f1e09e8bc.tar.xz
mailman2-e61719889de7b570adb19af5e223c66f1e09e8bc.zip
Bad values in topics no longer break the list.
-rwxr-xr-xMailman/MailList.py12
-rw-r--r--NEWS3
2 files changed, 13 insertions, 2 deletions
diff --git a/Mailman/MailList.py b/Mailman/MailList.py
index d1dc17a4..619c3206 100755
--- a/Mailman/MailList.py
+++ b/Mailman/MailList.py
@@ -1,4 +1,4 @@
-# Copyright (C) 1998-2016 by the Free Software Foundation, Inc.
+# Copyright (C) 1998-2018 by the Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -784,8 +784,16 @@ class MailList(HTMLFormatter, Deliverer, ListAdmin,
self.reply_to_address = ''
self.reply_goes_to_list = 0
# Legacy topics may have bad regular expressions in their patterns
+ # Also, someone may have broken topics with, e.g., config_list.
goodtopics = []
- for name, pattern, desc, emptyflag in self.topics:
+ for value in self.topics:
+ try:
+ name, pattern, desc, emptyflag = value
+ except ValueError:
+ # This value is not a 4-tuple. Just log and drop it.
+ syslog('error', 'Bad topic "%s" for list: %s',
+ value, self.internal_name())
+ continue
try:
orpattern = OR.join(pattern.splitlines())
re.compile(orpattern)
diff --git a/NEWS b/NEWS
index 104de16b..4e707a72 100644
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,9 @@ Here is a history of user visible changes to Mailman.
Bug fixes and other patches
+ - Bad values in a list's topics will no longer break everything that
+ might instantiate the list. (LP: #1754516)
+
- A Python 2.7 dependency introduced with the reCAPTCHA feature in 2.1.26
has been removed. (LP: #1752658)