This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #76474]: IPC::Open3 doesn't handle file descriptors correctly
authorVernon Lyon <vlyon@cpan.org>
Sun, 26 Sep 2010 13:34:58 +0000 (06:34 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 26 Sep 2010 13:34:58 +0000 (06:34 -0700)
commitfb9b5b31d8a62644191f4e414a66124e86f30797
tree3c3ca699e92b19de09d334a54b5cea3a2d69e61b
parent83f8bb564961ee8fba35156e720bef403d8fa9a7
[perl #76474]: IPC::Open3 doesn't handle file descriptors correctly

In the POD docs it says:
"The filehandles may also be integers, in which case they are under-
stood as file descriptors."

However IPC::Open3 doesn't handle the file descriptors correctly.
As an example, if we try to dup STDIN in a child process by using it's
file descriptor, we get:

> perl -MIPC::Open3 -wle 'open3("<&1", my $out, undef, $^X)'
close() on unopened filehandle 1 at /usr/share/perl/5.10/IPC/Open3.pm line 70.
open3: close(1) failed: Bad file descriptor at -e line 1

This is because in IPC::Open3 the subroutines xpipe*, xclose* and
xopen don't cater for descriptors being passed in instead of
filehandles.
ext/IPC-Open3/lib/IPC/Open3.pm