Hi Henri,

Verifying the value sounds like a good improvement.

The fix you suggested doesn't quite work since there is no conf variable
available, so I guess you have made other changes as well. Also, there is
an optional "verifier" for some configuration items that should be run as
well. I made a fix based on your suggestion:
https://github.com/jrosdahl/ccache/commit/3d05ccd8c8607a051cb80beeff340cc9aa1489c6

-- Joel

On Mon, 17 Jun 2019 at 13:49, Houder via ccache <ccache@lists.samba.org>
wrote:

> Hi list,
>
> Just reporting (it is not my intention to create an account
> on github in order to report a bug).
>
> Downloaded 3.7.1 and compiled it on Cygwin.
>
> Call flow for "ccache -o <key>=<value>
>
> ccache_main // src/ccache.c
>    ccache_main_options // src/ccache.c
>      conf_set_value_in_file // src/conf.c
>
> conf_set_value_in_file
>    find_conf(key)
>    "insert (or replace) key/value in cfg file"
>
> Function conf_set_value_in_file() only verifies that the key
> makes sense; it does not check the user provided value.
>
> Resulting in an _illegal_ value in the cfg file, if the user
> provided an illegal value.
>
> Subsequently, a command like "ccache -s" fails, reporting an
> illegal cfg file.
>
> Adding
>
>       if (!item->parser(value, (char *)conf + item->offset, errmsg)) {
>           *errmsg = format("Henri: unknown value \"%s\"", value);
>           return false;
>       }
>
> after the call to find_key (in conf_set_value_in_file() )
>
> rejects an illegal value.
>
> Henri
>
> _______________________________________________
> ccache mailing list
> ccache@lists.samba.org
> https://lists.samba.org/mailman/listinfo/ccache
>
_______________________________________________
ccache mailing list
ccache@lists.samba.org
https://lists.samba.org/mailman/listinfo/ccache

Reply via email to