aboutsummaryrefslogtreecommitdiff
path: root/doc/bugs/git_stderr_output_causes_problems.mdwn
diff options
context:
space:
mode:
authorhttp://smcv.pseudorandom.co.uk/ <http://smcv.pseudorandom.co.uk/@web>2008-07-18 22:08:13 -0400
committerJoey Hess <joey@kitenet.net>2008-07-18 22:08:13 -0400
commit1e6b38a3354f4b1b7afd13945acad3d2390d8007 (patch)
tree8c829f011c156ab554a545fcbe843c4767186fe5 /doc/bugs/git_stderr_output_causes_problems.mdwn
parent1e3e8c1b0ad42f08e64a0e932a0d94fb5b2f1348 (diff)
downloadikiwiki-1e6b38a3354f4b1b7afd13945acad3d2390d8007.tar
ikiwiki-1e6b38a3354f4b1b7afd13945acad3d2390d8007.tar.gz
Diffstat (limited to 'doc/bugs/git_stderr_output_causes_problems.mdwn')
-rw-r--r--doc/bugs/git_stderr_output_causes_problems.mdwn41
1 files changed, 29 insertions, 12 deletions
diff --git a/doc/bugs/git_stderr_output_causes_problems.mdwn b/doc/bugs/git_stderr_output_causes_problems.mdwn
index 155808884..e86b7842f 100644
--- a/doc/bugs/git_stderr_output_causes_problems.mdwn
+++ b/doc/bugs/git_stderr_output_causes_problems.mdwn
@@ -2,15 +2,32 @@ I've just been getting ikiwiki running on a hosted server. The server is wrappi
Ikiwiki's git handling is sending a bunch of output to stderr. The following patch closes stderr in the child process that ikiwiki forks to run git. This allows me to use ikiwiki on this hosted server. (patch inline - check source to get it)
-diff --git a/IkiWiki/Rcs/git.pm b/IkiWiki/Rcs/git.pm
-index 425536f..5734bb2 100644
---- a/IkiWiki/Rcs/git.pm
-+++ b/IkiWiki/Rcs/git.pm
-@@ -24,6 +24,7 @@ sub _safe_git (&@) { #{{{
- if (!$pid) {
- # In child.
- # Git commands want to be in wc.
-+ open STDERR, '>/dev/null';
- chdir $config{srcdir}
- or error("Cannot chdir to $config{srcdir}: $!");
- exec @cmdline or error("Cannot exec '@cmdline': $!");
+ diff --git a/IkiWiki/Rcs/git.pm b/IkiWiki/Rcs/git.pm
+ index 425536f..5734bb2 100644
+ --- a/IkiWiki/Rcs/git.pm
+ +++ b/IkiWiki/Rcs/git.pm
+ @@ -24,6 +24,7 @@ sub _safe_git (&@) { #{{{
+ if (!$pid) {
+ # In child.
+ # Git commands want to be in wc.
+ + open STDERR, '>/dev/null';
+ chdir $config{srcdir}
+ or error("Cannot chdir to $config{srcdir}: $!");
+ exec @cmdline or error("Cannot exec '@cmdline': $!");
+
+> This sounds like rather counter-productive "hardening" (making life harder
+> for real users without any security improvement that I can think of),
+> but if you have to suppress standard error of the CGI,
+> can't you just replace ikiwiki.cgi with this...
+>
+> #!/bin/sh
+> exec /some/where/else/ikiwiki.cgi "$@" 2>/dev/null
+>
+> or (if you're constrained to Perl) this?
+>
+> #!/usr/bin/perl
+> open STDERR, '>/dev/null';
+> exec ("/some/where/else/ikiwiki.cgi", @ARGV);
+>
+> (Also indented all the lines of your patch so markdown won't eat it :-) )
+> --[[smcv]]