Let [rpc_admin_allow] take multiple lines.

This commit is contained in:
Arthur Britto
2013-01-21 17:18:21 -08:00
parent ab6ab491eb
commit d569633c09
4 changed files with 16 additions and 6 deletions

View File

@@ -40,9 +40,13 @@ int iAdminGet(const Json::Value& jvRequest, const std::string& strRemoteIp)
: true
: false;
// Meets IP restriction for admin.
bool bAdminIP = theConfig.RPC_ADMIN_ALLOW.empty()
? strRemoteIp == "127.0.0.1"
: strRemoteIp == theConfig.RPC_ADMIN_ALLOW;
bool bAdminIP = false;
BOOST_FOREACH(const std::string& strAllowIp, theConfig.RPC_ADMIN_ALLOW)
{
if (strAllowIp == strRemoteIp)
bAdminIP = true;
}
if (bPasswordWrong // Wrong
|| (bPasswordSupplied && !bAdminIP)) // Supplied and doesn't meet IP filter.