From 4df5ac748848c0cc9b8035bb9deceb790af3b971 Mon Sep 17 00:00:00 2001 From: Richard Marian Thomaiyar Date: Thu, 3 Oct 2019 17:04:07 +0530 Subject: prov-mode: Remove throwing error from prov mode. Provision mode manager, exposing Restriction Mode interface will bail, if there is any problem in reading u-boot environment variable. This was causing issues during Power on activity, as it will block the whole IPMI loading itself. Hence instead of bailing out, code is modified to consider the secure safest value ProvisionedHostDisabled mode, if unable to get u-boot param value. Tested: 1. Verified ipmi loaded file, and whitelist filter works as expected 2. Verified that ipmi still loads with ProvisionedHostDisbaled when u-boot environment is not available 3. verified that it didn't disturb the old behaviour, by doing read-only section update, and doing one full flash update and made sure both works as expected. Change-Id: Ic2e896e1f2de8e876f3d82e935f1f04e7d0419dc Signed-off-by: Richard Marian Thomaiyar --- prov-mode-mgr/src/prov-mode-mgr.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/prov-mode-mgr/src/prov-mode-mgr.cpp b/prov-mode-mgr/src/prov-mode-mgr.cpp index c6c3315..33d084a 100644 --- a/prov-mode-mgr/src/prov-mode-mgr.cpp +++ b/prov-mode-mgr/src/prov-mode-mgr.cpp @@ -36,8 +36,9 @@ ProvModeMgr::ProvModeMgr( phosphor::logging::log( "Error in querying provision mode", phosphor::logging::entry("MSG=%s", ec.message().c_str())); - phosphor::logging::elog(); + provMode = + secCtrl::RestrictionMode::Modes::ProvisionedHostDisabled; + // Fall through - Continue with ProvisionedHostDisabled value. } if (modeStr.empty()) { @@ -65,8 +66,7 @@ void ProvModeMgr::updateProvModeProperty( phosphor::logging::log( "RestrictionMode set-property failed", phosphor::logging::entry("MSG=%s", ec.message().c_str())); - phosphor::logging::elog(); + // Continue, even for u-boot param update failure. } }, uBootEnvMgrService, uBootEnvMgrPath, uBootEnvMgrIntf, @@ -101,9 +101,7 @@ void ProvModeMgr::init() phosphor::logging::log( "RestrictionMode set-property failed", phosphor::logging::entry("Mode=%s", req.c_str()), - phosphor::logging::entry("EXCEPTION:%s", e.what())); - phosphor::logging::elog(); + phosphor::logging::entry("EXCEPTION=%s", e.what())); } return 0; }, -- cgit v1.2.3