Fix installation user mangling 70/74070/2
authorRadoslaw Bartosiak <r.bartosiak@samsung.com>
Fri, 10 Jun 2016 15:14:09 +0000 (17:14 +0200)
committerTomasz Swierczek <t.swierczek@samsung.com>
Tue, 14 Jun 2016 10:56:16 +0000 (03:56 -0700)
Set global user as the owner of preloaded applications and
applications installed globally.

Change-Id: Idb3f194aacefa7afaa047de6bfdfdb1bee6b8736
Signed-off-by: Radoslaw Bartosiak <r.bartosiak@samsung.com>
src/common/service_impl.cpp

index e42a728..a14491f 100644 (file)
@@ -262,12 +262,11 @@ void ServiceImpl::setRequestDefaultValues(uid_t& uid, int& installationType)
 {
     uid_t globalUid = getGlobalUserId();
 
-    if (uid == 0)
-        uid = globalUid;
-
     if (installationType == SM_APP_INSTALL_NONE)
-        installationType = (uid == globalUid) ? SM_APP_INSTALL_GLOBAL :
-                                                SM_APP_INSTALL_LOCAL;
+        installationType = (uid == 0) ? SM_APP_INSTALL_GLOBAL : SM_APP_INSTALL_LOCAL;
+    if ((installationType == SM_APP_INSTALL_GLOBAL)
+        || (installationType == SM_APP_INSTALL_PRELOADED))
+        uid = globalUid;
 }
 
 void ServiceImpl::installRequestMangle(app_inst_req &req, std::string &cynaraUserStr)