Skip security path register when ReadonlyUpdateUninstall 53/145053/1
authorSangyoon Jang <jeremy.jang@samsung.com>
Fri, 18 Aug 2017 07:38:11 +0000 (16:38 +0900)
committerSangyoon Jang <jeremy.jang@samsung.com>
Mon, 21 Aug 2017 04:34:46 +0000 (04:34 +0000)
Change-Id: I14ec76de118c53005b32d4e4c1aaf8b2dbfa9def
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
src/common/step/security/step_update_security.cc

index 95147c8bccbb522322ef34a5084f433170ea92f1..bc6c3bb26864f70aad199323122df0afcb7c6ac1 100644 (file)
@@ -23,14 +23,16 @@ Step::Status StepUpdateSecurity::process() {
     }
     return Status::SECURITY_ERROR;
   }
-  if (!RegisterSecurityContextForPath(
-      context_->pkgid.get(), context_->pkg_path.get(), context_->uid.get(),
-      context_->is_readonly_package.get(), &error_message)) {
-    if (!error_message.empty()) {
-      LOG(ERROR) << "error_message: " << error_message;
-      on_error(Status::SECURITY_ERROR, error_message);
+  if (context_->request_type.get() != RequestType::ReadonlyUpdateUninstall) {
+    if (!RegisterSecurityContextForPath(
+        context_->pkgid.get(), context_->pkg_path.get(), context_->uid.get(),
+        context_->is_readonly_package.get(), &error_message)) {
+      if (!error_message.empty()) {
+        LOG(ERROR) << "error_message: " << error_message;
+        on_error(Status::SECURITY_ERROR, error_message);
+      }
+      return Status::SECURITY_ERROR;
     }
-    return Status::SECURITY_ERROR;
   }
   LOG(DEBUG) << "Security context updated";
   return Status::OK;