diff options
author | Wenzong Fan <wenzong.fan@windriver.com> | 2014-04-23 03:42:06 -0400 |
---|---|---|
committer | Joe MacDonald <joe@deserted.net> | 2014-04-24 19:53:22 -0400 |
commit | 5df8724825a913f8d4ab00f1d45ee2615012744a (patch) | |
tree | 8728724fc38b66c0299eb61e65a06f8498716fa1 | |
parent | 2d5d3d861cf0468c05f45727ab16a9c626847e85 (diff) | |
download | meta-selinux-5df8724825a913f8d4ab00f1d45ee2615012744a.tar.gz |
policycoreutils / semanage: process ValueError for sepolicy, seobject
The sepolicy, seobject modules raise many unprocessed ValueError, just
process them in semanage to make the script proivdes error message but
not error trace.
Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
-rw-r--r-- | recipes-security/selinux/policycoreutils/policycoreutils-process-ValueError-for-sepolicy-seobject.patch | 48 | ||||
-rw-r--r-- | recipes-security/selinux/policycoreutils_2.2.5.bb | 1 |
2 files changed, 49 insertions, 0 deletions
diff --git a/recipes-security/selinux/policycoreutils/policycoreutils-process-ValueError-for-sepolicy-seobject.patch b/recipes-security/selinux/policycoreutils/policycoreutils-process-ValueError-for-sepolicy-seobject.patch new file mode 100644 index 0000000..933f2b2 --- /dev/null +++ b/recipes-security/selinux/policycoreutils/policycoreutils-process-ValueError-for-sepolicy-seobject.patch | |||
@@ -0,0 +1,48 @@ | |||
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 | 9 +++++++-- | ||
15 | 1 file changed, 7 insertions(+), 2 deletions(-) | ||
16 | |||
17 | diff --git a/semanage/semanage b/semanage/semanage | ||
18 | index 36b41cd..a36a3f9 100644 | ||
19 | --- a/semanage/semanage | ||
20 | +++ b/semanage/semanage | ||
21 | @@ -24,9 +24,15 @@ | ||
22 | # | ||
23 | |||
24 | import argparse | ||
25 | -import seobject | ||
26 | import sys | ||
27 | import gettext | ||
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 | gettext.install(PROGNAME, | ||
38 | @@ -59,7 +65,6 @@ usage_interface_dict = {' --add':('-t TYPE','-r RANGE','interface'),' --modify': | ||
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 | class CheckRole(argparse.Action): | ||
44 | def __call__(self, parser, namespace, value, option_string=None): | ||
45 | newval = getattr(namespace, self.dest) | ||
46 | -- | ||
47 | 1.7.9.5 | ||
48 | |||
diff --git a/recipes-security/selinux/policycoreutils_2.2.5.bb b/recipes-security/selinux/policycoreutils_2.2.5.bb index c278aff..7c32064 100644 --- a/recipes-security/selinux/policycoreutils_2.2.5.bb +++ b/recipes-security/selinux/policycoreutils_2.2.5.bb | |||
@@ -13,4 +13,5 @@ SRC_URI += "\ | |||
13 | file://policycoreutils-make-O_CLOEXEC-optional.patch \ | 13 | file://policycoreutils-make-O_CLOEXEC-optional.patch \ |
14 | file://policycoreutils-loadpolicy-symlink.patch \ | 14 | file://policycoreutils-loadpolicy-symlink.patch \ |
15 | file://policycoreutils-semanage-edit-user.patch \ | 15 | file://policycoreutils-semanage-edit-user.patch \ |
16 | file://policycoreutils-process-ValueError-for-sepolicy-seobject.patch \ | ||
16 | " | 17 | " |