New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
init: torcontrol argument should be validated #23589
Comments
Let me try tackling this! |
Ok, so I was able to add a function successfully that can check if the given string is a valid In fact, bitcoind is not raising an error for any invalid argument passed at initialization.
Just a confirmation. When the |
Is the Args Manager flags supposed to help with this? |
common sense would suggest there should be a message and some exit status, other than 0 |
|
hey folks, I'm very new to the codebase and wanted to try my hands around this issue. Also, I saw a PR that is targeting this issue so what's the update on that, is the issue still open? |
- Adds `util/network` with a helper function `hasValidHostPort(socketAddr)` for easy checking. The only checks for `hostname` are: not empty, and no spaces. - Returns error at init if `-torcontrol` is not a valid host:port combo. - `StartTorControl` returns a `bool`, and has a return parameter `error` where a suitable message is set at failure. Fixes bitcoin#23589
- Adds `util/network` with a helper function `hasValidHostPort(socketAddr)` for easy checking. The only checks for `hostname` are: not empty, and no spaces. - Returns error at init if `-torcontrol` is not a valid host:port combo. - `StartTorControl` returns a `bool`, and has a return parameter `error` where a suitable message is set at failure. Fixes bitcoin#23589
- Returns error at init if `-torcontrol` is not a valid host:port combo. - `StartTorControl` returns a `bool`, and has a return parameter `error` where a suitable message is set at failure. Fixes bitcoin#23589
- Returns error at init if `-torcontrol` is not a valid host:port combo. - `StartTorControl` returns a `bool`, and has a return parameter `error` where a suitable message is set at failure. Fixes bitcoin#23589
- Returns error at init if `-torcontrol` is not a valid host:port combo. - `StartTorControl` returns a `bool`, and has a return parameter `error` where a suitable message is set at failure. Fixes bitcoin#23589
- Returns error at init if `-torcontrol` is not a valid host:port combo. - `StartTorControl` returns a `bool`, and has a return parameter `error` where a suitable message is set at failure. Fixes bitcoin#23589
- Returns error at init if `-torcontrol` is not a valid host:port combo. - `StartTorControl` returns a `bool`, and has a return parameter `error` where a suitable message is set at failure. Fixes bitcoin#23589
- Returns error at init if `-torcontrol` is not a valid host:port combo. - `StartTorControl` returns a `bool`, and has a return parameter `error` where a suitable message is set at failure. Fixes bitcoin#23589
- Returns error at init if `-torcontrol` is not a valid host:port combo. - `StartTorControl` returns a `bool`, and has a return parameter `error` where a suitable message is set at failure. Fixes bitcoin#23589
- Returns error at init if `-torcontrol` is not a valid host:port combo. - `StartTorControl` returns a `bool`, and has a return parameter `error` where a suitable message is set at failure. Fixes bitcoin#23589
I see it not throwing the error because it is returning true here if it has no bitcoin/src/util/strencodings.cpp Line 117 in 61d59fe
I can open a PR to change this to false but it would affect these files that use
We could also do a check just for |
does this PR close this issue? |
- Returns error at init if `-torcontrol` is not a valid host:port combo. - `StartTorControl` returns a `bool`, and has a return parameter `error` where a suitable message is set at failure. Fixes bitcoin#23589
- Returns error at init if `-torcontrol` is not a valid host:port combo. - `StartTorControl` returns a `bool`, and has a return parameter `error` where a suitable message is set at failure. Fixes bitcoin#23589
I accidentally
-torcontrol=1
today (instead of-listenonion=1
) and was confused that it was accepted, as the argument needs to behost:port
.Expected outcome would be an error message and exiting.
Useful skills:
Want to work on this issue?
For guidance on contributing, please read CONTRIBUTING.md before opening your pull request.
The text was updated successfully, but these errors were encountered: