Package: setroubleshoot
Version: 2.0.12-2
Severity: normal

the call to selinuxenabled in the previous patch terminate the script if 
selinux is not enabled. Thus the error message is not printed.

This patch fixes this.

Cheers,
Alban


-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.29-rc5 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages setroubleshoot depends on:
ii  dbus                          1.2.12-1   simple interprocess messaging syst
ii  python                        2.5.4-2    An interactive high-level object-o
ii  python-audit                  1.7.11-1   Python bindings for security audit
ii  python-gtkhtml2               2.19.1-3.1 Python bindings for the GtkHTML 2 
ii  python-notify                 0.1.1-2+b1 Python bindings for libnotify
ii  python-rpm                    4.4.2.3-2  Python bindings for RPM
ii  python-support                0.90.3     automated rebuilding support for P

Versions of packages setroubleshoot recommends:
ii  auditd                 1.7.11-1          User space tools for security audi
ii  policycoreutils        2.0.55-1          SELinux core policy utilities
ii  selinux-policy-default 2:0.0.20080702-14 Strict and Targeted variants of th
ii  setroubleshoot-plugins 2.0.12-1          Tool to help troubleshoot SELinux 

setroubleshoot suggests no packages.

-- no debconf information
--- debian/setroubleshoot.init.orig     2009-03-07 16:16:48.000000000 +0100
+++ debian/setroubleshoot.init  2009-03-07 16:21:50.000000000 +0100
@@ -94,14 +94,19 @@
 set -e
 
 check_selinux_enabled() {
-    sestatus=$(sestatus ||: 2>/dev/null)
-    is_enabled=$(echo $sestatus |grep status |tr " " "\n" |tail -n 1)
-
-    if [ "x$is_enabled" != "xenabled" ]; then
-        echo "SElinux is disabled, doing nothing"
-        exit 0
+    if [ ! -x /usr/sbin/selinuxenabled ]; then
+      echo "SELinux doesn't seem to be installed, doing nothing";
+      exit 0
+    else
+      is_enabled=0;
+      /usr/sbin/selinuxenabled || is_enabled=$?
+     
+      if [ "x$is_enabled" != "x0" ]; then
+        echo "SElinux is disabled, doing nothing"
+        exit 0
+      fi
+      return 0
     fi
-    return 0
 }
 
 running_pid() {

Reply via email to