mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-15 22:52:31 +00:00
Address code review: fix setter exposure and narrow catch blocks
1. network.rpc.use_xmlrpc and network.rpc.use_jsonrpc: change from CMD2_VAR_BOOL_U (getter+setter both safe) to CMD2_VAR_BOOL_U_GET (getter safe, setter trusted-only). Untrusted callers could previously disable RPC transports entirely. 2. Remove broad catch(std::exception&) and catch(...) from xmlrpc_c.cc that masked real defects and altered fault semantics. 3. Revert SCGI callback catch-all to re-throw instead of swallowing exceptions with a generic error response.
This commit is contained in:
@@ -396,14 +396,6 @@ xmlrpc_call_command(xmlrpc_env* env, xmlrpc_value* args, void* voidServerInfo) {
|
||||
} catch (torrent::local_error& e) {
|
||||
xmlrpc_env_set_fault(env, XMLRPC_PARSE_ERROR, e.what());
|
||||
return NULL;
|
||||
|
||||
} catch (std::exception& e) {
|
||||
xmlrpc_env_set_fault(env, XMLRPC_PARSE_ERROR, e.what());
|
||||
return NULL;
|
||||
|
||||
} catch (...) {
|
||||
xmlrpc_env_set_fault(env, XMLRPC_PARSE_ERROR, "Unknown exception in command execution.");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user