diff options
| author | Yi Zhao <yi.zhao@windriver.com> | 2019-11-14 09:48:54 +0800 |
|---|---|---|
| committer | Joe MacDonald <joe_macdonald@mentor.com> | 2019-12-19 11:09:21 -0500 |
| commit | 751d5a3f2abb7cf629136fd6dc752d63477058cf (patch) | |
| tree | d4686ce5f61e78d2e2cab48225f36d1120a5c7c5 | |
| parent | 72a6a1f88bd43bf5ff47e019868b0b4a9ab2a619 (diff) | |
| download | meta-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>
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 ..." | |||
| 6 | SECTION = "base" | 6 | SECTION = "base" |
| 7 | LICENSE = "GPLv2+" | 7 | LICENSE = "GPLv2+" |
| 8 | 8 | ||
| 9 | SRC_URI += "file://fix-sepolicy-install-path.patch \ | 9 | SRC_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 | ||
| 14 | inherit python-dir | 11 | inherit python3-dir |
| 15 | 12 | ||
| 16 | DEPENDS += "python-native libsepol" | 13 | DEPENDS += "python3 libsepol" |
| 17 | RDEPENDS_${BPN}-audit2allow += "\ | 14 | RDEPENDS_${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 | " |
| 23 | RDEPENDS_${BPN}-chcat += "\ | 19 | RDEPENDS_${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 | " |
| 32 | RDEPENDS_${BPN} += "\ | 28 | RDEPENDS_${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 | " |
| 45 | RDEPENDS_${BPN}-semanage += "\ | 40 | RDEPENDS_${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 | " |
| 54 | RDEPENDS_${BPN}-sepolicy += "\ | 49 | RDEPENDS_${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 | " |
| 61 | RDEPENDS_${BPN}-sepolgen-ifgen += "\ | 55 | RDEPENDS_${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 | |
| 100 | FILES_${PN} += "\ | 94 | FILES_${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 | ||
| 106 | EXTRA_OEMAKE += "LIBSEPOLA=${STAGING_LIBDIR}/libsepol.a" | 100 | EXTRA_OEMAKE += "LIBSEPOLA=${STAGING_LIBDIR}/libsepol.a" |
| 101 | |||
| 107 | do_install() { | 102 | do_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 @@ | |||
| 1 | From 98c2944ffa3e35095187e1df9ff33498bbd0fa54 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Wenzong Fan <wenzong.fan@windriver.com> | ||
| 3 | Date: Tue, 1 Apr 2014 02:53:36 -0400 | ||
| 4 | Subject: [PATCH] policycoreutils: fix TypeError for seobject.py | ||
| 5 | |||
| 6 | File "/usr/lib64/python2.7/site-packages/seobject.py", line 109, in log | ||
| 7 | message += " sename=" + sename | ||
| 8 | TypeError: cannot concatenate 'str' and 'NoneType' objects | ||
| 9 | |||
| 10 | Uptream-Status: Pending | ||
| 11 | |||
| 12 | Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com> | ||
| 13 | |||
| 14 | --- | ||
| 15 | semanage/seobject.py | 2 +- | ||
| 16 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 17 | |||
| 18 | diff --git a/semanage/seobject.py b/semanage/seobject.py | ||
| 19 | index 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 @@ | |||
| 1 | From c1aae6cc131371729f098e4b0aa02142a85b5890 Mon Sep 17 00:00:00 2001 | 1 | From e57022e3577770188ad3570005b7107a09cf3bb9 Mon Sep 17 00:00:00 2001 |
| 2 | From: Xin Ouyang <Xin.Ouyang@windriver.com> | 2 | From: Xin Ouyang <Xin.Ouyang@windriver.com> |
| 3 | Date: Mon, 23 Sep 2013 21:17:59 +0800 | 3 | Date: Mon, 23 Sep 2013 21:17:59 +0800 |
| 4 | Subject: [PATCH] policycoreutils: fix install path for new pymodule sepolicy | 4 | Subject: [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 | ||
| 15 | diff --git a/sepolicy/Makefile b/sepolicy/Makefile | 15 | diff --git a/sepolicy/Makefile b/sepolicy/Makefile |
| 16 | index fb8a132..a6ee749 100644 | 16 | index 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 @@ | |||
| 1 | From 1a8bd0ca13746b5241af5736dee9a25ab360652b Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Wenzong Fan <wenzong.fan@windriver.com> | ||
| 3 | Date: Sun, 30 Mar 2014 22:25:59 -0400 | ||
| 4 | Subject: [PATCH] semanage: process ValueError for sepolicy, seobject | ||
| 5 | |||
| 6 | The sepolicy, seobject modules raise many unprocessed ValueError, just | ||
| 7 | process them in semanage to make the script proivdes error message but | ||
| 8 | not error trace. | ||
| 9 | |||
| 10 | Uptream-Status: Pending | ||
| 11 | |||
| 12 | Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com> | ||
| 13 | |||
| 14 | --- | ||
| 15 | semanage/semanage | 11 +++++++---- | ||
| 16 | 1 file changed, 7 insertions(+), 4 deletions(-) | ||
| 17 | |||
| 18 | diff --git a/semanage/semanage b/semanage/semanage | ||
| 19 | index 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 @@ | |||
| 1 | include selinux_20180524.inc | ||
| 2 | include ${BPN}.inc | ||
| 3 | |||
| 4 | LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833" | ||
| 5 | |||
| 6 | SRC_URI[md5sum] = "bd9850808203c76f07efd396bde790e3" | ||
| 7 | SRC_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 @@ | |||
| 1 | require selinux_20190315.inc | ||
| 2 | require ${BPN}.inc | ||
| 3 | |||
| 4 | LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833" | ||
| 5 | |||
| 6 | SRC_URI[md5sum] = "e9dfedd1139dd9998f5a09abfb670454" | ||
| 7 | SRC_URI[sha256sum] = "3650b5393b0d1790cac66db00e34f059aa91c23cfe3c2559676594e295d75fde" | ||
