/var/cache/templates/ File Permissions

Does anyone know where the permissions for these files are being pulled from? They are php files and permissions are set at 0666. No, they are not being set from config.local.php. I would like them to be 0644 or even better 0600 since they are php files.

Should be using the permissions identified in config.local.php. However, you'd have to dig through the Templater and Registry caches to see just where it's being set.



But note that the 'templater' is 3rd party code and so they probably do their own thing… Easiest thing to do would be to make a umask() call in your config.local.php. This will force anything that doesn't specify permissions to use what the mask is set to versus the hosting/php default.

Should but it isn't. It has to be defined somewhere because otherwise my server would default to 0644. Hence the reason for the thread.

Then you'll either have to dig through the templater and registry class objects or file a bug report. If it were me, I'd do the latter.

[quote name='tbirnseth' timestamp='1436489073' post='222347']If it were me, I'd do the latter.

[/quote]



I've pretty much given up on both helpdesk and bug tracker. Most likely I would get a “Working as designed” response.

[quote name='The Tool' timestamp='1436490899' post='222348']

I've pretty much given up on both helpdesk and bug tracker. Most likely I would get a “Working as designed” response.

[/quote]



Yep, that used to happen:( But we will sort this out soon.



The permission for /var/cache/templates/ files are set in app/lib/vendor/smarty/smarty/libs/Smarty.class.php file.

See the public $_file_perms = 0644;

But: this variable is overwritten in app/Tygh/SmartyEngine/Core.php - so this is what you need.


public $_dir_perms = 0777;
public $_file_perms = 0666;

Thanks imac! You saved me a lot of time digging through files.

[quote name='imac' timestamp='1436521516' post='222399']

Yep, that used to happen:( But we will sort this out soon.



The permission for /var/cache/templates/ files are set in app/lib/vendor/smarty/smarty/libs/Smarty.class.php file.

See the public $_file_perms = 0644;

But: this variable is overwritten in app/Tygh/SmartyEngine/Core.php - so this is what you need.


public $_dir_perms = 0777;
public $_file_perms = 0666;


[/quote]

i hope this will be changed by default to 644 755 because this is causing some errors in server log



[Fri Jul 10 16:47:51.552704 2015] [access_compat:error] [pid 23706] [client 54.240.145.107:16282] AH01797: client denied by server configuration: /home/demelsi/public_html/var/cache/misc/statics/design/themes/responsive/media

[Fri Jul 10 16:47:39.139612 2015] [access_compat:error] [pid 23705] [client 54.240.145.107:14832] AH01797: client denied by server configuration: /home/demelsi/public_html/var/cache/misc/statics/design/themes/responsive/media

[Fri Jul 10 16:46:55.171987 2015] [access_compat:error] [pid 23796] [client 54.240.145.107:9065] AH01797: client denied by server configuration: /home/demelsi/public_html/var/cache/misc/statics/design/themes/responsive/media

[Fri Jul 10 16:46:27.660126 2015] [access_compat:error] [pid 25243] [client 54.240.145.107:5206] AH01797: client denied by server configuration: /home/demelsi/public_html/var/cache/misc/statics/design/themes/responsive/media

[Fri Jul 10 14:55:58.277004 2015] [access_compat:error] [pid 22771] [client 54.240.144.152:23523] AH01797: client denied by server configuration: /home/demelsi/public_html/var/cache/misc/statics/design/themes/responsive/media





now we know where to set this properly

demeldoo, as far as I know, this issue is only related to the /var/cache/templates/ file persmissions. All of my other /var/cache/ files have the correct permissions. I do not see /var/cache/misc/statics/design/themes/responsive/media in my files. What kind of files are you seeing and what permissions do they have?

Any/all file/directory permissions should use the constants defined in config.local.php.

NO ONE SHOULD HAVE TO SEARCH to find usage. It should be defined in one place and used throughout.

[quote name='tbirnseth' timestamp='1436553975' post='222487']

Any/all file/directory permissions should use the constants defined in config.local.php.

NO ONE SHOULD HAVE TO SEARCH to find usage. It should be defined in one place and used throughout.

[/quote]



Right, thanks Tony. I created a task on this.

Im getting many of these too, can I fix it 4.5.2

thanks

John

Sun Jul 01 08:48:53.205413 2018] [access_compat:error] [pid 1251] [client 66.249.66.20:65511] AH01797: client denied by server configuration:

public_html/var/cache/misc/assets/design/themes/responsive, referer: https://www.hivis.co.uk/security-id-sia-arm-band.html

'public_html' should NOT be in that path. My guess is that you have some type of server configuration issue that has changed. All references to cs-cart files should be FROM public_html, not its parent directory.