Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 293522

./sites/default/files directory permission check is incorrect during install AND status report

$
0
0

Problem/Motivation

The install.php script and the "Reports > Status" Report both check for the files directory to have read/write permissions, but they should be checking for read/write/execute permissions instead.

This can cause various hard-to-troubleshoot permission-related errors with the files directory, including on Docker environments.

Steps to reproduce

  • Drupal is already installed
  • (goof up permissions) chmod 766 ./sites/default/files
  • Click Reports > Status Report
  • File System is green (should be red here, directory is not executable). No big deal yet
  • Click on Configuration > Performance
  • Click either Aggregate checkboxes under Bandwidth optimization or both
  • Clear all caches
  • You'll notice the CSS problem right away if that's what you selected to aggregate

Results

The specified file temporary://file6GnL0E could not be copied, because the destination directory is not properly configured. This may be caused by a problem with file or directory permissions. More information is available in the system log.

Proposed resolution

Install.php and Reports > Status should check for read/write/execute permissions (x77) on the directory in question

Remaining tasks

  • The patch needs to be rerolled for the latest version of Drupal 8.
  • It is not possible to add a reliable automated test for this issue.
Contributor tasks needed
TaskNovice task?Contributor instructionsComplete?
Reroll the patch if it no longer applies.Instructions
Update the issue summaryInstructions
Update the issue summary noting if allowed during the betaInstructions

User interface changes

  • None known.

API changes

Two functions will be added to the API:

  • file_directory_is_writable($uri)
  • drupal_is_executable($uri)

Original report by [mlehner616]

The install.php script checks for the files directory to have read/write permissions (x66), should be checking for read/write/execute instead (x77).
If the files directory is created with just read/write permissions, turning on caching/compression strips off CSS and displays errors regarding temporary files.

Install.php should check for this correctly, as well as the status report script.
Basically these two scripts don't care if execute permissions are set on ./sites/default/files

This may be a critical issue but I'll let someone more technical triage this one.
Tested multiple times and was able to reproduce this behavior:

Scenario 1

Drupal is already installed
(goof up permissions) chmod 766 ./sites/default/files
Click Reports > Status Report
File System is green (should be red here, directory is not executable). No big deal yet
Click on Configuration > Performance
Click either Aggregate checkboxes under Bandwidth optimization or both
Clear all caches
You'll notice the CSS problem right away if that's what you selected to aggregate

Here are the errors:
The specified file temporary://file6GnL0E could not be copied, because the destination directory is not properly configured. This may be caused by a problem with file or directory permissions. More information is available in the system log.
The specified file temporary://fileNY1O4m could not be copied, because the destination directory is not properly configured. This may be caused by a problem with file or directory permissions. More information is available in the system log.
The specified file temporary://fileSsnd94 could not be copied, because the destination directory is not properly configured. This may be caused by a problem with file or directory permissions. More information is available in the system log.
The specified file temporary://fileV3PZdN could not be copied, because the destination directory is not properly configured. This may be caused by a problem with file or directory permissions. More information is available in the system log.
The specified file temporary://fileSFTvjv could not be copied, because the destination directory is not properly configured. This may be caused by a problem with file or directory permissions. More information is available in the system log.
The specified file temporary://fileLB2jpd could not be copied, because the destination directory is not properly configured. This may be caused by a problem with file or directory permissions. More information is available in the system log.
The specified file temporary://fileSKgNvV could not be copied, because the destination directory is not properly configured. This may be caused by a problem with file or directory permissions. More information is available in the system log.
The specified file temporary://file1KkKCD could not be copied, because the destination directory is not properly configured. This may be caused by a problem with file or directory permissions. More information is available in the system log.
The specified file temporary://fileCHUVJl could not be copied, because the destination directory is not properly configured. This may be caused by a problem with file or directory permissions. More information is available in the system log.
The specified file temporary://fileNcdmR3 could not be copied, because the destination directory is not properly configured. This may be caused by a problem with file or directory permissions. More information is available in the system log.

What's expected:
Install.php and Reports > Status Report should red flag the non-executable files directory (permissions must be 777)

Install.php actually does the same thing. It doesn't care that ./sites/default/files directory is 766 when it should be 777


Viewing all articles
Browse latest Browse all 293522

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>