summaryrefslogtreecommitdiffstats
path: root/meta-security/recipes-security/security-manager/security-manager/security-manager-policy-reload-do-not-depend-on-GNU-.patch
blob: ac57964ca6192ee817a3912044566028810d16c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From d2995014142306987bf86b4d508a84b9b4683c5c Mon Sep 17 00:00:00 2001
From: Patrick Ohly <patrick.ohly@intel.com>
Date: Wed, 19 Aug 2015 15:02:32 +0200
Subject: [PATCH 2/2] security-manager-policy-reload: do not depend on GNU sed

\U (= make replacement uppercase) is a GNU sed extension which is not
supported by other sed implementation's (like the one from
busybox). When using busybox, the bucket for user profiles became
USER_TYPE_Uadmin instead USER_TYPE_ADMIN.

To make SecurityManager more portable, better use tr to turn the
bucket name into uppercase.

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Upstream-Status: Submitted (https://github.com/Samsung/security-manager/pull/1

---
 policy/security-manager-policy-reload | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/policy/security-manager-policy-reload b/policy/security-manager-policy-reload
index 274c49c..6f211c6 100755
--- a/policy/security-manager-policy-reload
+++ b/policy/security-manager-policy-reload
@@ -33,7 +33,7 @@ END
 find "$POLICY_PATH" -name "usertype-*.profile" |
 while read file
 do
-    bucket="`echo $file | sed -r 's|.*/usertype-(.*).profile$|USER_TYPE_\U\1|'`"
+    bucket="`echo $file | sed -r 's|.*/usertype-(.*).profile$|USER_TYPE_\1|' | tr '[:lower:]' '[:upper:]'`"
 
     # Re-create the bucket with empty contents
     cyad --delete-bucket=$bucket || true
-- 
2.1.4