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


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

Received: (at 784) by bugs.x2go.org; 10 Feb 2015 08:23:23 +0000
From mike.gabriel@das-netzwerkteam.de  Tue Feb 10 09:23:21 2015
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on
	ymir.das-netzwerkteam.de
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,URIBL_BLOCKED
	autolearn=ham version=3.3.2
Received: from freya.das-netzwerkteam.de (freya.das-netzwerkteam.de [88.198.48.199])
	by ymir.das-netzwerkteam.de (Postfix) with ESMTPS id 1ED205DBCA
	for <784@bugs.x2go.org>; Tue, 10 Feb 2015 09:23:21 +0100 (CET)
Received: from grimnir.das-netzwerkteam.de (grimnir.das-netzwerkteam.de [78.46.204.98])
	by freya.das-netzwerkteam.de (Postfix) with ESMTPS id B126FAF6;
	Tue, 10 Feb 2015 09:23:20 +0100 (CET)
Received: from localhost (localhost [127.0.0.1])
	by grimnir.das-netzwerkteam.de (Postfix) with ESMTP id 9084D3C1B3;
	Tue, 10 Feb 2015 09:23:20 +0100 (CET)
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 GFR2MHqexL2q; Tue, 10 Feb 2015 09:23:20 +0100 (CET)
Received: from grimnir.das-netzwerkteam.de (localhost [127.0.0.1])
	by grimnir.das-netzwerkteam.de (Postfix) with ESMTPS id 5B9013C045;
	Tue, 10 Feb 2015 09:23:20 +0100 (CET)
Received: from 134.245.44.4 ([134.245.44.4]) by mail.das-netzwerkteam.de
 (Horde Framework) with HTTP; Tue, 10 Feb 2015 08:23:20 +0000
Date: Tue, 10 Feb 2015 08:23:20 +0000
Message-ID: <20150210082320.Horde.Ux2rIQx6x4VgeCS6VpAbUg1@mail.das-netzwerkteam.de>
From: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
To: Jason Alavaliant <alavaliant@ra09.com>, 784@bugs.x2go.org
Subject: Re: [X2Go-Dev] Bug#784: x2gobroker-agent.pl commands break if user
 shell environment has login settings it doesn't like
In-Reply-To: <981e2e7256215a6351c339829d0e9d67@private.ra09.com>
User-Agent: Internet Messaging Program (IMP) H5 (6.2.2)
Accept-Language: de,en
Organization: DAS-NETZWERKTEAM
X-Originating-IP: 134.245.44.4
X-Remote-Browser: Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101
 Firefox/32.0 Iceweasel/32.0
Content-Type: multipart/signed; boundary="=_yDwoVzrZiIMbpXQFp59Opg9";
 protocol="application/pgp-signature"; micalg=pgp-sha1
MIME-Version: 1.0
[Message part 1 (text/plain, inline)]
Control: tag -1 pending
Control: tag -1 fixed 0.3.0.0

Hi Jason,

On  Di 10 Feb 2015 06:13:52 CET, Jason Alavaliant wrote:

> Package: x2ggobroker-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

This issue is already fixed in Git and pending for 0.0.3.0. I have  
marked the appropriate changelog line and added a closure there for  
this bug.

Mike


-- 

DAS-NETZWERKTEAM
mike gabriel, herweg 7, 24357 fleckeby
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)]

Send a report that this bug log contains spam.


X2Go Developers <owner@bugs.x2go.org>. Last modified: Sat Sep 26 01:43:29 2020; 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.