mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-20 23:20:45 +02:00
Allow -rpccookieperms on Windows
This commit is contained in:
parent
24ea5d9724
commit
2a704c3916
@ -265,17 +265,12 @@ static bool InitRPCAuthentication()
|
|||||||
fs::perms cookie_perms{DEFAULT_COOKIE_PERMS};
|
fs::perms cookie_perms{DEFAULT_COOKIE_PERMS};
|
||||||
auto cookie_perms_arg{gArgs.GetArg("-rpccookieperms")};
|
auto cookie_perms_arg{gArgs.GetArg("-rpccookieperms")};
|
||||||
if (cookie_perms_arg) {
|
if (cookie_perms_arg) {
|
||||||
#ifdef WIN32
|
|
||||||
LogPrintf("Unable to set unix-style file permissions on cookie via -rpccookieperms using Windows systems\n");
|
|
||||||
return false;
|
|
||||||
#else
|
|
||||||
auto perms{ConvertPermsToOctal(*cookie_perms_arg)};
|
auto perms{ConvertPermsToOctal(*cookie_perms_arg)};
|
||||||
if (!perms) {
|
if (!perms) {
|
||||||
LogPrintf("Invalid -rpccookieperms=%s; must be a 3 digit octal number (e.g. 400, 440 or 444).\n", *cookie_perms_arg);
|
LogPrintf("Invalid -rpccookieperms=%s; must be a 3 digit octal number (e.g. 400, 440 or 444).\n", *cookie_perms_arg);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
cookie_perms = static_cast<fs::perms>(*perms);
|
cookie_perms = static_cast<fs::perms>(*perms);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!GenerateAuthCookie(&strRPCUserColonPass, cookie_perms)) {
|
if (!GenerateAuthCookie(&strRPCUserColonPass, cookie_perms)) {
|
||||||
|
@ -618,7 +618,7 @@ void SetupServerArgs(ArgsManager& argsman)
|
|||||||
argsman.AddArg("-rpcbind=<addr>[:port]", "Bind to given address to listen for JSON-RPC connections. Do not expose the RPC server to untrusted networks such as the public internet! This option is ignored unless -rpcallowip is also passed. Port is optional and overrides -rpcport. Use [host]:port notation for IPv6. This option can be specified multiple times (default: 127.0.0.1 and ::1 i.e., localhost)", ArgsManager::ALLOW_ANY | ArgsManager::NETWORK_ONLY, OptionsCategory::RPC);
|
argsman.AddArg("-rpcbind=<addr>[:port]", "Bind to given address to listen for JSON-RPC connections. Do not expose the RPC server to untrusted networks such as the public internet! This option is ignored unless -rpcallowip is also passed. Port is optional and overrides -rpcport. Use [host]:port notation for IPv6. This option can be specified multiple times (default: 127.0.0.1 and ::1 i.e., localhost)", ArgsManager::ALLOW_ANY | ArgsManager::NETWORK_ONLY, OptionsCategory::RPC);
|
||||||
argsman.AddArg("-rpcdoccheck", strprintf("Throw a non-fatal error at runtime if the documentation for an RPC is incorrect (default: %u)", DEFAULT_RPC_DOC_CHECK), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::RPC);
|
argsman.AddArg("-rpcdoccheck", strprintf("Throw a non-fatal error at runtime if the documentation for an RPC is incorrect (default: %u)", DEFAULT_RPC_DOC_CHECK), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::RPC);
|
||||||
argsman.AddArg("-rpccookiefile=<loc>", "Location of the auth cookie. Relative paths will be prefixed by a net-specific datadir location. (default: data dir)", ArgsManager::ALLOW_ANY, OptionsCategory::RPC);
|
argsman.AddArg("-rpccookiefile=<loc>", "Location of the auth cookie. Relative paths will be prefixed by a net-specific datadir location. (default: data dir)", ArgsManager::ALLOW_ANY, OptionsCategory::RPC);
|
||||||
argsman.AddArg("-rpccookieperms=<octal>", strprintf("Set the permissions on the RPC auth cookie file to the specified octal value on unix systems only (default: %u)", PermsToOctalString(DEFAULT_COOKIE_PERMS).c_str()), ArgsManager::ALLOW_ANY, OptionsCategory::RPC);
|
argsman.AddArg("-rpccookieperms=<octal>", strprintf("Set the permissions on the RPC auth cookie file to the specified octal value (default: %u)", PermsToOctalString(DEFAULT_COOKIE_PERMS).c_str()), ArgsManager::ALLOW_ANY, OptionsCategory::RPC);
|
||||||
argsman.AddArg("-rpcpassword=<pw>", "Password for JSON-RPC connections", ArgsManager::ALLOW_ANY | ArgsManager::SENSITIVE, OptionsCategory::RPC);
|
argsman.AddArg("-rpcpassword=<pw>", "Password for JSON-RPC connections", ArgsManager::ALLOW_ANY | ArgsManager::SENSITIVE, OptionsCategory::RPC);
|
||||||
argsman.AddArg("-rpcport=<port>", strprintf("Listen for JSON-RPC connections on <port> (default: %u, testnet: %u, signet: %u, regtest: %u)", defaultBaseParams->RPCPort(), testnetBaseParams->RPCPort(), signetBaseParams->RPCPort(), regtestBaseParams->RPCPort()), ArgsManager::ALLOW_ANY | ArgsManager::NETWORK_ONLY, OptionsCategory::RPC);
|
argsman.AddArg("-rpcport=<port>", strprintf("Listen for JSON-RPC connections on <port> (default: %u, testnet: %u, signet: %u, regtest: %u)", defaultBaseParams->RPCPort(), testnetBaseParams->RPCPort(), signetBaseParams->RPCPort(), regtestBaseParams->RPCPort()), ArgsManager::ALLOW_ANY | ArgsManager::NETWORK_ONLY, OptionsCategory::RPC);
|
||||||
argsman.AddArg("-rpcserialversion", strprintf("Sets the serialization of raw transaction or block hex returned in non-verbose mode, non-segwit(0) (DEPRECATED) or segwit(1) (default: %d)", DEFAULT_RPC_SERIALIZE_VERSION), ArgsManager::ALLOW_ANY, OptionsCategory::RPC);
|
argsman.AddArg("-rpcserialversion", strprintf("Sets the serialization of raw transaction or block hex returned in non-verbose mode, non-segwit(0) (DEPRECATED) or segwit(1) (default: %d)", DEFAULT_RPC_SERIALIZE_VERSION), ArgsManager::ALLOW_ANY, OptionsCategory::RPC);
|
||||||
|
Loading…
Reference in New Issue
Block a user