summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYi Zhao <yi.zhao@windriver.com>2019-11-14 09:48:54 +0800
committerJoe MacDonald <joe_macdonald@mentor.com>2019-12-19 11:09:21 -0500
commit751d5a3f2abb7cf629136fd6dc752d63477058cf (patch)
treed4686ce5f61e78d2e2cab48225f36d1120a5c7c5
parent72a6a1f88bd43bf5ff47e019868b0b4a9ab2a619 (diff)
downloadmeta-selinux-751d5a3f2abb7cf629136fd6dc752d63477058cf.tar.gz
selinux-python: uprev to 2.9 (20190315)
* Switch to python3 * Drop patches: fix-TypeError-for-seobject.py.patch process-ValueError-for-sepolicy-seobject.patch * Rebase patches Signed-off-by: Yi Zhao <yi.zhao@windriver.com> Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
-rw-r--r--recipes-security/selinux/selinux-python.inc62
-rw-r--r--recipes-security/selinux/selinux-python/fix-TypeError-for-seobject.py.patch30
-rw-r--r--recipes-security/selinux/selinux-python/fix-sepolicy-install-path.patch8
-rw-r--r--recipes-security/selinux/selinux-python/process-ValueError-for-sepolicy-seobject.patch47
-rw-r--r--recipes-security/selinux/selinux-python_2.8.bb7
-rw-r--r--recipes-security/selinux/selinux-python_2.9.bb7
6 files changed, 40 insertions, 121 deletions
diff --git a/recipes-security/selinux/selinux-python.inc b/recipes-security/selinux/selinux-python.inc
index 8b34bff..5e27781 100644
--- a/recipes-security/selinux/selinux-python.inc
+++ b/recipes-security/selinux/selinux-python.inc
@@ -6,60 +6,54 @@ SELinux utilities audit2allow, chcat, semanage ..."
6SECTION = "base" 6SECTION = "base"
7LICENSE = "GPLv2+" 7LICENSE = "GPLv2+"
8 8
9SRC_URI += "file://fix-sepolicy-install-path.patch \ 9SRC_URI += "file://fix-sepolicy-install-path.patch"
10 file://fix-TypeError-for-seobject.py.patch \
11 file://process-ValueError-for-sepolicy-seobject.patch \
12"
13 10
14inherit python-dir 11inherit python3-dir
15 12
16DEPENDS += "python-native libsepol" 13DEPENDS += "python3 libsepol"
17RDEPENDS_${BPN}-audit2allow += "\ 14RDEPENDS_${BPN}-audit2allow += "\
18 python-core \ 15 python3-core \
19 python-textutils \
20 libselinux-python \ 16 libselinux-python \
21 ${BPN}-sepolgen \ 17 ${BPN}-sepolgen \
22" 18"
23RDEPENDS_${BPN}-chcat += "\ 19RDEPENDS_${BPN}-chcat += "\
24 python-core \ 20 python3-core \
25 python-codecs \ 21 python3-codecs \
26 python-shell \ 22 python3-shell \
27 python-stringold \ 23 python3-stringold \
28 python-unixadmin \ 24 python3-unixadmin \
29 libselinux-python \ 25 libselinux-python \
30 ${BPN} \ 26 ${BPN} \
31" 27"
32RDEPENDS_${BPN} += "\ 28RDEPENDS_${BPN} += "\
33 python-core \ 29 python3-core \
34 python-codecs \ 30 python3-codecs \
35 python-io \ 31 python3-io \
36 python-ipy \ 32 python3-ipy \
37 python-re \ 33 python3-stringold \
38 python-stringold \ 34 python3-syslog \
39 python-syslog \ 35 python3-unixadmin \
40 python-unixadmin \
41 libselinux-python \ 36 libselinux-python \
42 libsemanage-python \ 37 libsemanage-python \
43 setools \ 38 setools \
44" 39"
45RDEPENDS_${BPN}-semanage += "\ 40RDEPENDS_${BPN}-semanage += "\
46 python-core \ 41 python3-core \
47 python-ipy \ 42 python3-ipy \
48 python-compression \ 43 python3-compression \
49 python-xml \ 44 python3-xml \
50 python-misc \ 45 python3-misc \
51 libselinux-python \ 46 libselinux-python \
52 ${BPN} \ 47 ${BPN} \
53" 48"
54RDEPENDS_${BPN}-sepolicy += "\ 49RDEPENDS_${BPN}-sepolicy += "\
55 python-argparse \ 50 python3-core \
56 python-codecs \ 51 python3-codecs \
57 python-core \ 52 python3-syslog \
58 python-syslog \
59 ${BPN} \ 53 ${BPN} \
60" 54"
61RDEPENDS_${BPN}-sepolgen-ifgen += "\ 55RDEPENDS_${BPN}-sepolgen-ifgen += "\
62 python \ 56 python3-core \
63 libselinux-python \ 57 libselinux-python \
64" 58"
65 59
@@ -96,7 +90,7 @@ FILES_${PN}-sepolgen += "\
96 ${libdir}/python${PYTHON_BASEVERSION}/site-packages/sepolgen* \ 90 ${libdir}/python${PYTHON_BASEVERSION}/site-packages/sepolgen* \
97 ${localstatedir}/lib/sepolgen/perm_map \ 91 ${localstatedir}/lib/sepolgen/perm_map \
98" 92"
99# Map to policycoreutils-python in 2.6 93
100FILES_${PN} += "\ 94FILES_${PN} += "\
101 ${libdir}/python${PYTHON_BASEVERSION}/site-packages/seobject.py* \ 95 ${libdir}/python${PYTHON_BASEVERSION}/site-packages/seobject.py* \
102 ${libdir}/python${PYTHON_BASEVERSION}/site-packages/sepolicy*.egg-info \ 96 ${libdir}/python${PYTHON_BASEVERSION}/site-packages/sepolicy*.egg-info \
@@ -104,9 +98,11 @@ FILES_${PN} += "\
104" 98"
105 99
106EXTRA_OEMAKE += "LIBSEPOLA=${STAGING_LIBDIR}/libsepol.a" 100EXTRA_OEMAKE += "LIBSEPOLA=${STAGING_LIBDIR}/libsepol.a"
101
107do_install() { 102do_install() {
108 oe_runmake DESTDIR=${D} \ 103 oe_runmake DESTDIR="${D}" \
109 LIBDIR="${libdir}" \ 104 LIBDIR="${libdir}" \
105 PYLIBVER='python${PYTHON_BASEVERSION}' \
110 PYTHONLIBDIR='${libdir}/python${PYTHON_BASEVERSION}/site-packages' \ 106 PYTHONLIBDIR='${libdir}/python${PYTHON_BASEVERSION}/site-packages' \
111 install 107 install
112} 108}
diff --git a/recipes-security/selinux/selinux-python/fix-TypeError-for-seobject.py.patch b/recipes-security/selinux/selinux-python/fix-TypeError-for-seobject.py.patch
deleted file mode 100644
index 62cdeee..0000000
--- a/recipes-security/selinux/selinux-python/fix-TypeError-for-seobject.py.patch
+++ /dev/null
@@ -1,30 +0,0 @@
1From 98c2944ffa3e35095187e1df9ff33498bbd0fa54 Mon Sep 17 00:00:00 2001
2From: Wenzong Fan <wenzong.fan@windriver.com>
3Date: Tue, 1 Apr 2014 02:53:36 -0400
4Subject: [PATCH] policycoreutils: fix TypeError for seobject.py
5
6File "/usr/lib64/python2.7/site-packages/seobject.py", line 109, in log
7 message += " sename=" + sename
8TypeError: cannot concatenate 'str' and 'NoneType' objects
9
10Uptream-Status: Pending
11
12Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
13
14---
15 semanage/seobject.py | 2 +-
16 1 file changed, 1 insertion(+), 1 deletion(-)
17
18diff --git a/semanage/seobject.py b/semanage/seobject.py
19index 70fd192..23ab77e 100644
20--- a/semanage/seobject.py
21+++ b/semanage/seobject.py
22@@ -146,7 +146,7 @@ except:
23
24 def log(self, msg, name="", sename="", serole="", serange="", oldsename="", oldserole="", oldserange=""):
25 message = " %s name=%s" % (msg, name)
26- if sename != "":
27+ if sename != "" and sename != None:
28 message += " sename=" + sename
29 if oldsename != "":
30 message += " oldsename=" + oldsename
diff --git a/recipes-security/selinux/selinux-python/fix-sepolicy-install-path.patch b/recipes-security/selinux/selinux-python/fix-sepolicy-install-path.patch
index 6f68c94..30a19eb 100644
--- a/recipes-security/selinux/selinux-python/fix-sepolicy-install-path.patch
+++ b/recipes-security/selinux/selinux-python/fix-sepolicy-install-path.patch
@@ -1,4 +1,4 @@
1From c1aae6cc131371729f098e4b0aa02142a85b5890 Mon Sep 17 00:00:00 2001 1From e57022e3577770188ad3570005b7107a09cf3bb9 Mon Sep 17 00:00:00 2001
2From: Xin Ouyang <Xin.Ouyang@windriver.com> 2From: Xin Ouyang <Xin.Ouyang@windriver.com>
3Date: Mon, 23 Sep 2013 21:17:59 +0800 3Date: Mon, 23 Sep 2013 21:17:59 +0800
4Subject: [PATCH] policycoreutils: fix install path for new pymodule sepolicy 4Subject: [PATCH] policycoreutils: fix install path for new pymodule sepolicy
@@ -13,10 +13,10 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
13 1 file changed, 3 insertions(+), 1 deletion(-) 13 1 file changed, 3 insertions(+), 1 deletion(-)
14 14
15diff --git a/sepolicy/Makefile b/sepolicy/Makefile 15diff --git a/sepolicy/Makefile b/sepolicy/Makefile
16index fb8a132..a6ee749 100644 16index 69f29fa..a18d1c3 100644
17--- a/sepolicy/Makefile 17--- a/sepolicy/Makefile
18+++ b/sepolicy/Makefile 18+++ b/sepolicy/Makefile
19@@ -8,6 +8,8 @@ BASHCOMPLETIONDIR ?= $(PREFIX)/share/bash-completion/completions 19@@ -9,6 +9,8 @@ BASHCOMPLETIONDIR ?= $(PREFIX)/share/bash-completion/completions
20 CFLAGS ?= -Wall -Werror -Wextra -W 20 CFLAGS ?= -Wall -Werror -Wextra -W
21 override CFLAGS += -DPACKAGE="policycoreutils" -DSHARED -shared 21 override CFLAGS += -DPACKAGE="policycoreutils" -DSHARED -shared
22 22
@@ -25,7 +25,7 @@ index fb8a132..a6ee749 100644
25 BASHCOMPLETIONS=sepolicy-bash-completion.sh 25 BASHCOMPLETIONS=sepolicy-bash-completion.sh
26 26
27 all: python-build 27 all: python-build
28@@ -26,7 +28,7 @@ test: 28@@ -27,7 +29,7 @@ test:
29 @$(PYTHON) test_sepolicy.py -v 29 @$(PYTHON) test_sepolicy.py -v
30 30
31 install: 31 install:
diff --git a/recipes-security/selinux/selinux-python/process-ValueError-for-sepolicy-seobject.patch b/recipes-security/selinux/selinux-python/process-ValueError-for-sepolicy-seobject.patch
deleted file mode 100644
index b0bcd1d..0000000
--- a/recipes-security/selinux/selinux-python/process-ValueError-for-sepolicy-seobject.patch
+++ /dev/null
@@ -1,47 +0,0 @@
1From 1a8bd0ca13746b5241af5736dee9a25ab360652b Mon Sep 17 00:00:00 2001
2From: Wenzong Fan <wenzong.fan@windriver.com>
3Date: Sun, 30 Mar 2014 22:25:59 -0400
4Subject: [PATCH] semanage: process ValueError for sepolicy, seobject
5
6The sepolicy, seobject modules raise many unprocessed ValueError, just
7process them in semanage to make the script proivdes error message but
8not error trace.
9
10Uptream-Status: Pending
11
12Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
13
14---
15 semanage/semanage | 11 +++++++----
16 1 file changed, 7 insertions(+), 4 deletions(-)
17
18diff --git a/semanage/semanage b/semanage/semanage
19index 313537c..2977dd0 100644
20--- a/semanage/semanage
21+++ b/semanage/semanage
22@@ -25,8 +25,14 @@
23
24 import traceback
25 import argparse
26-import seobject
27 import sys
28+try:
29+ import seobject
30+ import sepolicy
31+except ValueError, e:
32+ print "Error: %s\n" % e
33+ sys.exit(1)
34+
35 PROGNAME = "policycoreutils"
36 try:
37 import gettext
38@@ -73,9 +79,6 @@ usage_interface_dict = {' --add': ('-t TYPE', '-r RANGE', 'interface'), ' --modi
39 usage_boolean = "semanage boolean [-h] [-n] [-N] [-S STORE] ["
40 usage_boolean_dict = {' --modify': ('(', '--on', '|', '--off', ')', 'boolean'), ' --list': ('-C',), ' --extract': ('',), ' --deleteall': ('',)}
41
42-import sepolicy
43-
44-
45 class CheckRole(argparse.Action):
46
47 def __call__(self, parser, namespace, value, option_string=None):
diff --git a/recipes-security/selinux/selinux-python_2.8.bb b/recipes-security/selinux/selinux-python_2.8.bb
deleted file mode 100644
index d63fdef..0000000
--- a/recipes-security/selinux/selinux-python_2.8.bb
+++ /dev/null
@@ -1,7 +0,0 @@
1include selinux_20180524.inc
2include ${BPN}.inc
3
4LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833"
5
6SRC_URI[md5sum] = "bd9850808203c76f07efd396bde790e3"
7SRC_URI[sha256sum] = "e69f5e24820cb247a3d881a9c90efba1e64d76af863c82fb81bc3b87ed71e238"
diff --git a/recipes-security/selinux/selinux-python_2.9.bb b/recipes-security/selinux/selinux-python_2.9.bb
new file mode 100644
index 0000000..250a99c
--- /dev/null
+++ b/recipes-security/selinux/selinux-python_2.9.bb
@@ -0,0 +1,7 @@
1require selinux_20190315.inc
2require ${BPN}.inc
3
4LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833"
5
6SRC_URI[md5sum] = "e9dfedd1139dd9998f5a09abfb670454"
7SRC_URI[sha256sum] = "3650b5393b0d1790cac66db00e34f059aa91c23cfe3c2559676594e295d75fde"