php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29770 popen() buffer too small
Submitted: 2004-08-20 12:04 UTC Modified: 2004-08-22 20:00 UTC
From: d dot rousseau at nnx dot com Assigned:
Status: Not a bug Package: Filesystem function related
PHP Version: 5.0.0 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: d dot rousseau at nnx dot com
New email:
PHP Version: OS:

 

 [2004-08-20 12:04 UTC] d dot rousseau at nnx dot com
Description:
------------
When calling popen() with a command line longer than 1024 characters, the command is truncated without any warning


Reproduce code:
---------------
$command = <some line longer than 1024 characters>;
$handle = popen ($command);


Expected result:
----------------
I would expect at least a warning that says that the command line has been truncated or error saying that the command line is too long.

This, and an increase to 2048 or 4096, if no general issue about comand line length.



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-08-22 20:00 UTC] iliaa@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

The limit is imposed by your operating system and not PHP. 
 [2004-10-21 21:21 UTC] mr_W at mindnever dot org
Actually not, this limit (at least in 4.3.9) is imposed by using static buffer char buf[1024] when safe_mode is set to 'on'. check out ext/standard/file.c
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jun 26 11:01:30 2024 UTC