Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(414)

Unified Diff: remoting/host/win/worker_process_launcher.cc

Issue 10824316: Avoid calling GetNamedPipeClientProcessId() which is not available on XP. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: CR feedback. Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/win/worker_process_launcher.h ('k') | remoting/host/win/wts_session_process_launcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/win/worker_process_launcher.cc
diff --git a/remoting/host/win/worker_process_launcher.cc b/remoting/host/win/worker_process_launcher.cc
index cf781b215d25a1502498f108782be610a9cbf70f..79f196e9a7f5a5c9bf8137a59be85bd65e09b467 100644
--- a/remoting/host/win/worker_process_launcher.cc
+++ b/remoting/host/win/worker_process_launcher.cc
@@ -109,16 +109,15 @@ void WorkerProcessLauncher::OnChannelConnected(int32 peer_pid) {
DCHECK(pipe_.IsValid());
DCHECK(process_exit_event_.IsValid());
- // Get the actual peer's PID (i.e. reported by the OS) instead of the PID
- // reported by the peer itself (|peer_pid|).
- DWORD actual_peer_pid;
- if (!GetNamedPipeClientProcessId(pipe_, &actual_peer_pid)) {
- LOG_GETLASTERROR(ERROR) << "Failed to query the peer's PID";
- Stop();
- return;
- }
-
- delegate_->OnChannelConnected(actual_peer_pid);
+ // |peer_pid| is send by the client and cannot be trusted.
+ // GetNamedPipeClientProcessId() is not available on XP. The pipe's security
+ // descriptor is the only protection we currently have against malicious
+ // clients.
+ //
+ // If we'd like to be able to launch low-privileged workers and let them
+ // connect back, the pipe handle should be passed to the worker instead of
+ // the pipe name.
+ delegate_->OnChannelConnected();
}
void WorkerProcessLauncher::OnChannelError() {
« no previous file with comments | « remoting/host/win/worker_process_launcher.h ('k') | remoting/host/win/wts_session_process_launcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698