Skip Menu |

This queue is for tickets about the Text-VimColor CPAN distribution.

Report information
The Basics
Id: 50646
Status: resolved
Priority: 0/
Queue: Text-VimColor

People
Owner: Nobody in particular
Requestors: perl [...] shiar.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.11
Fixed in: 0.12



Subject: child process should untie i/o handles
After forking, inherited file descriptors may have and retain unwanted side-effects if tied. For example, when used in a FastCGI script, any run will die with: "Not a GLOB reference at /usr/lib/perl5/FCGI.pm line 125." Attached patch fixes this issue.
Subject: 0001-child-process-should-untie-i-o-handles.patch
diff -ur Text-VimColor-0.11/lib/Text/VimColor.pm Text-VimColor-0.11-shiar/lib/Text/VimColor.pm --- Text-VimColor-0.11/lib/Text/VimColor.pm +++ Text-VimColor-0.11-shiar/lib/Text/VimColor.pm @@ -388,6 +388,7 @@ sub _run else { defined $pid or croak "error forking to run $prog: $!"; + tied $_ and untie $_ for *STDOUT, *STDERR, *STDIN; open STDIN, '/dev/null'; open STDOUT, '>/dev/null'; open STDERR, '>&=' . fileno($err_fh)
I've been granted co-maint by the PAUSE admins and have merged this. I tried to run this under FCGI once and hit the same errors. I'd like to consider rewriting this to use one of the may IPC:: modules instead of doing this locally, but I may never get around to it. For now this a great fix. Thank you very much!