Add to pass rivilege level when installing service app.
authorSoyoung Kim <sy037.kim@samsung.com>
Mon, 28 Oct 2013 14:27:44 +0000 (23:27 +0900)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Tue, 29 Oct 2013 07:22:47 +0000 (07:22 +0000)
[Issue#] N/A
[Problem] If hybrid app singined public app, installation success like having platform privilege.
[Cause] wrt-installer doesn't pass signature info when service app install.
[Solution] add to pass parameter about privilege level during install hybrid app.

0: NP, 1: Public, 2: Partner, 3: Platform
wrt-installer -iv [path] -p 1

[SCMRequest] N/A

Change-Id: I4d288f7d346fafe77eebbd6cb548c5ae5284b085

src/jobs/widget_install/task_certify_level.cpp
src/jobs/widget_install/task_certify_level.h
src/jobs/widget_install/task_install_ospsvc.cpp
src/jobs/widget_install/widget_install_context.h

index c1372f4..fd696e0 100644 (file)
@@ -166,6 +166,7 @@ TaskCertifyLevel::Level TaskCertifyLevel::getCertifyLevel()
         }
     }
 
+    m_contextData.certLevel = level;
     return level;
 }
 
index ddad9e9..ad8d427 100644 (file)
@@ -46,7 +46,7 @@ class TaskCertifyLevel :
     //data
     InstallerContext& m_contextData;
 
-    enum class Level : std::int8_t {
+    enum Level {
         UNKNOWN  = 0,
         PUBLIC   = 1,
         PARTNER  = 2,
index 96d0dae..15923f9 100644 (file)
@@ -42,7 +42,8 @@ using namespace WrtDB;
 
 namespace {
 const int MAX_BUF_SIZE = 128;
-const char* OSP_INSTALL_STR = "/usr/etc/package-manager/backend/tpk -iv ";
+const char* OSP_INSTALL_STR1 = "/usr/etc/package-manager/backend/tpk -iv ";
+const char* OSP_INSTALL_STR2 = " -p ";
 }
 
 namespace Jobs {
@@ -61,9 +62,9 @@ void TaskInstallOspsvc::StepInstallOspService()
     _D("Step: installation for osp service");
 
     std::ostringstream commStr;
-    commStr << OSP_INSTALL_STR << BashUtils::escape_arg(
-        m_context.locations->getPackageInstallationDir());
-    //commStr << " 2>&1";
+    commStr << OSP_INSTALL_STR1<< BashUtils::escape_arg(
+        m_context.locations->getPackageInstallationDir())
+        << OSP_INSTALL_STR2 << m_context.certLevel;
     _D("osp install command : %s", commStr.str().c_str());
 
     char readBuf[MAX_BUF_SIZE];
index 4816e94..5750cbd 100644 (file)
@@ -101,6 +101,7 @@ struct InstallerContext
 
     std::string requestedPath; ///input path of widget
     bool needEncryption;  ///for configuring right task if encryption needed
+    int certLevel;
 };
 
 #endif // INSTALLER_CONTEXT_H