Project

General

Profile

Actions

Bug #103728

closed

fixPermission() throws exception if permissions are correct

Added by Hartmut Müller 7 months ago. Updated 5 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Install Tool
Target version:
-
Start date:
2024-04-25
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
12
PHP Version:
8.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

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.


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #104161: Admin Tools: Action after clicking "Try to fix file and folder permissions" button in "Directory Status" modal never completesClosed2024-06-20

Actions
Has duplicate TYPO3 Core - Bug #93656: Fixing folder structure: Permission on fileadmin/_temp_ are already okClosed2021-03-05

Actions
Actions

Also available in: Atom PDF