Folks,

This is another small code review for a bug that showed up when a client
received a truncated catalog.  We have code that should fix this in most
cases; however, in this particular case the corruption was odd enough
that it tripped an assertion in version.py.  The fix is to throw an
IllegalVersion exception instead of raising an assertion.  This gets
caught by the fmri handlers, they raise an IllegalFmri exception.  The
IllegalFmri exception is caught by the catalog, preventing further
corruption or weird stack traces.

This is a 3-line fix.  Instead of a webrev, I've included a diff:

diff -r 8424a10cde55 -r d2e59742e9c3 src/modules/version.py
--- a/src/modules/version.py    Wed Feb 04 17:45:33 2009 -0800
+++ b/src/modules/version.py    Wed Feb 04 18:08:51 2009 -0800
@@ -242,7 +242,9 @@
                         if build is not None:
                                 self.build_release = DotSequence(build)
                         else:
-                                assert build_string is not None
+                                if build_string is None:
+                                        raise IllegalVersion("Build is %s, "
+                                            "build_string is None" % build)
                                 self.build_release = DotSequence(build_string)

Thanks,

-j
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to