check author_id before set-up paths for security api. 56/60956/2 accepted/tizen/common/20160307.153138 accepted/tizen/ivi/20160304.105553 accepted/tizen/mobile/20160304.105436 accepted/tizen/tv/20160304.105455 accepted/tizen/wearable/20160304.105524 submit/tizen/20160304.063157 submit/tizen/20160304.063745
authorjongmyeongko <jongmyeong.ko@samsung.com>
Thu, 3 Mar 2016 06:40:53 +0000 (15:40 +0900)
committerSangyoon Jang <s89.jang@samsung.com>
Thu, 3 Mar 2016 10:54:12 +0000 (02:54 -0800)
Change-Id: Ia6b5c161f247caf4e3730c297d5f712b458554e4
Signed-off-by: jongmyeongko <jongmyeong.ko@samsung.com>
src/common/security_registration.cc

index 22ad22e..01a7cd2 100644 (file)
@@ -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) {