contao / installation-bundle

[READ-ONLY] Contao Installation Bundle
GNU Lesser General Public License v3.0
8 stars 9 forks source link

Check for disabled symlink function #65

Closed fritzmg closed 7 years ago

fritzmg commented 7 years ago

I recently had a problem on a Hoster where the Contao Install Tool was unable to create symlinks for unknown reasons (at the time). Unfortunately, the error message regarding the creation of symlinks will only either be

Unable to create […] link due to error code 1314: 'A required privilege is not held by the client'. Do you have the required Administrator-rights?'

(Windows only, see Symfony/Component/Filesystem/Filesystem.php#L392) or

Failed to create […] link from "[…]" to "[…]".

(see Symfony/Component/Filesystem/Filesystem.php#L395). The latter does not tell you much what the actual problem is.

In my case it was because the symlink function was disabled. In that case calling the symlink function would usually show a warning:

Warning: symlink() has been disabled for security reasons

This warning is of course swallowed by Symfony by using @symlink(…).

In order to provide better feedback in the Install Tool for such simple problems, may be a check could be integrated for this case? i.e.

in_array('symlink', explode(',', ini_get('disable_functions')))

If not, then I'll add it to the Contao Check at least.

Toflar commented 7 years ago

Wtf, who does disable this function? :D Can you also add an issue for the Contao Manager? I think it should check that too.

fritzmg commented 7 years ago

Wtf, who does disable this function? :D

Die Steirer in Österreich ;). But in all seriousness I think this is part of some sort of "recommended" security setting, along with proc_open, exec, shell_exec etc. … security by neutering 🙄

Can you also add an issue for the Contao Manager? I think it should check that too.

Sure. Also imho the Contao Manager should check for all things that the Contao Check also checks for Contao 4 (unless it does that already, I am not too familiar with the Contao Manager yet).

Toflar commented 7 years ago

for all things that the Contao Check

Agree. I guess it does for 90% already ;)

leofeyer commented 7 years ago

I also think that this feature belongs into the Contao check. We are not checking other system requirements in the install tool, either.