Bug 112670

Summary: is_selinux_enabled() has changed in fedora to return -1 on error. This currently leads to problems.
Product: [Fedora] Fedora Reporter: Arkadiusz Miskiewicz <arekm>
Component: libselinuxAssignee: Daniel Walsh <dwalsh>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhide   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-02-11 14:11:44 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Arkadiusz Miskiewicz 2003-12-27 12:30:24 UTC
is_selinux_enabled() in original libselinux returns 1 if selinux was 
enabled and 0 is selinux was disabled or checking if it's 
enabled/disabled failed. For example if we don't have /proc mounted 
then original is_selinux_enabled() will return 0.

In fedora erros checking has been added and now if we don't have proc 
is_selinux_enabled() returns -1 which causes serious problems with 
almost every selinux enabled apps in fedora because current 
is_selinux_enabled is:

if (is_selinux_enabled()) {
  do something
}

so in case of error (-1) that part of code will be executed (even if 
in reality we do not have selinux support in our custom kernel).

I should rather submit this for each selinux package which uses 
is_selinux_enabled in way described above but...

Comment 1 Daniel Walsh 2004-02-11 14:11:44 UTC
All of these should be fixed now.