summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWenzong Fan <wenzong.fan@windriver.com>2014-04-23 03:42:06 -0400
committerJoe MacDonald <joe@deserted.net>2014-04-24 19:53:22 -0400
commit5df8724825a913f8d4ab00f1d45ee2615012744a (patch)
tree8728724fc38b66c0299eb61e65a06f8498716fa1
parent2d5d3d861cf0468c05f45727ab16a9c626847e85 (diff)
downloadmeta-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.patch48
-rw-r--r--recipes-security/selinux/policycoreutils_2.2.5.bb1
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 @@
1From b8e07bd0643b581ac33c96a1f94ae17c8df80ffd 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 semanage/semanage | 9 +++++++--
15 1 file changed, 7 insertions(+), 2 deletions(-)
16
17diff --git a/semanage/semanage b/semanage/semanage
18index 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--
471.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 "