aboutsummaryrefslogtreecommitdiffstats
path: root/Mailman/MTA/Utils.py
diff options
context:
space:
mode:
authorMark Sapiro <mark@msapiro.net>2008-06-30 08:32:26 -0700
committerMark Sapiro <mark@msapiro.net>2008-06-30 08:32:26 -0700
commit3f53fd904700c5878733d39bec5aac89070257f5 (patch)
treec5d3827444c7c78e8f17d1bb52aefe2c56a84270 /Mailman/MTA/Utils.py
parent262a617078d67cde8c30624272fa4ebefe2e572f (diff)
downloadmailman2-3f53fd904700c5878733d39bec5aac89070257f5.tar.gz
mailman2-3f53fd904700c5878733d39bec5aac89070257f5.tar.xz
mailman2-3f53fd904700c5878733d39bec5aac89070257f5.zip
- Bumped version to 2.1.11.
- Changed MailList.Create() to check that list name contains only characters that match the new mm_cfg.ACCEPTABLE_LISTNAME_CHARACTERS. - Changed MTA.Utils.makealiases() to escape a few characters in the list name in the pipe command.
Diffstat (limited to 'Mailman/MTA/Utils.py')
-rw-r--r--Mailman/MTA/Utils.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/Mailman/MTA/Utils.py b/Mailman/MTA/Utils.py
index 14562de6..07d8bcad 100644
--- a/Mailman/MTA/Utils.py
+++ b/Mailman/MTA/Utils.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2001,2002 by the Free Software Foundation, Inc.
+# Copyright (C) 2001-2008 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
@@ -17,6 +17,7 @@
"""Utilities for list creation/deletion hooks."""
import os
+import re
import pwd
from Mailman import mm_cfg
@@ -45,13 +46,17 @@ def _makealiases_mailprog(listname):
# backwards compatibility and may eventually go away (we really have no
# need for the -admin address anymore).
#
+ # We escape a few special characters in the list name in the pipe command
+ # to avoid characters that might split the pipe into two commands.
+ safename = re.sub('([;|&`$])', r'\\\1', listname)
+ #
# Seed this with the special cases.
- aliases = [(listname, '"|%s post %s"' % (wrapper, listname)),
+ aliases = [(listname, '"|%s post %s"' % (wrapper, safename)),
]
for ext in ('admin', 'bounces', 'confirm', 'join', 'leave', 'owner',
'request', 'subscribe', 'unsubscribe'):
aliases.append(('%s-%s' % (listname, ext),
- '"|%s %s %s"' % (wrapper, ext, listname)))
+ '"|%s %s %s"' % (wrapper, ext, safename)))
return aliases