Subject: Bug#409: x2goruncommand quoting errors sometimes create file "=" in users home directory.

From: Harald Nordgard-Hansen <[email-masked]>
Date: Thu, 23 Jan 2014 15:16:40 +0100

Package: x2goserver
Version: 4.0.1.13
Tag: patch

Some of the tests against $DISTRIB_RELEASE in x2goruncommand are badly
quoted, causing them to report the wrong result and to create a file
called "=" in the user home directory.  Aligning all tests to use the
same style of quoting fixes this.

Regards,
Harald Nordgård-Hansen
--- /usr/bin/x2goruncommand	2014-01-20 18:34:03.000000000 +0100
+++ x2goruncommand	2014-01-23 14:57:50.792160698 +0100
@@ -108,13 +108,13 @@
 
 elif ([ "$cmd" == "UNITY" ] || [ "$cmd" == "unity" ]); then
 	cmd="/usr/bin/gnome-session"
-	if [ "$DISTRIB_ID" == "Ubuntu" ] && [ "$(echo "$DISTRIB_RELEASE" >= 12.10 | bc)" == "1" ]; then
+	if [ "$DISTRIB_ID" == "Ubuntu" ] && [ "$(echo "$DISTRIB_RELEASE >= 12.10" | bc)" == "1" ]; then
 		export DESKTOP_SESSION="ubuntu"
 		args=" --session=$DESKTOP_SESSION"
-	elif [ "$DISTRIB_ID" == "Ubuntu" ] && [ "$(echo "$DISTRIB_RELEASE" == 11.10 | bc)" == "1" -o "$(echo $DISTRIB_RELEASE == 12.04 | bc)" == "1" ]; then
+	elif [ "$DISTRIB_ID" == "Ubuntu" ] && [ "$(echo "$DISTRIB_RELEASE == 11.10" | bc)" == "1" -o "$(echo "$DISTRIB_RELEASE == 12.04" | bc)" == "1" ]; then
 		export DESKTOP_SESSION="ubuntu-2d"
 		args=" --session=$DESKTOP_SESSION"
-	elif [ "$DISTRIB_ID" == "Ubuntu" ] && [ "$(echo "$DISTRIB_RELEASE" == 11.04 | bc)" == "1" ]; then
+	elif [ "$DISTRIB_ID" == "Ubuntu" ] && [ "$(echo "$DISTRIB_RELEASE == 11.04" | bc)" == "1" ]; then
 		export DESKTOP_SESSION="2d-ubuntu"
 		args=" --session=$DESKTOP_SESSION"
 	fi