Bug 10978 - ccache 3.2 ccache.conf: Permission denied, shared ccache permissions breakage (tmpfile handling related)
Summary: ccache 3.2 ccache.conf: Permission denied, shared ccache permissions breakage...
Alias: None
Product: ccache
Classification: Unclassified
Component: ccache (show other bugs)
Version: 3.2
Hardware: All All
: P5 normal
Target Milestone: 3.2.1
Assignee: Joel Rosdahl
QA Contact: Joel Rosdahl
Depends on:
Reported: 2014-12-01 23:35 UTC by Duncan
Modified: 2014-12-10 19:49 UTC (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Duncan 2014-12-01 23:35:15 UTC
Ccache 3.2's new temp handling kills shared cache by disregarding the umask setting, forcing 0600 perms on the cache-private ccache.conf as well as the per-subdir stats files.  Attempting to build with a different user then fails with

ccache: error: <cache-path>/ccache.conf: Permission denied.

Particularly frustrating is the fact that even with SGID (and even SUID) set on the directory as recommended in the manpage and with the recommended 002 umask set in /etc/ccache.conf, even after manually changing the file perms and ownership back to the appropriate user/group and 0664, at the next run ccache rewrites them once again to incorrect ownership, 0600 perms, breaking itself once again.

Note that it's not just ccache.conf.  The stats files are also affected.

This affects gentoo rather heavily as if portage is configured both to enable ccache (not the default but widely used) and for userprivs (the default instead of root), as soon as ccache 3.2 is merged, nothing else can be built, with failure normally at the configure step due to broken compiler.


See particularly comment 11, which implicates the new tmpfile handling (long link):

Comment 2 Joel Rosdahl 2014-12-10 19:32:21 UTC
Fixed in 5c5ead0337f0d90be8fe58b09a63ef6527fd316c on 3.2-maint.
Comment 3 Joel Rosdahl 2014-12-10 19:49:50 UTC
Included in v3.2.1.