OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // This file implements a standalone host process for Me2Me. | 5 // This file implements a standalone host process for Me2Me. |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
793 #if defined(OS_MACOSX) | 793 #if defined(OS_MACOSX) |
794 // On Mac, we run as root at the login screen, so the username won't match. | 794 // On Mac, we run as root at the login screen, so the username won't match. |
795 // However, there's no need to enforce the policy at the login screen, as | 795 // However, there's no need to enforce the policy at the login screen, as |
796 // the client will have to reconnect if a login occurs. | 796 // the client will have to reconnect if a login occurs. |
797 if (shutdown && getuid() == 0) { | 797 if (shutdown && getuid() == 0) { |
798 shutdown = false; | 798 shutdown = false; |
799 } | 799 } |
800 #endif | 800 #endif |
801 | 801 |
802 if (shutdown) { | 802 if (shutdown) { |
| 803 LOG(ERROR) << "The host username does not match."; |
803 ShutdownHost(kUsernameMismatchExitCode); | 804 ShutdownHost(kUsernameMismatchExitCode); |
804 } | 805 } |
805 } else { | 806 } else { |
806 LOG(INFO) << "Policy does not require host username match."; | 807 LOG(INFO) << "Policy does not require host username match."; |
807 } | 808 } |
808 | 809 |
809 return false; | 810 return false; |
810 } | 811 } |
811 | 812 |
812 bool HostProcess::OnNatPolicyUpdate(bool nat_traversal_enabled) { | 813 bool HostProcess::OnNatPolicyUpdate(bool nat_traversal_enabled) { |
(...skipping 20 matching lines...) Expand all Loading... |
833 // When curtain mode is in effect on Mac, the host process runs in the | 834 // When curtain mode is in effect on Mac, the host process runs in the |
834 // user's switched-out session, but launchd will also run an instance at | 835 // user's switched-out session, but launchd will also run an instance at |
835 // the console login screen. Even if no user is currently logged-on, we | 836 // the console login screen. Even if no user is currently logged-on, we |
836 // can't support remote-access to the login screen because the current host | 837 // can't support remote-access to the login screen because the current host |
837 // process model disconnects the client during login, which would leave | 838 // process model disconnects the client during login, which would leave |
838 // the logged in session un-curtained on the console until they reconnect. | 839 // the logged in session un-curtained on the console until they reconnect. |
839 // | 840 // |
840 // TODO(jamiewalch): Fix this once we have implemented the multi-process | 841 // TODO(jamiewalch): Fix this once we have implemented the multi-process |
841 // daemon architecture (crbug.com/134894) | 842 // daemon architecture (crbug.com/134894) |
842 if (getuid() == 0) { | 843 if (getuid() == 0) { |
| 844 LOG(ERROR) << "Running the host in the console login session is yet not " |
| 845 "supported."; |
843 ShutdownHost(kLoginScreenNotSupportedExitCode); | 846 ShutdownHost(kLoginScreenNotSupportedExitCode); |
844 return false; | 847 return false; |
845 } | 848 } |
846 } | 849 } |
847 #endif | 850 #endif |
848 | 851 |
849 if (curtain_required_ != curtain_required) { | 852 if (curtain_required_ != curtain_required) { |
850 if (curtain_required) | 853 if (curtain_required) |
851 LOG(ERROR) << "Policy requires curtain-mode."; | 854 LOG(INFO) << "Policy requires curtain-mode."; |
852 else | 855 else |
853 LOG(ERROR) << "Policy does not require curtain-mode."; | 856 LOG(INFO) << "Policy does not require curtain-mode."; |
854 curtain_required_ = curtain_required; | 857 curtain_required_ = curtain_required; |
855 if (curtaining_host_observer_) | 858 if (curtaining_host_observer_) |
856 curtaining_host_observer_->SetEnableCurtaining(curtain_required_); | 859 curtaining_host_observer_->SetEnableCurtaining(curtain_required_); |
857 return true; | 860 return true; |
858 } | 861 } |
859 return false; | 862 return false; |
860 } | 863 } |
861 | 864 |
862 bool HostProcess::OnHostTalkGadgetPrefixPolicyUpdate( | 865 bool HostProcess::OnHostTalkGadgetPrefixPolicyUpdate( |
863 const std::string& talkgadget_prefix) { | 866 const std::string& talkgadget_prefix) { |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1101 return exit_code; | 1104 return exit_code; |
1102 } | 1105 } |
1103 | 1106 |
1104 } // namespace remoting | 1107 } // namespace remoting |
1105 | 1108 |
1106 #if !defined(OS_WIN) | 1109 #if !defined(OS_WIN) |
1107 int main(int argc, char** argv) { | 1110 int main(int argc, char** argv) { |
1108 return remoting::HostMain(argc, argv); | 1111 return remoting::HostMain(argc, argv); |
1109 } | 1112 } |
1110 #endif // !defined(OS_WIN) | 1113 #endif // !defined(OS_WIN) |
OLD | NEW |