remove remaining codes reltated to preload_list.txt 04/57304/1
authorjongmyeongko <jongmyeong.ko@samsung.com>
Tue, 19 Jan 2016 00:22:28 +0000 (09:22 +0900)
committerjongmyeongko <jongmyeong.ko@samsung.com>
Tue, 19 Jan 2016 01:28:35 +0000 (10:28 +0900)
only root-user can use direct-install.

Change-Id: If51dd3f5ad2c7acc5beef4546d8b0f98a9fb8ef8
Signed-off-by: jongmyeongko <jongmyeong.ko@samsung.com>
src/common/pkgmgr_interface.cc

index 7e67520..38593a2 100644 (file)
@@ -50,20 +50,9 @@ int PkgMgrInterface::InitInternal(int argc, char** argv) {
 
   if (pkgmgr_installer_get_request_type(pi_)
       == PKGMGR_REQ_MANIFEST_DIRECT_INSTALL) {
-    // pkgid should be exists in preload app list
-    std::ifstream preload_list("/etc/package-manager/preload/preload_list.txt");
-    bool is_preload_app = false;
-    for (std::string str; std::getline(preload_list, str); ) {
-      if (str == GetRequestInfo()) {
-        is_preload_app = true;
-        break;
-      }
-    }
-    preload_list.close();
-
-    if (!is_preload_app) {
-      LOG(ERROR) <<
-          "Only preload app could be installed by manifest direct install";
+    uid_t uid = getuid();
+    if (uid != 0) {
+      LOG(ERROR) << "You are not an authorized user(" << uid << ")!";
       return EINVAL;
     }
   }