Address review feedback: explicit mark_safe whitelist and rpc trust flow

This commit is contained in:
Xirvik
2026-03-03 04:32:54 +00:00
committed by Jari Sundell
parent ba239bc8c5
commit d935e0ffe9
17 changed files with 807 additions and 560 deletions
+2 -2
View File
@@ -98,7 +98,7 @@ CommandMap::call_command(const key_type& key, const mapped_type& arg, const targ
if (itr == base_type::end())
throw torrent::input_error("Command \"" + std::string(key) + "\" does not exist.");
if (!RpcManager::is_trusted() && !(itr->second.m_flags & flag_untrusted_safe))
if (!rpc.is_trusted() && !(itr->second.m_flags & flag_untrusted_safe))
throw untrusted_error("Command \"" + std::string(key) + "\" is not allowed for untrusted connections.");
return itr->second.m_anySlot(&itr->second.m_variable, target, arg);
@@ -106,7 +106,7 @@ CommandMap::call_command(const key_type& key, const mapped_type& arg, const targ
const CommandMap::mapped_type
CommandMap::call_command(iterator itr, const mapped_type& arg, const target_type& target) {
if (!RpcManager::is_trusted() && !(itr->second.m_flags & flag_untrusted_safe))
if (!rpc.is_trusted() && !(itr->second.m_flags & flag_untrusted_safe))
throw untrusted_error("Command \"" + itr->first + "\" is not allowed for untrusted connections.");
return itr->second.m_anySlot(&itr->second.m_variable, target, arg);