]> git.ipfire.org Git - thirdparty/ccache.git/commit
Let CCACHE_UMASK apply only to files/directories in the cache directory
authorJoel Rosdahl <joel@rosdahl.net>
Sat, 1 Aug 2020 14:39:11 +0000 (16:39 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Sat, 1 Aug 2020 14:39:11 +0000 (16:39 +0200)
commit106a1d22919e65b521721af4124405ba0ed2e54a
tree7847ad7fa6d30c68b1dc3df76d74de189f22bd8a
parent10573efc80bc4df5052c9331244041cf4385d9b2
Let CCACHE_UMASK apply only to files/directories in the cache directory

Ever since the CCACHE_UMASK setting was added in
75dd382407a36b3ebab36bb1027eb43a07498bec it has applied to all files
created by ccache, including files such as the object files and
executables created when ccache is called for linking. This was
presumably the easy thing to do, but it affects the observable output
from the compiler. There are also two related bugs:

1. CCACHE_UMASK is not used when creating the initial configuration file.
2. CCACHE_UMASK is used when creating the log file.

Fix this by:

- saving the original umask in Context,
- introducing a UmaskScope class,
- using UmaskScope objects to set the original umask when calling the
  compiler and when copying result files from the cache, and
- setting the umask after creating the log file but before creating the
  initial configuration file.

Closes #628.
doc/MANUAL.adoc
src/Context.hpp
src/UmaskScope.hpp [new file with mode: 0644]
src/ccache.cpp
test/run
test/suites/base.bash