[PHP-DEV] Bug #955: system() with a command containing a pipe: fails under safe mode From: DelislMa <email protected>
Date: 11/26/98

From: DelislMa <email protected>
Operating system: Linux 2.1.126
PHP version: 3.0.5
PHP Bug Type: Misbehaving function
Bug description: system() with a command containing a pipe: fails under safe mode

In PHP 3.0.5 under Apache 1.3.3, I can't execute
a system command containing a pipe, while in safe mode.

In php3.ini:

[safemode]
safe_mode=1
safe_mode_exec_dir=/usr/local/php/safe
================================

In /usr/local/php/safe:

lrwxrwxrwx 1 root apache 13 Nov 25 08:49 sort2 ->
/usr/bin/sort
lrwxrwxrwx 1 root apache 18 Nov 25 08:49 who2 ->
/usr/local/bin/who
============================================

Trying this script:

<html><body>
<?php
        $safe_dir = "/usr/local/php/safe";
 
        echo "<br>safe mode test1 <br>";
        system("${safe_dir}/who2 | ${safe_dir}/sort2 -r");
 
        echo "<br> safe mode test2 <br>";
        system("${safe_dir}/who2");
?>
</body></html>

When safe_mode=0, I see the output of tests 1 and 2.
However, when safe_mode=1, test1 outputs nothing and test2 is ok.

Thanks for your attention...

--
PHP Development Mailing List   http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe <email protected>
For help: php-dev-help <email protected>