Task #85658

PharStreamWrapper denies phar files from symlinked extension

Added by Nicole Cordes over 1 year ago. Updated about 1 year ago.

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

100%

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

Associated revisions

Revision d4ca073b (diff)
Added by Oliver Hader over 1 year ago

[TASK] Document integration of PharStreamWrapper

Resolves: #85658
Releases: master, 8.7, 7.6
Change-Id: I6acdc235dff4b3c0c84a8a6d762d497f8d9664cc
Reviewed-on: https://review.typo3.org/57701
Tested-by: TYPO3com <>
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>

Revision b017d25d (diff)
Added by Oliver Hader over 1 year ago

[TASK] Document integration of PharStreamWrapper

Resolves: #85658
Releases: master, 8.7, 7.6
Change-Id: I6acdc235dff4b3c0c84a8a6d762d497f8d9664cc
Reviewed-on: https://review.typo3.org/57701
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-on: https://review.typo3.org/57710

Revision 403b60af (diff)
Added by Oliver Hader over 1 year ago

[TASK] Document integration of PharStreamWrapper

Resolves: #85658
Releases: master, 8.7, 7.6
Change-Id: I6acdc235dff4b3c0c84a8a6d762d497f8d9664cc
Reviewed-on: https://review.typo3.org/57701
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-on: https://review.typo3.org/57711

History

#1 Updated by Oliver Hader over 1 year 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?

#2 Updated by Oliver Hader over 1 year 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';
...

#3 Updated by Oliver Hader over 1 year ago

  • Description updated (diff)

#4 Updated by Oliver Hader over 1 year ago

  • Description updated (diff)

#5 Updated by Oliver Hader over 1 year 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.

#6 Updated by Oliver Hader over 1 year ago

  • Tracker changed from Bug to Task

#7 Updated by Oliver Hader over 1 year ago

  • Assignee deleted (Oliver Hader)

#8 Updated by Gerrit Code Review over 1 year 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

#9 Updated by Gerrit Code Review over 1 year 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

#10 Updated by Gerrit Code Review over 1 year 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

#11 Updated by Gerrit Code Review over 1 year 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

#12 Updated by Gerrit Code Review over 1 year 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

#13 Updated by Gerrit Code Review over 1 year 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

#14 Updated by Oliver Hader over 1 year ago

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

#15 Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF