/var/lib/debbugs/www/cgi/bugs-fetch2.pl is in debbugs 2.4.1ubuntu1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | #!/usr/bin/perl
require './common.pl';
require '/etc/debbugs/config';
%map= ($gMirrors);
my %in = readparse();
if ($in{'type'} eq 'ref') {
$_= $in{'ref'};
s/^\s+//; s/^\#//; s/^\s+//; s/^0*//; s/\s+$//;
if (m/\D/ || !m/\d/) {
print <<END;
Content-Type: text/html
<html><head><title>Bug number not numeric</title>
</head><body>
<h1>Invalid input to specific bug fetch form</h1>
You must type a number, being the bug reference number.
There should be no nondigits in your entry.
</html>
END
exit(0);
}
$suburl= $_;
$suburl =~ s,^..,$&/$&,;
$suburl.= '.html';
} elsif ($in{'type'} eq 'package') {
$_= $in{'package'};
s/^\s+//; s/\s+$//; y/A-Z/a-z/;
if (m/^[^0-9a-z]/ || m/[^-+.0-9a-z]/) {
print <<END;
Content-Type: text/html
<html><head><title>Package name contains invalid characters</title>
</head><body>
<h1>Invalid input to package buglist fetch form</h1>
You must type a package name. Package names start with a letter
or digit and contain only letters, digits and the characters
- + . (hyphen, plus, full stop).
</html>
END
exit(0);
}
$suburl= "pa/l$_.html";
} else {
print <<END;
Content-Type: text/plain
Please use the real DBC_WHO form. (invalid type value)
END
exit(0);
}
$base= $ENV{'HTTP_REFERER'};
if ($base =~ s:/${gWebHostBugDir}/.*$::) {
for $y (keys %map) {
$base= $map{$y} if $base eq $y;
}
} else {
$base= $in{'base'};
}
$newurl= "$base/${gWebHostBugDir}/db/$suburl";
print <<END;
Status: 301 Redirect
Location: $newurl
The bug report data you are looking for ($suburl)
is available <A href="$newurl">here</A>.
(If this link does not work then the bug or package does not exist in
the tracking system any more, or does not yet, or never did.)
END
exit(0);
|