BuildRequires: pkgconfig(drm-service-core-tizen)
BuildRequires: pkgconfig(libgum)
BuildRequires: pkgconfig(sqlite3)
+BuildRequires: pkgconfig(csr)
BuildRequires: pkgmgr-info-parser-devel
BuildRequires: pkgmgr-info-parser
BuildRequires: fdupes
#include <pkgmgr/pkgmgr_parser_db.h>
#include <tzplatform_config.h>
#include <drm-tizen-apps.h>
+#include <csr-content-screening.h>
#include "pkgmgr_installer.h"
#include "pkgmgr-server.h"
return pid;
}
+static int __check_csr(backend_info *ptr)
+{
+ csr_cs_context_h context = NULL;
+ csr_cs_malware_h detected = NULL;
+ int ret = -1;
+
+ ret = csr_cs_context_create(&context);\r
+ if (ret != CSR_ERROR_NONE) {
+ ERR("Failed to create csr context");
+ return -1;
+ }
+
+ if (context) {
+ ret = csr_cs_scan_file(context, ptr->pkgid, &detected);
+ if (ret != CSR_ERROR_NONE) {
+ ERR("Failed to scan file[%d]", ret);
+ return -1;
+ }
+
+ csr_cs_context_destroy(context);
+ if (detected != NULL) {
+ ERR("CSR Denied[%s] Installation", ptr->pkgid);
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
static int __pkgcmd_proc_iter_kill_cmdline(const char *apppath, int option)
{
DIR *dp;
ptr->req_type = item->req_type;
DBG("handle request type [%d]", item->req_type);
+ if (item->req_type == PKGMGR_REQUEST_TYPE_INSTALL ||
+ item->req_type == PKGMGR_REQUEST_TYPE_MOUNT_INSTALL ||
+ item->req_type == PKGMGR_REQUEST_TYPE_REINSTALL) {
+ ret = __check_csr(ptr);
+ if (ret != 0) {
+ ret = -1;
+ __send_fail_signal(ptr);
+ goto end;
+ }
+ }
+
switch (item->req_type) {
case PKGMGR_REQUEST_TYPE_INSTALL:
__set_backend_busy(x);
break;
}
+end:
ptr->pid = ret;
free(item);