Your message dated Sat, 02 May 2009 00:07:12 +0200
with message-id <[email protected]>
and subject line Re: Bug#526128: dak considers empty lines to match anything, 
on mail-whitelist
has caused the Debian Bug report #526128,
regarding dak considers empty lines to match anything, on mail-whitelist
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
526128: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=526128
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: dak
Severity: critical

Hello,

I'm working on a dak setup, and caused some massive mailing to happen
because of this bug, unfortunaltely. My mail-whitelist file had only my
own address, and a blank line. The problem is that the blank line
apparently matched everything, so lots of people got mails =(.

The attached patch seems to fix it, though maybe there's a cleaner
solution you can think of.

Thanks,

-- 
Gustavo Noronha Silva <[email protected]>
Collabora Ltd.
diff --git a/daklib/utils.py b/daklib/utils.py
index 651e13a..2997b76 100755
--- a/daklib/utils.py
+++ b/daklib/utils.py
@@ -618,7 +618,7 @@ def send_mail (message, filename=""):
             for line in whitelist_in:
                 if re_re_mark.match(line):
                     whitelist.append(re.compile(re_re_mark.sub("", line.strip(), 1)))
-                else:
+                elif line.strip():
                     whitelist.append(re.compile(re.escape(line.strip())))
         finally:
             whitelist_in.close()

--- End Message ---
--- Begin Message ---
> Severity: critical

This *never* matched this severity.

> I'm working on a dak setup, and caused some massive mailing to happen
> because of this bug, unfortunaltely. My mail-whitelist file had only my
> own address, and a blank line. The problem is that the blank line
> apparently matched everything, so lots of people got mails =(.

> The attached patch seems to fix it, though maybe there's a cleaner
> solution you can think of.

git commit 8429e76474a3ee3efa00509424172a2f31faa26d

index ee26430..6fd0c81 100755
--- a/daklib/regexes.py
+++ b/daklib/regexes.py
@@ -35,6 +35,7 @@ re_fdnic = re.compile(r"\n\n")
 re_bin_only_nmu = re.compile(r"\+b\d+$")
 
 re_comments = re.compile(r"\#.*")
+re_whitespace_comment = re.compile(r"^\s*(#|$)")
 re_no_epoch = re.compile(r"^\d+\:")
 re_no_revision = re.compile(r"-[^-]+$")
 re_arch_from_filename = re.compile(r"/binary-[^/]+/")
diff --git a/daklib/utils.py b/daklib/utils.py
index c40fe8e..951270b 100755
--- a/daklib/utils.py
+++ b/daklib/utils.py
@@ -43,7 +43,8 @@ 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_re_mark
+                    re_parse_maintainer, re_taint_free, re_gpg_uid, 
re_re_mark, \
+                    re_whitespace_comment
 
 
################################################################################
 
@@ -616,10 +617,11 @@ def send_mail (message, filename=""):
         whitelist_in = open_file(Cnf["Dinstall::MailWhiteList"])
         try:
             for line in whitelist_in:
-                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())))
+                if not re_whitespace_comment.match(line):
+                    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:
             whitelist_in.close()

-- 
bye, Joerg
"If un-free is black and free is white, then there
 are degrees of free-ness as there are shades of gray."
 [Kapil Paranjape]


--- End Message ---

Reply via email to