#include <ttrace.h>
#include <vconf.h>
#include <math.h>
+#include <trust-anchor.h>
#include "perf.h"
#include "launchpad_common.h"
/* TODO : should be add to check permission in the kernel*/
setsid();
+ if (menu_info->global)
+ ret = trust_anchor_launch(menu_info->pkgid, GLOBAL_USER);
+ else
+ ret = trust_anchor_launch(menu_info->pkgid, getuid());
+ if (ret != TRUST_ANCHOR_ERROR_NONE &&
+ ret != TRUST_ANCHOR_ERROR_NOT_INSTALLED) {
+ _E("trust_anchor_launch() returns %d", ret);
+ return PAD_ERR_REJECTED;
+ }
+
/* SET PRIVILEGES*/
ret = security_manager_prepare_app(appid);
if (ret != SECURITY_MANAGER_SUCCESS)
#include <bundle_internal.h>
#include <aul.h>
#include <security-manager.h>
+#include <trust-anchor.h>
#include <buxton2.h>
#include <vconf.h>
}
static int __prepare_exec(const char *appid, const char *app_path,
- const char *pkg_type, int type)
+ const char *pkg_type, int type, const char* pkgid, bool global)
{
const char *file_name = NULL;
char process_name[AUL_PR_NAME] = { 0, };
/* SET PRIVILEGES*/
SECURE_LOGD("[candidata] appid : %s / pkg_type : %s / app_path : %s",
appid, pkg_type, app_path);
+
+ if (global)
+ ret = trust_anchor_launch(pkgid, GLOBAL_USER);
+ else
+ ret = trust_anchor_launch(pkgid, getuid());
+
+ if (ret != TRUST_ANCHOR_ERROR_NONE &&
+ ret != TRUST_ANCHOR_ERROR_NOT_INSTALLED) {
+ _E("trust_anchor_launch() returns %d", ret);
+ return -1;
+ }
+
ret = security_manager_prepare_app(appid);
if (ret != SECURITY_MANAGER_SUCCESS) {
_E("Failed to set privileges %s:%d", appid, ret);
static int __default_launch_cb(bundle *kb, const char *appid,
const char *app_path, const char *root_path,
- const char *pkgid, const char *pkg_type, int loader_type)
+ const char *pkgid, const char *pkg_type, int loader_type, bool global)
{
char err_str[MAX_LOCAL_BUFSZ] = { 0, };
- if (__prepare_exec(appid, app_path, pkg_type, loader_type) < 0) {
+ if (__prepare_exec(appid, app_path, pkg_type, loader_type, pkgid, global) < 0) {
_E("__candidate_process_prepare_exec() failed");
if (access(app_path, F_OK | R_OK)) {
SECURE_LOGE("access() failed for file: \"%s\", " \
__default_launch_cb(kb, menu_info->appid, app_path,
menu_info->root_path, menu_info->pkgid,
- menu_info->pkg_type, type);
+ menu_info->pkg_type, type, menu_info->global);
if (__loader_callbacks->launch) {
ret = __loader_callbacks->launch(tmp_argc, tmp_argv, app_path,