59d4971ff2a1af8852c081bafa311600e96ecea7
[AGL/meta-agl.git] / meta-app-framework / recipes-security / security-manager / security-manager / 0004-app-install-implement-multiple-set-of-smack-rules.patch
1 From a5979d9d674e400ecd7fcdf5d7589cfa0cfeb492 Mon Sep 17 00:00:00 2001
2 From: Alejandro Joya <alejandro.joya.cruz@intel.com>
3 Date: Wed, 4 Nov 2015 19:06:23 -0600
4 Subject: [PATCH 04/14] app-install: implement multiple set of smack-rules
5
6 If it's need it could create load multiple set of smack rules
7 related with the privileges.
8 It wouldn't affect the case that only the default set of rules is need it.
9
10 Signed-off-by: Alejandro Joya <alejandro.joya.cruz@intel.com>
11 ---
12  src/common/service_impl.cpp | 6 ++++++
13  1 file changed, 6 insertions(+)
14
15 diff --git a/src/common/service_impl.cpp b/src/common/service_impl.cpp
16 index 7fd621c..ae305d3 100644
17 --- a/src/common/service_impl.cpp
18 +++ b/src/common/service_impl.cpp
19 @@ -338,6 +338,12 @@ int appInstall(const app_inst_req &req, uid_t uid)
20          LogDebug("Adding Smack rules for new appId: " << req.appId << " with pkgId: "
21                  << req.pkgId << ". Applications in package: " << pkgContents.size());
22          SmackRules::installApplicationRules(req.appId, req.pkgId, pkgContents);
23 +       /*Setup for privileges custom rules*/
24 +        LogDebug("Adding Smack rules for new appId: " << req.appId << " with pkgId: "
25 +                << req.pkgId << ". Applications in package: " << pkgContents.size()
26 +               << " and Privileges");
27 +       SmackRules::installApplicationPrivilegesRules(req.appId, req.pkgId,
28 +           pkgContents,req.privileges);
29      } catch (const SmackException::Base &e) {
30          LogError("Error while applying Smack policy for application: " << e.DumpToString());
31          return SECURITY_MANAGER_API_ERROR_SETTING_FILE_LABEL_FAILED;
32 -- 
33 2.21.0
34