diff options
author | Wenzong Fan <wenzong.fan@windriver.com> | 2017-09-04 22:59:49 -0700 |
---|---|---|
committer | Mark Hatle <mark.hatle@windriver.com> | 2017-09-13 19:48:51 -0500 |
commit | 1d3df562b781c7c9f9c54e65f2ac5972d2a0b022 (patch) | |
tree | c2c6f84c4cb81bc21fdb343eccc5a9df179e1fcd /recipes-security/selinux/selinux-python | |
parent | a5b5f5b328fa7f059fbfe8480bd107379bfe8d21 (diff) | |
download | meta-selinux-1d3df562b781c7c9f9c54e65f2ac5972d2a0b022.tar.gz |
selinux-python: add package 2.7 (20170804)
Move packages to python/*:
- policycoreutils/semanage -> python/semanage
- policycoreutils/audit2allow -> python/audit2allow
- policycoreutils/sepolgen-ifgen -> python/audit2allow/sepolgen-ifgen
- policycoreutils/sepolicy -> python/sepolicy
- policycoreutils/scripts/chcat -> python/chcat
- sepolgen -> python/sepolgen
* Move and rebase patches:
- policycoreutils-fix-TypeError-for-seobject.py.patch
- policycoreutils-fix-sepolicy-install-path.patch
- policycoreutils-process-ValueError-for-sepolicy-seobject.patch
* Cleanup policycoreutils.inc and policycoreutils_2.7.bb
Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
Update policycoreutils_git.bb
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Diffstat (limited to 'recipes-security/selinux/selinux-python')
3 files changed, 111 insertions, 0 deletions
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 new file mode 100644 index 0000000..993ff7e --- /dev/null +++ b/recipes-security/selinux/selinux-python/fix-TypeError-for-seobject.py.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | From a66c50c0e8cd3799fc2819835b872ab62419f684 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 | semanage/seobject.py | 2 +- | ||
15 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
16 | |||
17 | Index: policycoreutils-2.5/semanage/seobject.py | ||
18 | =================================================================== | ||
19 | --- policycoreutils-2.5.orig/semanage/seobject.py 2016-02-25 13:41:38.035974459 -0500 | ||
20 | +++ policycoreutils-2.5/semanage/seobject.py 2016-02-25 13:43:42.075974072 -0500 | ||
21 | @@ -121,7 +121,7 @@ | ||
22 | |||
23 | def log(self, msg, name="", sename="", serole="", serange="", oldsename="", oldserole="", oldserange=""): | ||
24 | message = " %s name=%s" % (msg, name) | ||
25 | - if sename != "": | ||
26 | + if sename != "" and sename != None: | ||
27 | message += " sename=" + sename | ||
28 | if oldsename != "": | ||
29 | 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 new file mode 100644 index 0000000..617908a --- /dev/null +++ b/recipes-security/selinux/selinux-python/fix-sepolicy-install-path.patch | |||
@@ -0,0 +1,33 @@ | |||
1 | Subject: [PATCH] policycoreutils: fix install path for new pymodule sepolicy | ||
2 | |||
3 | Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com> | ||
4 | Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com> | ||
5 | --- | ||
6 | sepolicy/Makefile | 4 +++- | ||
7 | 1 file changed, 3 insertions(+), 1 deletion(-) | ||
8 | |||
9 | diff --git a/sepolicy/Makefile b/sepolicy/Makefile | ||
10 | index 2b8716c..70f4bdd 100644 | ||
11 | --- a/sepolicy/Makefile | ||
12 | +++ b/sepolicy/Makefile | ||
13 | @@ -12,6 +12,8 @@ BASHCOMPLETIONDIR ?= $(DESTDIR)/usr/share/bash-completion/completions | ||
14 | SHAREDIR ?= $(PREFIX)/share/sandbox | ||
15 | override CFLAGS = -I$(PREFIX)/include -DPACKAGE="policycoreutils" -Wall -Werror -Wextra -W -DSHARED -shared | ||
16 | |||
17 | +PYLIBVER ?= $(shell python -c 'import sys;print "python%d.%d" % sys.version_info[0:2]') | ||
18 | + | ||
19 | BASHCOMPLETIONS=sepolicy-bash-completion.sh | ||
20 | |||
21 | all: python-build | ||
22 | @@ -30,7 +32,7 @@ test: | ||
23 | @python test_sepolicy.py -v | ||
24 | |||
25 | install: | ||
26 | - $(PYTHON) setup.py install `test -n "$(DESTDIR)" && echo --root $(DESTDIR)` | ||
27 | + $(PYTHON) setup.py install --install-lib $(LIBDIR)/$(PYLIBVER)/site-packages | ||
28 | [ -d $(BINDIR) ] || mkdir -p $(BINDIR) | ||
29 | install -m 755 sepolicy.py $(BINDIR)/sepolicy | ||
30 | (cd $(BINDIR); ln -sf sepolicy sepolgen) | ||
31 | -- | ||
32 | 1.7.9.5 | ||
33 | |||
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 new file mode 100644 index 0000000..1929aa5 --- /dev/null +++ b/recipes-security/selinux/selinux-python/process-ValueError-for-sepolicy-seobject.patch | |||
@@ -0,0 +1,49 @@ | |||
1 | From b8e07bd0643b581ac33c96a1f94ae17c8df80ffd 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 | semanage/semanage | 11 +++++++---- | ||
15 | 1 file changed, 7 insertions(+), 4 deletions(-) | ||
16 | |||
17 | diff --git a/semanage/semanage b/semanage/semanage | ||
18 | index 19a6c51..c0083c6 100644 | ||
19 | --- a/semanage/semanage | ||
20 | +++ b/semanage/semanage | ||
21 | @@ -25,8 +25,14 @@ | ||
22 | |||
23 | import traceback | ||
24 | import argparse | ||
25 | -import seobject | ||
26 | import sys | ||
27 | +try: | ||
28 | + import seobject | ||
29 | + import sepolicy | ||
30 | +except ValueError, e: | ||
31 | + print "Error: %s\n" % e | ||
32 | + sys.exit(1) | ||
33 | + | ||
34 | PROGNAME = "policycoreutils" | ||
35 | try: | ||
36 | import gettext | ||
37 | @@ -67,9 +73,6 @@ usage_interface_dict = {' --add': ('-t TYPE', '-r RANGE', 'interface'), ' --modi | ||
38 | usage_boolean = "semanage boolean [-h] [-n] [-N] [-S STORE] [" | ||
39 | usage_boolean_dict = {' --modify': ('(', '--on', '|', '--off', ')', 'boolean'), ' --list': ('-C',), ' --extract': ('',), ' --deleteall': ('',)} | ||
40 | |||
41 | -import sepolicy | ||
42 | - | ||
43 | - | ||
44 | class CheckRole(argparse.Action): | ||
45 | |||
46 | def __call__(self, parser, namespace, value, option_string=None): | ||
47 | -- | ||
48 | 2.7.4 | ||
49 | |||