Task #85658
closedPharStreamWrapper denies phar files from symlinked extension
100%
Description
Given:
An installation with symlinked extension(s)
Expected:
Able to execute an extensions phar file
Actual:
An exception is thrown because the phar path does not contain typo3conf.
I tested this with caretaker_mattermost as a symlinked extension in my local development environment.
The extension looks like
Warning: Uncaught TYPO3\CMS\Core\IO\PharStreamWrapperException: Executing phar://...path-to-phar.../file.phar is denied in typo3/sysext/core/Classes/IO/PharStreamWrapper.php:507
Updated by Oliver Hader over 6 years ago
- Status changed from New to Needs Feedback
How does the exception look like on your local environment? What is the real extension path & how does the symlink look like?
Updated by Oliver Hader over 6 years ago
Extension caretaker_mattermost
uses __DIR__
when invoking the Phar bundle, which will then always be the resolved target of the symbolic link, see https://github.com/IchHabRecht/caretaker_mattermost/blob/bbb68361f4769832ea023d0c2df53a1e69be31b3/Classes/Services/ExitPoints/class.Tx_CaretakerMattermost_NotificationMattermmostExitPoint.php#L35
... include_once 'phar://' . __DIR__ . '/../../../Resources/Php/thibaud-dauce-mattermost-php.phar/vendor/autoload.php'; ...
Using \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('caretaker_mattermost')
instead of __DIR__
should work then, thus having
... include_once 'phar://' . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('caretaker_mattermost') . '../../../Resources/Php/thibaud-dauce-mattermost-php.phar/vendor/autoload.php'; ...
Updated by Oliver Hader over 6 years ago
- Status changed from Needs Feedback to Accepted
- Assignee set to Oliver Hader
Next step:
Create "important" ReST file that documents the behavior of the new PharStreamWrapper, its intention as well as the limitation and implication as mentioned in this ticket.
Updated by Gerrit Code Review over 6 years ago
- Status changed from Accepted to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57701
Updated by Gerrit Code Review over 6 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57701
Updated by Gerrit Code Review over 6 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57701
Updated by Gerrit Code Review over 6 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57701
Updated by Gerrit Code Review over 6 years ago
Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57710
Updated by Gerrit Code Review over 6 years ago
Patch set 1 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57711
Updated by Oliver Hader over 6 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset d4ca073bc1267474c48c740ec91b6f08454dc140.