In this case it doesn't, since the function is only used for config
parsing (I hope). Add the check to prevent a memory leak, just in
case this changes in the future.
TODO: Option parsing functions should really be moved elsewhere and
renamed appropriately, like set_opt_kernel() or config_set_kernel(),
if config parsing is to remain as-is. It will probably change
drastically, so leaving as-is for now.
This reverts commit 8dd1c2d4af.
Introduced a security bug: since CCAN/opt is used to parse the JSON
config (something it is not meant to do), it was possible to specify
the default of
"api-listen":false
in .conf and expect the API to be disabled. However, since CCAN/opt
does not check for parameters to OPT_WITHOUT_ARG, this got set to
true anyway, and enabled the API on a (possibly unfirewalled) network.
For this reason, configuration options are not named uniformly.
This should have been reverted as soon as it became known:
4c4b909be6 (Fri Feb 28)
Sorry for that.
It looks like there's an exploit that abuses said command, but it is still not clear exactly how.
There's also an additional message when the reconnect happens: "WARNING: POTENTIAL CLIENT.EXPLOIT!", but it requires you to be actively monitoring your log to catch it, and in which case you already get a "Reconnect requested from Pool 0 to 127.0.0.1" message.
Note that disabling 'client.reconnect' might affect some pools that rely on the feature, like pools that you lease your rig to.
Oh and this is dry-coded. :)
There are no other kernels, and differentiating kernels in the future
should be done in a universal way, preferably not by choosing a function.
Note how queue_kernel() is used (passed as function reference).
WIP!
Use a string instead of a state-machine-ey kernel selection mechanism
where kernel names have to be predefined. This should allow just dropping
new kernels into dir `kernel` without bloating the code in three other
places.
Is in dire need of a cleanup, function parameter check, edge case check -
all the usual testing.
In particular, checking these definitions/keywords:
* enum cl_kernels
* kname
* [c]gpu[s]->kernel (and similar)
* memory cleanup after strdup()?..
* chosen_kernel
* queue_scrypt_kernel
* strbuf
* initCl