From 6f4cbaedd49063dcb8b1eab75ede9d0a0ac3b71f Mon Sep 17 00:00:00 2001 From: Joerg Jaspert Date: Fri, 13 Feb 2009 23:05:58 +0100 Subject: [PATCH] whitelist patch this needs module re for now Signed-off-by: Joerg Jaspert --- daklib/regexes.py | 1 + daklib/utils.py | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/daklib/regexes.py b/daklib/regexes.py index 96f6c8e9..ee26430c 100755 --- a/daklib/regexes.py +++ b/daklib/regexes.py @@ -105,4 +105,5 @@ re_gpg_fingerprint = re.compile(r"^fpr:+(.*):$", re.MULTILINE); re_user_address = re.compile(r"^pub:.*<(.*)@.*>.*$", re.MULTILINE); re_user_mails = re.compile(r"^(pub|uid):[^rdin].*<(.*@.*)>.*$", re.MULTILINE); re_user_name = re.compile(r"^pub:.*:(.*)<.*$", re.MULTILINE); +re_re_mark = re.compile(r'^RE:') diff --git a/daklib/utils.py b/daklib/utils.py index 85ef0b55..373910c4 100755 --- a/daklib/utils.py +++ b/daklib/utils.py @@ -37,11 +37,12 @@ import stat import apt_pkg import database import time +import re import email as modemail from dak_exceptions import * from regexes import re_html_escaping, html_escaping, re_single_line_field, \ re_multi_line_field, re_srchasver, re_verwithext, \ - re_parse_maintainer, re_taint_free, re_gpg_uid + re_parse_maintainer, re_taint_free, re_gpg_uid, re_re_mark ################################################################################ @@ -607,11 +608,10 @@ def send_mail (message, filename=""): whitelist = []; whitelist_in = open_file(Cnf["Dinstall::MailWhiteList"]) - RE_mark = re.compile(r'^RE:') try: for line in whitelist_in: - if RE_mark.match(line): - whitelist.append(re.compile(RE_mark.sub("", line.strip(), 1))) + if re_re_mark.match(line): + whitelist.append(re.compile(re_re_mark.sub("", line.strip(), 1))) else: whitelist.append(re.compile(re.escape(line.strip()))) finally: -- 2.39.5