]> git.donarmstrong.com Git - debbugs.git/commitdiff
[project @ 2003-06-10 00:59:36 by cjwatson]
authorcjwatson <>
Tue, 10 Jun 2003 07:59:36 +0000 (23:59 -0800)
committercjwatson <>
Tue, 10 Jun 2003 07:59:36 +0000 (23:59 -0800)
Avoid accepting mail to archived bugs! The generic getbugcomponent()
function can't be quite as simple as it seems, because CGI scripts are
prepared to accept archived bugs while most of the backend scripts aren't.
This is a somewhat hacky workaround but does the job for now.

cgi/common.pl
scripts/errorlib.in

index 543d3ee7032760f9ce09c1a08b26f3f4fb8ff42e..04e77b82b855e0cf778cc6b7eecc08b654d9da40 100644 (file)
@@ -621,7 +621,8 @@ sub getsrcpkgs {
    
 sub buglog {
     my $bugnum = shift;
-    return getbugcomponent($bugnum, 'log');
+    my $location = getbuglocation($bugnum, 'log');
+    return getbugcomponent($bugnum, 'log', $location);
 }
 
 1;
index 062e864046312905f9c0ba1217680fba612b82e2..fe7aceea206c8c4cf15f25e29a3aa9ac6cfb11f9 100755 (executable)
@@ -1,5 +1,5 @@
 # -*- perl -*-
-# $Id: errorlib.in,v 1.29 2003/06/06 17:56:05 cjwatson Exp $
+# $Id: errorlib.in,v 1.30 2003/06/10 00:59:36 cjwatson Exp $
 
 sub F_SETLK { 6; } sub F_WRLCK{ 1; }
 $flockstruct= 'sslll'; # And there ought to be something for this too.
@@ -49,7 +49,14 @@ sub getlocationpath {
 sub getbugcomponent {
     my ($bugnum, $ext, $location) = @_;
 
-    $location = getbuglocation($bugnum, $ext) unless defined $location;
+    unless (defined $location) {
+       $location = getbuglocation($bugnum, $ext);
+       # Default to non-archived bugs only for now; CGI scripts want
+       # archived bugs but most of the backend scripts don't. For now,
+       # anything that is prepared to accept archived bugs should call
+       # getbuglocation() directly first.
+       return undef unless $location eq 'db' or $location eq 'db-h';
+    }
     my $dir = getlocationpath($location);
     return undef unless $dir;
     if ($location eq 'db') {