From: Junghyun Yeon Date: Tue, 14 Mar 2017 05:00:23 +0000 (+0900) Subject: Fix installer backend crash issue X-Git-Tag: accepted/tizen/common/20170329.171708~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F79%2F118779%2F2;p=platform%2Fcore%2Fappfw%2Fapp-installers.git Fix installer backend crash issue - Backend has crashed with some install cases while undo StepUpdateApplication after failed to update app. - It caused because old manifest data doesn't set properly. - Fix it by checking manifest before use and not performing undo() in some update cases Change-Id: Ib0f10f151ef8ea87ada839bb897e081f2f8ecb33 Signed-off-by: Junghyun Yeon --- diff --git a/src/common/pkgmgr_registration.cc b/src/common/pkgmgr_registration.cc index f19d208..6fbc94c 100644 --- a/src/common/pkgmgr_registration.cc +++ b/src/common/pkgmgr_registration.cc @@ -81,6 +81,9 @@ bool RegisterCertificates( // "removable" : this package can be removed. // "readonly" : this package exists in readonly location. bool AssignPackageTags(manifest_x* manifest) { + if (!manifest) + return false; + // preload, removalbe and readonly : in parse_preload step. if (manifest->preload && !strcmp(manifest->preload, "true")) { if (manifest->removable && !strcmp(manifest->removable, "false")) diff --git a/src/common/step/pkgmgr/step_update_app.cc b/src/common/step/pkgmgr/step_update_app.cc index af90d09..57129c4 100644 --- a/src/common/step/pkgmgr/step_update_app.cc +++ b/src/common/step/pkgmgr/step_update_app.cc @@ -40,6 +40,11 @@ Step::Status StepUpdateApplication::process() { } Step::Status StepUpdateApplication::undo() { + RequestType req_type = context_->request_type.get(); + if (req_type == RequestType::ManifestDirectUpdate || + req_type == RequestType::ManifestPartialUpdate) + return Status::OK; + // Prepare certification info for revert std::string base64 = QueryCertificateAuthorCertificate(context_->pkgid.get(), context_->uid.get());