]> 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>
Tue, 7 Jun 2022 15:31:54 +0000 (17:31 +0200)
commit6484cdfa0f22214d91cd61562f48d4d9060d2533
tree65bea0de7f5f00dc4715fc9b3964eba77378d104
parente55d7e6d97e65580e21389b1b5b69d35421720be
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.
src/Util.cpp
src/Util.hpp
test/suites/secondary_file.bash