Bug #103728
closedfixPermission() throws exception if permissions are correct
100%
Description
The function fixPermission() in typo3/sysext/install/Classes/FolderStructure/AbstractNode.php throws an exception if permissions are equal to the target permissions:
if ($this->isPermissionCorrect()) {
throw new Exception(
'Permission on ' . $this->getAbsolutePath() . ' are already ok',
1366744035
);
}
$result = @chmod($this->getAbsolutePath(), (int)octdec($this->getTargetPermission()));
…
The exception is used as a program control structure here. The side effect is that any cli script calling this function returns an error code on absolutely correct permissions.
composer install calls implicitly install:fixfolderstructure, which calls fixPermission().
Our auto-deployment fails if all file and directory permissions are correct.
I would expect that fixPermission() would throw an exception on uncorrectable permissions only.
The behaviour is documented here [[https://docs.typo3.org/typo3cms/exceptions/main/en-us/Exceptions/1366744035.html]], but the resolution to ignore this error is not the best solution in scripted deployments.
Updated by Gerrit Code Review 5 months ago
- Status changed from New to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84575
Updated by Gerrit Code Review 5 months ago
Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84575
Updated by Gerrit Code Review 5 months ago
Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84796
Updated by Christian Kuhn 5 months ago
- Related to Bug #104161: Admin Tools: Action after clicking "Try to fix file and folder permissions" button in "Directory Status" modal never completes added
Updated by Gerrit Code Review 5 months ago
Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84575
Updated by Gerrit Code Review 5 months ago
Patch set 2 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84796
Updated by Georg Ringer 5 months ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 6026bea73d0dcb9305b402b30d8e4b61cfc29d33.
Updated by Georg Ringer 4 months ago
- Has duplicate Bug #93656: Fixing folder structure: Permission on fileadmin/_temp_ are already ok added