mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-12 19:20:42 +02:00
rpcauthfile: Support multiple lines each with a different auth config
This commit is contained in:
parent
732efacf78
commit
07bdd6864a
@ -40,8 +40,8 @@ def main():
|
||||
rpcauth = f'{args.username}:{salt}${password_hmac}'
|
||||
|
||||
if args.output:
|
||||
file = open(args.output, "x", encoding="utf8")
|
||||
file.write(rpcauth)
|
||||
file = open(args.output, "a", encoding="utf8")
|
||||
file.write(rpcauth + "\n")
|
||||
|
||||
if args.json:
|
||||
odict={'username':args.username, 'password':args.password}
|
||||
|
@ -335,7 +335,7 @@ static bool InitRPCAuthentication()
|
||||
file.open(path);
|
||||
if (!file.is_open()) continue;
|
||||
std::string rpcauth;
|
||||
std::getline(file, rpcauth);
|
||||
while (std::getline(file, rpcauth)) {
|
||||
std::vector<std::string> fields{SplitString(rpcauth, ':')};
|
||||
const std::vector<std::string> salt_hmac{SplitString(fields.back(), '$')};
|
||||
if (fields.size() == 2 && salt_hmac.size() == 2) {
|
||||
@ -345,6 +345,7 @@ static bool InitRPCAuthentication()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
g_rpc_whitelist_default = gArgs.GetBoolArg("-rpcwhitelistdefault", gArgs.IsArgSet("-rpcwhitelist"));
|
||||
for (const std::string& strRPCWhitelist : gArgs.GetArgs("-rpcwhitelist")) {
|
||||
|
Loading…
Reference in New Issue
Block a user