Skip to content

Commit

Permalink
Remove unneeded check.
Browse files Browse the repository at this point in the history
  • Loading branch information
dchapyshev committed May 25, 2024
1 parent d80c0b7 commit 03421b9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 31 deletions.
12 changes: 0 additions & 12 deletions source/host/desktop_session_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -204,18 +204,6 @@ base::local_shared_ptr<DesktopSessionProxy> DesktopSessionManager::sessionProxy(
//--------------------------------------------------------------------------------------------------
void DesktopSessionManager::onNewConnection(std::unique_ptr<base::IpcChannel> 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();
Expand Down
19 changes: 0 additions & 19 deletions source/host/user_session_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -502,26 +502,7 @@ void UserSessionManager::onNewConnection(std::unique_ptr<base::IpcChannel> 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";
Expand Down

0 comments on commit 03421b9

Please sign in to comment.