From: uncle at fedor dot com
Operating system: Linux SuSE 8.2
PHP version: 4.3.7
PHP Bug Type: Filesystem function related
Bug description: exec(), system(), passthru() incorrectly escape parentheses
Description:
------------
exec() gives the following results when working with files containing
spaces *and* parentheses/brackets on Linux:
If the filename to be passed by the exec() function is enclosed in quotes
"..." (to handle the spaces) then the backslashes are added before the
following symbols:
( ) [ ] { }
and possibly before some other ones I haven't discovered.
Reproduce code:
---------------
1. exec ("touch \"Testfile without parentheses.txt\"");
2. exec ("touch Now_without_spaces_(but_with_parenteses)");
3. exec ("touch \"Now both spaces (and parentheses)\");
Expected result:
----------------
1. Creating file:
Testfile without parentheses.txt
2. Creating file:
Now_without_spaces_(but_with_parentheses)
3. Creating file:
Now both spaces (and parentheses)
Actual result:
--------------
1. Creating file:
Testfile without parentheses.txt
2. Creating file:
Now_without_spaces_(but_with_parentheses)
3. Creating file:
Now both spaces \(and parentheses\)
--
Edit bug report at http://bugs.php.net/?id=28881&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=28881&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=28881&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=28881&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=28881&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=28881&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=28881&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=28881&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=28881&r=support
Expected behavior: http://bugs.php.net/fix.php?id=28881&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=28881&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=28881&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=28881&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28881&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=28881&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=28881&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=28881&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28881&r=float