Add support for rpccookiefile alternative to rpcuser/rpcpassword#60
Merged
luke-jr merged 20 commits intoOCEAN-xyz:masterfrom Mar 7, 2025
Merged
Add support for rpccookiefile alternative to rpcuser/rpcpassword#60luke-jr merged 20 commits intoOCEAN-xyz:masterfrom
luke-jr merged 20 commits intoOCEAN-xyz:masterfrom
Conversation
…to 20 20 is sufficient
…once and reuse - in order to eliminate discrepancies between char array sizes, use sizeof() in max_string_length of datum_config_options - introduce a warning in case a config option is truncated - where userpass was reused for a filepath, create a separate variable - reduce user and pass to 128 bytes - exit during config upon parsing error, makes more sense to me
Instead of sizing the first element, size the type Co-authored-by: Luke Dashjr <luke_github1@dashjr.org>
In fact the maximums are enforced to be not more than 60 in datum_conf.c
|
Tested "rpccookiefile" without "rpcuser" nor "rpcpassword" in the config file at bbfcd29, seems to work fine. |
jesterhodl
reviewed
Feb 6, 2025
src/datum_conf.c
Outdated
| datum_config_opt_missing_error(datum_config_get_option_info2("bitcoind", "rpcpassword")); | ||
| return 0; | ||
| } | ||
| sprintf(datum_config.bitcoind_rpcuserpass, "%s:%s", datum_config.bitcoind_rpcuser, datum_config.bitcoind_rpcpassword); |
Contributor
There was a problem hiding this comment.
This is safe because we truncate to max_string_len, but compiler doesn't know and gives a warning. How about resize bitcoind_rpcuser and bitcoind_rpcpassword in datum_conf.h from 256 to 128. That would be in line with #46 where I set these to 128 to align array sizes with max_string_len limits. (Yes, I still have that PR to work on)
And use snprintf to future-proof in case sizes are changed:
snprintf(datum_config.bitcoind_rpcuserpass, sizeof(datum_config.bitcoind_rpcuserpass), "%s:%s", datum_config.bitcoind_rpcuser, datum_config.bitcoind_rpcpassword);
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.
No description provided.