X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fsecmgr-wrap.c;h=57f5d20fe2435cce9e429f543129baf7150e6422;hb=3deda0d23967a4da9268598795bbd7c7d7bf79e8;hp=75c63ca2be9ed6226b946d8cf02f588b4ec39109;hpb=12a227a2fc574cf0fd560453e1cdd15c50550abb;p=src%2Fapp-framework-main.git diff --git a/src/secmgr-wrap.c b/src/secmgr-wrap.c index 75c63ca..57f5d20 100644 --- a/src/secmgr-wrap.c +++ b/src/secmgr-wrap.c @@ -1,6 +1,8 @@ /* Copyright 2015 IoT.bzh + author: José Bollo + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -17,10 +19,10 @@ #include #include #include -#include #include +#include "verbose.h" #include "secmgr-wrap.h" static app_inst_req *request = NULL; @@ -45,15 +47,15 @@ int secmgr_init(const char *id) assert(request == NULL); rc = security_manager_app_inst_req_new(&request); if (rc != SECURITY_MANAGER_SUCCESS) - syslog(LOG_ERR, "security_manager_app_inst_req_new failed"); + ERROR("security_manager_app_inst_req_new failed"); else { rc = security_manager_app_inst_req_set_pkg_id(request, id); if (rc != SECURITY_MANAGER_SUCCESS) - syslog(LOG_ERR, "security_manager_app_inst_req_set_pkg_id failed"); + ERROR("security_manager_app_inst_req_set_pkg_id failed"); else { rc = security_manager_app_inst_req_set_app_id(request, id); if (rc != SECURITY_MANAGER_SUCCESS) - syslog(LOG_ERR, "security_manager_app_inst_req_set_app_id failed"); + ERROR("security_manager_app_inst_req_set_app_id failed"); } } if (rc != SECURITY_MANAGER_SUCCESS) @@ -73,8 +75,8 @@ int secmgr_install() assert(request != NULL); rc = security_manager_app_install(request); if (rc != SECURITY_MANAGER_SUCCESS) - syslog(LOG_ERR, "security_manager_app_install failed"); - security_manager_app_inst_req_free(request); + ERROR("security_manager_app_install failed"); + secmgr_cancel(); return retcode(rc); } @@ -84,7 +86,7 @@ int secmgr_permit(const char *permission) assert(request != NULL); rc = security_manager_app_inst_req_add_privilege(request, permission); if (rc != SECURITY_MANAGER_SUCCESS) - syslog(LOG_ERR, "security_manager_app_inst_add_privilege %s failed", permission); + ERROR("security_manager_app_inst_add_privilege %s failed", permission); return retcode(rc); } @@ -94,7 +96,7 @@ static int addpath(const char *pathname, enum app_install_path_type type) assert(request != NULL); rc = security_manager_app_inst_req_add_path(request, pathname, type); if (rc != SECURITY_MANAGER_SUCCESS) - syslog(LOG_ERR, "security_manager_app_inst_add_path %s failed", pathname); + ERROR("security_manager_app_inst_add_path %s failed", pathname); return retcode(rc); } @@ -113,3 +115,8 @@ int secmgr_path_read_write(const char *pathname) return addpath(pathname, SECURITY_MANAGER_PATH_RW); } +int secmgr_prepare_exec(const char *appid) +{ + return retcode(security_manager_prepare_app(appid)); +} +