From unknown Tue May 19 15:22:45 2026
MIME-Version: 1.0
X-Mailer: MIME-tools 5.502 (Entity 5.502)
X-Loop: owner@bugs.x2go.org
From: owner@bugs.x2go.org (X2Go Bug Tracking System)
Subject: Bug#105 closed by mike@das-netzwerkteam.de (Mike Gabriel) ()
Message-ID: <handler.105.c.136606139416704.notifdone@bugs.x2go.org>
References: <20130415212942.726F6F8471@minobo.das-netzwerkteam.de>
X-X2go-PR-Keywords: pending moreinfo
X-X2go-PR-Message: they-closed 105
X-X2go-PR-Package: x2goserver
X-X2go-PR-Source: x2goserver
Date: Mon, 15 Apr 2013 21:30:19 +0000
Content-Type: multipart/mixed; boundary="----------=_1366061419-17672-0"

This is a multi-part message in MIME format...

------------=_1366061419-17672-0
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=utf-8

This is an automatic notification regarding your Bug report
which was filed against the x2goserver package:

#105: Logic errors in x2goruncommand

It has been closed by mike@das-netzwerkteam.de (Mike Gabriel).

Their explanation is attached below along with your original report.
If this explanation is unsatisfactory and you have not received a
better one in a separate message then please contact mike@das-netzwerkteam.=
de (Mike Gabriel) by
replying to this email.


--=20
X2Go Bug Tracking System
Contact owner@bugs.x2go.org with problems

------------=_1366061419-17672-0
Content-Type: message/rfc822
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

Received: (at control) by bugs.x2go.org; 15 Apr 2013 21:29:54 +0000
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on
	ymir.das-netzwerkteam.de
X-Spam-Level: **
X-Spam-Status: No, score=3.0 required=5.0 tests=EMPTY_BODY autolearn=no
	version=3.3.2
Received: from freya.das-netzwerkteam.de (freya.das-netzwerkteam.de [88.198.48.199])
	by ymir (Postfix) with ESMTPS id 1406F5DB11
	for <control@bugs.x2go.org>; Mon, 15 Apr 2013 23:29:54 +0200 (CEST)
Received: from grimnir.das-netzwerkteam.de (grimnir.das-netzwerkteam.de [78.46.204.98])
	by freya.das-netzwerkteam.de (Postfix) with ESMTPS id D79301325
	for <control@bugs.x2go.org>; Mon, 15 Apr 2013 23:29:53 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
	by grimnir.das-netzwerkteam.de (Postfix) with ESMTP id C72713BB9B
	for <control@bugs.x2go.org>; Mon, 15 Apr 2013 23:29:53 +0200 (CEST)
X-Virus-Scanned: Debian amavisd-new at grimnir.das-netzwerkteam.de
Received: from grimnir.das-netzwerkteam.de ([127.0.0.1])
	by localhost (grimnir.das-netzwerkteam.de [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id FuJ-UwuNw3iQ for <control@bugs.x2go.org>;
	Mon, 15 Apr 2013 23:29:53 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
	by grimnir.das-netzwerkteam.de (Postfix) with ESMTP id A2EB83BB98
	for <control@bugs.x2go.org>; Mon, 15 Apr 2013 23:29:53 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
	by grimnir.das-netzwerkteam.de (Postfix) with ESMTP id 8A5F33BB9B
	for <control@bugs.x2go.org>; Mon, 15 Apr 2013 23:29:53 +0200 (CEST)
Received: from minobo.das-netzwerkteam.de (localhost [127.0.0.1])
	by grimnir.das-netzwerkteam.de (Postfix) with ESMTP id 5B3F33BB98
	for <control@bugs.x2go.org>; Mon, 15 Apr 2013 23:29:53 +0200 (CEST)
Received: by minobo.das-netzwerkteam.de (Postfix, from userid 1000)
	id 726F6F8471; Mon, 15 Apr 2013 23:29:42 +0200 (CEST)
To: control@bugs.x2go.org
Subject: 
Message-Id: <20130415212942.726F6F8471@minobo.das-netzwerkteam.de>
Date: Mon, 15 Apr 2013 23:29:42 +0200 (CEST)
From: mike@das-netzwerkteam.de (Mike Gabriel)

close #105
thanks


------------=_1366061419-17672-0
Content-Type: message/rfc822
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

Received: (at submit) by bugs.x2go.org; 18 Jan 2013 17:16:08 +0000
Received: from mailhub1.dartmouth.edu (mailhub1.dartmouth.edu [129.170.16.122])
	by ymir (Postfix) with ESMTPS id A4D045DB18
	for <submit@bugs.x2go.org>; Fri, 18 Jan 2013 18:16:07 +0100 (CET)
Received: from schultz.kiewit.dartmouth.edu (Schultz.Kiewit.dartmouth.edu [129.170.70.6])
	(authenticated bits=0)
	by mailhub1.dartmouth.edu (8.13.5/DND2.0/8.13.5) with ESMTP id r0IHFuYS009592
	(version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO)
	for <submit@bugs.x2go.org>; Fri, 18 Jan 2013 12:15:56 -0500
From: "Matthew L. Dailey" <matthew.l.dailey@dartmouth.edu>
Content-Type: multipart/mixed; boundary="Apple-Mail=_D3332E29-F29A-4CCF-91C2-D305D5522E4D"
Subject: Logic errors in x2goruncommand
Message-Id: <7AD4B654-3C34-40A2-8C95-C370F80A20AC@dartmouth.edu>
Date: Fri, 18 Jan 2013 12:15:56 -0500
To: submit@bugs.x2go.org
Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\))
X-Mailer: Apple Mail (2.1499)
X-MailScanner: Found to be clean by mailhub1.dartmouth.edu
X-MailScanner-From: matthew.l.dailey@dartmouth.edu


--Apple-Mail=_D3332E29-F29A-4CCF-91C2-D305D5522E4D
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii

Package: x2goserver
Version: 4.1.0.0

Greetings.

In working on a deployment of X2Go on some Ubuntu machines, I found some =
logic errors in the x2goruncommand script that cased it not to determine =
the proper session to run for Gnome or Unity on Ubuntu 12.04 (and =
probably others). In essence, the script was testing the return code of =
bc, rather than the actual answer (1 or 0) to the boolean question being =
passed to it.

Here is a patch (also attached) that fixes this problem and I can verify =
that this works on at least Ubuntu 12.04 systems. I don't have any =
others I can easily test on. I'm not crazy about the quotes both outside =
and inside $(), but I think it should be okay. Perhaps a more adept bash =
programmer might have a better suggestion. :-)

Thanks for your attention and please let me know if you have any =
questions or need any other information. And, thanks for your hard work =
on this terrific project!

--=20
Matthew L. Dailey
Systems Administrator
Thayer School of Engineering
Dartmouth College

--- x2goruncommand.orig	2012-12-30 16:49:03.000000000 -0500
+++ x2goruncommand	2013-01-15 16:45:33.623393451 -0500
@@ -91,13 +91,13 @@
 if [ "$cmd" =3D=3D "GNOME" ] || [ "$cmd" =3D=3D "gnome-session" ]; then
=20
 	cmd=3D"/usr/bin/gnome-session"
-	if [ "$DISTRIB_ID" =3D=3D "Ubuntu" ] && $(echo "$DISTRIB_RELEASE =
>=3D 11.10" | bc); then
+	if [ "$DISTRIB_ID" =3D=3D "Ubuntu" ] && [ "$(echo =
"$DISTRIB_RELEASE >=3D 11.10" | bc)" =3D=3D "1" ]; then
 		export DESKTOP_SESSION=3D"gnome-fallback"
 		args=3D" --session=3D$DESKTOP_SESSION"
-	elif [ "$DISTRIB_ID" =3D=3D "Ubuntu" ] && $(echo =
"$DISTRIB_RELEASE =3D=3D 11.04" | bc); then
+	elif [ "$DISTRIB_ID" =3D=3D "Ubuntu" ] && [ "$(echo =
"$DISTRIB_RELEASE =3D=3D 11.04" | bc)" =3D=3D "1" ]; then
 		export DESKTOP_SESSION=3D"2d-gnome"
 		args=3D" --session=3D$DESKTOP_SESSION"
-	elif [ "$DISTRIB_ID" =3D=3D "Ubuntu" ] && $(echo =
"$DISTRIB_RELEASE <=3D 10.10" | bc); then
+	elif [ "$DISTRIB_ID" =3D=3D "Ubuntu" ] && [ "$(echo =
"$DISTRIB_RELEASE <=3D 10.10" | bc)" =3D=3D "1" ]; then
 		export DESKTOP_SESSION=3D"gnome"
 	elif cat /etc/debian_version | egrep "^(squeeze|6\.).*" =
>/dev/null; then
 		export DESKTOP_SESSION=3D"gnome"
@@ -108,13 +108,13 @@
=20
 elif ([ "$cmd" =3D=3D "UNITY" ] || [ "$cmd" =3D=3D "unity" ]); then
 	cmd=3D"/usr/bin/gnome-session"
-	if [ "$DISTRIB_ID" =3D=3D "Ubuntu" ] && $(echo =
"$DISTRIB_RELEASE" >=3D 12.10 | bc); then
+	if [ "$DISTRIB_ID" =3D=3D "Ubuntu" ] && [ "$(echo =
"$DISTRIB_RELEASE >=3D 12.10" | bc)" =3D=3D "1" ]; then
 		export DESKTOP_SESSION=3D"ubuntu"
 		args=3D" --session=3D$DESKTOP_SESSION"
-	elif [ "$DISTRIB_ID" =3D=3D "Ubuntu" ] && [ $(echo =
"$DISTRIB_RELEASE" =3D=3D 11.10 | bc) || $(echo $DISTRIB_RELEASE =3D=3D =
12.04 | bc) ]; then
+	elif [ "$DISTRIB_ID" =3D=3D "Ubuntu" ] && [ "$(echo =
"$DISTRIB_RELEASE =3D=3D 11.10" | bc)" =3D=3D "1" -o "$(echo =
"$DISTRIB_RELEASE =3D=3D 12.04" | bc)" =3D=3D "1" ]; then
 		export DESKTOP_SESSION=3D"ubuntu-2d"
 		args=3D" --session=3D$DESKTOP_SESSION"
-	elif [ "$DISTRIB_ID" =3D=3D "Ubuntu" ] && $(echo =
"$DISTRIB_RELEASE" =3D=3D 11.04 | bc); then
+	elif [ "$DISTRIB_ID" =3D=3D "Ubuntu" ] && [ "$(echo =
"$DISTRIB_RELEASE =3D=3D 11.04" | bc)" =3D=3D "1" ]; then
 		export DESKTOP_SESSION=3D"2d-ubuntu"
 		args=3D" --session=3D$DESKTOP_SESSION"
 	fi


--Apple-Mail=_D3332E29-F29A-4CCF-91C2-D305D5522E4D
Content-Disposition: attachment;
	filename=x2goruncommand.patch
Content-Type: application/octet-stream;
	name="x2goruncommand.patch"
Content-Transfer-Encoding: 7bit

--- x2goruncommand.orig	2012-12-30 16:49:03.000000000 -0500
+++ x2goruncommand	2013-01-15 16:45:33.623393451 -0500
@@ -91,13 +91,13 @@
 if [ "$cmd" == "GNOME" ] || [ "$cmd" == "gnome-session" ]; then
 
 	cmd="/usr/bin/gnome-session"
-	if [ "$DISTRIB_ID" == "Ubuntu" ] && $(echo "$DISTRIB_RELEASE >= 11.10" | bc); then
+	if [ "$DISTRIB_ID" == "Ubuntu" ] && [ "$(echo "$DISTRIB_RELEASE >= 11.10" | bc)" == "1" ]; then
 		export DESKTOP_SESSION="gnome-fallback"
 		args=" --session=$DESKTOP_SESSION"
-	elif [ "$DISTRIB_ID" == "Ubuntu" ] && $(echo "$DISTRIB_RELEASE == 11.04" | bc); then
+	elif [ "$DISTRIB_ID" == "Ubuntu" ] && [ "$(echo "$DISTRIB_RELEASE == 11.04" | bc)" == "1" ]; then
 		export DESKTOP_SESSION="2d-gnome"
 		args=" --session=$DESKTOP_SESSION"
-	elif [ "$DISTRIB_ID" == "Ubuntu" ] && $(echo "$DISTRIB_RELEASE <= 10.10" | bc); then
+	elif [ "$DISTRIB_ID" == "Ubuntu" ] && [ "$(echo "$DISTRIB_RELEASE <= 10.10" | bc)" == "1" ]; then
 		export DESKTOP_SESSION="gnome"
 	elif cat /etc/debian_version | egrep "^(squeeze|6\.).*" >/dev/null; then
 		export DESKTOP_SESSION="gnome"
@@ -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); 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) || $(echo $DISTRIB_RELEASE == 12.04 | bc) ]; 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); then
+	elif [ "$DISTRIB_ID" == "Ubuntu" ] && [ "$(echo "$DISTRIB_RELEASE == 11.04" | bc)" == "1" ]; then
 		export DESKTOP_SESSION="2d-ubuntu"
 		args=" --session=$DESKTOP_SESSION"
 	fi

--Apple-Mail=_D3332E29-F29A-4CCF-91C2-D305D5522E4D
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=us-ascii



--Apple-Mail=_D3332E29-F29A-4CCF-91C2-D305D5522E4D--

------------=_1366061419-17672-0--
