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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Fri May 09 23:01:31 2025 UTC