Chromium Code Reviews| Index: chrome/browser/policy/device_policy_cache.cc |
| diff --git a/chrome/browser/policy/device_policy_cache.cc b/chrome/browser/policy/device_policy_cache.cc |
| index 3c4bb24c158da271f038f88754fab69a12631fc3..418fd4047396879c5af5c54a78ca705f2b28bd20 100644 |
| --- a/chrome/browser/policy/device_policy_cache.cc |
| +++ b/chrome/browser/policy/device_policy_cache.cc |
| @@ -150,8 +150,8 @@ bool DevicePolicyCache::SetPolicy(const em::PolicyFetchResponse& policy) { |
| DCHECK(IsReady()); |
| // Make sure we have an enterprise device. |
| - std::string registration_user(install_attributes_->GetRegistrationUser()); |
| - if (registration_user.empty()) { |
| + std::string registration_domain(install_attributes_->GetDomain()); |
| + if (registration_domain.empty()) { |
| LOG(WARNING) << "Refusing to accept policy on non-enterprise device."; |
| UMA_HISTOGRAM_ENUMERATION(kMetricPolicy, |
| kMetricPolicyFetchNonEnterpriseDevice, |
| @@ -174,10 +174,10 @@ bool DevicePolicyCache::SetPolicy(const em::PolicyFetchResponse& policy) { |
| // Existing installations may not have a canonicalized version of the |
| // registration user name in install attributes, so re-canonicalize here. |
| - if (chromeos::Authenticator::Canonicalize(registration_user) != |
| - chromeos::Authenticator::Canonicalize(policy_data.username())) { |
|
Mattias Nissler (ping if slow)
2012/06/04 10:17:52
Remove the authenticator header as well. Also, don
pastarmovj
2012/06/08 09:54:32
Done.
|
| + if (registration_domain != |
| + install_attributes_->ExtractDomainName(policy_data.username())) { |
| LOG(WARNING) << "Refusing policy blob for " << policy_data.username() |
| - << " which doesn't match " << registration_user; |
| + << " which doesn't match domain " << registration_domain; |
| UMA_HISTOGRAM_ENUMERATION(kMetricPolicy, kMetricPolicyFetchUserMismatch, |
| kMetricPolicySize); |
| InformNotifier(CloudPolicySubsystem::LOCAL_ERROR, |