}
if (malware != NULL) {
- ERR("CSR denied[%d] installation", path);
+ ERR("CSR detected malware from [%s]", path);
ret = -1;
}
ret = aul_terminate_pid_for_uid(pid, uid);
if (ret != AUL_R_OK) {
- ERR("failed to terminate app(%d)", appid);
+ ERR("failed to terminate app(%s)", appid);
return -1;
}
goto error;
}
+ job->extra_data = extra_getsize_info;
extra_getsize_info->getsize_fifo = strdup(fifo_path);
if (!extra_getsize_info->getsize_fifo) {
ERR("out of memory");
ERR("failed to mkfifo");
goto error;
}
- job->extra_data = extra_getsize_info;
snprintf(args, sizeof(args), "%s %s %s %d -k %s -u %d --sync",
backend_cmd, job->pkgid, job->args, job->caller_uid,
static int __process_set_app_icon(struct backend_job *job)
{
int ret;
+ pkgmgrinfo_appinfo_h handle = NULL;
+ char *app_root_path = NULL;
+
+ ret = pkgmgrinfo_appinfo_get_usr_appinfo(job->pkgid, job->target_uid, &handle);
+ if (ret != PMINFO_R_OK) {
+ _return_value_to_caller(job->req_id, g_variant_new("(i)", ret));
+ return PKGMGR_R_ENOPKG;
+ }
+ ret = pkgmgrinfo_appinfo_get_root_path(handle, &app_root_path);
+ if (ret != PMINFO_R_OK || !app_root_path) {
+ _return_value_to_caller(job->req_id, g_variant_new("(i)", ret));
+ pkgmgrinfo_appinfo_destroy_appinfo(handle);
+ return PKGMGR_R_ESYSTEM;
+ }
+
+ if (strncasecmp(job->args, app_root_path, strlen(app_root_path)) != 0 ||
+ strstr(job->args, "..") != NULL ||
+ access(job->args, F_OK) != 0) {
+ ERR("invalid path[%s]", job->args);
+ _return_value_to_caller(job->req_id, g_variant_new("(i)", ret));
+ pkgmgrinfo_appinfo_destroy_appinfo(handle);
+ return PKGMGR_R_EINVAL;
+ }
+
+ pkgmgrinfo_appinfo_destroy_appinfo(handle);
ret = pkgmgr_parser_update_app_icon_info_in_usr_db(job->pkgid,
job->target_uid, job->args);
_return_value_to_caller(job->req_id, g_variant_new("(i)", ret));