Bug #955: system() with a command containing a pipe: fails under safe mode
| From: | DelislMa at CollegeSherbrooke dot qc dot ca | Date: | Thu, 26 Nov 1998 15:12:52 +0000 |
| Subject: | Bug #955: system() with a command containing a pipe: fails under safe mode | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-2600@lists.php.net to get a copy of this message | ||
From: DelislMa@CollegeSherbrooke.qc.ca
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@lists.php.net
For help: php-dev-help@lists.php.net