#include <sys/types.h>
struct backend_job {
- uid_t uid;
+ uid_t target_uid;
+ uid_t caller_uid;
int req_type;
char *req_id;
char *pkgid;
};
int _is_queue_empty(int pos);
-int _push_queue(uid_t uid, const char *req_id, int req_type,
- const char *queue_type, const char *pkgid, const char *args);
+int _push_queue(uid_t target_uid, uid_t caller_uid, const char *req_id,
+ int req_type, const char *queue_type, const char *pkgid,
+ const char *args);
struct backend_job *_pop_queue(int pos);
void _free_backend_job(struct backend_job *job);
int _init_backend_queue(void);
return -1;
snprintf(args, sizeof(args), "%s -k %s -i %s -u %d %s", backend_cmd,
- job->req_id, job->pkgid, (int)job->uid, job->args);
+ job->req_id, job->pkgid, (int)job->target_uid, job->args);
argv = __generate_argv(args);
return -1;
snprintf(args, sizeof(args), "%s -k %s -w %s -u %d %s", backend_cmd,
- job->req_id, job->pkgid, (int)job->uid, job->args);
+ job->req_id, job->pkgid, (int)job->target_uid, job->args);
argv = __generate_argv(args);
return -1;
snprintf(args, sizeof(args), "%s -k %s -r %s -u %d", backend_cmd,
- job->req_id, job->pkgid, (int)job->uid);
+ job->req_id, job->pkgid, (int)job->target_uid);
argv = __generate_argv(args);
pid = __fork_and_exec_with_args(argv, APPFW_UID);
return -1;
snprintf(args, sizeof(args), "%s -k %s -d %s -u %d", backend_cmd,
- job->req_id, job->pkgid, (int)job->uid);
+ job->req_id, job->pkgid, (int)job->target_uid);
argv = __generate_argv(args);
pid = __fork_and_exec_with_args(argv, APPFW_UID);
return -1;
snprintf(args, sizeof(args), "%s -k %s -m %s -u %d -t %s", backend_cmd,
- job->req_id, job->pkgid, (int)job->uid, job->args);
+ job->req_id, job->pkgid, (int)job->target_uid, job->args);
argv = __generate_argv(args);
pid = __fork_and_exec_with_args(argv, APPFW_UID);
return -1;
snprintf(args, sizeof(args), "%s -k %s -u %d -A %s", backend_cmd,
- job->req_id, (int)job->uid, job->pkgid);
+ job->req_id, (int)job->target_uid, job->pkgid);
argv = __generate_argv(args);
pid = __fork_and_exec_with_args(argv, APPFW_UID);
return -1;
snprintf(args, sizeof(args), "%s -k %s -u %d -D %s", backend_cmd,
- job->req_id, (int)job->uid, job->pkgid);
+ job->req_id, (int)job->target_uid, job->pkgid);
argv = __generate_argv(args);
pid = __fork_and_exec_with_args(argv, APPFW_UID);
/* get actual pkgid and replace it to appid which is currently stored
* at pkgid variable
*/
- ret = __change_job_info(job, job->uid, &is_global);
+ ret = __change_job_info(job, job->target_uid, &is_global);
if (ret != PMINFO_R_OK || strlen(job->appid) == 0) {
- _send_app_signal(job->uid, job->req_id, job->pkgid, job->pkgid,
+ _send_app_signal(job->target_uid, job->req_id, job->pkgid, job->pkgid,
PKGMGR_INSTALLER_START_KEY_STR,
PKGMGR_INSTALLER_APP_ENABLE_EVENT_STR,
job->req_type);
- _send_app_signal(job->uid, job->req_id, job->pkgid, job->pkgid,
+ _send_app_signal(job->target_uid, job->req_id, job->pkgid, job->pkgid,
PKGMGR_INSTALLER_END_KEY_STR,
PKGMGR_INSTALLER_FAIL_EVENT_STR,
job->req_type);
return ret;
}
- _send_app_signal(job->uid, job->req_id, job->pkgid, job->appid,
+ _send_app_signal(job->target_uid, job->req_id, job->pkgid, job->appid,
PKGMGR_INSTALLER_START_KEY_STR,
PKGMGR_INSTALLER_APP_ENABLE_EVENT_STR, job->req_type);
ret = pkgmgr_parser_update_app_disable_info_in_usr_db(job->appid,
- job->uid, 0);
+ job->target_uid, 0);
if (ret != PMINFO_R_OK)
- _send_app_signal(job->uid, job->req_id, job->pkgid, job->appid,
+ _send_app_signal(job->target_uid, job->req_id, job->pkgid, job->appid,
PKGMGR_INSTALLER_END_KEY_STR,
PKGMGR_INSTALLER_FAIL_EVENT_STR,
job->req_type);
else
- _send_app_signal(job->uid, job->req_id, job->pkgid, job->appid,
+ _send_app_signal(job->target_uid, job->req_id, job->pkgid, job->appid,
PKGMGR_INSTALLER_END_KEY_STR,
PKGMGR_INSTALLER_OK_EVENT_STR,
job->req_type);
/* get actual pkgid and replace it to appid which is currently stored
* at pkgid variable
*/
- ret = __change_job_info(job, job->uid, &is_global);
+ ret = __change_job_info(job, job->target_uid, &is_global);
if (ret != PMINFO_R_OK || strlen(job->appid) == 0) {
- _send_app_signal(job->uid, job->req_id, job->pkgid, job->pkgid,
+ _send_app_signal(job->target_uid, job->req_id, job->pkgid, job->pkgid,
PKGMGR_INSTALLER_START_KEY_STR,
PKGMGR_INSTALLER_APP_DISABLE_EVENT_STR,
job->req_type);
- _send_app_signal(job->uid, job->req_id, job->pkgid, job->pkgid,
+ _send_app_signal(job->target_uid, job->req_id, job->pkgid, job->pkgid,
PKGMGR_INSTALLER_END_KEY_STR,
PKGMGR_INSTALLER_FAIL_EVENT_STR,
job->req_type);
return ret;
}
- _send_app_signal(job->uid, job->req_id, job->pkgid, job->appid,
+ _send_app_signal(job->target_uid, job->req_id, job->pkgid, job->appid,
PKGMGR_INSTALLER_START_KEY_STR,
PKGMGR_INSTALLER_APP_DISABLE_EVENT_STR, job->req_type);
- ret = __kill_app(job->appid, job->uid);
+ ret = __kill_app(job->appid, job->target_uid);
if (ret != 0) {
- _send_app_signal(job->uid, job->req_id, job->pkgid, job->appid,
+ _send_app_signal(job->target_uid, job->req_id, job->pkgid, job->appid,
PKGMGR_INSTALLER_END_KEY_STR,
PKGMGR_INSTALLER_FAIL_EVENT_STR,
job->req_type);
}
ret = pkgmgr_parser_update_app_disable_info_in_usr_db(job->appid,
- job->uid, 1);
+ job->target_uid, 1);
if (ret != PMINFO_R_OK)
- _send_app_signal(job->uid, job->req_id, job->pkgid, job->appid,
+ _send_app_signal(job->target_uid, job->req_id, job->pkgid, job->appid,
PKGMGR_INSTALLER_END_KEY_STR,
PKGMGR_INSTALLER_FAIL_EVENT_STR,
job->req_type);
else
- _send_app_signal(job->uid, job->req_id, job->pkgid, job->appid,
+ _send_app_signal(job->target_uid, job->req_id, job->pkgid, job->appid,
PKGMGR_INSTALLER_END_KEY_STR,
PKGMGR_INSTALLER_OK_EVENT_STR,
job->req_type);
/* get actual pkgid and replace it to appid which is currently stored
* at pkgid variable
*/
- ret = __change_job_info(job, job->uid, &is_global);
+ ret = __change_job_info(job, job->target_uid, &is_global);
if (ret != PMINFO_R_OK || strlen(job->appid) == 0) {
- _send_app_signal(job->uid, job->req_id, job->pkgid, job->pkgid,
+ _send_app_signal(job->target_uid, job->req_id, job->pkgid, job->pkgid,
PKGMGR_INSTALLER_START_KEY_STR,
PKGMGR_INSTALLER_GLOBAL_APP_ENABLE_FOR_UID,
job->req_type);
- _send_app_signal(job->uid, job->req_id, job->pkgid, job->pkgid,
+ _send_app_signal(job->target_uid, job->req_id, job->pkgid, job->pkgid,
PKGMGR_INSTALLER_END_KEY_STR,
PKGMGR_INSTALLER_FAIL_EVENT_STR,
job->req_type);
return ret;
}
- _send_app_signal(job->uid, job->req_id, job->pkgid, job->appid,
+ _send_app_signal(job->target_uid, job->req_id, job->pkgid, job->appid,
PKGMGR_INSTALLER_START_KEY_STR,
PKGMGR_INSTALLER_GLOBAL_APP_ENABLE_FOR_UID,
job->req_type);
ret = pkgmgr_parser_update_global_app_disable_for_uid_info_in_db(
- job->appid, job->uid, 0);
+ job->appid, job->target_uid, 0);
if (ret != PMINFO_R_OK)
- _send_app_signal(job->uid, job->req_id, job->pkgid, job->appid,
+ _send_app_signal(job->target_uid, job->req_id, job->pkgid, job->appid,
PKGMGR_INSTALLER_END_KEY_STR,
PKGMGR_INSTALLER_FAIL_EVENT_STR,
job->req_type);
else
- _send_app_signal(job->uid, job->req_id, job->pkgid, job->appid,
+ _send_app_signal(job->target_uid, job->req_id, job->pkgid, job->appid,
PKGMGR_INSTALLER_END_KEY_STR,
PKGMGR_INSTALLER_OK_EVENT_STR,
job->req_type);
*/
ret = __change_job_info(job, GLOBAL_USER, &is_global);
if (ret != PMINFO_R_OK || strlen(job->appid) == 0) {
- _send_app_signal(job->uid, job->req_id,
+ _send_app_signal(job->target_uid, job->req_id,
job->pkgid, job->pkgid,
PKGMGR_INSTALLER_START_KEY_STR,
PKGMGR_INSTALLER_GLOBAL_APP_DISABLE_FOR_UID,
job->req_type);
- _send_app_signal(job->uid, job->req_id, job->pkgid, job->pkgid,
+ _send_app_signal(job->target_uid, job->req_id, job->pkgid, job->pkgid,
PKGMGR_INSTALLER_END_KEY_STR,
PKGMGR_INSTALLER_FAIL_EVENT_STR,
job->req_type);
return ret;
}
- _send_app_signal(job->uid, job->req_id,
+ _send_app_signal(job->target_uid, job->req_id,
job->pkgid, job->appid,
PKGMGR_INSTALLER_START_KEY_STR,
PKGMGR_INSTALLER_GLOBAL_APP_DISABLE_FOR_UID,
job->req_type);
- ret = __kill_app(job->appid, job->uid);
+ ret = __kill_app(job->appid, job->target_uid);
ret = pkgmgr_parser_update_global_app_disable_for_uid_info_in_db(
- job->appid, job->uid, 1);
+ job->appid, job->target_uid, 1);
if (ret != PMINFO_R_OK)
- _send_app_signal(job->uid, job->req_id, job->pkgid, job->appid,
+ _send_app_signal(job->target_uid, job->req_id, job->pkgid, job->appid,
PKGMGR_INSTALLER_END_KEY_STR,
PKGMGR_INSTALLER_FAIL_EVENT_STR,
job->req_type);
else
- _send_app_signal(job->uid, job->req_id, job->pkgid, job->appid,
+ _send_app_signal(job->target_uid, job->req_id, job->pkgid, job->appid,
PKGMGR_INSTALLER_END_KEY_STR,
PKGMGR_INSTALLER_OK_EVENT_STR,
job->req_type);
static int __process_getsize(struct backend_job *job)
{
- static const char *backend_cmd = "/usr/bin/pkg_getsize";
+ static const char backend_cmd[] = "/usr/bin/pkg_getsize";
char **argv;
char args[MAX_PKG_ARGS_LEN];
int pid;
- snprintf(args, sizeof(args), "%s %s %s -k %s", backend_cmd, job->pkgid,
- job->args, job->req_id);
+ snprintf(args, sizeof(args), "%s %s %s %d -k %s -u %d",
+ backend_cmd, job->pkgid, job->args, job->caller_uid,
+ job->req_id, job->target_uid);
argv = __generate_argv(args);
- pid = __fork_and_exec_with_args(argv, job->uid);
+ pid = __fork_and_exec_with_args(argv, APPFW_UID);
g_strfreev(argv);
/* TODO: set movetype */
snprintf(args, sizeof(args), "%s -k %s -c %s -u %d", backend_cmd,
- job->req_id, job->pkgid, (int)job->uid);
+ job->req_id, job->pkgid, (int)job->target_uid);
argv = __generate_argv(args);
pid = __fork_and_exec_with_args(argv, APPFW_UID);
snprintf(args, sizeof(args), "%s %s", backend_cmd, job->pkgid);
argv = __generate_argv(args);
- pid = __fork_and_exec_with_args(argv, job->uid);
+ pid = __fork_and_exec_with_args(argv, job->target_uid);
g_strfreev(argv);
pkgmgrinfo_pkginfo_h handle;
pkgcmd_data *pdata;
- ret = pkgmgrinfo_pkginfo_get_usr_pkginfo(job->pkgid, job->uid,
+ ret = pkgmgrinfo_pkginfo_get_usr_pkginfo(job->pkgid, job->target_uid,
&handle);
if (ret < 0) {
ERR("Failed to get handle");
free(pdata);
return -1;
}
- pdata->uid = job->uid;
+ pdata->uid = job->target_uid;
ret = pkgmgrinfo_appinfo_get_usr_list(handle, PMINFO_ALL_APP,
- __pkgcmd_app_cb, pdata, job->uid);
+ __pkgcmd_app_cb, pdata, job->target_uid);
_return_value_to_caller(job->req_id,
g_variant_new("(ii)", PKGMGR_R_OK, pdata->pid));
pkgmgrinfo_pkginfo_h handle;
pkgcmd_data *pdata;
- ret = pkgmgrinfo_pkginfo_get_usr_pkginfo(job->pkgid, job->uid,
+ ret = pkgmgrinfo_pkginfo_get_usr_pkginfo(job->pkgid, job->target_uid,
&handle);
if (ret < 0) {
ERR("Failed to get handle");
free(pdata);
return -1;
}
- pdata->uid = job->uid;
+ pdata->uid = job->target_uid;
ret = pkgmgrinfo_appinfo_get_usr_list(handle, PMINFO_ALL_APP,
- __pkgcmd_app_cb, pdata, job->uid);
+ __pkgcmd_app_cb, pdata, job->target_uid);
_return_value_to_caller(job->req_id,
g_variant_new("(ii)", PKGMGR_R_OK, pdata->pid));
bool is_global = false;
const char *val;
- ret = __change_job_info(job, job->uid, &is_global);
+ ret = __change_job_info(job, job->target_uid, &is_global);
if (ret != PMINFO_R_OK || strlen(job->appid) == 0)
return -1;
val = flag ? PKGMGR_INSTALLER_APP_ENABLE_SPLASH_SCREEN_EVENT_STR :
PKGMGR_INSTALLER_APP_DISABLE_SPLASH_SCREEN_EVENT_STR;
- _send_app_signal(job->uid, job->req_id, job->pkgid, job->appid,
+ _send_app_signal(job->target_uid, job->req_id, job->pkgid, job->appid,
PKGMGR_INSTALLER_START_KEY_STR, val, job->req_type);
if (is_global)
- ret = pkgmgr_parser_update_global_app_splash_screen_display_info_in_usr_db(job->appid, job->uid, flag);
+ ret = pkgmgr_parser_update_global_app_splash_screen_display_info_in_usr_db(job->appid, job->target_uid, flag);
else
ret = pkgmgr_parser_update_app_splash_screen_display_info_in_usr_db(
- job->appid, job->uid, flag);
+ job->appid, job->target_uid, flag);
if (ret != PMINFO_R_OK)
- _send_app_signal(job->uid, job->req_id, job->pkgid,
+ _send_app_signal(job->target_uid, job->req_id, job->pkgid,
job->appid, PKGMGR_INSTALLER_END_KEY_STR,
PKGMGR_INSTALLER_FAIL_EVENT_STR,
job->req_type);
else
- _send_app_signal(job->uid, job->req_id, job->pkgid,
+ _send_app_signal(job->target_uid, job->req_id, job->pkgid,
job->appid, PKGMGR_INSTALLER_END_KEY_STR,
PKGMGR_INSTALLER_OK_EVENT_STR,
job->req_type);
int mode;
mode = atoi(job->args);
- ret = _set_restriction_mode(job->uid, job->pkgid, mode);
+ ret = _set_restriction_mode(job->target_uid, job->pkgid, mode);
_return_value_to_caller(job->req_id,
g_variant_new("(i)", ret));
int mode;
mode = atoi(job->args);
- ret = _unset_restriction_mode(job->uid, job->pkgid, mode);
+ ret = _unset_restriction_mode(job->target_uid, job->pkgid, mode);
_return_value_to_caller(job->req_id,
g_variant_new("(i)", ret));
int ret;
int mode = -1;
- ret = _get_restriction_mode(job->uid, job->pkgid, &mode);
+ ret = _get_restriction_mode(job->target_uid, job->pkgid, &mode);
_return_value_to_caller(job->req_id,
g_variant_new("(ii)", mode, ret));
return job;
}
-int _push_queue(uid_t uid, const char *req_id, int req_type,
- const char *queue_type, const char *pkgid, const char *args)
+int _push_queue(uid_t target_uid, uid_t caller_uid, const char *req_id,
+ int req_type, const char *queue_type, const char *pkgid,
+ const char *args)
{
struct backend_queue *queue;
struct backend_job *job;
}
job = calloc(1, sizeof(struct backend_job));
- job->uid = uid;
+ job->target_uid = target_uid;
+ job->caller_uid = caller_uid;
if (req_id)
job->req_id = strdup(req_id);
job->req_type = req_type;
return 0;
}
-static int __handle_request_install(uid_t uid,
+static int __handle_request_install(uid_t caller_uid,
GDBusMethodInvocation *invocation, GVariant *parameters)
{
uid_t target_uid = (uid_t)-1;
goto catch;
}
- if (_push_queue(target_uid, reqkey, REQUEST_TYPE_INSTALL, pkgtype,
- pkgpath, args)) {
+ if (_push_queue(target_uid, caller_uid, reqkey, REQUEST_TYPE_INSTALL,
+ pkgtype, pkgpath, args)) {
g_dbus_method_invocation_return_value(invocation,
g_variant_new("(is)", PKGMGR_R_ESYSTEM, ""));
ret = -1;
return ret;
}
-static int __handle_request_mount_install(uid_t uid,
+static int __handle_request_mount_install(uid_t caller_uid,
GDBusMethodInvocation *invocation, GVariant *parameters)
{
uid_t target_uid = (uid_t)-1;
goto catch;
}
- if (_push_queue(target_uid, reqkey, REQUEST_TYPE_MOUNT_INSTALL,
+ if (_push_queue(target_uid, caller_uid, reqkey,
+ REQUEST_TYPE_MOUNT_INSTALL,
pkgtype, pkgpath, args)) {
g_dbus_method_invocation_return_value(invocation,
g_variant_new("(is)", PKGMGR_R_ESYSTEM, ""));
return ret;
}
-static int __handle_request_reinstall(uid_t uid,
+static int __handle_request_reinstall(uid_t caller_uid,
GDBusMethodInvocation *invocation, GVariant *parameters)
{
uid_t target_uid = (uid_t)-1;
free(pkgtype);
return -1;
}
- if (_push_queue(target_uid, reqkey, REQUEST_TYPE_REINSTALL, pkgtype,
- pkgid, NULL)) {
+ if (_push_queue(target_uid, caller_uid, reqkey, REQUEST_TYPE_REINSTALL,
+ pkgtype, pkgid, NULL)) {
g_dbus_method_invocation_return_value(invocation,
g_variant_new("(is)", PKGMGR_R_ESYSTEM, ""));
free(reqkey);
return 0;
}
-static int __handle_request_uninstall(uid_t uid,
+static int __handle_request_uninstall(uid_t caller_uid,
GDBusMethodInvocation *invocation, GVariant *parameters)
{
uid_t target_uid = (uid_t)-1;
free(pkgtype);
return -1;
}
- if (_push_queue(target_uid, reqkey, REQUEST_TYPE_UNINSTALL, pkgtype,
- pkgid, NULL)) {
+ if (_push_queue(target_uid, caller_uid, reqkey, REQUEST_TYPE_UNINSTALL,
+ pkgtype, pkgid, NULL)) {
g_dbus_method_invocation_return_value(invocation,
g_variant_new("(is)", PKGMGR_R_ESYSTEM, ""));
free(reqkey);
return 0;
}
-static int __handle_request_move(uid_t uid,
+static int __handle_request_move(uid_t caller_uid,
GDBusMethodInvocation *invocation, GVariant *parameters)
{
uid_t target_uid = (uid_t)-1;
}
snprintf(buf, sizeof(buf), "%d", move_type);
- if (_push_queue(target_uid, reqkey, REQUEST_TYPE_MOVE, pkgtype,
- pkgid, buf)) {
+ if (_push_queue(target_uid, caller_uid, reqkey, REQUEST_TYPE_MOVE,
+ pkgtype, pkgid, buf)) {
g_dbus_method_invocation_return_value(invocation,
g_variant_new("(is)", PKGMGR_R_ESYSTEM, ""));
free(reqkey);
return 0;
}
-static int __handle_request_enable_pkgs(uid_t uid,
+static int __handle_request_enable_pkgs(uid_t caller_uid,
GDBusMethodInvocation *invocation, GVariant *parameters)
{
uid_t target_uid = (uid_t)-1;
free(reqkey);
return -1;
}
- if (_push_queue(target_uid, reqkey, REQUEST_TYPE_ENABLE_PKG,
+ if (_push_queue(target_uid, caller_uid, reqkey,
+ REQUEST_TYPE_ENABLE_PKG,
pkgtype, pkgid, NULL)) {
g_dbus_method_invocation_return_value(invocation,
g_variant_new("(is)",
return 0;
}
-static int __handle_request_disable_pkgs(uid_t uid,
+static int __handle_request_disable_pkgs(uid_t caller_uid,
GDBusMethodInvocation *invocation, GVariant *parameters)
{
uid_t target_uid = (uid_t)-1;
free(reqkey);
return -1;
}
- if (_push_queue(target_uid, reqkey, REQUEST_TYPE_DISABLE_PKG,
+ if (_push_queue(target_uid, caller_uid, reqkey,
+ REQUEST_TYPE_DISABLE_PKG,
pkgtype, pkgid, NULL)) {
g_dbus_method_invocation_return_value(invocation,
g_variant_new("(is)",
return 0;
}
-static int __handle_request_enable_app(uid_t uid,
+static int __handle_request_enable_app(uid_t caller_uid,
GDBusMethodInvocation *invocation, GVariant *parameters)
{
uid_t target_uid = (uid_t)-1;
goto catch;
}
- if (_push_queue(target_uid, reqkey, REQUEST_TYPE_ENABLE_APP, "default",
+ if (_push_queue(target_uid, caller_uid, reqkey,
+ REQUEST_TYPE_ENABLE_APP, "default",
appid, NULL)) {
g_dbus_method_invocation_return_value(invocation,
g_variant_new("(is)", PKGMGR_R_ESYSTEM, ""));
return ret;
}
-static int __handle_request_disable_app(uid_t uid,
+static int __handle_request_disable_app(uid_t caller_uid,
GDBusMethodInvocation *invocation, GVariant *parameters)
{
uid_t target_uid = (uid_t)-1;
goto catch;
}
- if (_push_queue(target_uid, reqkey, REQUEST_TYPE_DISABLE_APP, "default",
+ if (_push_queue(target_uid, caller_uid, reqkey,
+ REQUEST_TYPE_DISABLE_APP, "default",
appid, NULL)) {
g_dbus_method_invocation_return_value(invocation,
g_variant_new("(is)", PKGMGR_R_ESYSTEM, ""));
return ret;
}
-static int __handle_request_enable_global_app_for_uid(uid_t uid,
+static int __handle_request_enable_global_app_for_uid(uid_t caller_uid,
GDBusMethodInvocation *invocation, GVariant *parameters)
{
uid_t target_uid = (uid_t)-1;
goto catch;
}
- if (_push_queue(target_uid, reqkey,
+ if (_push_queue(target_uid, caller_uid, reqkey,
REQUEST_TYPE_ENABLE_GLOBAL_APP_FOR_UID,
"default", appid, NULL)) {
g_dbus_method_invocation_return_value(invocation,
return ret;
}
-static int __handle_request_disable_global_app_for_uid(uid_t uid,
+static int __handle_request_disable_global_app_for_uid(uid_t caller_uid,
GDBusMethodInvocation *invocation, GVariant *parameters)
{
uid_t target_uid = (uid_t)-1;
goto catch;
}
- if (_push_queue(target_uid, reqkey,
+ if (_push_queue(target_uid, caller_uid, reqkey,
REQUEST_TYPE_DISABLE_GLOBAL_APP_FOR_UID,
"default", appid, NULL)) {
g_dbus_method_invocation_return_value(invocation,
return ret;
}
-static int __handle_request_getsize(uid_t uid,
+static int __handle_request_getsize(uid_t caller_uid,
GDBusMethodInvocation *invocation, GVariant *parameters)
{
uid_t target_uid = (uid_t)-1;
}
snprintf(buf, sizeof(buf), "%d", get_type);
- if (_push_queue(target_uid, reqkey, REQUEST_TYPE_GETSIZE, "pkgtool",
- pkgid, buf)) {
+ if (_push_queue(target_uid, caller_uid, reqkey, REQUEST_TYPE_GETSIZE,
+ "pkgtool", pkgid, buf)) {
g_dbus_method_invocation_return_value(invocation,
g_variant_new("(is)", PKGMGR_R_ESYSTEM, ""));
free(reqkey);
return 0;
}
-static int __handle_request_cleardata(uid_t uid,
+static int __handle_request_cleardata(uid_t caller_uid,
GDBusMethodInvocation *invocation, GVariant *parameters)
{
uid_t target_uid = (uid_t)-1;
return -1;
}
- if (_push_queue(target_uid, reqkey, REQUEST_TYPE_CLEARDATA, pkgtype,
- pkgid, NULL)) {
+ if (_push_queue(target_uid, caller_uid, reqkey, REQUEST_TYPE_CLEARDATA,
+ pkgtype, pkgid, NULL)) {
g_dbus_method_invocation_return_value(invocation,
g_variant_new("(i)", PKGMGR_R_ESYSTEM));
free(reqkey);
return 0;
}
-static int __handle_request_clearcache(uid_t uid,
+static int __handle_request_clearcache(uid_t caller_uid,
GDBusMethodInvocation *invocation, GVariant *parameters)
{
uid_t target_uid = (uid_t)-1;
return -1;
}
- if (_push_queue(target_uid, NULL, REQUEST_TYPE_CLEARCACHE,
+ if (_push_queue(target_uid, caller_uid, NULL, REQUEST_TYPE_CLEARCACHE,
"pkgtool", pkgid, NULL)) {
g_dbus_method_invocation_return_value(invocation,
g_variant_new("(i)", PKGMGR_R_ESYSTEM));
return 0;
}
-static int __handle_request_kill(uid_t uid,
+static int __handle_request_kill(uid_t caller_uid,
GDBusMethodInvocation *invocation, GVariant *parameters)
{
uid_t target_uid = (uid_t)-1;
return -1;
}
- if (_push_queue(target_uid, reqkey, REQUEST_TYPE_KILL,
+ if (_push_queue(target_uid, caller_uid, reqkey, REQUEST_TYPE_KILL,
"default", pkgid, NULL)) {
g_dbus_method_invocation_return_value(invocation,
g_variant_new("(ii)", PKGMGR_R_ESYSTEM, 0));
return 0;
}
-static int __handle_request_check(uid_t uid,
+static int __handle_request_check(uid_t caller_uid,
GDBusMethodInvocation *invocation, GVariant *parameters)
{
uid_t target_uid = (uid_t)-1;
return -1;
}
- if (_push_queue(target_uid, reqkey, REQUEST_TYPE_CHECK,
+ if (_push_queue(target_uid, caller_uid, reqkey, REQUEST_TYPE_CHECK,
"default", pkgid, NULL)) {
g_dbus_method_invocation_return_value(invocation,
g_variant_new("(ii)", PKGMGR_R_ESYSTEM, 0));
return 0;
}
-static int __handle_request_generate_license_request(uid_t uid,
+static int __handle_request_generate_license_request(uid_t caller_uid,
GDBusMethodInvocation *invocation, GVariant *parameters)
{
char *reqkey;
return -1;
}
- if (_push_queue(uid, reqkey,
+ if (_push_queue(caller_uid, caller_uid, reqkey,
REQUEST_TYPE_GENERATE_LICENSE_REQUEST,
"default", NULL, resp_data)) {
g_dbus_method_invocation_return_value(invocation,
return 0;
}
-static int __handle_request_register_license(uid_t uid,
+static int __handle_request_register_license(uid_t caller_uid,
GDBusMethodInvocation *invocation, GVariant *parameters)
{
char *reqkey;
return -1;
}
- if (_push_queue(uid, reqkey, REQUEST_TYPE_REGISTER_LICENSE,
+ if (_push_queue(caller_uid, caller_uid, reqkey,
+ REQUEST_TYPE_REGISTER_LICENSE,
"default", NULL, resp_data)) {
g_dbus_method_invocation_return_value(invocation,
g_variant_new("(i)", PKGMGR_R_ESYSTEM));
return 0;
}
-static int __handle_request_decrypt_package(uid_t uid,
+static int __handle_request_decrypt_package(uid_t caller_uid,
GDBusMethodInvocation *invocation, GVariant *parameters)
{
char *reqkey;
return -1;
}
- if (_push_queue(uid, reqkey, REQUEST_TYPE_DECRYPT_PACKAGE,
+ if (_push_queue(caller_uid, caller_uid, reqkey,
+ REQUEST_TYPE_DECRYPT_PACKAGE,
"default", drm_file_path,
decrypted_file_path)) {
g_dbus_method_invocation_return_value(invocation,
return 0;
}
-static int __update_app_splash_screen(uid_t uid,
+static int __update_app_splash_screen(uid_t caller_uid,
GDBusMethodInvocation *invocation, GVariant *parameters,
int req_type)
{
return -1;
}
- if (_push_queue(target_uid, reqkey, req_type, "default",
+ if (_push_queue(target_uid, caller_uid, reqkey, req_type, "default",
appid, NULL)) {
ERR("Failed to push request");
g_dbus_method_invocation_return_value(invocation,
return 0;
}
-static int __handle_request_enable_app_splash_screen(uid_t uid,
+static int __handle_request_enable_app_splash_screen(uid_t caller_uid,
GDBusMethodInvocation *invocation, GVariant *parameters)
{
- return __update_app_splash_screen(uid, invocation, parameters,
+ return __update_app_splash_screen(caller_uid, invocation, parameters,
REQUEST_TYPE_ENABLE_APP_SPLASH_SCREEN);
}
-static int __handle_request_disable_app_splash_screen(uid_t uid,
+static int __handle_request_disable_app_splash_screen(uid_t caller_uid,
GDBusMethodInvocation *invocation, GVariant *parameters)
{
- return __update_app_splash_screen(uid, invocation, parameters,
+ return __update_app_splash_screen(caller_uid, invocation, parameters,
REQUEST_TYPE_DISABLE_APP_SPLASH_SCREEN);
}
-static int __handle_request_set_restriction_mode(uid_t uid,
+static int __handle_request_set_restriction_mode(uid_t caller_uid,
GDBusMethodInvocation *invocation, GVariant *parameters)
{
uid_t target_uid = (uid_t)-1;
}
snprintf(buf, sizeof(buf), "%d", mode);
- if (_push_queue(target_uid, reqkey,
+ if (_push_queue(target_uid, caller_uid, reqkey,
REQUEST_TYPE_SET_RESTRICTION_MODE,
"default", pkgid, buf)) {
g_dbus_method_invocation_return_value(invocation,
return 0;
}
-static int __handle_request_unset_restriction_mode(uid_t uid,
+static int __handle_request_unset_restriction_mode(uid_t caller_uid,
GDBusMethodInvocation *invocation, GVariant *parameters)
{
uid_t target_uid = (uid_t)-1;
}
snprintf(buf, sizeof(buf), "%d", mode);
- if (_push_queue(target_uid, reqkey,
+ if (_push_queue(target_uid, caller_uid, reqkey,
REQUEST_TYPE_UNSET_RESTRICTION_MODE,
"default", pkgid, buf)) {
g_dbus_method_invocation_return_value(invocation,
return 0;
}
-static int __handle_request_get_restriction_mode(uid_t uid,
+static int __handle_request_get_restriction_mode(uid_t caller_uid,
GDBusMethodInvocation *invocation, GVariant *parameters)
{
uid_t target_uid = (uid_t)-1;
return -1;
}
- if (_push_queue(target_uid, reqkey,
+ if (_push_queue(target_uid, caller_uid, reqkey,
REQUEST_TYPE_GET_RESTRICTION_MODE,
"default", pkgid, NULL)) {
g_dbus_method_invocation_return_value(invocation,
pkgmgr_installer_set_request_type(pi, req_type);
pkgmgr_installer_send_signal(pi, job->backend_type, job->pkgid,
"end", "fail");
- n = __get_uid_list(job->uid, &uids);
+ n = __get_uid_list(job->target_uid, &uids);
for (i = 0; i < n; i++)
pkgmgr_installer_send_signal_for_uid(pi, uids[i],
job->backend_type, job->pkgid, "end", "fail");