From 4d5c6e1583ae73949447b7a2644b1c14b9102e7c Mon Sep 17 00:00:00 2001 From: jongmyeongko Date: Tue, 19 Jan 2016 09:22:28 +0900 Subject: [PATCH] remove remaining codes reltated to preload_list.txt only root-user can use direct-install. Change-Id: If51dd3f5ad2c7acc5beef4546d8b0f98a9fb8ef8 Signed-off-by: jongmyeongko --- src/common/pkgmgr_interface.cc | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/src/common/pkgmgr_interface.cc b/src/common/pkgmgr_interface.cc index 7e67520..38593a2 100644 --- a/src/common/pkgmgr_interface.cc +++ b/src/common/pkgmgr_interface.cc @@ -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; } } -- 2.7.4