php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50262 stdin behavior changed between 5.2.10 and 5.2.11
Submitted: 2009-11-22 10:54 UTC Modified: 2009-11-22 22:12 UTC
From: daniel at rozsnyo dot com Assigned:
Status: Closed Package: Streams related
PHP Version: 5.2.11 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: daniel at rozsnyo dot com
New email:
PHP Version: OS:

 

 [2009-11-22 10:54 UTC] daniel at rozsnyo dot com
Description:
------------
My postfix filter scripts written in PHP stopped working after an upgrade to php-5.2.11, the issue can be tracked down to PHP with a simplified script.

Reproduce code:
---------------
Create a postfix policy filter, it is enough to create a simple get and store script like this:

<?php
    $fd = STDIN;
    $rq = '';
    while(!feof($fd)) $rq .= fgets($fd,1024);
    file_put_contents('/tmp/req',$rq);
?>


Expected result:
----------------
I expect the /tmp/req file to be filled with postfix's request attributes (attrib=value pairs).


Actual result:
--------------
With 5.2.11: The file is empty.
With 5.2.10: The file is OK, filled with attributes.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-11-22 10:56 UTC] daniel at rozsnyo dot com
I have prepared two strace listings, one for 5.2.10 and one for 5.2.11. The 5.2.11 looks like the php thinks there is an immediate eof for STDIN.
 [2009-11-22 16:44 UTC] jani@php.net
Please try using this snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [2009-11-22 22:12 UTC] daniel at rozsnyo dot com
Thank you, the upcoming version of:

/usr/bin/php -v
PHP 5.2.12RC2-dev (cli) (built: Nov 22 2009 23:01:23)

has a fix on this issue. Hope to see it released soon,

Daniel.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 03 23:01:30 2024 UTC