Subject: Bug#327: x2go client crashes if .bashrc prints anything

From: "Dan Halbert" <[email-masked]>
Date: Sat, 19 Oct 2013 12:22:43 -0400 (EDT)

Package: x2goclient
Version: 4.0.0.3
 
If I put an
echo "testing"   # exact text doesn't matter
 
at the top of my .bashrc, then the x2goclient crashes immediately when trying to start a session.
 
(The crash does not occur if I put a similar statement in .bash_login.)
 
I have reproduced this on the Windows client; I believe a colleague saw it on both the Windows and Linux clients.
 
The x2go server being used is  4.0.1.6-0~712~precise1.

---

From: Mike Gabriel <[email-masked]>
Date: Tue, 29 Oct 2013 08:36:28 +0000

tag #327 confirmed
thanks

Hi Dan,

> echo "testing"   # exact text doesn't matter

I presume, this on the server.

> I have reproduced this on the Windows client; I believe a colleague  
> saw it on both the Windows and Linux clients.
>

I can confirm that the issue exists with latest X2Go Client.

I could confirm this issue on Debian wheezy or Ubuntu precise as X2Go  
Server. On Ubuntu lucid, the problem does not occur.

Mike
-- 

DAS-NETZWERKTEAM
mike gabriel, herweg 7, 24357 fleckeby
fon: +49 (1520) 1976 148

GnuPG Key ID 0x25771B31
mail: [email-masked], http://das-netzwerkteam.de

freeBusy:
https://mail.das-netzwerkteam.de/freebusy/m.gabriel%40das-netzwerkteam.de.xfb

---

From: Dan Halbert <[email-masked]>
Date: Tue, 29 Oct 2013 07:55:05 -0400

> I presume, this on the server.
Right, this is on the server. With the Windows client there is no 
.bashrc anyway. I confirmed with my colleague that he saw this on both 
the Windows and Ubuntu Precise clients.

Which windowing system chosen on the server does not seem to matter 
either. I saw it with UNITY and with just "Terminal".

> Server. On Ubuntu lucid, the problem does not occur.
That's interesting. The reason for putting in the echo's was to debug a 
completely unrelated problem about which shell init got run when we were 
running some batch jobs. I had instrumented the init files before 
without difficulty. Thanks for looking at this.

---

From: Mike Gabriel <[email-masked]>
Date: Tue, 29 Oct 2013 12:23:16 +0000

clone #327 -1
tag #327 wontfix
retitle -1 users can inject data into X2Go Client using .bashrc
severity -1 grave

Hi Dan,

On  Di 29 Okt 2013 12:55:05 CET, Dan Halbert wrote:

> .bashrc anyway. I confirmed with my colleague that he saw this on  
> both the Windows and Ubuntu Precise clients.
>
>> I could confirm this issue on Debian wheezy or Ubuntu precise as  
>> X2Go Server. On Ubuntu lucid, the problem does not occur.
> That's interesting. The reason for putting in the echo's was to  
> debug a completely unrelated problem about which shell init got run  
> when we were running some batch jobs. I had instrumented the init  
> files before without difficulty. Thanks for looking at this.

I have looked at this in depth this morning. Indeed an echoing .bashrc  
file breaks X2Go. But it also breaks everything else around SSH, esp.  
scp [1, 2].

The first link [1] also provides a solution that I want to quote here:

""" (file: ~/.bashrc)
[... normal .bashrc stuff ...]

if [[ $- =~ "i" ]]; then
    echo "SPEAK OUT LOUD!!!"
fi
"""

The i-flag in $- checks if the shell is interactive or not. With X2Go,  
this flag will not get set.

Greets,
Mike

[1]  
http://stackoverflow.com/questions/12440287/scp-doesnt-work-when-echo-in-bashrc
[2] https://bugzilla.redhat.com/show_bug.cgi?id=20527

-- 

DAS-NETZWERKTEAM

GnuPG Key ID 0x25771B31

freeBusy:

---

From: Andrew Martin <[email-masked]>
Date: Mon, 24 Mar 2025 09:13:04 -0500

Hi,

Would you be interested in acquiring the Healthcare Information and
Management Systems Society Attendees 2025 Email List?

Present We Have Verified Contacts:- 50,857, Cost: USD- 1,982

Interested? Email me Back, I would love to provide more information on the
list.

Kind Regards,

Andrew Martin

Marketing Coordinator

---

From: April Parker <[email-masked]>
Date: Wed, 7 Jan 2026 07:30:42 -0600

Hi,

Would you be interested in acquiring  Healthcare Information and
Management Systems Society

Attendees Data List-2026

Number of Contacts:- 50,682
Cost              :-$2,586

Kind Regards,
April Parker
Marketing Coordinator