Project

General

Profile

Actions

Task #85658

closed

PharStreamWrapper denies phar files from symlinked extension

Added by Nicole Cordes over 6 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2018-07-26
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Sprint Focus:

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
Actions #1

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?

Actions #2

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';
...
Actions #3

Updated by Oliver Hader over 6 years ago

  • Description updated (diff)
Actions #4

Updated by Oliver Hader over 6 years ago

  • Description updated (diff)
Actions #5

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.

Actions #6

Updated by Oliver Hader over 6 years ago

  • Tracker changed from Bug to Task
Actions #7

Updated by Oliver Hader over 6 years ago

  • Assignee deleted (Oliver Hader)
Actions #8

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

Actions #9

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

Actions #10

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

Actions #11

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

Actions #12

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

Actions #13

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

Actions #14

Updated by Oliver Hader over 6 years ago

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

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF