Hide error message for root user 89/58489/1
authorLukasz Wysocki <l.wysocki@samsung.com>
Mon, 1 Feb 2016 11:46:37 +0000 (12:46 +0100)
committerLukasz Wysocki <l.wysocki@samsung.com>
Mon, 1 Feb 2016 11:46:37 +0000 (12:46 +0100)
Change-Id: Ia0aae587c8b10f83027ab7fd68c3593ff46a364b

src/tpk/step/step_parse_preload.cc

index 790e80d..786e5e2 100644 (file)
@@ -46,9 +46,11 @@ Step::Status StepParsePreload::process() {
   if (is_preload) {
     context_->manifest_data.get()->preload = strdup("true");
 
-    LOG(ERROR) << "You're not authorized to install preload app: "
-        << context_->pkgid.get().c_str();
-    return Status::OPERATION_NOT_ALLOWED;
+    if (getuid() != 0) {
+      LOG(ERROR) << "You're not authorized to install preload app: "
+          << context_->pkgid.get().c_str();
+      return Status::OPERATION_NOT_ALLOWED;
+    }
   } else {
     context_->manifest_data.get()->preload = strdup("false");
   }