Bug 1062267 - IPC::Run3::run3($command, \undef) clobbers STDIN
Summary: IPC::Run3::run3($command, \undef) clobbers STDIN
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: perl-IPC-RUN3
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Ralf Corsepius
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-02-06 14:45 UTC by Petr Pisar
Modified: 2014-03-24 06:45 UTC (History)
2 users (show)

Fixed In Version: perl-IPC-Run3-0.046-4.fc19
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1062274 (view as bug list)
Environment:
Last Closed: 2014-03-24 06:43:13 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Proposed fix (4.32 KB, patch)
2014-02-06 14:48 UTC, Petr Pisar
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
CPAN 52317 0 None None None Never

Description Petr Pisar 2014-02-06 14:45:14 UTC
If IPC::Run3::run3() is invoked with \undef for command's standard input, it will clobber STDIN, so STDIN is unusable after return from run3():

Reproducer:

$ printf '1\n2\n'| perl -MIPC::Run3 -e 'while (<>) { print; run3([q{true}], \undef) }' 
1

This should print:

1
2

But it stops after first loop.

Observed in perl-IPC-Run3-0.046-3.fc20.noarch, F20.

Reported to upstream, patch is there.

Comment 1 Petr Pisar 2014-02-06 14:48:51 UTC
Created attachment 860208 [details]
Proposed fix

Comment 2 Ralf Corsepius 2014-02-06 15:09:10 UTC
(In reply to Petr Pisar from comment #0)
> If IPC::Run3::run3() is invoked with \undef for command's standard input, it
> will clobber STDIN, so STDIN is unusable after return from run3():
> 
> Reproducer:
> 
> $ printf '1\n2\n'| perl -MIPC::Run3 -e 'while (<>) { print; run3([q{true}],
> \undef) }' 
> 1
> 
> This should print:
> 
> 1
> 2
> 
> But it stops after first loop.
> 
> Observed in perl-IPC-Run3-0.046-3.fc20.noarch, F20.
> 
> Reported to upstream, patch is there.

Thanks for the report. 

Presuming you to have tested all this carefully and "just being into it" and me not having enough time to look into this today, feel free to apply the patch to git. 

Otherwise, I'll look into it, tomorrow.

Comment 3 Petr Pisar 2014-02-06 16:22:55 UTC
I spent long time to understand what lead upstream to use the current code as the patch actually reverts it. The perl documentation regarding file handle globs and underlying file descriptors is very sparse. I did some tests and everything seems good with the patch, but I'd like somebody to review it.

Comment 4 Fedora Update System 2014-02-11 07:58:15 UTC
perl-IPC-Run3-0.046-4.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/perl-IPC-Run3-0.046-4.fc20

Comment 5 Fedora Update System 2014-02-11 07:58:23 UTC
perl-IPC-Run3-0.046-4.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/perl-IPC-Run3-0.046-4.fc19

Comment 6 Fedora Update System 2014-02-12 14:36:18 UTC
Package perl-IPC-Run3-0.046-4.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing perl-IPC-Run3-0.046-4.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-2332/perl-IPC-Run3-0.046-4.fc19
then log in and leave karma (feedback).

Comment 7 Fedora Update System 2014-02-12 14:36:29 UTC
Package perl-IPC-Run3-0.046-4.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing perl-IPC-Run3-0.046-4.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-2334/perl-IPC-Run3-0.046-4.fc20
then log in and leave karma (feedback).

Comment 8 Fedora Update System 2014-03-24 06:43:13 UTC
perl-IPC-Run3-0.046-4.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 9 Fedora Update System 2014-03-24 06:45:43 UTC
perl-IPC-Run3-0.046-4.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.