#110736Permissions of created files are not fixed without target content
Description
TYPO3\CMS\Install\FolderStructure\FileNode::fixSelf() only corrects the
permissions of a newly created file when the node also defines a target
content:
if ($resultCreateFile->getSeverity() === ContextualFeedbackSeverity::OK
&& $this->targetContent !== null
) {
$result[] = $this->setContent();
if (!$this->isPermissionCorrect()) {
$result[] = $this->fixPermission();
}
}
A file node without a target content is created, but its permissions are
never adjusted to its targetPermission. “Folder structure” then reports a
permission mismatch until “Try to fix errors” is run a second time, because
only the “file already exists” branch of fixSelf() calls
@fixPermission()@.
Writing the content and fixing the permissions are two unrelated steps and
should not be coupled.
Note on impact
This is a latent issue: every file node of the default structure
(DefaultFactory) defines either targetContent or targetContentFile,
and their targetPermission is derived from
@$GLOBALS[‘TYPO3_CONF_VARS’][‘SYS’][‘fileCreateMask’]@, which file creation
applies anyway. It surfaces for structure definitions that omit the target
content or use a targetPermission differing from the file create mask.
Side note
FileNodeTest::createFileThrowsExceptionIfNodeExists() expects exception
code 1366398198, which is thrown by
@AbstractNode::getRelativePathBelowSiteRoot()@ before
@FileNode::createFile()@ can throw its own 1367048077. The test does not
cover the guard it is named after.
Reviews 2
History 13
-
Gerrit Code Review pushed patch set 1 for main to change 95902 status
NewUnder Review <span data-processor="relativetime" data-value="2026-09-17T20:05:25+00:00" > 09/17/26, 20:05 </span> -
Gerrit Code Review pushed patch set 1 for 14.3 to change 96591 <span data-processor="relativetime" data-value="2026-10-10T08:53:44+00:00" > 10/10/26, 08:53 </span>
-
Georg Ringer commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-10-10T09:10:12+00:00" > 10/10/26, 09:10 </span>
Applied in changeset commit:d57c16c65e4a3ce63cc3aa3f806f55585dab4c5a.