[X2Go-Dev] Bug#1434: Use login shell for session
Orion Poplawski
orion at nwra.com
Sat Jan 25 05:19:03 CET 2020
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 at nwra.com
Boulder, CO 80301 https://www.nwra.com/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3799 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.x2go.org/pipermail/x2go-dev/attachments/20200124/0957491e/attachment.bin>
More information about the x2go-dev
mailing list