]> git.ipfire.org Git - thirdparty/ccache.git/commit
fix: Use correct umask when populating primary cache from secondary
authorJoel Rosdahl <joel@rosdahl.net>
Tue, 7 Jun 2022 14:53:44 +0000 (16:53 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Sat, 20 Aug 2022 11:33:12 +0000 (13:33 +0200)
commit8294d99c547d952d9d0fa1fff607eb7dfd9f9f7d
tree3c0a747e2f1cbb24f351bbe1a546b9e56a09636a
parent87cbd482009c2fabc62ae68e18d77ffbaa02b04f
fix: Use correct umask when populating primary cache from secondary

Util::get_umask retrieves the process's umask and caches it to avoid
some system calls. This doesn't interact well now when using UmaskScope
to change umask temporarily since Util::get_umask then only sometimes
returns the correct value. This leads to the incorrect umask being used
when writing cache entries to the primary storage for secondary storage
hits.

Fix this by not caching the umask system call.

Closes #1087.

(cherry picked from commit 6484cdfa0f22214d91cd61562f48d4d9060d2533)
src/Util.cpp
src/Util.hpp
test/suites/secondary_file.bash