]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
cgierror: When the CGI fails, print the error to stderr, not "Died"
authorSimon McVittie <smcv@debian.org>
Sun, 14 May 2017 14:06:01 +0000 (15:06 +0100)
committerSimon McVittie <smcv@debian.org>
Sun, 14 May 2017 14:39:21 +0000 (15:39 +0100)
$@ 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.

IkiWiki/CGI.pm
debian/changelog

index d20a759235267b8ffd086c8d04c9df5aff01b0df..f1eb31d97a6c0e02d3fe1a83fd62fa6603763fc3 100644 (file)
@@ -490,7 +490,8 @@ sub cgierror ($) {
        print "Content-type: text/html\n\n";
        print cgitemplate(undef, gettext("Error"),
                "<p class=\"error\">".gettext("Error").": $message</p>");
-       die $@;
+
+       die $message;
 }
 
 1
index 005c811d346ad98327d30ade4a36f69284b8ff92..a92e3711e5f8d44e5dd8337ccb05bd2dcc5e1dea 100644 (file)
@@ -6,6 +6,7 @@ ikiwiki (3.20170112) UNRELEASED; urgency=medium
   * Guard against set-but-empty REMOTE_USER CGI variable on
     misconfigured nginx servers, and in general treat sessions with
     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