diff options
author | Yi Zhao <yi.zhao@windriver.com> | 2022-08-28 10:29:32 +0800 |
---|---|---|
committer | Joe MacDonald <joe@deserted.net> | 2022-08-28 13:54:59 -0400 |
commit | e37231db767bd5216eec561adc85d0a724070dd1 (patch) | |
tree | 4fa3f16a6ff56758086b0d0e699f52aa9c42f61e | |
parent | cf3c9d14de75fac8103a29f24e582538db5c7511 (diff) | |
download | meta-selinux-e37231db767bd5216eec561adc85d0a724070dd1.tar.gz |
selinux-sandbox: upgrade 3.3 -> 3.4
* Backport a patch to fix chcat runtime error.
* Refresh patch.
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
-rw-r--r-- | recipes-security/selinux/selinux-sandbox/0001-gettext-handle-unsupported-languages-properly.patch | 49 | ||||
-rw-r--r-- | recipes-security/selinux/selinux-sandbox/sandbox-de-bashify.patch | 6 | ||||
-rw-r--r-- | recipes-security/selinux/selinux-sandbox_3.4.bb (renamed from recipes-security/selinux/selinux-sandbox_3.3.bb) | 8 |
3 files changed, 57 insertions, 6 deletions
diff --git a/recipes-security/selinux/selinux-sandbox/0001-gettext-handle-unsupported-languages-properly.patch b/recipes-security/selinux/selinux-sandbox/0001-gettext-handle-unsupported-languages-properly.patch new file mode 100644 index 0000000..f1d8235 --- /dev/null +++ b/recipes-security/selinux/selinux-sandbox/0001-gettext-handle-unsupported-languages-properly.patch | |||
@@ -0,0 +1,49 @@ | |||
1 | From 70602601ac1cfc4399430ef8609b96fc224d1e25 Mon Sep 17 00:00:00 2001 | ||
2 | From: Vit Mojzis <vmojzis@redhat.com> | ||
3 | Date: Fri, 24 Jun 2022 16:24:25 +0200 | ||
4 | Subject: [PATCH] gettext: handle unsupported languages properly | ||
5 | |||
6 | With "fallback=True" gettext.translation behaves the same as | ||
7 | gettext.install and uses NullTranslations in case the | ||
8 | translation file for given language was not found (as opposed to | ||
9 | throwing an exception). | ||
10 | |||
11 | Fixes: | ||
12 | # LANG is set to any "unsupported" language, e.g. en_US.UTF-8 | ||
13 | $ chcat --help | ||
14 | Traceback (most recent call last): | ||
15 | File "/usr/bin/chcat", line 39, in <module> | ||
16 | t = gettext.translation(PROGNAME, | ||
17 | File "/usr/lib64/python3.9/gettext.py", line 592, in translation | ||
18 | raise FileNotFoundError(ENOENT, | ||
19 | FileNotFoundError: [Errno 2] No translation file found for domain: 'selinux-python' | ||
20 | |||
21 | Signed-off-by: Vit Mojzis <vmojzis@redhat.com> | ||
22 | Reviewed-by: Daniel Burgener <dburgener@linux.microsoft.com> | ||
23 | Acked-by: Petr Lautrbach <plautrba@redhat.com> | ||
24 | |||
25 | Upstream-Status: Backport | ||
26 | [https://github.com/SELinuxProject/selinux/commit/344463076b2a91e1d2c7f5cc3835dc1a53a05e88] | ||
27 | |||
28 | Signed-off-by: Yi Zhao <yi.zhao@windriver.com> | ||
29 | --- | ||
30 | sandbox | 3 ++- | ||
31 | 1 file changed, 2 insertions(+), 1 deletion(-) | ||
32 | |||
33 | diff --git a/sandbox b/sandbox | ||
34 | index cd5709f..789621e 100644 | ||
35 | --- a/sandbox | ||
36 | +++ b/sandbox | ||
37 | @@ -45,7 +45,8 @@ try: | ||
38 | kwargs['unicode'] = True | ||
39 | t = gettext.translation(PROGNAME, | ||
40 | localedir="/usr/share/locale", | ||
41 | - **kwargs) | ||
42 | + **kwargs, | ||
43 | + fallback=True) | ||
44 | _ = t.gettext | ||
45 | except: | ||
46 | try: | ||
47 | -- | ||
48 | 2.25.1 | ||
49 | |||
diff --git a/recipes-security/selinux/selinux-sandbox/sandbox-de-bashify.patch b/recipes-security/selinux/selinux-sandbox/sandbox-de-bashify.patch index e9622f0..6258b7c 100644 --- a/recipes-security/selinux/selinux-sandbox/sandbox-de-bashify.patch +++ b/recipes-security/selinux/selinux-sandbox/sandbox-de-bashify.patch | |||
@@ -1,4 +1,4 @@ | |||
1 | From b92c39f0be5552c19923f75aef4487348a08b7dc Mon Sep 17 00:00:00 2001 | 1 | From d592d59eb4e7dbf8ce6dc84b3f4c0026fd7cc60c Mon Sep 17 00:00:00 2001 |
2 | From: Joe MacDonald <joe_macdonald@mentor.com> | 2 | From: Joe MacDonald <joe_macdonald@mentor.com> |
3 | Date: Fri, 20 Feb 2015 21:07:47 -0500 | 3 | Date: Fri, 20 Feb 2015 21:07:47 -0500 |
4 | Subject: [PATCH] sandbox: de-bashify | 4 | Subject: [PATCH] sandbox: de-bashify |
@@ -6,7 +6,7 @@ Subject: [PATCH] sandbox: de-bashify | |||
6 | There's no bashisms apparent in either the sandbox initscript nor the | 6 | There's no bashisms apparent in either the sandbox initscript nor the |
7 | sandboxX script, so point them at /bin/sh instead. | 7 | sandboxX script, so point them at /bin/sh instead. |
8 | 8 | ||
9 | Upstream-Status: Pending | 9 | Upstream-Status: Inappropriate [embedded specific] |
10 | 10 | ||
11 | Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com> | 11 | Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com> |
12 | Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com> | 12 | Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com> |
@@ -37,5 +37,5 @@ index eaa500d..8755d75 100644 | |||
37 | context=`id -Z | secon -t -l -P` | 37 | context=`id -Z | secon -t -l -P` |
38 | export TITLE="Sandbox $context -- `grep ^#TITLE: ~/.sandboxrc | /usr/bin/cut -b8-80`" | 38 | export TITLE="Sandbox $context -- `grep ^#TITLE: ~/.sandboxrc | /usr/bin/cut -b8-80`" |
39 | -- | 39 | -- |
40 | 2.7.4 | 40 | 2.25.1 |
41 | 41 | ||
diff --git a/recipes-security/selinux/selinux-sandbox_3.3.bb b/recipes-security/selinux/selinux-sandbox_3.4.bb index cc9baad..a5a8e13 100644 --- a/recipes-security/selinux/selinux-sandbox_3.3.bb +++ b/recipes-security/selinux/selinux-sandbox_3.4.bb | |||
@@ -9,13 +9,15 @@ LIC_FILES_CHKSUM = "file://${S}/COPYING;md5=393a5ca445f6965873eca0259a17f833" | |||
9 | 9 | ||
10 | require selinux_common.inc | 10 | require selinux_common.inc |
11 | 11 | ||
12 | SRC_URI += "file://sandbox-de-bashify.patch" | 12 | SRC_URI += "file://sandbox-de-bashify.patch \ |
13 | file://0001-gettext-handle-unsupported-languages-properly.patch \ | ||
14 | " | ||
13 | 15 | ||
14 | S = "${WORKDIR}/git/sandbox" | 16 | S = "${WORKDIR}/git/sandbox" |
15 | 17 | ||
16 | DEPENDS += "libcap-ng libselinux" | 18 | DEPENDS = "libselinux libcap-ng gettext-native" |
17 | 19 | ||
18 | RDEPENDS:${PN} += "\ | 20 | RDEPENDS:${PN} = "\ |
19 | python3-core \ | 21 | python3-core \ |
20 | python3-math \ | 22 | python3-math \ |
21 | python3-shell \ | 23 | python3-shell \ |