php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41710 proc_open and open_basedir fail to open
Submitted: 2007-06-15 22:00 UTC Modified: 2007-07-03 01:00 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: eric at pixelhammer dot net Assigned:
Status: No Feedback Package: Filesystem function related
PHP Version: 5.2.3 OS: Linux version 2.6.9-42.0.3.ELsmp
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2007-06-15 22:00 UTC] eric at pixelhammer dot net
Description:
------------
executing proc_open produces the following in the error log...

PHP Warning: proc_open(/home/vhosts/tmp/error-ANP-24551.txt) [function.proc-open]: failed to open stream: Operation not permitted in /home/xxx/object/xxx.php on line 222

PHP Warning: proc_open() [function.proc-open]: open_basedir restriction in effect. File(/home/vhosts/tmp/error-ANP-24551.txt) is not within the allowed path(s): (/var/www/:/home/vhosts/xxx.com/:/home/xxx/:/var/qmail/control/:/home/vhosts/lib/keys/:/home/vhosts/tmp/:/data1/backup_exempt/log/phpErrorLog/) in /home/xxx/object/xxx.php on line 222

Reproduce code:
---------------
$descriptorspec = array(0 => array("pipe", "r"), 1 => array("pipe", "w"), 2 => array("file", '/home/vhosts/tmp/error-ANP-24551.txt', "a"));
$pipe = array();
$proc = "echo " . escapeshellarg($dataString) . " | /usr/bin/gpg -a -e --batch --no-secmem-warning --homedir " . $this->keyFileDir . " -r " . $this->encryptTo . " -o -";
$process = proc_open($proc, $descriptorspec, $pipe);


Expected result:
----------------
proc_open should return a valid resource and data can be retreived with the following...

fclose($pipe[0]);
$data = stream_get_contents($pipe[1]);
fclose($pipe[1]);
proc_close($process);


Actual result:
--------------
proc_open does not return a valid resource.  This code was working before the upgrade to php 5.2.3

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-07-03 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 00:01:28 2024 UTC