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.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to x2go-dev@lists.berlios.de, X2Go Developers <x2go-dev@lists.berlios.de>:
Bug#105; Package x2goserver. (Fri, 18 Jan 2013 17:18:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Matthew L. Dailey" <matthew.l.dailey@dartmouth.edu>:
New Bug report received and forwarded. Copy sent to X2Go Developers <x2go-dev@lists.berlios.de>. (Fri, 18 Jan 2013 17:18:02 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.x2go.org (full text, mbox):

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 1 (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 3 (text/plain, inline)]



Information forwarded to x2go-dev@lists.berlios.de, X2Go Developers <x2go-dev@lists.berlios.de>:
Bug#105; Package x2goserver. (Mon, 11 Feb 2013 21:48:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Mike Gabriel <mike.gabriel@das-netzwerkteam.de>:
Extra info received and forwarded to list. Copy sent to X2Go Developers <x2go-dev@lists.berlios.de>. (Mon, 11 Feb 2013 21:48:01 GMT) Full text and rfc822 format available.

Message #10 received at 105@bugs.x2go.org (full text, mbox):

From: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
To: "Matthew L. Dailey" <matthew.l.dailey@dartmouth.edu>, 105@bugs.x2go.org
Cc: control@bugs.x2go.org
Subject: Re: [X2Go-Dev] Bug#105: Logic errors in x2goruncommand
Date: Mon, 11 Feb 2013 22:46:32 +0100
[Message part 1 (text/plain, inline)]
tag #105 pending
thanks

Hi Matthew,

On Fr 18 Jan 2013 18:15:56 CET "Matthew L. Dailey" wrote:

> 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!

Thanks for spotting this issue!!!

Fixed in Git Vcs:
http://code.x2go.org/gitweb?p=x2goserver.git;a=commitdiff;h=cd23b80ca2f1056500e8b78cedebf60089086bda

The fix will be available in X2Go Server 4.0.0.1 (next release).

Greets,
Mike


-- 

DAS-NETZWERKTEAM
mike gabriel, rothenstein 5, 24214 neudorf-bornstein
fon: +49 (1520) 1976 148

GnuPG Key ID 0x25771B31
mail: mike.gabriel@das-netzwerkteam.de, http://das-netzwerkteam.de

freeBusy:
https://mail.das-netzwerkteam.de/freebusy/m.gabriel%40das-netzwerkteam.de.xfb
[Message part 2 (application/pgp-signature, inline)]

Added tag(s) pending. Request was from Mike Gabriel <mike.gabriel@das-netzwerkteam.de> to control@bugs.x2go.org. (Mon, 11 Feb 2013 21:48:02 GMT) Full text and rfc822 format available.

Information forwarded to x2go-dev@lists.berlios.de, X2Go Developers <x2go-dev@lists.berlios.de>:
Bug#105; Package x2goserver. (Sat, 23 Mar 2013 01:03:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Mike Gabriel <mike.gabriel@das-netzwerkteam.de>:
Extra info received and forwarded to list. Copy sent to X2Go Developers <x2go-dev@lists.berlios.de>. (Sat, 23 Mar 2013 01:03:02 GMT) Full text and rfc822 format available.

Message #17 received at 105@bugs.x2go.org (full text, mbox):

From: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
To: 83@bugs.x2go.org, 86@bugs.x2go.org, 105@bugs.x2go.org, 121@bugs.x2go.org
Cc: control@bugs.x2go.org
Subject: The reported issue has been fixed in X2Go Server 4.0.0.1
Date: Sat, 23 Mar 2013 01:51:12 +0100
[Message part 1 (text/plain, inline)]
close #83
close #86
close #105
close #121
thanks

The reported issue has been solved in release 4.0.0.1 of X2Go Server.

light+love,
Mike

-- 

DAS-NETZWERKTEAM
mike gabriel, rothenstein 5, 24214 neudorf-bornstein
fon: +49 (1520) 1976 148

GnuPG Key ID 0x25771B31
mail: mike.gabriel@das-netzwerkteam.de, http://das-netzwerkteam.de

freeBusy:
https://mail.das-netzwerkteam.de/freebusy/m.gabriel%40das-netzwerkteam.de.xfb
[Message part 2 (application/pgp-signature, inline)]

Marked Bug as done Request was from Mike Gabriel <mike.gabriel@das-netzwerkteam.de> to control@bugs.x2go.org. (Sat, 23 Mar 2013 01:03:04 GMT) Full text and rfc822 format available.

Notification sent to "Matthew L. Dailey" <matthew.l.dailey@dartmouth.edu>:
Bug acknowledged by developer. (Sat, 23 Mar 2013 01:03:04 GMT) Full text and rfc822 format available.

Marked as found in versions 3.1.1.9-0~623~precise1. Request was from mike@das-netzwerkteam.de (Mike Gabriel) to control@bugs.x2go.org. (Mon, 25 Mar 2013 23:05:08 GMT) Full text and rfc822 format available.

Added tag(s) moreinfo. Request was from mike@das-netzwerkteam.de (Mike Gabriel) to control@bugs.x2go.org. (Mon, 25 Mar 2013 23:05:08 GMT) Full text and rfc822 format available.

Merged 105 64 Request was from mike@das-netzwerkteam.de (Mike Gabriel) to control@bugs.x2go.org. (Mon, 25 Mar 2013 23:05:08 GMT) Full text and rfc822 format available.

No longer marked as found in versions 4.1.0.0. Request was from mike@das-netzwerkteam.de (Mike Gabriel) to control@bugs.x2go.org. (Mon, 25 Mar 2013 23:07:15 GMT) Full text and rfc822 format available.

Marked as found in versions 4.0.0.1 and reopened. Request was from mike@das-netzwerkteam.de (Mike Gabriel) to control@bugs.x2go.org. (Mon, 25 Mar 2013 23:07:15 GMT) Full text and rfc822 format available.

Marked as fixed in versions 4.0.0.2. Request was from mike@das-netzwerkteam.de (Mike Gabriel) to control@bugs.x2go.org. (Mon, 25 Mar 2013 23:07:15 GMT) Full text and rfc822 format available.

Marked Bug as done Request was from mike@das-netzwerkteam.de (Mike Gabriel) to control@bugs.x2go.org. (Mon, 15 Apr 2013 21:30:19 GMT) Full text and rfc822 format available.

Notification sent to "Matthew L. Dailey" <matthew.l.dailey@dartmouth.edu>:
Bug acknowledged by developer. (Mon, 15 Apr 2013 21:30:19 GMT) Full text and rfc822 format available.

Bug archived. Request was from Debbugs Internal Request <owner@bugs.x2go.org> to internal_control@bugs.x2go.org. (Tue, 14 May 2013 05:24:01 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


X2Go Developers <owner@bugs.x2go.org>. Last modified: Thu May 23 05:49:09 2019; Machine Name: ymir.das-netzwerkteam.de

X2Go Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.