trsteel88 / TrsteelCkeditorBundle

Symfony2 bundle for easy integration of the CKEditor WYSIWYG
97 stars 59 forks source link

Fix cache permissions #89

Closed garak closed 8 years ago

garak commented 9 years ago

Before this fix, the HTML_Purifier cache is created with wrong permissions, making impossible to clear cache.

trsteel88 commented 9 years ago

I don't think this belongs here. What does the htmlpurifier set it to at the moment and why would the permissions be different?

If we were to bring this into the bundle, there should be a way to configure it.

garak commented 9 years ago

If I remember correctly (sorry, but it was some times ago), the current default setting is creating directory with 0700, so every time you try to clear cache you get a permission error. I'm using this with default permission settings suggested by Symfony docs (e.g. with acl), and my proposed fix works for me.

trsteel88 commented 9 years ago

hmmm, every server is configured differently though and I don't want to break other people's permissions. I don't ever have this issue.

0700 means that only the current user will have access to Read/Write/Execute.

If we change it to 0775 it means:

User: Read/Write/Execute Group: Read/Write/Execute World: Read/Execute

I am not comfortable changing this because World shouldn't be able to access it and in some instances you may not want the Group to be able to access it (e.g A user may be part of an Apache group but only that particular user should be able to access it).

If you want this to be merge you'll need to add it as a configuration options and default it to null so we can let htmlpurifier use its default value. If it is set, use the set value.

garak commented 9 years ago

I found on http://htmlpurifier.org/live/configdoc/plain.html#Cache.SerializerPermissions that default option is 755 (with 493 being the decimal version of octal). So the problem is that currently permissions are limited to owner to write. Anyway, I see that this need to be configurable. I'll change this PR asap.