Репозитории ALT
S: | 2.1.39-alt1 |
5.1: | 2.1.12-alt2 |
4.1: | 2.1.10-alt0.3.1.M41.1 |
4.0: | 2.1.9-alt6.M40.1 |
3.0: | 2.1.6-alt1 |
Группа :: Система/Серверы
Пакет: mailman
Главная Изменения Спек Патчи Sources Загрузить Gear Bugs and FR Repocop
Патч: mailman-2.1.9-deb-70_invalid_utf8_dos.patch
Скачать
Скачать
Patch: 70_invalid_utf8_dos.patch
Author: Lionel Elie Mamane <lionel@mamane.lu>
Avoid DOS if attachement filename is invalid Unicode string
Index: Mailman/Handlers/Scrubber.py
===================================================================
--- Mailman/Handlers/Scrubber.py.orig 2006-08-15 15:14:15.000000000 +0800
+++ Mailman/Handlers/Scrubber.py 2006-08-15 15:14:54.000000000 +0800
@@ -302,7 +302,10 @@
finally:
os.umask(omask)
desc = part.get('content-description', _('not available'))
- filename = part.get_filename(_('not available'))
+ try:
+ filename = part.get_filename(_('not available'))
+ except UnicodeDecodeError:
+ filename = _('not available')
filename = Utils.oneline(filename, lcset)
replace_payload_by_text(part, _("""\
A non-text attachment was scrubbed...
@@ -412,7 +415,10 @@
ctype = msg.get_content_type()
# i18n file name is encoded
lcset = Utils.GetCharSet(mlist.preferred_language)
- filename = Utils.oneline(msg.get_filename(''), lcset)
+ try:
+ filename = Utils.oneline(msg.get_filename(''), lcset)
+ except UnicodeDecodeError:
+ filename = ''
fnext = os.path.splitext(filename)[1]
# For safety, we should confirm this is valid ext for content-type
# but we can use fnext if we introduce fnext filtering
@@ -438,7 +444,10 @@
try:
# Now base the filename on what's in the attachment, uniquifying it if
# necessary.
- filename = msg.get_filename()
+ try:
+ filename = msg.get_filename()
+ except UnicodeDecodeError:
+ filename = None
if not filename or mm_cfg.SCRUBBER_DONT_USE_ATTACHMENT_FILENAME:
filebase = 'attachment'
else: