mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-21 16:46:18 +00:00
Check flag_public_rpc when dispatching jsonrpc calls.
Private commands and non-exported redirects were reachable over jsonrpc.
This commit is contained in:
+1
-1
@@ -146,7 +146,7 @@ jsonrpc_call_command(const std::string& method, const json& params) {
|
|||||||
|
|
||||||
CommandMap::iterator itr = commands.find(method.c_str());
|
CommandMap::iterator itr = commands.find(method.c_str());
|
||||||
|
|
||||||
if (itr == commands.end()) {
|
if (itr == commands.end() || !(itr->second.m_flags & CommandMap::flag_public_rpc)) {
|
||||||
throw rpc_error(JSONRPC_METHOD_NOT_FOUND_ERROR, "method not found: " + method);
|
throw rpc_error(JSONRPC_METHOD_NOT_FOUND_ERROR, "method not found: " + method);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user