cgierror: When the CGI fails, print the error to stderr, not "Died"

$@ could be clobbered by the "exception handler", and in practice
it seems that it is. This can be seen on stderr of t/git-cgi.t.
master
Simon McVittie 2017-05-14 15:06:01 +01:00
parent 26ded17653
commit 60cb2ac458
2 changed files with 3 additions and 1 deletions

View File

@ -490,7 +490,8 @@ sub cgierror ($) {
print "Content-type: text/html\n\n"; print "Content-type: text/html\n\n";
print cgitemplate(undef, gettext("Error"), print cgitemplate(undef, gettext("Error"),
"<p class=\"error\">".gettext("Error").": $message</p>"); "<p class=\"error\">".gettext("Error").": $message</p>");
die $@;
die $message;
} }
1 1

1
debian/changelog vendored
View File

@ -6,6 +6,7 @@ ikiwiki (3.20170112) UNRELEASED; urgency=medium
* Guard against set-but-empty REMOTE_USER CGI variable on * Guard against set-but-empty REMOTE_USER CGI variable on
misconfigured nginx servers, and in general treat sessions with misconfigured nginx servers, and in general treat sessions with
a set-but-empty name as if they were not signed in. a set-but-empty name as if they were not signed in.
* When the CGI fails, print the error to stderr, not "Died"
-- Simon McVittie <smcv@debian.org> Sun, 14 May 2017 15:34:52 +0100 -- Simon McVittie <smcv@debian.org> Sun, 14 May 2017 15:34:52 +0100