|  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
 [2009-11-22 10:54 UTC] daniel at rozsnyo dot com
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:

    $fd = STDIN;
    $rq = '';
    while(!feof($fd)) $rq .= fgets($fd,1024);

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.


Add a Patch

Pull Requests

Add a Pull Request


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]
Please try using this snapshot:
For Windows:

 [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,

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jul 22 22:01:28 2024 UTC