]> git.ipfire.org Git - thirdparty/ccache.git/commit
fix: Only use /run/user/<UID>/ccache-tmp if writable
authorJoel Rosdahl <joel@rosdahl.net>
Sun, 3 Apr 2022 08:50:43 +0000 (10:50 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Sun, 3 Apr 2022 08:56:56 +0000 (10:56 +0200)
commitef2e922f9642f943199138447b29ec53fa63ea68
treee69651e609217f37e1c29efc85a84a258aa62af2
parent47eceb4d4f0646d6785c6ddfdb28343976549ed3
fix: Only use /run/user/<UID>/ccache-tmp if writable

The fix for #984 addressed a problem when /run/user/0 already exists and
ccache is run with fakeroot. However, it didn’t handle the case when
/run/user/0/ccache-tmp already exists, which will happen for instance if
the real root user has run ccache at least once.

Fix this by using access(2) to verify that the ccache-tmp directory is
writable. Note: Can’t just check the mode bits of the directory since
they appear OK since fakeroot fakes the UID.

Fixes #1044.
src/Config.cpp