php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #27076 exec() with safe_mode
Submitted: 2004-01-28 12:39 UTC Modified: 2004-02-19 12:52 UTC
From: not at valid dot email Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: linux
Private report: No CVE-ID: None
 [2004-01-28 12:39 UTC] not at valid dot email
Description:
------------
safe_mode cause exec command to parse all arguments after the command as one argument (in quote?)

Is this a bug? is it documented somewhere?


Reproduce code:
---------------
<?php
exec("echo x | echo y",$output);
$output=implode(',',$output);
echo "output is: $output"
?>

Expected result:
----------------
safe_mode off output is: y
safe_mode on output is: y

Actual result:
--------------
safe_mode off output is: y
safe_mode on output is: x | echo y

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-01-28 14:53 UTC] sniper@php.net
Yes, it's a feature. Couldn't find it documented anywhere.
Reclassifed as documentation problem.


 [2004-01-28 15:03 UTC] kennyt@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.

I added a warning below the other safe_mode note. Thanks.
 [2004-02-09 09:47 UTC] didou@php.net
This should also be mentionned in the other functions of ref.exec. Maybe with an entity ?
 [2004-02-17 21:31 UTC] irchtml@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.

Added the entity kennyt@php.net created to passthru() and system().
 [2004-02-18 04:36 UTC] didou@php.net
You didn't fix nothing here... I added an entity yesterday :

http://news.php.net/article.php?group=php.doc&article=969358998

This bug report is about the problem reflected by &warn.sm.exec; It's already in exec() and system() man page, but still need to be added elsewhere.

didou
 [2004-02-19 12:52 UTC] didou@php.net
A note was added to exec() system() passthru() and popen()
should be fixed now !
 [2020-02-07 06:12 UTC] phpdocbot@php.net
Automatic comment on behalf of kennyt
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=9e7b48f9067617e05bf1465cd6206de72e340a27
Log: Fix #27076: Add warning about safe_mode and argument quoting.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 23 09:00:03 2025 UTC