[ccache] Insufficient environment sanitization in test.sh
rrendec at arista.com
Sat Dec 23 13:49:21 UTC 2017
I ran across a weird issue where test.sh fails in the CCACHE_NOHASHDIR
test because the CCACHE_HASHDIR variable happens to be set in my
I added a debug print in conf_update_from_environment() and the
variable that is inherited from the shell (CCACHE_HASHDIR) comes last,
so it has precedence over CCACHE_NOHASHDIR=1 that is set locally by the
I would say this is a problem with test.sh, which fails to sanitize the
environment properly at the beginning of the TEST() function. Probably
this is a problem with all boolean options, which accept either the
direct or negated form (e.g. CCACHE_HASHDIR vs. CCACHE_NOHASHDIR).
My idea is to iterate through the output of `env` and unset all
variables starting with CCACHE_ instead of listing them explicitly
(since this is pretty much what conf_update_from_environment() does).
More information about the ccache