diff options
Diffstat (limited to 'recipes-security/selinux/selinux-python/process-ValueError-for-sepolicy-seobject.patch')
-rw-r--r-- | recipes-security/selinux/selinux-python/process-ValueError-for-sepolicy-seobject.patch | 49 |
1 files changed, 49 insertions, 0 deletions
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 | |||