From 03421b94bb26e11dcf87da7cf3640c8a88cee29d Mon Sep 17 00:00:00 2001 From: Dmitry Chapyshev Date: Sat, 25 May 2024 18:39:41 +0500 Subject: [PATCH] Remove unneeded check. --- source/host/desktop_session_manager.cc | 12 ------------ source/host/user_session_manager.cc | 19 ------------------- 2 files changed, 31 deletions(-) diff --git a/source/host/desktop_session_manager.cc b/source/host/desktop_session_manager.cc index 21dddda8b..9bf5162e1 100644 --- a/source/host/desktop_session_manager.cc +++ b/source/host/desktop_session_manager.cc @@ -204,18 +204,6 @@ base::local_shared_ptr DesktopSessionManager::sessionProxy( //-------------------------------------------------------------------------------------------------- void DesktopSessionManager::onNewConnection(std::unique_ptr channel) { -#if defined(OS_WIN) - std::filesystem::path ref_path = DesktopSessionProcess::filePath(); - std::filesystem::path path = channel->peerFilePath(); - - if (ref_path != path) - { - LOG(LS_ERROR) << "An attempt was made to connect from an unknown application (sid=" - << session_id_ << " ref_path=" << ref_path << " path=" << path << ")"; - return; - } -#endif // defined(OS_WIN) - LOG(LS_INFO) << "Session process successfully connected (sid=" << session_id_ << ")"; session_attach_timer_.stop(); diff --git a/source/host/user_session_manager.cc b/source/host/user_session_manager.cc index 1a56ffbb5..9a00b3036 100644 --- a/source/host/user_session_manager.cc +++ b/source/host/user_session_manager.cc @@ -502,26 +502,7 @@ void UserSessionManager::onNewConnection(std::unique_ptr chann LOG(LS_INFO) << "New IPC connection"; #if defined(OS_WIN) - std::filesystem::path reference_path; - if (!base::BasePaths::currentExecDir(&reference_path)) - { - LOG(LS_ERROR) << "currentExecDir failed"; - return; - } - - reference_path.append(kExecutableNameForUi); - - std::filesystem::path channel_path = channel->peerFilePath(); base::SessionId session_id = channel->peerSessionId(); - - if (reference_path != channel_path) - { - LOG(LS_ERROR) << "An attempt was made to connect from an unknown application (ref_path=" - << reference_path << " channel_path=" << channel_path << " session_id=" - << session_id << ")"; - return; - } - if (session_id == base::kInvalidSessionId) { LOG(LS_ERROR) << "Invalid session id";