[X2Go-Commits] [x2goserver] 01/01: x2goserver-xsession/etc/Xsession: Detect $SHELL from getent passwd and use it to launch the session (on RHEL, SUSE, Gentoo and alike). (Fixes: #1434).
git-admin at x2go.org
git-admin at x2go.org
Mon May 16 21:57:04 CEST 2022
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to branch master
in repository x2goserver.
commit 2cabb88c3f785d93060d41e3f86eadc508aab553
Author: Orion Poplawski <orion at 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.
---
debian/changelog | 6 ++++++
x2goserver-xsession/etc/Xsession | 4 ++++
2 files changed, 10 insertions(+)
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.
diff --git a/x2goserver-xsession/etc/Xsession b/x2goserver-xsession/etc/Xsession
index 5df6101c..6466bc4d 100755
--- a/x2goserver-xsession/etc/Xsession
+++ b/x2goserver-xsession/etc/Xsession
@@ -135,6 +135,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
--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2goserver.git
More information about the x2go-commits
mailing list