Chromium Code Reviews| 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); |
| } |