Bug #30040

Missing quotes in system() command in initializeForRuntime()

Added by Adrian Föder almost 4 years ago. Updated over 3 years ago.

Status:Resolved Start date:2011-09-19
Priority:Should have Due date:
Assigned To:Bastian Waidelich % Done:

100%

Category:Core
Target version:TYPO3 Flow Base Distribution - 1.0.1
PHP Version: Complexity:
Has patch:No Affected Flow version:FLOW3 1.0.0

Description

As a hardcore Windows user I again experienced a problem regarding the quotes for a system() command, in my case resolving to something like
system('c:\Program Files\Zend.....')

which ended as >> "C:\Program" is not an existing..... <<

so I fixed line 420 of Core/Bootstrap.php; changing from

$command = escapeshellcmd($this->settings['core']['phpBinaryPathAndFilename']) . ' -c ' . escapeshellarg(php_ini_loaded_file()) . ' -v';

...to

$command = '"' . escapeshellcmd($this->settings['core']['phpBinaryPathAndFilename']) . '" -c ' . escapeshellarg(php_ini_loaded_file()) . ' -v';

This works now.


Related issues

related to TYPO3.Flow - Bug #32827: TYPO3\FLOW3\Exception thrown in file Bootstrap.php Closed 2011-12-24
duplicated by TYPO3.Flow - Bug #31779: Command execution on Windows breaks with special chars in... Closed 2011-11-12

Associated revisions

Revision d87ef93a
Added by Bastian Waidelich over 3 years ago

[TASK] Escape phpBinaryPathAndFilename in Command execution

Currently the bootstrap fails to properly escape the php path
when dispatching sub requests in command execution.
This leads to exceptions when the path contains spaces or other
special characters.
This is fixed by putting the command in quotes and replacing
backslashes.

Change-Id: Ida11468a75ba2465db275a55e331b2d6e6eb4a0f
Fixes: #30040
Releases: 1.0, 1.1

Revision cfc654fe
Added by Bastian Waidelich over 3 years ago

[BUGFIX] Escape phpBinaryPathAndFilename in Command execution

Currently the bootstrap fails to properly escape the php path
when dispatching sub requests in command execution.
This leads to exceptions when the path contains spaces or other
special characters.
This is fixed by putting the command in quotes and replacing
backslashes.

Change-Id: If13f4c21b8cde63ba692a7e7e5f793d4a70042a1
Fixes: #30040
Releases: 1.0, 1.1

History

#1 Updated by Karsten Dambekalns almost 4 years ago

  • Project changed from TYPO3 Flow Base Distribution to TYPO3.Flow

#2 Updated by Karsten Dambekalns almost 4 years ago

  • Category set to Core
  • Assigned To set to Bastian Waidelich
  • Target version set to 1.0.1
  • Affected Flow version set to FLOW3 1.0.0

Bastian can you verify this and create a change?

#3 Updated by Adrian Föder almost 4 years ago

I by the way was able to "fix" that with using forward slashes and 8.3 filenames (as noted in http://forge.typo3.org/projects/flow3/wiki/Installation_hints ).
But we should wrap the quotes anyway because it's just correct. (Bastian, maybe you remember, on the T3DD11 I poked you about this issue, you fixed it and... maybe forgot to commit it :)

#4 Updated by Bastian Waidelich over 3 years ago

  • Status changed from New to Accepted
  • Has patch set to No

#5 Updated by Mr. Hudson over 3 years ago

  • Status changed from Accepted to Under Review

Patch set 1 of change Ida11468a75ba2465db275a55e331b2d6e6eb4a0f has been pushed to the review server.
It is available at http://review.typo3.org/6663

#6 Updated by Bastian Waidelich over 3 years ago

Please test asap so this can go into the bugfix release 1.0.1 today!

#7 Updated by Mr. Hudson over 3 years ago

Patch set 2 of change Ida11468a75ba2465db275a55e331b2d6e6eb4a0f has been pushed to the review server.
It is available at http://review.typo3.org/6663

#8 Updated by Mr. Hudson over 3 years ago

Patch set 3 of change Ida11468a75ba2465db275a55e331b2d6e6eb4a0f has been pushed to the review server.
It is available at http://review.typo3.org/6663

#9 Updated by Mr. Hudson over 3 years ago

Patch set 4 of change Ida11468a75ba2465db275a55e331b2d6e6eb4a0f has been pushed to the review server.
It is available at http://review.typo3.org/6663

#10 Updated by Bastian Waidelich over 3 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF