Fix StepParsePreload 61/167961/1
authorSangyoon Jang <jeremy.jang@samsung.com>
Tue, 23 Jan 2018 04:06:17 +0000 (13:06 +0900)
committerSangyoon Jang <jeremy.jang@samsung.com>
Tue, 23 Jan 2018 05:29:05 +0000 (14:29 +0900)
Remove a unnecessary condition.

Change-Id: Ia7043e5d1ae0db82acd477c12e9145b9ef4624a9
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
src/common/step/configuration/step_parse_preload.cc

index 994f9c9..9f333c2 100644 (file)
@@ -24,7 +24,6 @@ namespace common_installer {
 namespace configuration {
 
 ci::Step::Status StepParsePreload::process() {
-  RequestType req_type = context_->request_type.get();
   const char* readonly_val = context_->manifest_data.get()->readonly;
   if (!readonly_val || (readonly_val && strlen(readonly_val) == 0)) {
     if (readonly_val)
@@ -32,7 +31,7 @@ ci::Step::Status StepParsePreload::process() {
     if (context_->is_readonly_package.get()) {
       context_->manifest_data.get()->readonly = strdup("true");
 
-      if (getuid() != 0 && req_type != RequestType::Recovery) {
+      if (getuid() != 0) {
         LOG(ERROR) << "You're not authorized to install readonly app: "
             << context_->pkgid.get().c_str();
         return Status::OPERATION_NOT_ALLOWED;
@@ -43,6 +42,7 @@ ci::Step::Status StepParsePreload::process() {
   }
 
   PkgQueryInterface pkg_query(context_->pkgid.get(), context_->uid.get());
+  RequestType req_type = context_->request_type.get();
   const char* preload_val = context_->manifest_data.get()->preload;
   if (!preload_val || (preload_val && strlen(preload_val) == 0)) {
     if (preload_val)