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...
Status: CLOSED FIXED
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
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-01 23:35 UTC by Duncan
Modified: 2014-12-10 19:49 UTC (History)
1 user (show)

See Also:


Attachments

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.

https://bugs.gentoo.org/show_bug.cgi?id=529998

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

https://git.samba.org/?p=ccache.git;a=blobdiff;f=conf.c;h=92c70c0648d5f5339fc28c889107f32f61c4bbb9;hp=56adb484ecd4079906e50aef03f930c5d98f7b79;hb=fc61ca9a9232f26ee3f714d4b8738d916f6948ff;hpb=f49770a4b142e82a3cf1f5e1da158f69e0447972
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.