From: "Yi Zhao" <yi.zhao@windriver.com>
To: Joe MacDonald <joe@deserted.net>
Cc: <yocto@yoctoproject.org>
Subject: Re: [meta-selinux][PATCH 18/19] setools: upgrade 4.1.1 -> 4.2.2
Date: Fri, 20 Dec 2019 08:55:41 +0800 [thread overview]
Message-ID: <1540af4c-0378-fd51-29df-4a54cc5ce90e@windriver.com> (raw)
In-Reply-To: <CANBf+V10oC==_F_R1wgr7uXrrDW=AvpM-b1S82mrG+7mN-Kxvg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 16965 bytes --]
On 12/20/19 1:32 AM, Joe MacDonald wrote:
> Hi Yi,
>
> I've merged the rest of this series, but this one fails to apply. It
> looks like your tree didn't contain:
>
> commit 5fd3c5b71edb99659aeb5cb5903088d84517382e (relabel, master)
> Author: Christophe PRIOUZEAU <christophe.priouzeau@st.com
> <mailto:christophe.priouzeau@st.com>>
> Date: Tue Nov 5 14:47:09 2019 +0000
>
> autorelabel: only selinux-autorelabel need autorelabel file
>
> With previous implementation, several packages provided
> .autorelabel file while only selinux-autorelabel manage it.
> If there is several packages which try to install .autorelabel
> file, an issue occur during installation of packagegroup-core-selinux.
>
> Signed-off-by: Christophe Priouzeau <christophe.priouzeau@st.com
> <mailto:christophe.priouzeau@st.com>>
> Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com
> <mailto:joe_macdonald@mentor.com>>
>
> Can you take a look at it and verify which parts of the change are
> still necessary given the above change?
Sure. I will send V2.
//Yi
>
> Thanks.
> -J.
>
> On Wed, Nov 13, 2019 at 8:50 PM Yi Zhao <yi.zhao@windriver.com
> <mailto:yi.zhao@windriver.com>> wrote:
>
> * Switch to python3
>
> * Drop patches:
> Fix-build-failure-with-GCC-7-due-to-possible-truncat.patch
> setools4-fix-cross-compiling-errors-for-powerpc-mips.patch
>
> Signed-off-by: Yi Zhao <yi.zhao@windriver.com
> <mailto:yi.zhao@windriver.com>>
> ---
> ...e-with-GCC-7-due-to-possible-truncat.patch | 105
> ------------------
> ...ss-compiling-errors-for-powerpc-mips.patch | 35 ------
> .../setools4-fixes-for-cross-compiling.patch | 34 +++---
> .../{setools_4.1.1.bb <http://setools_4.1.1.bb> =>
> setools_4.2.2.bb <http://setools_4.2.2.bb>} | 14 +--
> 4 files changed, 19 insertions(+), 169 deletions(-)
> delete mode 100644
> recipes-security/setools/setools/Fix-build-failure-with-GCC-7-due-to-possible-truncat.patch
> delete mode 100644
> recipes-security/setools/setools/setools4-fix-cross-compiling-errors-for-powerpc-mips.patch
> rename recipes-security/setools/{setools_4.1.1.bb
> <http://setools_4.1.1.bb> => setools_4.2.2.bb
> <http://setools_4.2.2.bb>} (61%)
>
> diff --git
> a/recipes-security/setools/setools/Fix-build-failure-with-GCC-7-due-to-possible-truncat.patch
> b/recipes-security/setools/setools/Fix-build-failure-with-GCC-7-due-to-possible-truncat.patch
> deleted file mode 100644
> index a5af041..0000000
> ---
> a/recipes-security/setools/setools/Fix-build-failure-with-GCC-7-due-to-possible-truncat.patch
> +++ /dev/null
> @@ -1,105 +0,0 @@
> -Upstream-Status: Backport
> [https://github.com/TresysTechnology/setools/commit/e41adf0]
> -
> -Signed-off-by: Kai Kang <kai.kang@windriver.com
> <mailto:kai.kang@windriver.com>>
> -
> -From e41adf01647c695b80b112b337e76021bb9f30c3 Mon Sep 17 00:00:00
> 2001
> -From: Laurent Bigonville <bigon@bigon.be <mailto:bigon@bigon.be>>
> -Date: Tue, 26 Sep 2017 15:15:30 +0200
> -Subject: [PATCH] Fix build failure with GCC 7 due to possible
> truncation of
> - snprintf output
> -
> -setools fails to build under GCC7 -Wformat -Werror with the
> following error:
> -
> -x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall
> -Wstrict-prototypes -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=.
> -fstack-protector-strong -Wformat -Werror=format-security
> -Wno-sign-compare -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Ilibqpol
> -Ilibqpol/include -I/usr/include/python3.6m -c
> libqpol/policy_extend.c -o
> build/temp.linux-amd64-3.6/libqpol/policy_extend.o -Werror -Wextra
> -Waggregate-return -Wfloat-equal -Wformat -Wformat=2 -Winit-self
> -Wmissing-format-attribute -Wmissing-include-dirs -Wnested-externs
> -Wold-style-definition -Wpointer-arith -Wredundant-decls
> -Wstrict-prototypes -Wunknown-pragmas -Wwrite-strings
> -Wno-missing-field-initializers -Wno-unused-parameter
> -Wno-cast-qual -Wno-shadow -Wno-unreachable-code -fno-exceptions
> -libqpol/policy_extend.c: In function 'policy_extend':
> -libqpol/policy_extend.c:161:27: error: '%04zd' directive output
> may be truncated writing between 4 and 10 bytes into a region of
> size 5 [-Werror=format-truncation=]
> - snprintf(buff, 9, "@ttr%04zd", i + 1);
> - ^~~~~
> -libqpol/policy_extend.c:161:22: note: directive argument in the
> range [1, 4294967295]
> - snprintf(buff, 9, "@ttr%04zd", i + 1);
> - ^~~~~~~~~~~
> -
> -Increase the size of the buffer to avoid collisions
> -
> -Closes: https://github.com/TresysTechnology/setools/issues/174
> -Signed-off-by: Laurent Bigonville <bigon@bigon.be
> <mailto:bigon@bigon.be>>
> ----
> - libqpol/policy_extend.c | 16 ++++++++--------
> - 1 file changed, 8 insertions(+), 8 deletions(-)
> -
> -diff --git a/libqpol/policy_extend.c b/libqpol/policy_extend.c
> -index 742819b..739e184 100644
> ---- a/libqpol/policy_extend.c
> -+++ b/libqpol/policy_extend.c
> -@@ -110,7 +110,7 @@ static int
> qpol_policy_remove_bogus_aliases(qpol_policy_t * policy)
> - * Builds data for the attributes and inserts them into the
> policydb.
> - * This function modifies the policydb. Names created for
> attributes
> - * are of the form @ttr<value> where value is the value of the
> attribute
> -- * as a four digit number (prepended with 0's as needed).
> -+ * as a ten digit number (prepended with 0's as needed).
> - * @param policy The policy from which to read the attribute
> map and
> - * create the type data for the attributes. This policy will be
> altered
> - * by this function.
> -@@ -125,7 +125,7 @@ static int
> qpol_policy_build_attrs_from_map(qpol_policy_t * policy)
> - uint32_t bit = 0, count = 0;
> - ebitmap_node_t *node = NULL;
> - type_datum_t *tmp_type = NULL, *orig_type;
> -- char *tmp_name = NULL, buff[10];
> -+ char *tmp_name = NULL, buff[16];
> - int error = 0, retv;
> -
> - INFO(policy, "%s", "Generating attributes for policy.
> (Step 4 of 5)");
> -@@ -137,7 +137,7 @@ static int
> qpol_policy_build_attrs_from_map(qpol_policy_t * policy)
> -
> - db = &policy->p->p;
> -
> -- memset(&buff, 0, 10 * sizeof(char));
> -+ memset(&buff, 0, 16 * sizeof(char));
> -
> - for (i = 0; i < db->p_types.nprim; i++) {
> - /* skip types */
> -@@ -158,7 +158,7 @@ static int
> qpol_policy_build_attrs_from_map(qpol_policy_t * policy)
> - * with this attribute */
> - /* Does not exist */
> - if (db->p_type_val_to_name[i] == NULL){
> -- snprintf(buff, 9, "@ttr%04zd", i + 1);
> -+ snprintf(buff, 15, "@ttr%010zd", i + 1);
> - tmp_name = strdup(buff);
> - if (!tmp_name) {
> - error = errno;
> -@@ -240,7 +240,7 @@ static int
> qpol_policy_build_attrs_from_map(qpol_policy_t * policy)
> - * Builds data for empty attributes and inserts them into the
> policydb.
> - * This function modifies the policydb. Names created for the
> attributes
> - * are of the form @ttr<value> where value is the value of the
> attribute
> -- * as a four digit number (prepended with 0's as needed).
> -+ * as a ten digit number (prepended with 0's as needed).
> - * @param policy The policy to which to add type data for
> attributes.
> - * This policy will be altered by this function.
> - * @return Returns 0 on success and < 0 on failure; if the call
> fails,
> -@@ -251,7 +251,7 @@ static int
> qpol_policy_build_attrs_from_map(qpol_policy_t * policy)
> - static int qpol_policy_fill_attr_holes(qpol_policy_t * policy)
> - {
> - policydb_t *db = NULL;
> -- char *tmp_name = NULL, buff[10];
> -+ char *tmp_name = NULL, buff[16];
> - int error = 0, retv = 0;
> - ebitmap_t tmp_bmap = { NULL, 0 };
> - type_datum_t *tmp_type = NULL;
> -@@ -265,12 +265,12 @@ static int
> qpol_policy_fill_attr_holes(qpol_policy_t * policy)
> -
> - db = &policy->p->p;
> -
> -- memset(&buff, 0, 10 * sizeof(char));
> -+ memset(&buff, 0, 16 * sizeof(char));
> -
> - for (i = 0; i < db->p_types.nprim; i++) {
> - if (db->type_val_to_struct[i])
> - continue;
> -- snprintf(buff, 9, "@ttr%04zd", i + 1);
> -+ snprintf(buff, 15, "@ttr%010zd", i + 1);
> - tmp_name = strdup(buff);
> - if (!tmp_name) {
> - error = errno;
> ---
> -2.20.1
> -
> diff --git
> a/recipes-security/setools/setools/setools4-fix-cross-compiling-errors-for-powerpc-mips.patch
> b/recipes-security/setools/setools/setools4-fix-cross-compiling-errors-for-powerpc-mips.patch
> deleted file mode 100644
> index 9a6b818..0000000
> ---
> a/recipes-security/setools/setools/setools4-fix-cross-compiling-errors-for-powerpc-mips.patch
> +++ /dev/null
> @@ -1,35 +0,0 @@
> -From dc86d880ae0d66233679112a2bf0115c39df68f1 Mon Sep 17 00:00:00
> 2001
> -From: Wenzong Fan <wenzong.fan@windriver.com
> <mailto:wenzong.fan@windriver.com>>
> -Date: Fri, 17 Feb 2017 08:57:35 +0000
> -Subject: [meta-selinux][PATCH] setools4: fix cross-compiling
> errors for powerpc, mips
> -
> -Fix build errors:
> -| libqpol/policy.c: In function 'qpol_binpol_version':
> -| libqpol/policy.c:95:24: error: implicit declaration of function
> 'bswap_32' [-Werror=implicit-function-declaration]
> -| #define le32_to_cpu(x) bswap_32(x)
> -
> -Upstream-Status: Pending
> -
> -Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com
> <mailto:wenzong.fan@windriver.com>>
> ----
> - libqpol/policy.c | 4 ++++
> - 1 file changed, 4 insertions(+)
> -
> -diff --git a/libqpol/policy.c b/libqpol/policy.c
> -index ae3acb5..b5b87f9 100644
> ---- a/libqpol/policy.c
> -+++ b/libqpol/policy.c
> -@@ -45,6 +45,10 @@
> - # include <asm/types.h>
> - #endif
> -
> -+#if defined(_ARCH_PPC) || defined(mips)
> -+#include <byteswap.h>
> -+#endif
> -+
> - #include <sepol/debug.h>
> - #include <sepol/handle.h>
> - #include <sepol/policydb/flask_types.h>
> ---
> -2.11.0
> -
> diff --git
> a/recipes-security/setools/setools/setools4-fixes-for-cross-compiling.patch
> b/recipes-security/setools/setools/setools4-fixes-for-cross-compiling.patch
> index 5c43c49..51c7603 100644
> ---
> a/recipes-security/setools/setools/setools4-fixes-for-cross-compiling.patch
> +++
> b/recipes-security/setools/setools/setools4-fixes-for-cross-compiling.patch
> @@ -1,7 +1,7 @@
> -From a104374147b398838edc04e937c92e762ea3f5d9 Mon Sep 17 00:00:00
> 2001
> +From e0a112874d10dbf741c27b107edddedd86d51529 Mon Sep 17 00:00:00
> 2001
> From: Wenzong Fan <wenzong.fan@windriver.com
> <mailto:wenzong.fan@windriver.com>>
> Date: Tue, 14 Feb 2017 06:32:35 +0000
> -Subject: [meta-selinux][PATCH] setools4: fixes for cross compiling
> +Subject: [PATCH] setools4: fixes for cross compiling
>
> * search libsepol from $STAGING_LIBDIR
> * fix manual install path as '/usr/share/man/man1'
> @@ -9,32 +9,24 @@ Subject: [meta-selinux][PATCH] setools4: fixes
> for cross compiling
> Upstream-Status: Inappropriate [embedded specific]
>
> Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com
> <mailto:wenzong.fan@windriver.com>>
> +Signed-off-by: Yi Zhao <yi.zhao@windriver.com
> <mailto:yi.zhao@windriver.com>>
> ---
> - setup.py | 4 ++--
> - 1 file changed, 2 insertions(+), 2 deletions(-)
> + setup.py | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/setup.py b/setup.py
> -index 2ca44c9..300ff70 100644
> +index ac8a876..df7ebbc 100644
> --- a/setup.py
> +++ b/setup.py
> -@@ -77,7 +77,7 @@ class BuildExtCommand(build_ext):
> - build_ext.run(self)
> +@@ -78,7 +78,7 @@ class QtHelpCommand(Command):
>
>
> --base_lib_dirs = ['.', '/usr/lib64', '/usr/lib', '/usr/local/lib']
> -+base_lib_dirs = [os.environ["STAGING_LIBDIR"]]
> - include_dirs = ['libqpol', 'libqpol/include']
> + # Library linkage
> +-lib_dirs = ['.', '/usr/lib64', '/usr/lib', '/usr/local/lib']
> ++lib_dirs = [os.environ["STAGING_LIBDIR"]]
> + include_dirs = []
>
> - try:
> -@@ -182,7 +182,7 @@ setup(name='setools',
> - 'build_qhc': QtHelpCommand},
> - packages=['setools', 'setools.diff', 'setools.policyrep',
> 'setoolsgui', 'setoolsgui.apol'],
> - scripts=['apol', 'sediff', 'seinfo', 'seinfoflow',
> 'sesearch', 'sedta'],
> -- data_files=[(join(sys.prefix, 'share/man/man1'),
> glob.glob("man/*.1"))],
> -+ data_files=[('/usr/share/man/man1', glob.glob("man/*.1"))],
> - package_data={'': ['*.ui', '*.qhc', '*.qch'], 'setools':
> ['perm_map']},
> - ext_modules=ext_py_mods,
> - test_suite='tests',
> + with suppress(KeyError):
> --
> -2.13.0
> +2.7.4
>
> diff --git a/recipes-security/setools/setools_4.1.1.bb
> <http://setools_4.1.1.bb>
> b/recipes-security/setools/setools_4.2.2.bb <http://setools_4.2.2.bb>
> similarity index 61%
> rename from recipes-security/setools/setools_4.1.1.bb
> <http://setools_4.1.1.bb>
> rename to recipes-security/setools/setools_4.2.2.bb
> <http://setools_4.2.2.bb>
> index db529f4..6e5a950 100644
> --- a/recipes-security/setools/setools_4.1.1.bb
> <http://setools_4.1.1.bb>
> +++ b/recipes-security/setools/setools_4.2.2.bb
> <http://setools_4.2.2.bb>
> @@ -9,26 +9,24 @@ SECTION = "base"
> LICENSE = "GPLv2 & LGPLv2.1"
>
> S = "${WORKDIR}/git"
> -SRC_URI = "git://github.com/SELinuxProject/${BPN}.git;branch=4.1
> <http://github.com/SELinuxProject/$%7BBPN%7D.git;branch=4.1> \
> +SRC_URI = "git://github.com/SELinuxProject/${BPN}.git;branch=4.2
> <http://github.com/SELinuxProject/$%7BBPN%7D.git;branch=4.2> \
> file://setools4-fixes-for-cross-compiling.patch \
> - file://setools4-fix-cross-compiling-errors-for-powerpc-mips.patch \
> - file://Fix-build-failure-with-GCC-7-due-to-possible-truncat.patch \
> "
>
> -SRCREV = "e03617eb7ab5a035633bff66500b95d25232e331"
> +SRCREV = "15bffa7823b9a999f9d51533785ade18fe44df08"
>
> LIC_FILES_CHKSUM =
> "file://${S}/COPYING;md5=83a5eb6974c11f30785e90d0eeccf40c \
> file://${S}/COPYING.GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
> file://${S}/COPYING.LGPL;md5=4fbd65380cdd255951079008b364516c"
>
> -DEPENDS += "bison-native flex-native swig-native python libsepol"
> +DEPENDS += "bison-native flex-native swig-native python3
> python3-cython-native libsepol"
>
> -RDEPENDS_${PN} += "python-networkx python-enum34 python-decorator
> python-setuptools \
> - python-logging python-json python-argparse
> libselinux-python"
> +RDEPENDS_${PN} += "python3-networkx python3-decorator
> python3-setuptools \
> + python3-logging python3-json libselinux-python"
>
> RPROVIDES_${PN} += "${PN}-console"
>
> -inherit setuptools
> +inherit setuptools3
>
> do_install_append() {
> # Need PyQt5 support, disable gui tools
> --
> 2.17.1
>
>
>
> --
> Joe MacDonald
> :wq
[-- Attachment #2: Type: text/html, Size: 24810 bytes --]
next prev parent reply other threads:[~2019-12-20 0:55 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-14 1:48 [meta-selinux][PATCH 00/19] selinux: upgrade 2.8 -> 2.9 Yi Zhao
2019-11-14 1:48 ` [meta-selinux][PATCH 01/19] python-ipy: upgrade to 1.00 and add python3 version Yi Zhao
2019-11-14 1:48 ` [meta-selinux][PATCH 02/19] selinux: uprev inc files to 2.9 (20190315) Yi Zhao
2019-11-14 1:48 ` [meta-selinux][PATCH 03/19] libsepol: uprev " Yi Zhao
2019-11-14 1:48 ` [meta-selinux][PATCH 04/19] libselinux: " Yi Zhao
2019-11-14 1:48 ` [meta-selinux][PATCH 05/19] libselinux-python: add recipe Yi Zhao
2019-11-14 1:48 ` [meta-selinux][PATCH 06/19] libsemanage: uprev to 2.9 (20190315) Yi Zhao
2019-11-14 1:48 ` [meta-selinux][PATCH 07/19] checkpolicy: " Yi Zhao
2019-11-14 1:48 ` [meta-selinux][PATCH 08/19] secilc: " Yi Zhao
2019-11-14 1:48 ` [meta-selinux][PATCH 09/19] policycoreutils: " Yi Zhao
2019-11-14 1:48 ` [meta-selinux][PATCH 10/19] mcstrans: " Yi Zhao
2019-11-14 1:48 ` [meta-selinux][PATCH 11/19] restorecond: " Yi Zhao
2019-11-14 1:48 ` [meta-selinux][PATCH 12/19] selinux-python: " Yi Zhao
2019-11-14 1:48 ` [meta-selinux][PATCH 13/19] selinux-dbus: " Yi Zhao
2019-11-14 1:48 ` [meta-selinux][PATCH 14/19] selinux-sandbox: " Yi Zhao
2019-11-14 1:48 ` [meta-selinux][PATCH 15/19] selinux-gui: " Yi Zhao
2019-11-14 1:48 ` [meta-selinux][PATCH 16/19] semodule-utils: " Yi Zhao
2019-11-14 1:48 ` [meta-selinux][PATCH 17/19] selinux-init: fix build error when enable usrmerge feature Yi Zhao
2019-11-14 1:49 ` [meta-selinux][PATCH 18/19] setools: upgrade 4.1.1 -> 4.2.2 Yi Zhao
2019-12-19 17:32 ` Joe MacDonald
2019-12-20 0:55 ` Yi Zhao [this message]
2019-11-14 1:49 ` [meta-selinux][PATCH 19/19] audit: switch to python3 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=1540af4c-0378-fd51-29df-4a54cc5ce90e@windriver.com \
--to=yi.zhao@windriver.com \
--cc=joe@deserted.net \
--cc=yocto@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