This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
dont report a $@ exception with uninitialized $!'s message in IPC::Open3
authorDaniel Dragan <bulk88@hotmail.com>
Tue, 7 Jul 2015 16:59:01 +0000 (12:59 -0400)
committerTony Cook <tony@develop-help.com>
Wed, 8 Jul 2015 01:35:57 +0000 (11:35 +1000)
commitc85f23b236fa90fedd9cceed2da12481184d5bbf
treeaff58bca43713ec58444143c0d000adef9c371d9
parent7ed1d857c7b7016b9bde564c6802a4721d903d95
dont report a $@ exception with uninitialized $!'s message in IPC::Open3

Commit a24d8dfd08 "Make IPC::Open3 work without fork()" from 5.003 created
an eval block, and if that eval block threw an exception, instead of
propagating $@, the code propagated $!, even though no system call was done
and $! is effectivly unintialized data. In one case for me, a taint
exception inside system was turned into open3() throwing an exception
about "Inappropriate I/O control operation" or "Bad file descriptor", which
had nothing to do with the real fault which was a Perl C level croak with
the message "Insecure $ENV{PATH} while running with -T switch at ..."
which was called as Perl_pp_system->Perl_taint_env->Perl_taint_proper->
Perl_croak->Perl_vcroak. This patch does not try to fix the ambiguity of
the error messages between the !DO_SPAWN and IO::Pipe
branches/implementations of _open3.
ext/IPC-Open3/lib/IPC/Open3.pm
ext/IPC-Open3/t/IPC-Open3.t
pod/perldelta.pod