setroubleshoot/0011-framework-Handla-all-e...

43 lines
1.3 KiB
Diff

From 64f09779477f17759aa8e3d5ca47975ca46856d0 Mon Sep 17 00:00:00 2001
From: Petr Lautrbach <plautrba@redhat.com>
Date: Mon, 28 Aug 2017 09:01:44 +0200
Subject: [PATCH 11/19] framework: Handla all exceptions from
do_analyze_logfile()
Fixes:
$ sudo umount /sys/fs/selinux
$ sudo sealert -a /var/log/audit/audit.log
Opps, sealert hit an error!
ValueError: You must specify the -p option with the path to the policy file.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/bin/sealert", line 695, in <module>
do_analyze_logfile(logfile)
File "/usr/bin/sealert", line 532, in do_analyze_logfile
audit2why.init()
SystemError: <built-in function init> returned a result with an error set
---
framework/src/sealert | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/framework/src/sealert b/framework/src/sealert
index c8036f8..b7d5898 100755
--- a/framework/src/sealert
+++ b/framework/src/sealert
@@ -699,7 +699,7 @@ if __name__ == '__main__':
except ProgramError as e:
print(e.strerror, file=sys.stderr)
sys.exit(3)
- except ValueError as e:
+ except Exception as e:
print("SELinux is disabled or we can't open a policy file")
sys.exit(3)
--
2.14.1