Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The SysTempDirCheck does not check if it can write subdirectories #569

Closed
Toflar opened this issue Jun 23, 2020 · 0 comments
Closed

The SysTempDirCheck does not check if it can write subdirectories #569

Toflar opened this issue Jun 23, 2020 · 0 comments
Labels
Milestone

Comments

@Toflar
Copy link
Member

Toflar commented Jun 23, 2020

This might lead to issues such as contao/contao#1813.

However, creating subdirectories in /tmp must be allowed for everyone. Go check your personal temporary directory on your OS, I'm sure you'll probably find even more directories than you'll find files.

Also, there's many sources for this, just search the Internet for "correct permissions for tmp directory" but here's one for you: https://www.thegeekdiary.com/unix-linux-what-is-the-correct-permission-of-tmp-and-vartmp-directories/

Also, checking out the code of SysTempDirCheck.php I'm not sure if the current error message is correct. It seems like it outputs information related to open_basedir. However, that is just one use case. It might also be the case that the configured temporary directory just does not have the correct rights. The open_basedir check should be separate from it.
So imho

  1. Check if a file can created in sys_get_temp_dir()
  2. Check if a file can be written to in sys_get_temp_dir()
  3. Check if a directory can be created in sys_get_temp_dir()
  4. Check if a file can be written to that created directory

If any of those checks fail:

  1. Split the open_basedir paths (:) and check if they match sys_get_temp_dir(). If not, the configuration of open_basedir is wrong.
  2. Otherwise the permissions of the temporary directory seem to be wrong.

/cc @ausi

@aschempp aschempp added the bug label Jul 1, 2020
@aschempp aschempp added this to the 1.2.6 milestone Jul 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants