X2Go Bug report logs - #105
Logic errors in x2goruncommand

version graph

Package: x2goserver; Maintainer for x2goserver is X2Go Developers <x2go-dev@lists.x2go.org>; Source for x2goserver is src:x2goserver.

Reported by: "Matthew L. Dailey" <matthew.l.dailey@dartmouth.edu>

Date: Fri, 18 Jan 2013 17:18:02 UTC

Severity: normal

Tags: moreinfo, pending

Merged with 64

Found in versions 4.0.0.1, 3.1.1.9-0~623~precise1

Fixed in version 4.0.0.2

Done: mike@das-netzwerkteam.de (Mike Gabriel)

Bug is archived. No further changes may be made.

Full log


🔗 View this message in rfc822 format

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"
[Message part 1 (text/plain, inline)]
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.


-- 
X2Go Bug Tracking System
Contact owner@bugs.x2go.org with problems
[Message part 2 (message/rfc822, inline)]
From: mike@das-netzwerkteam.de (Mike Gabriel)
To: control@bugs.x2go.org
Date: Mon, 15 Apr 2013 23:29:42 +0200 (CEST)
close #105
thanks

[Message part 3 (message/rfc822, inline)]
From: "Matthew L. Dailey" <matthew.l.dailey@dartmouth.edu>
To: submit@bugs.x2go.org
Subject: Logic errors in x2goruncommand
Date: Fri, 18 Jan 2013 12:15:56 -0500
[Message part 4 (text/plain, inline)]
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!

-- 
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" == "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

[x2goruncommand.patch (application/octet-stream, attachment)]
[Message part 6 (text/plain, inline)]


Send a report that this bug log contains spam.


X2Go Developers <owner@bugs.x2go.org>. Last modified: Tue May 7 12:52:01 2024; Machine Name: ymir.das-netzwerkteam.de

X2Go Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.