From 68750b6874d402d2f6490663490539afb671b88a Mon Sep 17 00:00:00 2001 From: ypostolov Date: Wed, 8 Aug 2018 18:01:14 +0300 Subject: [PATCH 1/2] SDL respond UNSUPPORTED_RESOURCE on SystemRequest (QUERY_APPS) if SDL is below version 4.0 --- .../sdl_rpc_plugin/src/commands/mobile/system_request.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc index 78de02b5278..8d68d59cc74 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc @@ -457,7 +457,6 @@ void SystemRequest::Run() { SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); return; } - const mobile_apis::RequestType::eType request_type = static_cast( (*message_)[strings::msg_params][strings::request_type].asInt()); @@ -511,6 +510,13 @@ void SystemRequest::Run() { return; } + if (mobile_apis::RequestType::QUERY_APPS == request_type && + application_manager_.get_settings().max_supported_protocol_version() < + 4) { + SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE); + return; + } + if (!file_system::IsFileNameValid(file_name)) { const std::string err_msg = "Sync file name contains forbidden symbols."; LOG4CXX_ERROR(logger_, err_msg); From 3540848c21d445e1c079e44df650449f6b506029 Mon Sep 17 00:00:00 2001 From: ypostolov Date: Fri, 10 Aug 2018 10:36:16 +0300 Subject: [PATCH 2/2] answer review comments --- .../sdl_rpc_plugin/src/commands/mobile/system_request.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc index 8d68d59cc74..77852e5c5ce 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc @@ -510,9 +510,11 @@ void SystemRequest::Run() { return; } + const uint16_t query_apps_min_version = 4; + if (mobile_apis::RequestType::QUERY_APPS == request_type && application_manager_.get_settings().max_supported_protocol_version() < - 4) { + query_apps_min_version) { SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE); return; }