From 8caf07edb322d7b30b9adb1ac5c157af9ebcc18d Mon Sep 17 00:00:00 2001 From: Sangyoon Jang Date: Tue, 18 Aug 2015 14:48:48 +0900 Subject: [PATCH] Treat as global user when receive request from root Change-Id: If0ce1ece84de1640dde15b026f2b94d52a283c85 Signed-off-by: Sangyoon Jang --- am_daemon/amd_request.c | 9 ++++----- include/menu_db_util.h | 5 ++--- include/simple_util.h | 1 - 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/am_daemon/amd_request.c b/am_daemon/amd_request.c index 509753d..64982a7 100644 --- a/am_daemon/amd_request.c +++ b/am_daemon/amd_request.c @@ -430,13 +430,12 @@ static gboolean __request_handler(gpointer data) kb = bundle_decode(pkt->data, pkt->len); appid = (char *)bundle_get_val(kb, AUL_K_APPID); if (cr.uid == 0) { - _E("Root user request to start app assumming this is done by system deamon... Please fix it...switch to DEFAULT_USER"); - ret = _start_app(appid, kb, pkt->cmd, cr.pid, DEFAULT_USER, clifd); - } - else { + _E("request from root, treat as global user"); + ret = _start_app(appid, kb, pkt->cmd, cr.pid, GLOBAL_USER, clifd); + } else { ret = _start_app(appid, kb, pkt->cmd, cr.pid, cr.uid, clifd); } - if(ret > 0) { + if (ret > 0) { item = calloc(1, sizeof(item_pkt_t)); if (item == NULL) { _E("out of memory"); diff --git a/include/menu_db_util.h b/include/menu_db_util.h index 2b7bdb9..fbba006 100644 --- a/include/menu_db_util.h +++ b/include/menu_db_util.h @@ -208,9 +208,8 @@ static inline app_info_from_db *_get_app_info_from_db_by_apppath_user( int ret = PMINFO_R_OK; if (uid == 0) { - _E("Root user request to start app assumming this is done by" - "system deamon... Please fix it...switch to DEFAULT_USER"); - uid = DEFAULT_USER; + _E("request from root, treat as global user"); + uid = GLOBAL_USER; } if (apppath == NULL) diff --git a/include/simple_util.h b/include/simple_util.h index b855b49..cf744e0 100644 --- a/include/simple_util.h +++ b/include/simple_util.h @@ -29,7 +29,6 @@ #include #define GLOBAL_USER tzplatform_getuid(TZ_SYS_GLOBALAPP_USER) -#define DEFAULT_USER tzplatform_getuid(TZ_SYS_DEFAULT_USER) #undef LOG_TAG #define LOG_TAG "AUL" -- 2.7.4