config: stop truncating values at a '#' - #70
Merged
rsantacroce merged 1 commit intoSep 1, 2026
Conversation
Comments were stripped by cutting the line at the first '#' anywhere, before the key/value split and before unquote(). A password of p#ssw0rd silently became p, quoting did not help, and the pool then failed RPC auth with nothing in the log pointing at the config file. coinbase_tag and the address fields had the same exposure. '#' now introduces a comment only at the start of a line or after whitespace, and never inside double quotes. Inline comments still work, which is what proxy.conf.example documents. Adds tests/test_config.c — there was no config suite at all. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A
#anywhere in a config value silently truncates it.config.cstrips from the first#on the line before parsing, so a value that legitimately contains one arrives cut short — and nothing warns.The failure is quiet, which is what makes it worth fixing. An operator writes a value, reads it back in the file, and sees what they intended; only the running process disagrees.
This keeps
#as a comment introducer where it starts a comment, and stops it eating the rest of a value otherwise.Adds a
test_configsuite — there was no coverage of the config parser at all. The test that matters asserts the value arrives intact, so that whatever validates it later is validating the real string rather than a truncated one.Verified on a clean checkout of
main: full suite green, including the new suite.