Package: open-vm-tools
Version: 2008.02.13-77928-1
Severity: serious
Cause: renders package unusable
Tags: patch

On /etc/init.d/open-vm-tools script, the program names of vmware-checkvm and 
vmware-guestd are wrong.
Instead of 'vmware-checkvm' there is 'checkvm' (and the path is wrong), and 
instead of 'vmware-guestd' there is 'guestd'.
The init script present in the package always tells that it is not running on 
a vm, as checkvm binary is not found.

In addition, the vmxnet detection code doesn't work, as the function always 
returns 1.

I've attached the patch that fixes the script for both problems.

Bye,
Emilio Scalise
--- open-vm-tools.old	2008-02-24 20:27:52.000000000 +0100
+++ open-vm-tools	2008-03-03 13:30:30.000000000 +0100
@@ -12,18 +12,22 @@
 
 . /lib/lsb/init-functions
 
+CHECKVMBIN="vmware-checkvm"
+CHECKVMPATH="/usr/sbin/"
+GUESTD="vmware-guestd"
+
 vmxnet_needed ()
 {
-	HWVERSION="$(checkvm -h | head -1 | cut -f5 -d\ )"
+	HWVERSION="$($CHECKVMBIN -h | head -1 | cut -f5 -d\ )"
 
 	for DEVICE in /sys/bus/pci/devices/*
 	do
-		if grep -q 15ad ${DEVICE} && grep -q 0720 ${DEVICE}
+		if grep -q 15ad ${DEVICE}/vendor && grep -q 0720 ${DEVICE}/device
 		then
 			return 0
 		fi
 
-		if [ "${HWVERSION}" -ge "4" ] && grep -q 1022 ${DEVICE} && grep -q 2000 ${DEVICE}
+		if [ "${HWVERSION}" -ge "4" ] && grep -q 1022 ${DEVICE}/vendor && grep -q 2000 ${DEVICE}/device
 		then
 			return 0
 		fi
@@ -33,7 +37,7 @@
 }
 
 exit_if_not_in_vm () {
-	if [ ! -x /usr/bin/checkvm ] || ! /usr/bin/checkvm > /dev/null 2>&1
+	if [ ! -x $CHECKVMPATH$CHECKVMBIN ] || ! $CHECKVMPATH$CHECKVMBIN > /dev/null 2>&1
 	then
 		echo "Not starting as we're not running in a vm."
 		exit 0
@@ -56,8 +60,8 @@
 			modprobe vmxnet
 		fi
 
-		log_daemon_msg "Starting open-vm guest daemon" "guestd"
-		guestd --background /var/run/vmware-guestd.pid
+		log_daemon_msg "Starting open-vm guest daemon" "$GUESTD"
+		$GUESTD --background /var/run/vmware-guestd.pid
 		log_end_msg 0
 		;;
 
@@ -65,7 +69,7 @@
 		# Check if we're running inside VMWare
 		exit_if_not_in_vm
 
-		log_daemon_msg "Stopping open-vm guest daemon" "guestd"
+		log_daemon_msg "Stopping open-vm guest daemon" "$GUESTD"
 
 		if [ -f /var/run/vmware-guestd.pid ]
 		then

Reply via email to