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

Unified Diff: chrome/browser/policy/device_policy_cache.cc

Issue 9854017: Canonicalize enterprise registration user. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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
« no previous file with comments | « chrome/browser/chromeos/login/enrollment/enterprise_enrollment_screen.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 f053c2bbcc7508592b3d71e674fefd28e718f180..a1408933b6948738b683b28215b700d6c5520bbb 100644
--- a/chrome/browser/policy/device_policy_cache.cc
+++ b/chrome/browser/policy/device_policy_cache.cc
@@ -18,6 +18,7 @@
#include "chrome/browser/chromeos/cros_settings.h"
#include "chrome/browser/chromeos/dbus/dbus_thread_manager.h"
#include "chrome/browser/chromeos/dbus/update_engine_client.h"
+#include "chrome/browser/chromeos/login/authenticator.h"
#include "chrome/browser/chromeos/login/ownership_service.h"
#include "chrome/browser/chromeos/login/signed_settings_helper.h"
#include "chrome/browser/policy/app_pack_updater.h"
@@ -169,7 +170,10 @@ bool DevicePolicyCache::SetPolicy(const em::PolicyFetchResponse& policy) {
return false;
}
- if (registration_user != policy_data.username()) {
+ // 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())) {
LOG(WARNING) << "Refusing policy blob for " << policy_data.username()
<< " which doesn't match " << registration_user;
UMA_HISTOGRAM_ENUMERATION(kMetricPolicy, kMetricPolicyFetchUserMismatch,
« no previous file with comments | « chrome/browser/chromeos/login/enrollment/enterprise_enrollment_screen.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698