Test if audit module is enabled so that logger class is defined correctly. Fixes: "semanage fcontext -l" fails with "OSError: Protocol not supported" when booting with audit=0 Signed-off-by: Vit Mojzis <vmojzis@xxxxxxxxxx> --- python/semanage/seobject.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/semanage/seobject.py b/python/semanage/seobject.py index e5c81a7d..29b4afe0 100644 --- a/python/semanage/seobject.py +++ b/python/semanage/seobject.py @@ -101,6 +101,8 @@ ftype_to_audit = {"": "any", try: import audit + #test if audit module is enabled + audit.audit_close(audit.audit_open()) class logger: -- 2.14.3 _______________________________________________ Selinux mailing list Selinux@xxxxxxxxxxxxx To unsubscribe, send email to Selinux-leave@xxxxxxxxxxxxx. To get help, send an email containing "help" to Selinux-request@xxxxxxxxxxxxx.