From: Yi Zhao <yi.zhao@windriver.com>
To: yocto@lists.yoctoproject.org, joe_macdonald@mentor.com, joe@deserted.net
Subject: [meta-selinux][PATCH 14/16] selinux-sandbox: upgrade 3.3 -> 3.4
Date: Sun, 28 Aug 2022 10:29:32 +0800 [thread overview]
Message-ID: <20220828022934.47592-14-yi.zhao@windriver.com> (raw)
In-Reply-To: <20220828022934.47592-1-yi.zhao@windriver.com>
* Backport a patch to fix chcat runtime error.
* Refresh patch.
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
---
...andle-unsupported-languages-properly.patch | 49 +++++++++++++++++++
.../selinux-sandbox/sandbox-de-bashify.patch | 6 +--
...-sandbox_3.3.bb => selinux-sandbox_3.4.bb} | 8 +--
3 files changed, 57 insertions(+), 6 deletions(-)
create mode 100644 recipes-security/selinux/selinux-sandbox/0001-gettext-handle-unsupported-languages-properly.patch
rename recipes-security/selinux/{selinux-sandbox_3.3.bb => selinux-sandbox_3.4.bb} (77%)
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 @@
+From 70602601ac1cfc4399430ef8609b96fc224d1e25 Mon Sep 17 00:00:00 2001
+From: Vit Mojzis <vmojzis@redhat.com>
+Date: Fri, 24 Jun 2022 16:24:25 +0200
+Subject: [PATCH] gettext: handle unsupported languages properly
+
+With "fallback=True" gettext.translation behaves the same as
+gettext.install and uses NullTranslations in case the
+translation file for given language was not found (as opposed to
+throwing an exception).
+
+Fixes:
+ # LANG is set to any "unsupported" language, e.g. en_US.UTF-8
+ $ chcat --help
+ Traceback (most recent call last):
+ File "/usr/bin/chcat", line 39, in <module>
+ t = gettext.translation(PROGNAME,
+ File "/usr/lib64/python3.9/gettext.py", line 592, in translation
+ raise FileNotFoundError(ENOENT,
+ FileNotFoundError: [Errno 2] No translation file found for domain: 'selinux-python'
+
+Signed-off-by: Vit Mojzis <vmojzis@redhat.com>
+Reviewed-by: Daniel Burgener <dburgener@linux.microsoft.com>
+Acked-by: Petr Lautrbach <plautrba@redhat.com>
+
+Upstream-Status: Backport
+[https://github.com/SELinuxProject/selinux/commit/344463076b2a91e1d2c7f5cc3835dc1a53a05e88]
+
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+---
+ sandbox | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/sandbox b/sandbox
+index cd5709f..789621e 100644
+--- a/sandbox
++++ b/sandbox
+@@ -45,7 +45,8 @@ try:
+ kwargs['unicode'] = True
+ t = gettext.translation(PROGNAME,
+ localedir="/usr/share/locale",
+- **kwargs)
++ **kwargs,
++ fallback=True)
+ _ = t.gettext
+ except:
+ try:
+--
+2.25.1
+
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 @@
-From b92c39f0be5552c19923f75aef4487348a08b7dc Mon Sep 17 00:00:00 2001
+From d592d59eb4e7dbf8ce6dc84b3f4c0026fd7cc60c Mon Sep 17 00:00:00 2001
From: Joe MacDonald <joe_macdonald@mentor.com>
Date: Fri, 20 Feb 2015 21:07:47 -0500
Subject: [PATCH] sandbox: de-bashify
@@ -6,7 +6,7 @@ Subject: [PATCH] sandbox: de-bashify
There's no bashisms apparent in either the sandbox initscript nor the
sandboxX script, so point them at /bin/sh instead.
-Upstream-Status: Pending
+Upstream-Status: Inappropriate [embedded specific]
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
@@ -37,5 +37,5 @@ index eaa500d..8755d75 100644
context=`id -Z | secon -t -l -P`
export TITLE="Sandbox $context -- `grep ^#TITLE: ~/.sandboxrc | /usr/bin/cut -b8-80`"
--
-2.7.4
+2.25.1
diff --git a/recipes-security/selinux/selinux-sandbox_3.3.bb b/recipes-security/selinux/selinux-sandbox_3.4.bb
similarity index 77%
rename from recipes-security/selinux/selinux-sandbox_3.3.bb
rename to 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"
require selinux_common.inc
-SRC_URI += "file://sandbox-de-bashify.patch"
+SRC_URI += "file://sandbox-de-bashify.patch \
+ file://0001-gettext-handle-unsupported-languages-properly.patch \
+ "
S = "${WORKDIR}/git/sandbox"
-DEPENDS += "libcap-ng libselinux"
+DEPENDS = "libselinux libcap-ng gettext-native"
-RDEPENDS:${PN} += "\
+RDEPENDS:${PN} = "\
python3-core \
python3-math \
python3-shell \
--
2.25.1
next prev parent reply other threads:[~2022-08-28 2:30 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-28 2:29 [meta-selinux][PATCH 01/16] selinux: upgrade 3.3 -> 3.4 Yi Zhao
2022-08-28 2:29 ` [meta-selinux][PATCH 02/16] libsepol: " Yi Zhao
2022-08-28 2:29 ` [meta-selinux][PATCH 03/16] libselinux: " Yi Zhao
2022-08-28 2:29 ` [meta-selinux][PATCH 04/16] libselinux-python: " Yi Zhao
2022-08-28 2:29 ` [meta-selinux][PATCH 05/16] libsemanage: " Yi Zhao
2022-08-28 2:29 ` [meta-selinux][PATCH 06/16] checkpolicy: " Yi Zhao
2022-08-28 2:29 ` [meta-selinux][PATCH 07/16] secilc: " Yi Zhao
2022-08-28 2:29 ` [meta-selinux][PATCH 08/16] policycoreutils: " Yi Zhao
2022-08-28 2:29 ` [meta-selinux][PATCH 09/16] mcstrans: " Yi Zhao
2022-08-28 2:29 ` [meta-selinux][PATCH 10/16] restorecond: " Yi Zhao
2022-08-28 2:29 ` [meta-selinux][PATCH 11/16] selinux-python: " Yi Zhao
2022-08-28 2:29 ` [meta-selinux][PATCH 12/16] selinux-dbus: " Yi Zhao
2022-08-28 2:29 ` [meta-selinux][PATCH 13/16] selinux-gui: " Yi Zhao
2022-08-28 2:29 ` Yi Zhao [this message]
2022-08-28 2:29 ` [meta-selinux][PATCH 15/16] semodule-utils: " Yi Zhao
2022-08-28 2:29 ` [meta-selinux][PATCH 16/16] setools: fix buildpaths issue Yi Zhao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220828022934.47592-14-yi.zhao@windriver.com \
--to=yi.zhao@windriver.com \
--cc=joe@deserted.net \
--cc=joe_macdonald@mentor.com \
--cc=yocto@lists.yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).