Commit fee637a4 authored by tnagel@chromium.org's avatar tnagel@chromium.org

Enrollment recovery: Fix check for presence of machine id.

Ensure that enrollment recovery really only is triggered when the
machine id can be accessed.

BUG=389481

Review URL: https://codereview.chromium.org/386643003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@282484 0039d316-1c4b-4281-b951-d872f2087c98
parent 888ecd9a
...@@ -133,12 +133,7 @@ bool DeviceCloudPolicyInitializer::ShouldRecoverEnrollment() const { ...@@ -133,12 +133,7 @@ bool DeviceCloudPolicyInitializer::ShouldRecoverEnrollment() const {
if (install_attributes_->IsEnterpriseDevice() && if (install_attributes_->IsEnterpriseDevice() &&
chromeos::StartupUtils::IsEnrollmentRecoveryRequired()) { chromeos::StartupUtils::IsEnrollmentRecoveryRequired()) {
LOG(WARNING) << "Enrollment recovery required according to pref."; LOG(WARNING) << "Enrollment recovery required according to pref.";
std::string machine_id; if (!DeviceCloudPolicyManagerChromeOS::GetMachineID().empty())
bool machine_id_success =
chromeos::system::StatisticsProvider::GetInstance()
->GetMachineStatistic(chromeos::system::kHardwareClassKey,
&machine_id);
if (machine_id_success && machine_id != "")
return true; return true;
LOG(WARNING) << "Postponing recovery because machine id is missing."; LOG(WARNING) << "Postponing recovery because machine id is missing.";
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment