Chromium Code Reviews| 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 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 717 return; | 717 return; |
| 718 } | 718 } |
| 719 | 719 |
| 720 bool restart_required = false; | 720 bool restart_required = false; |
| 721 bool bool_value; | 721 bool bool_value; |
| 722 std::string string_value; | 722 std::string string_value; |
| 723 if (policies->GetString(policy_hack::PolicyWatcher::kHostDomainPolicyName, | 723 if (policies->GetString(policy_hack::PolicyWatcher::kHostDomainPolicyName, |
| 724 &string_value)) { | 724 &string_value)) { |
| 725 restart_required |= OnHostDomainPolicyUpdate(string_value); | 725 restart_required |= OnHostDomainPolicyUpdate(string_value); |
| 726 } | 726 } |
| 727 // The curtain mode policy should be handled before the username matching | |
| 728 // setting. | |
|
Wez
2013/04/15 19:01:35
Why? Requiring a specific ordering to policy appl
alexeypa (please no reviews)
2013/04/15 19:10:01
Done.
| |
| 729 if (policies->GetBoolean( | |
| 730 policy_hack::PolicyWatcher::kHostRequireCurtainPolicyName, | |
| 731 &bool_value)) { | |
| 732 restart_required |= OnCurtainPolicyUpdate(bool_value); | |
| 733 } | |
| 727 if (policies->GetBoolean( | 734 if (policies->GetBoolean( |
| 728 policy_hack::PolicyWatcher::kHostMatchUsernamePolicyName, | 735 policy_hack::PolicyWatcher::kHostMatchUsernamePolicyName, |
| 729 &bool_value)) { | 736 &bool_value)) { |
| 730 restart_required |= OnUsernamePolicyUpdate(bool_value); | 737 restart_required |= OnUsernamePolicyUpdate(bool_value); |
| 731 } | 738 } |
| 732 if (policies->GetBoolean(policy_hack::PolicyWatcher::kNatPolicyName, | 739 if (policies->GetBoolean(policy_hack::PolicyWatcher::kNatPolicyName, |
| 733 &bool_value)) { | 740 &bool_value)) { |
| 734 restart_required |= OnNatPolicyUpdate(bool_value); | 741 restart_required |= OnNatPolicyUpdate(bool_value); |
| 735 } | 742 } |
| 736 if (policies->GetString( | 743 if (policies->GetString( |
| 737 policy_hack::PolicyWatcher::kHostTalkGadgetPrefixPolicyName, | 744 policy_hack::PolicyWatcher::kHostTalkGadgetPrefixPolicyName, |
| 738 &string_value)) { | 745 &string_value)) { |
| 739 restart_required |= OnHostTalkGadgetPrefixPolicyUpdate(string_value); | 746 restart_required |= OnHostTalkGadgetPrefixPolicyUpdate(string_value); |
| 740 } | 747 } |
| 741 if (policies->GetBoolean( | |
| 742 policy_hack::PolicyWatcher::kHostRequireCurtainPolicyName, | |
| 743 &bool_value)) { | |
| 744 restart_required |= OnCurtainPolicyUpdate(bool_value); | |
| 745 } | |
| 746 std::string token_url_string, token_validation_url_string; | 748 std::string token_url_string, token_validation_url_string; |
| 747 if (policies->GetString( | 749 if (policies->GetString( |
| 748 policy_hack::PolicyWatcher::kHostTokenUrlPolicyName, | 750 policy_hack::PolicyWatcher::kHostTokenUrlPolicyName, |
| 749 &token_url_string) && | 751 &token_url_string) && |
| 750 policies->GetString( | 752 policies->GetString( |
| 751 policy_hack::PolicyWatcher::kHostTokenValidationUrlPolicyName, | 753 policy_hack::PolicyWatcher::kHostTokenValidationUrlPolicyName, |
| 752 &token_validation_url_string)) { | 754 &token_validation_url_string)) { |
| 753 restart_required |= OnHostTokenUrlPolicyUpdate( | 755 restart_required |= OnHostTokenUrlPolicyUpdate( |
| 754 GURL(token_url_string), GURL(token_validation_url_string)); | 756 GURL(token_url_string), GURL(token_validation_url_string)); |
| 755 } | 757 } |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 787 | 789 |
| 788 #if defined(OS_MACOSX) | 790 #if defined(OS_MACOSX) |
| 789 // On Mac, we run as root at the login screen, so the username won't match. | 791 // On Mac, we run as root at the login screen, so the username won't match. |
| 790 // However, there's no need to enforce the policy at the login screen, as | 792 // However, there's no need to enforce the policy at the login screen, as |
| 791 // the client will have to reconnect if a login occurs. | 793 // the client will have to reconnect if a login occurs. |
| 792 if (shutdown && getuid() == 0) { | 794 if (shutdown && getuid() == 0) { |
| 793 shutdown = false; | 795 shutdown = false; |
| 794 } | 796 } |
| 795 #endif | 797 #endif |
| 796 | 798 |
| 799 // The RDP sessions make the connected user to enter the OS credential | |
|
Wez
2013/04/15 19:01:35
nit: Suggest reword:
"Curtain-mode on Windows pre
alexeypa (please no reviews)
2013/04/15 19:10:01
Done.
| |
| 800 // before he or she can access the machine meaning that the username | |
| 801 // matching policy can be safely if the curtain is required. | |
| 802 #if defined(OS_WIN) && defined(REMOTING_RDP_SESSION) | |
| 803 if (curtain_required_) | |
| 804 return false; | |
| 805 #endif // defined(OS_WIN) && defined(REMOTING_RDP_SESSION) | |
| 806 | |
| 807 // Shutdown the host if the username does not match. | |
| 797 if (shutdown) { | 808 if (shutdown) { |
| 798 LOG(ERROR) << "The host username does not match."; | 809 LOG(ERROR) << "The host username does not match."; |
| 799 ShutdownHost(kUsernameMismatchExitCode); | 810 ShutdownHost(kUsernameMismatchExitCode); |
| 800 } | 811 } |
| 801 } else { | 812 } else { |
| 802 LOG(INFO) << "Policy does not require host username match."; | 813 LOG(INFO) << "Policy does not require host username match."; |
| 803 } | 814 } |
| 804 | 815 |
| 805 return false; | 816 return false; |
| 806 } | 817 } |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1143 return exit_code; | 1154 return exit_code; |
| 1144 } | 1155 } |
| 1145 | 1156 |
| 1146 } // namespace remoting | 1157 } // namespace remoting |
| 1147 | 1158 |
| 1148 #if !defined(OS_WIN) | 1159 #if !defined(OS_WIN) |
| 1149 int main(int argc, char** argv) { | 1160 int main(int argc, char** argv) { |
| 1150 return remoting::HostMain(argc, argv); | 1161 return remoting::HostMain(argc, argv); |
| 1151 } | 1162 } |
| 1152 #endif // !defined(OS_WIN) | 1163 #endif // !defined(OS_WIN) |
| OLD | NEW |