selinux_current_policy_path will return none on a disabled SELinux system

This commit is contained in:
Dan Walsh 2013-11-13 10:43:46 -05:00 committed by Stephen Smalley
parent 7315245750
commit 5fe159bfdd

View file

@ -63,7 +63,7 @@ def parse_options():
def get_policy():
p = selinux.selinux_current_policy_path()
if os.path.exists(p):
if p and os.path.exists(p):
return p
i = selinux.security_policyvers()
p = selinux.selinux_binary_policy_path() + "." + str(i)