site_cache_dir: use /var/tmp instead of /var/cache on unix#148
site_cache_dir: use /var/tmp instead of /var/cache on unix#148gaborbernat merged 1 commit intotox-dev:mainfrom
Conversation
Turns out `/var/cache` might be non-writable by regular users (e.g. on ubuntu), so we are better off using `/var/tmp` which is and it is what was suggested in original appdirs discussion in ActiveState/appdirs#77
|
Hmm, this change somehow seems counter-intuitive. Also, check what the FHS says about this (5.5 and 5.15): https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch05.html Especially that stuff in /var/tmp is deleted "less frequently", but in a site-specific (not: app-specific) manner seems to make it unsuitable for application cache files. Cache files are not temporary files, they are just files that can be rebuilt (but that might be expensive, so you don't want some external "site cleanup cron job" delete that stuff). Maybe the only thing that caused the initial issue (see top post) with |
|
@ThomasWaldmann The application was not installed by root, but user-installed applications want to share expensive cache between users as well. In practical terms it seems systemd will delete files that weren't even read by anyone in I agree that |
|
This breaking change in @ThomasWaldmann is correct that applications should put their own cache data in a subdirectory of Please consider reverting this. |
Open a PR with this change. We do not plan to revert. |
This directory was changed from /var/cache to /var/tmp in tox-dev#148 due to permissions issues. However, /var/tmp is an insecure location to store anything with a predictable filename, because any other user could have written it first. This leads to vulnerabilities categorized under CWE-377 and CAPEC-149. To deal with the permissions issues, applications should put their own cache data in a subdirectory of /var/cache (e.g. /var/cache/cups), and the application’s package is responsible for ensuring the subdirectory exists and giving it the correct permissions. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
|
Opened #239. |
Just to be clear, site_cache_dir was introduced about a week before this PR, realistically I doubt anyone was using it during that period.
Thanks, let's continue there. |
Turns out
/var/cachemight be non-writable by regular users (e.g. on ubuntu), so we are better off using/var/tmpwhich is and it is what was suggested in original appdirs discussion in ActiveState/appdirs#77site_cache_dirwas introduced very recently and it seems fine to make this breaking change right now.Related #145