Package: kexec-tools
Severity: normal
Version: 20070330-4
Tags: patch

Both /etc/init.d/kexec and /etc/init.d/kexec-load have "#! /bin/sh"
shebangs, and both have do_stop functions with the following bug:

        test "x`cat /sys/kernel/kexec_loaded`y" == "x1y" || exit 0         
                                                ^^

This use of == instead of = is a bashism.  If /bin/sh isn't bash,
the test automatically fails (with an error message), so do_stop
always exits without doing anything useful.

(I noticed this because I have /bin/sh linked to /bin/dash, and I
set that up precisely because I'm trying out a bunch of interesting
boot-related packages like bootchart and kexec...)

Trivial "s/==/=/' patch attached.

-- System Information:         
Debian Release: lenny/sid         
APT prefers testing         
APT policy: (500, 'testing'), (50, 'unstable')         
Architecture: i386 (i586)         
         
Kernel: Linux 2.6.23.custom
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages kexec-tools depends on:
ii  debconf                       1.5.18     Debian configuration management sy
ii  libc6                         2.7-6      GNU C Library: Shared libraries
       
kexec-tools recommends no packages.
                  
-- debconf-show failed         

JBR
Ankh kak! (Ancient Egyptian blessing)
diff -ru kexec-tools-20070330.old/debian/kexec.init.d kexec-tools-20070330/debian/kexec.init.d
--- kexec-tools-20070330.old/debian/kexec.init.d	2008-01-25 16:48:59.000000000 +0000
+++ kexec-tools-20070330/debian/kexec.init.d	2008-01-25 16:50:02.000000000 +0000
@@ -18,7 +18,7 @@
 test -r /etc/default/kexec && . /etc/default/kexec
 
 do_stop () {
-	test "x`cat /sys/kernel/kexec_loaded`y" == "x1y" || exit 0
+	test "x`cat /sys/kernel/kexec_loaded`y" = "x1y" || exit 0
 	test -x /sbin/kexec || exit 0
 
 	log_action_msg "Will now restart with kexec"
diff -ru kexec-tools-20070330.old/debian/kexec-load.init.d kexec-tools-20070330/debian/kexec-load.init.d
--- kexec-tools-20070330.old/debian/kexec-load.init.d	2008-01-25 16:48:59.000000000 +0000
+++ kexec-tools-20070330/debian/kexec-load.init.d	2008-01-25 16:50:11.000000000 +0000
@@ -20,7 +20,7 @@
 do_stop () {
 	test "$LOAD_KEXEC" = 1 || exit 0
 	test -x /sbin/kexec || exit 0
-	test "x`cat /sys/kernel/kexec_loaded`y" == "x1y" && exit 0
+	test "x`cat /sys/kernel/kexec_loaded`y" = "x1y" && exit 0
 
 	REAL_APPEND="$APPEND"
 

Reply via email to