return ret;
}
-
int _start_app(char* appid, bundle* kb, int cmd, int caller_pid, uid_t caller_uid, int fd)
{
const struct appinfo *ai;
multiple = appinfo_get_value(ai, AIT_MULTI);
if (!multiple || strncmp(multiple, "false", 5) == 0) {
- pid = _status_app_is_running_v2(appid, caller_uid);
+ pid = _status_app_is_running(appid, caller_uid);
}
if (app_group_is_group_app(kb, caller_uid)) {
}
if (pid > 0) {
- if (_status_get_app_info_status(pid) == STATUS_DYING) {
+ if (_status_get_app_info_status(pid, caller_uid) == STATUS_DYING) {
pid = -ETERMINATING;
} else if (caller_pid == pid) {
SECURE_LOGD("caller process & callee process is same.[%s:%d]", appid, pid);
GSLIST_FOREACH_SAFE(app_status_info_list, iter, iter_next) {
info_t = (app_status_info_t *)iter->data;
if(pid == info_t->pid) {
- if(uid == info_t->user)
+ if(uid == info_t->uid)
return 0;
else {
//PID is unique so if it is exist but user value is not correct remove it.
info_t->status = STATUS_LAUNCHING;
info_t->pid = pid;
info_t->pad_pid = pad_pid;
- info_t->user = uid;
+ info_t->uid = uid;
app_status_info_list = g_slist_append(app_status_info_list, info_t);
for (iter = app_status_info_list; iter != NULL; iter = g_slist_next(iter))
{
info_t = (app_status_info_t *)iter->data;
- SECURE_LOGD(" [%d] : %s, %d, %d", info_t->user, info_t->appid, info_t->pid, info_t->status);
+ SECURE_LOGD(" [%d] : %s, %d, %d", info_t->uid, info_t->appid, info_t->pid, info_t->status);
}
return 0;
for (iter = app_status_info_list; iter != NULL; iter = g_slist_next(iter))
{
info_t = (app_status_info_t *)iter->data;
- if((pid == info_t->pid) && ((info_t->user == uid) || (info_t->user == 0))) {
+ if((pid == info_t->pid) && ((info_t->uid == uid) || (info_t->uid == 0))) {
info_t->status = status;
is_sub_app = false;
break;
GSLIST_FOREACH_SAFE(app_status_info_list, iter, iter_next) {
info_t = (app_status_info_t *)iter->data;
- if (info_t->user == uid) {
+ if (info_t->uid == uid) {
app_status_info_list =
g_slist_remove(app_status_info_list, info_t);
free(info_t);
GSLIST_FOREACH_SAFE(app_status_info_list, iter, iter_next) {
info_t = (app_status_info_t *)iter->data;
- if((pid == info_t->pid) && ((info_t->user == uid) || (info_t->user == 0))) {
+ if((pid == info_t->pid) && ((info_t->uid == uid) || (info_t->uid == 0))) {
app_status_info_list = g_slist_remove(app_status_info_list, info_t);
free(info_t);
break;
return 0;
}
-int _status_get_app_info_status(int pid)
+int _status_get_app_info_status(int pid, uid_t uid)
{
GSList *iter = NULL;
app_status_info_t *info_t = NULL;
for (iter = app_status_info_list; iter != NULL; iter = g_slist_next(iter))
{
info_t = (app_status_info_t *)iter->data;
- if(pid == info_t->pid) {
+ if(pid == info_t->pid && uid == info_t->uid) {
return info_t->status;
}
}
return -1;
}
-
int _status_app_is_running(char *appid, uid_t uid)
{
GSList *iter = NULL;
for (iter = app_status_info_list; iter != NULL; iter = g_slist_next(iter))
{
info_t = (app_status_info_t *)iter->data;
- if(( strncmp(appid, info_t->appid, MAX_PACKAGE_STR_SIZE) == 0 ) && (info_t->user == uid)) {
+ if(( strncmp(appid, info_t->appid, MAX_PACKAGE_STR_SIZE) == 0 ) && (info_t->uid == uid)) {
return info_t->pid;
}
}
return NULL;
}
-int _status_send_running_appinfo(int fd)
+int _status_send_running_appinfo(int fd, uid_t uid)
{
GSList *iter = NULL;
app_status_info_t *info_t = NULL;
for (iter = app_status_info_list; iter != NULL; iter = g_slist_next(iter))
{
info_t = (app_status_info_t *)iter->data;
- if (app_group_is_sub_app(info_t->pid))
+ if (info_t->uid != uid || app_group_is_sub_app(info_t->pid))
continue;
snprintf(tmp_pid, MAX_PID_STR_BUFSZ, "%d", info_t->pid);
int _status_add_app_info_list(char *appid, char *app_path, int pid, int pad_pid, uid_t uid);
int _status_update_app_info_list(int pid, int status, uid_t uid);
int _status_remove_app_info_list(int pid, uid_t uid);
-int _status_get_app_info_status(int pid);
-int _status_send_running_appinfo(int fd);
+int _status_get_app_info_status(int pid, uid_t uid);
+int _status_send_running_appinfo(int fd, uid_t uid);
int _status_app_is_running(char *appid, uid_t uid);
int _status_app_is_running_v2(char *appid, uid_t caller_uid);
char *_status_app_get_appid_bypid(int pid);