X2Go Bug report logs - #1434
Use login shell for session

version graph

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

Reported by: Orion Poplawski <orion@nwra.com>

Date: Sat, 25 Jan 2020 04:20:02 UTC

Severity: normal

Tags: patch, pending

Found in version 4.1.0.3

Fixed in version 4.1.0.4

Reply or subscribe to this bug.

Toggle useless messages

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


Report forwarded to x2go-dev@lists.x2go.org, X2Go Developers <x2go-dev@lists.x2go.org>:
Bug#1434; Package x2goserver. (Sat, 25 Jan 2020 04:20:03 GMT) (full text, mbox, link).


Acknowledgement sent to Orion Poplawski <orion@nwra.com>:
New Bug report received and forwarded. Copy sent to X2Go Developers <x2go-dev@lists.x2go.org>. (Sat, 25 Jan 2020 04:20:03 GMT) (full text, mbox, link).


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

From: Orion Poplawski <orion@nwra.com>
To: submit@bugs.x2go.org
Subject: Use login shell for session
Date: Fri, 24 Jan 2020 21:19:03 -0700
[Message part 1 (text/plain, inline)]
Package: x2goserver
Version: 4.1.0.3
Tags: patch

X2Go's Xsession file always starts the user's session with /bin/bash (at 
least on RedHat systems where SHELL is set to /bin/bash via ~/.bashrc 
calling /etc/bashrc).  This patch attempts to determine the user's login 
shell and use that for launching the session.  See also:

 https://bugzilla.redhat.com/show_bug.cgi?id=1794660

Another option might be the judicious use of the --norc option when 
launching x2goruncommand on followers but I'm not sure what other 
effects this will have or where to do that.  Effects might not be to bad 
because I can simulate this by moving away the user's .bash_profile and 
.bashrc files and then the tcsh is used as expected in this case. 
However, while $SHELL does not get set in this case, the xfce4-session 
script still gets launched with bash which triggers some other errors, 
so this patch may be the best option.


---
 x2goserver-xsession/etc/Xsession | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/x2goserver-xsession/etc/Xsession 
b/x2goserver-xsession/etc/Xsession
index 270a0b3..522f37e 100755
--- a/x2goserver-xsession/etc/Xsession
+++ b/x2goserver-xsession/etc/Xsession
@@ -117,6 +117,10 @@ if ! echo "*" >>"$WRITE_TEST"; then
 fi
 rm -f "$WRITE_TEST"

+# Determine the users login shell and use that to launch the session
+SHELL=$(getent passwd $LOGNAME | cut -d: -f7)
+# Fallback
+[ -z "$SHELL" ] && SHELL=/bin/bash

 if [ -f /etc/debian_version ] || [ -f /etc/devuan_version ]; then

--
1.8.3.1

-- 
Orion Poplawski
Manager of NWRA Technical Systems          720-772-5637
NWRA, Boulder/CoRA Office             FAX: 303-415-9702
3380 Mitchell Lane                       orion@nwra.com
Boulder, CO 80301                 https://www.nwra.com/

[smime.p7s (application/pkcs7-signature, attachment)]

Information forwarded to x2go-dev@lists.x2go.org, X2Go Developers <x2go-dev@lists.x2go.org>:
Bug#1434; Package x2goserver. (Mon, 16 May 2022 20:00:01 GMT) (full text, mbox, link).


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.x2go.org>. (Mon, 16 May 2022 20:00:02 GMT) (full text, mbox, link).


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

From: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
To: 1434-submitter@bugs.x2go.org
Cc: control@bugs.x2go.org, 1434@bugs.x2go.org
Subject: X2Go issue (in src:x2goserver) has been marked as pending for release
Date: Mon, 16 May 2022 21:57:03 +0200 (CEST)
tag #1434 pending
fixed #1434 4.1.0.4
thanks

Hi!

X2Go issue #1434 (src:x2goserver) reported by you has been
fixed in X2Go Git. You can see the changelog below, and you can
check the diff of the fix at:

    https://code.x2go.org/gitweb?p=x2goserver.git;a=commitdiff;h=2cabb88c3f785d93060d41e3f86eadc508aab553

The issue will most likely be fixed in src:x2goserver (4.1.0.4).

light+love
X2Go Git Admin (on behalf of the sender of this mail)

---
commit 2cabb88c3f785d93060d41e3f86eadc508aab553
Author: Orion Poplawski <orion@nwra.com>
Date:   Mon May 16 21:55:23 2022 +0200

    x2goserver-xsession/etc/Xsession: Detect $SHELL from getent passwd and use it to launch the session (on RHEL, SUSE, Gentoo and alike). (Fixes: #1434).
    
     X2Go's Xsession file always starts the user's session with /bin/bash (at
     least on RedHat systems where SHELL is set to /bin/bash via ~/.bashrc
     calling /etc/bashrc).  This patch attempts to determine the user's login
     shell and use that for launching the session.  See also:
     .
     https://bugzilla.redhat.com/show_bug.cgi?id=1794660
     .
     Another option might be the judicious use of the --norc option when
     launching x2goruncommand on followers but I'm not sure what other
     effects this will have or where to do that.  Effects might not be to bad
     because I can simulate this by moving away the user's .bash_profile and
     .bashrc files and then the tcsh is used as expected in this case.
     However, while $SHELL does not get set in this case, the xfce4-session
     script still gets launched with bash which triggers some other errors,
     so this patch may be the best option.

diff --git a/debian/changelog b/debian/changelog
index a9cc40af..9aa24304 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -472,6 +472,12 @@ x2goserver (4.1.0.4-0x2go1.2) UNRELEASED; urgency=medium
     - Support for rootless X2GoKdrive sessions.
     - Setting keyboard layout in rootless X2GoKdrive sessions.
 
+  [ Orion Paplowski ]
+  * New upstream version (4.1.0.4):
+    - x2goserver-xsession/etc/Xsession: Detect $SHELL from getent passwd
+      and use it to launch the session (on RHEL, SUSE, Gentoo and alike).
+      (Fixes: #1434).
+
   [ Tom Ruzicka ]
   * debian/po: Add Czech debconf translation.
 


Added tag(s) pending. Request was from Mike Gabriel <mike.gabriel@das-netzwerkteam.de> to control@bugs.x2go.org. (Mon, 16 May 2022 20:00:02 GMT) (full text, mbox, link).


Marked as fixed in versions 4.1.0.4. Request was from Mike Gabriel <mike.gabriel@das-netzwerkteam.de> to control@bugs.x2go.org. (Mon, 16 May 2022 20:00:02 GMT) (full text, mbox, link).


Message sent on to Orion Poplawski <orion@nwra.com>:
Bug#1434. (Mon, 16 May 2022 20:00:02 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


X2Go Developers <owner@bugs.x2go.org>. Last modified: Thu Mar 23 15:31:39 2023; 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.