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

Unified Diff: remoting/host/daemon_process_win.cc

Issue 1061903002: Disable chromoting service on permanent errors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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
Index: remoting/host/daemon_process_win.cc
diff --git a/remoting/host/daemon_process_win.cc b/remoting/host/daemon_process_win.cc
index 85706d59e31ee213e1c49d64f8f5ffb1de4f75bc..b9d339aa90140e4c713b7717ddce974b3c7087ee 100644
--- a/remoting/host/daemon_process_win.cc
+++ b/remoting/host/daemon_process_win.cc
@@ -140,11 +140,21 @@ void DaemonProcessWin::OnChannelConnected(int32 peer_pid) {
}
void DaemonProcessWin::OnPermanentError(int exit_code) {
- // Change the service start type to 'manual' if the host has been deleted
- // remotely. This way the host will not be started every time the machine
- // boots until the user re-enable it again.
- if (exit_code == kInvalidHostIdExitCode)
+ DCHECK(kMinPermanentErrorExitCode <= exit_code &&
+ exit_code <= kMaxPermanentErrorExitCode);
+
+ // Change the service start type to 'manual' if the host has been unregistered
+ // in the remoting host directory. This way the host will not be started every
+ // time the machine boots until the user re-enable it again.
+ // For regular accounts, the exit_code will be kInvalidHostIdExitCode.
+ // For service accounts, the exit_code will be
+ // kInvalidOauthCredentialsExitCode. This is because when a host is deleted
+ // the service account is deleted as well, which revokes the auth token, so
+ // the host is no longer able to authenticate.
Sergey Ulanov 2015/04/07 21:50:18 This description is too wordy. I don't think you n
+ if (exit_code == kInvalidHostIdExitCode ||
+ exit_code == kInvalidOauthCredentialsExitCode) {
DisableAutoStart();
+ }
DaemonProcess::OnPermanentError(exit_code);
}

Powered by Google App Engine
This is Rietveld 408576698