diff options
author | Yi Zhao <yi.zhao@windriver.com> | 2019-11-14 09:49:00 +0800 |
---|---|---|
committer | Joe MacDonald <joe_macdonald@mentor.com> | 2019-12-19 11:17:00 -0500 |
commit | 88b9ab90c8a06e52556e18ae32556701255ed290 (patch) | |
tree | 1ebe4301491096ced8e52c5c67f631d7dff25fc1 /recipes-security | |
parent | 61389a1984b7bda682c1cbe2be183abb4d7fbe1b (diff) | |
download | meta-selinux-88b9ab90c8a06e52556e18ae32556701255ed290.tar.gz |
setools: upgrade 4.1.1 -> 4.2.2
* 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>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
Diffstat (limited to 'recipes-security')
-rw-r--r-- | recipes-security/setools/setools/Fix-build-failure-with-GCC-7-due-to-possible-truncat.patch | 105 | ||||
-rw-r--r-- | recipes-security/setools/setools/setools4-fix-cross-compiling-errors-for-powerpc-mips.patch | 35 | ||||
-rw-r--r-- | recipes-security/setools/setools/setools4-fixes-for-cross-compiling.patch | 34 | ||||
-rw-r--r-- | recipes-security/setools/setools_4.2.2.bb (renamed from recipes-security/setools/setools_4.1.1.bb) | 14 |
4 files changed, 19 insertions, 169 deletions
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 @@ | |||
1 | Upstream-Status: Backport [https://github.com/TresysTechnology/setools/commit/e41adf0] | ||
2 | |||
3 | Signed-off-by: Kai Kang <kai.kang@windriver.com> | ||
4 | |||
5 | From e41adf01647c695b80b112b337e76021bb9f30c3 Mon Sep 17 00:00:00 2001 | ||
6 | From: Laurent Bigonville <bigon@bigon.be> | ||
7 | Date: Tue, 26 Sep 2017 15:15:30 +0200 | ||
8 | Subject: [PATCH] Fix build failure with GCC 7 due to possible truncation of | ||
9 | snprintf output | ||
10 | |||
11 | setools fails to build under GCC7 -Wformat -Werror with the following error: | ||
12 | |||
13 | 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 | ||
14 | libqpol/policy_extend.c: In function 'policy_extend': | ||
15 | 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=] | ||
16 | snprintf(buff, 9, "@ttr%04zd", i + 1); | ||
17 | ^~~~~ | ||
18 | libqpol/policy_extend.c:161:22: note: directive argument in the range [1, 4294967295] | ||
19 | snprintf(buff, 9, "@ttr%04zd", i + 1); | ||
20 | ^~~~~~~~~~~ | ||
21 | |||
22 | Increase the size of the buffer to avoid collisions | ||
23 | |||
24 | Closes: https://github.com/TresysTechnology/setools/issues/174 | ||
25 | Signed-off-by: Laurent Bigonville <bigon@bigon.be> | ||
26 | --- | ||
27 | libqpol/policy_extend.c | 16 ++++++++-------- | ||
28 | 1 file changed, 8 insertions(+), 8 deletions(-) | ||
29 | |||
30 | diff --git a/libqpol/policy_extend.c b/libqpol/policy_extend.c | ||
31 | index 742819b..739e184 100644 | ||
32 | --- a/libqpol/policy_extend.c | ||
33 | +++ b/libqpol/policy_extend.c | ||
34 | @@ -110,7 +110,7 @@ static int qpol_policy_remove_bogus_aliases(qpol_policy_t * policy) | ||
35 | * Builds data for the attributes and inserts them into the policydb. | ||
36 | * This function modifies the policydb. Names created for attributes | ||
37 | * are of the form @ttr<value> where value is the value of the attribute | ||
38 | - * as a four digit number (prepended with 0's as needed). | ||
39 | + * as a ten digit number (prepended with 0's as needed). | ||
40 | * @param policy The policy from which to read the attribute map and | ||
41 | * create the type data for the attributes. This policy will be altered | ||
42 | * by this function. | ||
43 | @@ -125,7 +125,7 @@ static int qpol_policy_build_attrs_from_map(qpol_policy_t * policy) | ||
44 | uint32_t bit = 0, count = 0; | ||
45 | ebitmap_node_t *node = NULL; | ||
46 | type_datum_t *tmp_type = NULL, *orig_type; | ||
47 | - char *tmp_name = NULL, buff[10]; | ||
48 | + char *tmp_name = NULL, buff[16]; | ||
49 | int error = 0, retv; | ||
50 | |||
51 | INFO(policy, "%s", "Generating attributes for policy. (Step 4 of 5)"); | ||
52 | @@ -137,7 +137,7 @@ static int qpol_policy_build_attrs_from_map(qpol_policy_t * policy) | ||
53 | |||
54 | db = &policy->p->p; | ||
55 | |||
56 | - memset(&buff, 0, 10 * sizeof(char)); | ||
57 | + memset(&buff, 0, 16 * sizeof(char)); | ||
58 | |||
59 | for (i = 0; i < db->p_types.nprim; i++) { | ||
60 | /* skip types */ | ||
61 | @@ -158,7 +158,7 @@ static int qpol_policy_build_attrs_from_map(qpol_policy_t * policy) | ||
62 | * with this attribute */ | ||
63 | /* Does not exist */ | ||
64 | if (db->p_type_val_to_name[i] == NULL){ | ||
65 | - snprintf(buff, 9, "@ttr%04zd", i + 1); | ||
66 | + snprintf(buff, 15, "@ttr%010zd", i + 1); | ||
67 | tmp_name = strdup(buff); | ||
68 | if (!tmp_name) { | ||
69 | error = errno; | ||
70 | @@ -240,7 +240,7 @@ static int qpol_policy_build_attrs_from_map(qpol_policy_t * policy) | ||
71 | * Builds data for empty attributes and inserts them into the policydb. | ||
72 | * This function modifies the policydb. Names created for the attributes | ||
73 | * are of the form @ttr<value> where value is the value of the attribute | ||
74 | - * as a four digit number (prepended with 0's as needed). | ||
75 | + * as a ten digit number (prepended with 0's as needed). | ||
76 | * @param policy The policy to which to add type data for attributes. | ||
77 | * This policy will be altered by this function. | ||
78 | * @return Returns 0 on success and < 0 on failure; if the call fails, | ||
79 | @@ -251,7 +251,7 @@ static int qpol_policy_build_attrs_from_map(qpol_policy_t * policy) | ||
80 | static int qpol_policy_fill_attr_holes(qpol_policy_t * policy) | ||
81 | { | ||
82 | policydb_t *db = NULL; | ||
83 | - char *tmp_name = NULL, buff[10]; | ||
84 | + char *tmp_name = NULL, buff[16]; | ||
85 | int error = 0, retv = 0; | ||
86 | ebitmap_t tmp_bmap = { NULL, 0 }; | ||
87 | type_datum_t *tmp_type = NULL; | ||
88 | @@ -265,12 +265,12 @@ static int qpol_policy_fill_attr_holes(qpol_policy_t * policy) | ||
89 | |||
90 | db = &policy->p->p; | ||
91 | |||
92 | - memset(&buff, 0, 10 * sizeof(char)); | ||
93 | + memset(&buff, 0, 16 * sizeof(char)); | ||
94 | |||
95 | for (i = 0; i < db->p_types.nprim; i++) { | ||
96 | if (db->type_val_to_struct[i]) | ||
97 | continue; | ||
98 | - snprintf(buff, 9, "@ttr%04zd", i + 1); | ||
99 | + snprintf(buff, 15, "@ttr%010zd", i + 1); | ||
100 | tmp_name = strdup(buff); | ||
101 | if (!tmp_name) { | ||
102 | error = errno; | ||
103 | -- | ||
104 | 2.20.1 | ||
105 | |||
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 @@ | |||
1 | From dc86d880ae0d66233679112a2bf0115c39df68f1 Mon Sep 17 00:00:00 2001 | ||
2 | From: Wenzong Fan <wenzong.fan@windriver.com> | ||
3 | Date: Fri, 17 Feb 2017 08:57:35 +0000 | ||
4 | Subject: [meta-selinux][PATCH] setools4: fix cross-compiling errors for powerpc, mips | ||
5 | |||
6 | Fix build errors: | ||
7 | | libqpol/policy.c: In function 'qpol_binpol_version': | ||
8 | | libqpol/policy.c:95:24: error: implicit declaration of function 'bswap_32' [-Werror=implicit-function-declaration] | ||
9 | | #define le32_to_cpu(x) bswap_32(x) | ||
10 | |||
11 | Upstream-Status: Pending | ||
12 | |||
13 | Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com> | ||
14 | --- | ||
15 | libqpol/policy.c | 4 ++++ | ||
16 | 1 file changed, 4 insertions(+) | ||
17 | |||
18 | diff --git a/libqpol/policy.c b/libqpol/policy.c | ||
19 | index ae3acb5..b5b87f9 100644 | ||
20 | --- a/libqpol/policy.c | ||
21 | +++ b/libqpol/policy.c | ||
22 | @@ -45,6 +45,10 @@ | ||
23 | # include <asm/types.h> | ||
24 | #endif | ||
25 | |||
26 | +#if defined(_ARCH_PPC) || defined(mips) | ||
27 | +#include <byteswap.h> | ||
28 | +#endif | ||
29 | + | ||
30 | #include <sepol/debug.h> | ||
31 | #include <sepol/handle.h> | ||
32 | #include <sepol/policydb/flask_types.h> | ||
33 | -- | ||
34 | 2.11.0 | ||
35 | |||
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 @@ | |||
1 | From a104374147b398838edc04e937c92e762ea3f5d9 Mon Sep 17 00:00:00 2001 | 1 | From e0a112874d10dbf741c27b107edddedd86d51529 Mon Sep 17 00:00:00 2001 |
2 | From: Wenzong Fan <wenzong.fan@windriver.com> | 2 | From: Wenzong Fan <wenzong.fan@windriver.com> |
3 | Date: Tue, 14 Feb 2017 06:32:35 +0000 | 3 | Date: Tue, 14 Feb 2017 06:32:35 +0000 |
4 | Subject: [meta-selinux][PATCH] setools4: fixes for cross compiling | 4 | Subject: [PATCH] setools4: fixes for cross compiling |
5 | 5 | ||
6 | * search libsepol from $STAGING_LIBDIR | 6 | * search libsepol from $STAGING_LIBDIR |
7 | * fix manual install path as '/usr/share/man/man1' | 7 | * fix manual install path as '/usr/share/man/man1' |
@@ -9,32 +9,24 @@ Subject: [meta-selinux][PATCH] setools4: fixes for cross compiling | |||
9 | Upstream-Status: Inappropriate [embedded specific] | 9 | Upstream-Status: Inappropriate [embedded specific] |
10 | 10 | ||
11 | Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com> | 11 | Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com> |
12 | Signed-off-by: Yi Zhao <yi.zhao@windriver.com> | ||
12 | --- | 13 | --- |
13 | setup.py | 4 ++-- | 14 | setup.py | 2 +- |
14 | 1 file changed, 2 insertions(+), 2 deletions(-) | 15 | 1 file changed, 1 insertion(+), 1 deletion(-) |
15 | 16 | ||
16 | diff --git a/setup.py b/setup.py | 17 | diff --git a/setup.py b/setup.py |
17 | index 2ca44c9..300ff70 100644 | 18 | index ac8a876..df7ebbc 100644 |
18 | --- a/setup.py | 19 | --- a/setup.py |
19 | +++ b/setup.py | 20 | +++ b/setup.py |
20 | @@ -77,7 +77,7 @@ class BuildExtCommand(build_ext): | 21 | @@ -78,7 +78,7 @@ class QtHelpCommand(Command): |
21 | build_ext.run(self) | ||
22 | 22 | ||
23 | 23 | ||
24 | -base_lib_dirs = ['.', '/usr/lib64', '/usr/lib', '/usr/local/lib'] | 24 | # Library linkage |
25 | +base_lib_dirs = [os.environ["STAGING_LIBDIR"]] | 25 | -lib_dirs = ['.', '/usr/lib64', '/usr/lib', '/usr/local/lib'] |
26 | include_dirs = ['libqpol', 'libqpol/include'] | 26 | +lib_dirs = [os.environ["STAGING_LIBDIR"]] |
27 | include_dirs = [] | ||
27 | 28 | ||
28 | try: | 29 | with suppress(KeyError): |
29 | @@ -182,7 +182,7 @@ setup(name='setools', | ||
30 | 'build_qhc': QtHelpCommand}, | ||
31 | packages=['setools', 'setools.diff', 'setools.policyrep', 'setoolsgui', 'setoolsgui.apol'], | ||
32 | scripts=['apol', 'sediff', 'seinfo', 'seinfoflow', 'sesearch', 'sedta'], | ||
33 | - data_files=[(join(sys.prefix, 'share/man/man1'), glob.glob("man/*.1"))], | ||
34 | + data_files=[('/usr/share/man/man1', glob.glob("man/*.1"))], | ||
35 | package_data={'': ['*.ui', '*.qhc', '*.qch'], 'setools': ['perm_map']}, | ||
36 | ext_modules=ext_py_mods, | ||
37 | test_suite='tests', | ||
38 | -- | 30 | -- |
39 | 2.13.0 | 31 | 2.7.4 |
40 | 32 | ||
diff --git a/recipes-security/setools/setools_4.1.1.bb b/recipes-security/setools/setools_4.2.2.bb index db529f4..6e5a950 100644 --- a/recipes-security/setools/setools_4.1.1.bb +++ b/recipes-security/setools/setools_4.2.2.bb | |||
@@ -9,26 +9,24 @@ SECTION = "base" | |||
9 | LICENSE = "GPLv2 & LGPLv2.1" | 9 | LICENSE = "GPLv2 & LGPLv2.1" |
10 | 10 | ||
11 | S = "${WORKDIR}/git" | 11 | S = "${WORKDIR}/git" |
12 | SRC_URI = "git://github.com/SELinuxProject/${BPN}.git;branch=4.1 \ | 12 | SRC_URI = "git://github.com/SELinuxProject/${BPN}.git;branch=4.2 \ |
13 | file://setools4-fixes-for-cross-compiling.patch \ | 13 | file://setools4-fixes-for-cross-compiling.patch \ |
14 | file://setools4-fix-cross-compiling-errors-for-powerpc-mips.patch \ | ||
15 | file://Fix-build-failure-with-GCC-7-due-to-possible-truncat.patch \ | ||
16 | " | 14 | " |
17 | 15 | ||
18 | SRCREV = "e03617eb7ab5a035633bff66500b95d25232e331" | 16 | SRCREV = "15bffa7823b9a999f9d51533785ade18fe44df08" |
19 | 17 | ||
20 | LIC_FILES_CHKSUM = "file://${S}/COPYING;md5=83a5eb6974c11f30785e90d0eeccf40c \ | 18 | LIC_FILES_CHKSUM = "file://${S}/COPYING;md5=83a5eb6974c11f30785e90d0eeccf40c \ |
21 | file://${S}/COPYING.GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ | 19 | file://${S}/COPYING.GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ |
22 | file://${S}/COPYING.LGPL;md5=4fbd65380cdd255951079008b364516c" | 20 | file://${S}/COPYING.LGPL;md5=4fbd65380cdd255951079008b364516c" |
23 | 21 | ||
24 | DEPENDS += "bison-native flex-native swig-native python libsepol" | 22 | DEPENDS += "bison-native flex-native swig-native python3 python3-cython-native libsepol" |
25 | 23 | ||
26 | RDEPENDS_${PN} += "python-networkx python-enum34 python-decorator python-setuptools \ | 24 | RDEPENDS_${PN} += "python3-networkx python3-decorator python3-setuptools \ |
27 | python-logging python-json python-argparse libselinux-python" | 25 | python3-logging python3-json libselinux-python" |
28 | 26 | ||
29 | RPROVIDES_${PN} += "${PN}-console" | 27 | RPROVIDES_${PN} += "${PN}-console" |
30 | 28 | ||
31 | inherit setuptools | 29 | inherit setuptools3 |
32 | 30 | ||
33 | do_install_append() { | 31 | do_install_append() { |
34 | # Need PyQt5 support, disable gui tools | 32 | # Need PyQt5 support, disable gui tools |