update_engine: Ignore OOBE update check result after rollback
Ignore the result of the OOBE update check if a rollback has
happened, even if the deadline field is set in the response. This
is needed to skip forced updates after rollback, thus avoiding
infinite rollback-update loops happening (since policy containing
targetversionprefix is not yet available during OOBE).
BUG=chromium:831266
TEST='cros_run_unit_tests --board=caroline --packages update_engine'
Change-Id: I792f09e54a42c4b73116071f2d55e2a4ee196daf
Reviewed-on: https://chromium-review.googlesource.com/1057617
Commit-Ready: Marton Hunyady <hunyadym@chromium.org>
Tested-by: Marton Hunyady <hunyadym@chromium.org>
Reviewed-by: Amin Hassani <ahassani@chromium.org>
diff --git a/omaha_request_action.cc b/omaha_request_action.cc
index 9021e3f..13a58fb 100644
--- a/omaha_request_action.cc
+++ b/omaha_request_action.cc
@@ -1266,7 +1266,8 @@
if (system_state_->hardware()->IsOOBEEnabled() &&
!system_state_->hardware()->IsOOBEComplete(nullptr) &&
- output_object.deadline.empty() &&
+ (output_object.deadline.empty() ||
+ payload_state->GetRollbackHappened()) &&
params_->app_version() != "ForcedUpdate") {
output_object.update_exists = false;
LOG(INFO) << "Ignoring non-critical Omaha updates until OOBE is done.";