#41710 [NEW]: proc_open and open_basedir fail to open

From: Date: Fri, 15 Jun 2007 22:00:14 +0000
Subject: #41710 [NEW]: proc_open and open_basedir fail to open
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-113843@lists.php.net to get a copy of this message
From: eric at pixelhammer dot net Operating system: Linux version 2.6.9-42.0.3.ELsmp PHP version: 5.2.3 PHP Bug Type: Filesystem function related Bug description: proc_open and open_basedir fail to open 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 -- Edit bug report at http://bugs.php.net/?id=41710&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=41710&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=41710&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=41710&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=41710&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=41710&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=41710&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=41710&r=needscript Try newer version: http://bugs.php.net/fix.php?id=41710&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=41710&r=support Expected behavior: http://bugs.php.net/fix.php?id=41710&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=41710&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=41710&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=41710&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41710&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=41710&r=dst IIS Stability: http://bugs.php.net/fix.php?id=41710&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=41710&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=41710&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=41710&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=41710&r=mysqlcfg

« previous php.bugs (#113843) next »