mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 15:19:07 +01:00
fix: increase consistency of rpcauth parsing
Previous rpcauth behavior was to sometimes ignore empty -rpcauth= settings, and other times treat them as errors. Empty rpcauth is now consistently treated as an error and prevents bitcoind from starting. Updates associated test cases. Also updates to non-deprecated logging macro. Co-Authored-By: Luke Dashjr <luke-jr+git@utopios.org> Co-Authored-By: Ryan Ofsky <ryan@ofsky.org>
This commit is contained in:
@@ -314,8 +314,9 @@ static bool InitRPCAuthentication()
|
||||
LogPrintf("Config options rpcuser and rpcpassword will soon be deprecated. Locally-run instances may remove rpcuser to use cookie-based auth, or may be replaced with rpcauth. Please see share/rpcauth for rpcauth auth generation.\n");
|
||||
strRPCUserColonPass = gArgs.GetArg("-rpcuser", "") + ":" + gArgs.GetArg("-rpcpassword", "");
|
||||
}
|
||||
if (gArgs.GetArg("-rpcauth", "") != "") {
|
||||
LogPrintf("Using rpcauth authentication.\n");
|
||||
|
||||
if (!gArgs.GetArgs("-rpcauth").empty()) {
|
||||
LogInfo("Using rpcauth authentication.\n");
|
||||
for (const std::string& rpcauth : gArgs.GetArgs("-rpcauth")) {
|
||||
std::vector<std::string> fields{SplitString(rpcauth, ':')};
|
||||
const std::vector<std::string> salt_hmac{SplitString(fields.back(), '$')};
|
||||
|
||||
Reference in New Issue
Block a user