Skip to content

wrong Filepermissions, on some (!) machines, V7.1.3 #1950

@Eumolp

Description

@Eumolp

This bug seems still to bite me. But not in gerneral:
On my development machine (same Typo3 V12.4. php8.1) everything is OK, but installing on a live-Server this issue drives you mad.

I am not the best developer, but I checked:

  • GeneralUtility::writeFile() does not explicitly set a right
  • the behavior is platform-specific and unstable (locally it works, live not)

When writing temporary JS files in AssetService.php (e.g. $tmpFile), the file permissions are set to 0600 depending on the system. This prevents loading in the FE if the umask is restrictive.
Suggestion: After GeneralUtility::writeFile() explicitly set @chmod($tmpFile, 0644).

Classes/Service/AssetService.php:
781 > GeneralUtility::writeFile($tmpFile, $contents, true);
782 > + @chmod($tmpFile, 0644);
783 > if (@rename($tmpFile, $file) === false) {

So far the bug only occures with JavaScript files, not CSS. But this is not really tested.

Originally posted by @Eumolp in #1944

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions