Bug 159038 - postinstall script tests size of selinuxenabled as string rather than execute it
postinstall script tests size of selinuxenabled as string rather than execute it
Product: Fedora
Classification: Fedora
Component: selinux-policy-targeted (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Daniel Walsh
: EasyFix
Depends On:
  Show dependency treegraph
Reported: 2005-05-27 18:41 EDT by Göran Uddeborg
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version: 1.25.4-10.1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-09-15 11:58:42 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Göran Uddeborg 2005-05-27 18:41:13 EDT
Description of problem:
In the postinstall script of the s-p-t-source package, there is a test
        if [ "${SELINUXTYPE}" = "targeted" -a /usr/sbin/selinuxenabled ]; then
This is true if $SELINUXTYPE is targeted, and if the string
/usr/sbin/selinuxanabled is non-null.  The latter is of course always true.  But
I bet the intended test is to see if SELinux is enabled, which is achieved by
executing the command instead.  As in this expression
        if [ "${SELINUXTYPE}" = "targeted" ] && /usr/sbin/selinuxenabled; then

Version-Release number of selected component (if applicable):

Additional info:
The same problem is true in the strict policy.  Do you want a separate bugzilla
or do you fix both from this report?
Comment 1 Daniel Walsh 2005-05-28 01:17:33 EDT
Fixed in selinux-policy-*-1.23.17-3
Comment 2 David Juran 2005-05-29 12:18:02 EDT
Now the postinstall script has a syntax error. Try replacing the '-a' on line
229 with a '&&' instead (-: 

Note You need to log in before you can comment on or make changes to this bug.