[dak/security] Error out when we are unable to find a source id for a file we want to install. Shouldnt happen.
---
ChangeLog | 8 ++++++++
dak/process_accepted.py | 4 ++--
daklib/dak_exceptions.py | 3 ++-
3 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 0556396..b6b1ac9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-08-07 Joerg Jaspert <joerg@debian.org>
+
+ * dak/process_accepted.py (install): Error out with the new
+ exception if we dont know the source package for a file we want to
+ install. Shouldn't ever hit us, but better safe than sorry.
+
+ * daklib/dak_exceptions.py (dakerrors): new exception - no source field.
+
2008-08-05 Joerg Jaspert <joerg@debian.org>
* config/debian/cron.unchecked: disable the ssh-move insanity (and
diff --git a/dak/process_accepted.py b/dak/process_accepted.py
index e99c35b..94c2ea3 100755
--- a/dak/process_accepted.py
+++ b/dak/process_accepted.py
@@ -35,6 +35,7 @@ from daklib import database
from daklib import logging
from daklib import queue
from daklib import utils
+from daklib.dak_exceptions import *
###############################################################################
@@ -354,8 +355,7 @@ def install ():
projectB.query("INSERT INTO binaries (package, version, maintainer, source, architecture, file, type, sig_fpr) VALUES ('%s', '%s', %d, %d, %d, %d, '%s', %d)"
% (package, version, maintainer_id, source_id, architecture_id, files[file]["files id"], type, fingerprint_id))
else:
- projectB.query("INSERT INTO binaries (package, version, maintainer, architecture, file, type, sig_fpr) VALUES ('%s', '%s', %d, %d, %d, '%s', %d)"
- % (package, version, maintainer_id, architecture_id, files[file]["files id"], type, fingerprint_id))
+ raise NoSourceFieldError, "Unable to find a source id for %s (%s), %s, file %s, type %s, signed by %s" % (package, version, architecture, file, type, sig_fpr)
for suite in changes["distribution"].keys():
suite_id = database.get_suite_id(suite)
projectB.query("INSERT INTO bin_associations (suite, bin) VALUES (%d, currval('binaries_id_seq'))" % (suite_id))
diff --git a/daklib/dak_exceptions.py b/daklib/dak_exceptions.py
index b52e065..4e79546 100644
--- a/daklib/dak_exceptions.py
+++ b/daklib/dak_exceptions.py
@@ -48,7 +48,8 @@ dakerrors = {
"FileExistsError": """Exception raised when destination file exists.""",
"SendmailFailedError": """Exception raised when Sendmail invocation failed.""",
"NoFreeFilenameError": """Exception raised when no alternate filename was found.""",
- "TransitionsError": """Exception raised when transitions file can't be parsed."""
+ "TransitionsError": """Exception raised when transitions file can't be parsed.""",
+ "NoSourceFieldError": """Exception raised - we cant find the source - wtf?"""
}
def construct_dak_exception(name, description):
--
1.5.6.5
Reply to: