From 98ef131c06e85df633fc9316cc9d481c80dbee93 Mon Sep 17 00:00:00 2001 From: jongmyeongko Date: Thu, 3 Mar 2016 15:40:53 +0900 Subject: [PATCH] check author_id before set-up paths for security api. Change-Id: Ia6b5c161f247caf4e3730c297d5f712b458554e4 Signed-off-by: jongmyeongko --- src/common/security_registration.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/common/security_registration.cc b/src/common/security_registration.cc index 22ad22e..01a7cd2 100644 --- a/src/common/security_registration.cc +++ b/src/common/security_registration.cc @@ -97,6 +97,12 @@ bool PrepareRequest(const std::string& app_id, const std::string& pkg_id, for (auto& policy : kSecurityPolicies) { bf::path subpath = path / policy.first; if (bf::exists(subpath)) { + if (policy.second == SECURITY_MANAGER_PATH_TRUSTED_RW && + author_id.empty()) { + LOG(WARNING) << "the path " << policy.first + << " exists, but author_id is empty"; + continue; + } error = security_manager_app_inst_req_add_path(req, subpath.c_str(), policy.second); if (error != SECURITY_MANAGER_SUCCESS) { -- 2.7.4