From b95bdaa637806ab620a485b261fc69a78e045ce4 Mon Sep 17 00:00:00 2001 From: Tomasz Iwanek Date: Wed, 21 Oct 2015 09:10:38 +0200 Subject: [PATCH] Remove sorting of privileges for security_manager According to security team, sorting is not needed: "This requirement is now removed. You can safely call security_manager_app_inst_req_add_privilege in arbitrary order and even with duplicates" Change-Id: I19b1300e5558832d362ae538a354f1018674cb26 --- src/common/security_registration.cc | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/common/security_registration.cc b/src/common/security_registration.cc index 06cb954..f62481d 100644 --- a/src/common/security_registration.cc +++ b/src/common/security_registration.cc @@ -64,23 +64,15 @@ bool PrepareRequest(const std::string& app_id, const std::string& pkg_id, } if (manifest) { - std::vector priv_vec; - privileges_x *privileges = nullptr; PKGMGR_LIST_MOVE_NODE_TO_HEAD(manifest->privileges, privileges); for (; privileges != nullptr; privileges = privileges->next) { privilege_x* priv = nullptr; PKGMGR_LIST_MOVE_NODE_TO_HEAD(privileges->privilege, priv); for (; priv != nullptr; priv = priv->next) { - priv_vec.push_back(priv->text); + security_manager_app_inst_req_add_privilege(req, priv->text); } } - - // privileges should be sorted. - std::sort(priv_vec.begin(), priv_vec.end()); - for (auto& priv : priv_vec) { - security_manager_app_inst_req_add_privilege(req, priv.c_str()); - } } return true; -- 2.7.4