mirror of
https://github.com/topjohnwu/selinux.git
synced 2025-02-19 10:50:39 +00:00

After 9406ace8 ("libsemanage: throw exceptions in python rather than return NULL"), calls to libsemanage functions return Python exceptions instead of returning negative error return codes. For systems that did not have the applicable headers installed prior to build, the difference was not seen. Following commit 9792099f ("Properly build the swig exception file even if the headers are missing"), that issue has been resolved and the underlying semanage_fcontext_query_local and semanage_fcontext_query calls now result in an OSError return. This results in the following error when attempting to modify a fcontext defined in the systems base policy. libsemanage.dbase_llist_query: could not query record value (No such file or directory). OSError: No such file or directory To resolve the error, handle the OSError exception, but retain the previous query operation. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1398427 Signed-off-by: Kyle Walker <kwalker@redhat.com>