X2Go Bug report logs - #784
x2gobroker-agent.pl commands break if user shell environment has login settings it doesn't like

version graph

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

Reported by: Jason Alavaliant <alavaliant@ra09.com>

Date: Tue, 10 Feb 2015 05:55:01 UTC

Severity: normal

Tags: fixed, pending

Found in version 0.0.2.3

Fixed in version 0.0.3.0

Done: X2Go Release Manager <git-admin@x2go.org>

Bug is archived. No further changes may be made.

Full log


🔗 View this message in rfc822 format

X-Loop: owner@bugs.x2go.org
Subject: Bug#784: x2gobroker-agent.pl commands break if user shell environment has login settings it doesn't like
Reply-To: Jason Alavaliant <alavaliant@ra09.com>, 784@bugs.x2go.org
Resent-From: Jason Alavaliant <alavaliant@ra09.com>
Resent-To: x2go-dev@lists.x2go.org
Resent-CC: X2Go Developers <x2go-dev@lists.x2go.org>
X-Loop: owner@bugs.x2go.org
Resent-Date: Tue, 10 Feb 2015 05:55:01 +0000
Resent-Message-ID: <handler.784.B.14235474661186@bugs.x2go.org>
Resent-Sender: owner@bugs.x2go.org
X-X2Go-PR-Message: report 784
X-X2Go-PR-Package: x2gobroker-agent
X-X2Go-PR-Keywords: 
Received: via spool by submit@bugs.x2go.org id=B.14235474661186
          (code B); Tue, 10 Feb 2015 05:55:01 +0000
Received: (at submit) by bugs.x2go.org; 10 Feb 2015 05:51:06 +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=0.8 required=5.0 tests=BAYES_50,URIBL_BLOCKED
	autolearn=ham version=3.3.2
X-Greylist: delayed 2224 seconds by postgrey-1.34 at ymir.das-netzwerkteam.de; Tue, 10 Feb 2015 06:51:01 CET
Received: from thetower.ra09.com (ra09.com [202.124.104.240])
	by ymir.das-netzwerkteam.de (Postfix) with ESMTPS id DD7953BE64
	for <submit@bugs.x2go.org>; Tue, 10 Feb 2015 06:51:01 +0100 (CET)
Received: from localhost ([127.0.0.1] helo=private.ra09.com)
	by thetower.ra09.com with esmtp (Exim 4.80)
	(envelope-from <alavaliant@ra09.com>)
	id 1YL38y-0003o3-Tc
	for submit@bugs.x2go.org; Tue, 10 Feb 2015 18:13:53 +1300
MIME-Version: 1.0
Content-Type: multipart/mixed;
 boundary="=_773b835ab8d0c5d10826fa71d4305850"
Date: Tue, 10 Feb 2015 18:13:52 +1300
From: Jason Alavaliant <alavaliant@ra09.com>
To: submit@bugs.x2go.org
Message-ID: <981e2e7256215a6351c339829d0e9d67@private.ra09.com>
X-Sender: alavaliant@ra09.com
User-Agent: Roundcube Webmail/1.0.5
[Message part 1 (text/plain, inline)]
Package: x2gobroker-agent
Version: 0.0.2.3

One of my users started to get their connections to the x2go broker 
failing with 'Error downloading http://x2go-broker-url/plain/inifile - 
server replied: Internal Server Error'

Tracking back through the commands the broker was logging the issue 
turned out be

/usr/lib/x2go/x2gobroker-agent $USER listsessions
(and other commands that x2gobroker-agent.pl runs by su - username -c 
command) returning things like

OK
[1] 32542
klipper: Command not found.
[1] + exit 1       klipper

which was a result of how the command is run;     since the 
x2gobroker-agent $USER FOO   commands all internally su to the named 
user to run the command it results in the user's environment being 
sourced which puts them at the risk of being broken by the user's 
environment.    My user in this case had embedded a command that didn't 
exist on the broker host to run as soon as their shell environment was 
created which caused the broker to error out.   (possibly compounded by 
in this case the shell tcsh being used as the user's default shell - 
tcsh in my experience being very temperamental with it's startup files - 
a single failure will stop the environment file sourcing to error our 
instantly and not process further lines.  I've not had time to cross 
compare with bash etc and see if this problem only exists for tcsh or if 
it effects most shells).

I managed to work around the issue in my case by fixing the su commands 
in x2gobroker-agent.pl to use /bin/sh (which links to /bin/dash) on my 
system to avoid user shell startup file environment issues breaking 
logging in via the broker.    It feels more like a workaround that a 
proper fix to me so I'm not suggesting the attached patch for merging,   
rather just as an example of how I got around it in my case.     My 
feeling is that there must be a better way to ensure these 
x2gobroker-agent commands can't be broken by the user env but I'm not 
managing to come up with a better solution currently.

Thanks
Jason
[patch-x2gobroker-agent-fix-su-tcsh-env-bugs.patch (text/x-diff, attachment)]

Send a report that this bug log contains spam.


X2Go Developers <owner@bugs.x2go.org>. Last modified: Thu Nov 21 19:42:35 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.