mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
rpc: Validate -rpcauth arguments
This commit is contained in:
@@ -253,11 +253,14 @@ static bool InitRPCAuthentication()
|
||||
if (gArgs.GetArg("-rpcauth","") != "")
|
||||
{
|
||||
LogPrintf("Using rpcauth authentication.\n");
|
||||
for (std::string rpcauth : gArgs.GetArgs("-rpcauth")) {
|
||||
for (const std::string& rpcauth : gArgs.GetArgs("-rpcauth")) {
|
||||
std::vector<std::string> fields;
|
||||
boost::split(fields, rpcauth, boost::is_any_of(":$"));
|
||||
if (fields.size() == 3) {
|
||||
g_rpcauth.push_back(fields);
|
||||
} else {
|
||||
LogPrintf("Invalid -rpcauth argument.\n");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user