Fix install error with pkgs having no privilege 65/42565/1 accepted/tizen/mobile/20150630.195309 accepted/tizen/tv/20150630.195451 accepted/tizen/wearable/20150630.195640 submit/tizen/20150630.105734
authorYoumin Ha <youmin.ha@samsung.com>
Tue, 30 Jun 2015 06:11:42 +0000 (15:11 +0900)
committerYoumin Ha <youmin.ha@samsung.com>
Tue, 30 Jun 2015 06:38:41 +0000 (15:38 +0900)
If a package has no privilege in its manifest, current code assumes it
as an error, and the installation fails.
This commit fixes it, by skipping privilege validation if there is no
privilege in the package.

Change-Id: I6edb38bcbe5ecba497f8478622b361e867327a66
Signed-off-by: Youmin Ha <youmin.ha@samsung.com>
packaging/app-installers.spec
src/common/step/step_check_signature.cc

index 83da006..0eb5604 100644 (file)
@@ -4,7 +4,7 @@
 Name:           app-installers
 Summary:        Application installers
 Version:        1.0
-Release:        0
+Release:        1
 Group:          Application Framework/Package Management
 License:        Apache-2.0
 Source0:        %{name}-%{version}.tar.gz
index ccdad36..79fe0f6 100644 (file)
@@ -145,12 +145,14 @@ bool ValidatePrivilegeLevel(common_installer::PrivilegeLevel level,
   }
 
   char* error = nullptr;
-  int status = privilege_manager_verify_privilege(api_version,
-      is_webapp ? PRVMGR_PACKAGE_TYPE_WRT : PRVMGR_PACKAGE_TYPE_CORE, list,
-      PrivilegeLevelToVisibility(level),
-      &error);
-  if (list)
+  int status = PRVMGR_ERR_NONE;
+  if (list) {  // Do the privilege check only if the package has privileges
+    status = privilege_manager_verify_privilege(api_version,
+        is_webapp ? PRVMGR_PACKAGE_TYPE_WRT : PRVMGR_PACKAGE_TYPE_CORE, list,
+        PrivilegeLevelToVisibility(level),
+        &error);
     g_list_free(list);
+  }
   if (status != PRVMGR_ERR_NONE) {
     LOG(ERROR) << "Error while verifing privilege level: " << error;
     free(error);