summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYunjin Lee <yunjin-.lee@samsung.com>2016-03-17 17:55:23 -0700
committerYunjin Lee <yunjin-.lee@samsung.com>2016-03-17 18:00:16 -0700
commit23a5ce599a85820625250456d1f770ffb835d46a (patch)
treea4801afea47fc8ac25e331241dbd52528b2974ff
parentb8f55196ada616f688d6d9c3b15cd14f696bdee1 (diff)
downloadsecurity-manager-23a5ce599a85820625250456d1f770ffb835d46a.tar.gz
security-manager-23a5ce599a85820625250456d1f770ffb835d46a.tar.bz2
security-manager-23a5ce599a85820625250456d1f770ffb835d46a.zip
This reverts commit 46fb8b487d05fc36959e8595c742fc10e5fc2ff2. Change-Id: I67496a1682467ba45a4d368ca8924804f414cc58
-rwxr-xr-xsrc/client/client-security-manager.cpp20
-rw-r--r--src/cmd/security-manager-cmd.cpp13
-rw-r--r--src/common/include/protocols.h1
-rw-r--r--src/common/include/service_impl.h2
-rwxr-xr-xsrc/common/service_impl.cpp23
-rw-r--r--src/include/app-manager.h12
-rw-r--r--src/include/security-manager-types.h9
-rw-r--r--src/server/service/service.cpp1
8 files changed, 11 insertions, 70 deletions
diff --git a/src/client/client-security-manager.cpp b/src/client/client-security-manager.cpp
index 472781f6..1e0fbcf2 100755
--- a/src/client/client-security-manager.cpp
+++ b/src/client/client-security-manager.cpp
@@ -91,12 +91,6 @@ int security_manager_app_inst_req_new(app_inst_req **pp_req)
}
(*pp_req)->uid = geteuid();
- uid_t globalUid = tzplatform_getuid(TZ_SYS_GLOBALAPP_USER);
- if ((*pp_req)->uid == 0 || (*pp_req)->uid == globalUid)
- (*pp_req)->installationType = static_cast<int>(SM_APP_INSTALL_GLOBAL);
- else
- (*pp_req)->installationType = static_cast<int>(SM_APP_INSTALL_LOCAL);
-
return SECURITY_MANAGER_SUCCESS;
}
@@ -184,17 +178,6 @@ int security_manager_app_inst_req_add_path(app_inst_req *p_req, const char *path
}
SECURITY_MANAGER_API
-int security_manager_app_inst_req_set_install_type(app_inst_req *p_req, const enum app_install_type type)
-{
- if (!p_req || (type <= SM_APP_INSTALL_NONE) || (type >= SM_APP_INSTALL_END))
- return SECURITY_MANAGER_ERROR_INPUT_PARAM;
-
- p_req->installationType = static_cast<int>(type);
-
- return SECURITY_MANAGER_SUCCESS;
-}
-
-SECURITY_MANAGER_API
int security_manager_app_install(const app_inst_req *p_req)
{
using namespace SecurityManager;
@@ -222,8 +205,7 @@ int security_manager_app_install(const app_inst_req *p_req)
p_req->appPaths,
p_req->uid,
p_req->tizenVersion,
- p_req->authorName,
- p_req->installationType);
+ p_req->authorName);
//send buffer to server
retval = sendToServer(SERVICE_SOCKET, send.Pop(), recv);
diff --git a/src/cmd/security-manager-cmd.cpp b/src/cmd/security-manager-cmd.cpp
index 0e9b5c5c..a1f55e58 100644
--- a/src/cmd/security-manager-cmd.cpp
+++ b/src/cmd/security-manager-cmd.cpp
@@ -55,12 +55,6 @@ static std::map <std::string, enum security_manager_user_type> user_type_map = {
{"normal", SM_USER_TYPE_NORMAL}
};
-static std::map <std::string, enum app_install_type> install_type_map = {
- {"local", SM_APP_INSTALL_LOCAL},
- {"global", SM_APP_INSTALL_GLOBAL},
- {"preloaded", SM_APP_INSTALL_PRELOADED}
-};
-
static po::options_description getGenericOptions()
{
po::options_description opts("Generic options");
@@ -101,8 +95,6 @@ static po::options_description getInstallOptions()
"user identifier number (required)")
("author-id,c", po::value<std::string>(),
"unique author's identifier (required for trusted_rw paths)")
- ("install-type", po::value<std::string>(),
- "type of installation (local, global, preloaded")
;
return opts;
}
@@ -244,10 +236,9 @@ static void parseInstallOptions(int argc, char *argv[],
}
if (vm.count("uid"))
req.uid = vm["uid"].as<uid_t>();
- if (vm.count("author-id"))
+ if (vm.count("author-id")) {
req.authorName = vm["author-id"].as<std::string>();
- if (vm.count("install-type"))
- req.installationType = install_type_map.at(vm["install-type"].as<std::string>());
+ }
}
diff --git a/src/common/include/protocols.h b/src/common/include/protocols.h
index 984a5ab5..940564ba 100644
--- a/src/common/include/protocols.h
+++ b/src/common/include/protocols.h
@@ -40,7 +40,6 @@ struct app_inst_req {
uid_t uid;
std::string tizenVersion;
std::string authorName;
- int installationType;
};
struct user_req {
diff --git a/src/common/include/service_impl.h b/src/common/include/service_impl.h
index def5618c..296fd83c 100644
--- a/src/common/include/service_impl.h
+++ b/src/common/include/service_impl.h
@@ -41,7 +41,7 @@ private:
static bool isSubDir(const char *parent, const char *subdir);
- static bool getUserAppDir(const uid_t &uid, const app_install_type &installType, std::string &userAppDir);
+ static bool getUserAppDir(const uid_t &uid, std::string &userAppDir);
static bool installRequestAuthCheck(const app_inst_req &req, uid_t uid, std::string &appPath);
diff --git a/src/common/service_impl.cpp b/src/common/service_impl.cpp
index b551dca1..0e063267 100755
--- a/src/common/service_impl.cpp
+++ b/src/common/service_impl.cpp
@@ -208,7 +208,7 @@ bool ServiceImpl::isSubDir(const char *parent, const char *subdir)
return (*subdir == '/' || *parent == *subdir);
}
-bool ServiceImpl::getUserAppDir(const uid_t &uid, const app_install_type &installType, std::string &userAppDir)
+bool ServiceImpl::getUserAppDir(const uid_t &uid, std::string &userAppDir)
{
struct tzplatform_context *tz_ctx = nullptr;
@@ -221,15 +221,8 @@ bool ServiceImpl::getUserAppDir(const uid_t &uid, const app_install_type &instal
if (tzplatform_context_set_user(tz_ctxPtr.get(), uid))
return false;
- enum tzplatform_variable id;
-
- if (installType == SM_APP_INSTALL_LOCAL)
- id = TZ_USER_APP;
- else if (installType == SM_APP_INSTALL_GLOBAL)
- id = TZ_SYS_RW_APP;
- else
- id = TZ_SYS_RO_APP;
-
+ enum tzplatform_variable id =
+ (uid == getGlobalUserId()) ? TZ_SYS_RW_APP : TZ_USER_APP;
const char *appDir = tzplatform_context_getenv(tz_ctxPtr.get(), id);
if (!appDir)
return false;
@@ -249,14 +242,12 @@ bool ServiceImpl::installRequestAuthCheck(const app_inst_req &req, uid_t uid, st
std::string userAppDir;
std::stringstream correctPath;
- if (static_cast<app_install_type>(req.installationType) == SM_APP_INSTALL_LOCAL)
- LogDebug("Installation type: local");
- else if (static_cast<app_install_type>(req.installationType) == SM_APP_INSTALL_GLOBAL)
- LogDebug("Installation type: global");
+ if (uid != getGlobalUserId())
+ LogDebug("Installation type: single user");
else
- LogDebug("Installation type: preloaded");
+ LogDebug("Installation type: global installation");
- if (!getUserAppDir(uid, static_cast<app_install_type>(req.installationType), userAppDir)) {
+ if (!getUserAppDir(uid, userAppDir)) {
LogError("Failed getting app dir for user uid: " << uid);
return false;
}
diff --git a/src/include/app-manager.h b/src/include/app-manager.h
index b4fb36b2..1d90b6a4 100644
--- a/src/include/app-manager.h
+++ b/src/include/app-manager.h
@@ -112,18 +112,6 @@ int security_manager_app_inst_req_set_uid(app_inst_req *p_req,
int security_manager_app_inst_req_set_author_id(app_inst_req *p_req, const char *author_id);
/*
- * This function is used to set up installation type (global, local, preloaded).
- * If type is not set and if installation is performed by global user, type is set to
- * 'SM_APP_INSTALL_GLOBAL'. Otherwise installation type is set to 'SM_APP_INSTALL_LOCAL'.
- *
- * \param[in] Pointer handling app_inst_req structure
- * \param[in] Installation type
- * \return API return code or error code
- *
- */
-int security_manager_app_inst_req_set_install_type(app_inst_req *p_req, const enum app_install_type type);
-
-/*
* This function is used to install application based on
* using filled up app_inst_req data structure
*
diff --git a/src/include/security-manager-types.h b/src/include/security-manager-types.h
index df17a5a5..0acf3288 100644
--- a/src/include/security-manager-types.h
+++ b/src/include/security-manager-types.h
@@ -66,15 +66,6 @@ enum app_install_path_type {
SECURITY_MANAGER_ENUM_END
};
-enum app_install_type : int {
- SM_APP_INSTALL_NONE = 0,
- SM_APP_INSTALL_LOCAL,
- SM_APP_INSTALL_GLOBAL,
- SM_APP_INSTALL_PRELOADED,
- SM_APP_INSTALL_END
-};
-typedef enum app_install_type app_install_type;
-
/**
* This enum has values equivalent to gumd user type.
* The gum-utils help states that
diff --git a/src/server/service/service.cpp b/src/server/service/service.cpp
index d5ac17ad..50e56354 100644
--- a/src/server/service/service.cpp
+++ b/src/server/service/service.cpp
@@ -175,7 +175,6 @@ void Service::processAppInstall(MessageBuffer &buffer, MessageBuffer &send, uid_
Deserialization::Deserialize(buffer, req.uid);
Deserialization::Deserialize(buffer, req.tizenVersion);
Deserialization::Deserialize(buffer, req.authorName);
- Deserialization::Deserialize(buffer, req.installationType);
Serialization::Serialize(send, serviceImpl.appInstall(req, uid));
}