Add fix proposed upstream to fix SHELL setting in Wayland sessions

epel9
Neal Gompa 4 years ago
parent 116bfcbf71
commit 25138b1b93

@ -0,0 +1,81 @@
From 12d96497e9e60645b21bbe7b48eb160185c41ee5 Mon Sep 17 00:00:00 2001
From: Neal Gompa <ngompa13@gmail.com>
Date: Sun, 17 Jan 2021 11:35:11 -0500
Subject: [PATCH] wayland-session: Ensure $SHELL remains correctly set
In some circumstances, the effort of setting the environment
correctly can wind up clobbering the user-specified shell. To
work around this issue, capture the shell setting in a variable
and set it back at the end of environment and profile setup.
---
data/scripts/wayland-session | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/data/scripts/wayland-session b/data/scripts/wayland-session
index de4f519..11f8490 100755
--- a/data/scripts/wayland-session
+++ b/data/scripts/wayland-session
@@ -8,6 +8,8 @@
# Note that the respective logout scripts are not sourced.
case $SHELL in
*/bash)
+ # Backup the user shell setting into SDDM specific variable
+ SDDM_USER_SHELL=$SHELL
[ -z "$BASH" ] && exec $SHELL $0 "$@"
set +o posix
[ -f /etc/profile ] && . /etc/profile
@@ -18,8 +20,12 @@ case $SHELL in
elif [ -f $HOME/.profile ]; then
. $HOME/.profile
fi
+ # Restore user shell setting that may have been clobbered by setting environment
+ export SHELL=$SDDM_USER_SHELL
;;
*/zsh)
+ # Backup the user shell setting into SDDM specific variable
+ SDDM_USER_SHELL=$SHELL
[ -z "$ZSH_NAME" ] && exec $SHELL $0 "$@"
[ -d /etc/zsh ] && zdir=/etc/zsh || zdir=/etc
zhome=${ZDOTDIR:-$HOME}
@@ -29,24 +35,38 @@ case $SHELL in
[ -f $zdir/zlogin ] && . $zdir/zlogin
[ -f $zhome/.zlogin ] && . $zhome/.zlogin
emulate -R sh
+ # Restore user shell setting that may have been clobbered by setting environment
+ export SHELL=$SDDM_USER_SHELL
;;
*/csh|*/tcsh)
+ # Backup the user shell setting into SDDM specific variable
+ SDDM_USER_SHELL=$SHELL
# [t]cshrc is always sourced automatically.
# Note that sourcing csh.login after .cshrc is non-standard.
wlsess_tmp=`mktemp /tmp/wlsess-env-XXXXXX`
$SHELL -c "if (-f /etc/csh.login) source /etc/csh.login; if (-f ~/.login) source ~/.login; /bin/sh -c 'export -p' >! $wlsess_tmp"
. $wlsess_tmp
rm -f $wlsess_tmp
+ # Restore user shell setting that may have been clobbered by setting environment
+ export SHELL=$SDDM_USER_SHELL
;;
*/fish)
+ # Backup the user shell setting into SDDM specific variable
+ SDDM_USER_SHELL=$SHELL
xsess_tmp=`mktemp /tmp/xsess-env-XXXXXX`
$SHELL --login -c "/bin/sh -c 'export -p' > $xsess_tmp"
. $xsess_tmp
rm -f $xsess_tmp
+ # Restore user shell setting that may have been clobbered by setting environment
+ export SHELL=$SDDM_USER_SHELL
;;
*) # Plain sh, ksh, and anything we do not know.
+ # Backup the user shell setting into SDDM specific variable
+ SDDM_USER_SHELL=$SHELL
[ -f /etc/profile ] && . /etc/profile
[ -f $HOME/.profile ] && . $HOME/.profile
+ # Restore user shell setting that may have been clobbered by setting environment
+ export SHELL=$SDDM_USER_SHELL
;;
esac
--
2.29.2

@ -9,7 +9,7 @@
Name: sddm Name: sddm
Version: 0.19.0 Version: 0.19.0
Release: 1%{?dist} Release: 2%{?dist}
License: GPLv2+ License: GPLv2+
Summary: QML based X11 desktop manager Summary: QML based X11 desktop manager
@ -26,6 +26,9 @@ Patch051: 0001-Remove-suffix-for-Wayland-session.patch
# From: https://github.com/sddm/sddm/pull/1230 # From: https://github.com/sddm/sddm/pull/1230
Patch052: 0001-Redesign-Xauth-handling.patch Patch052: 0001-Redesign-Xauth-handling.patch
# From: https://github.com/sddm/sddm/pull/1360
Patch053: 0001-wayland-session-Ensure-SHELL-remains-correctly-set.patch
## downstream patches ## downstream patches
Patch101: sddm-0.19.0-fedora_config.patch Patch101: sddm-0.19.0-fedora_config.patch
@ -218,6 +221,9 @@ fi
%changelog %changelog
* Sun Jan 17 2021 Neal Gompa <ngompa13@gmail.com> - 0.19.0-2
- Add fix proposed upstream to fix SHELL setting in Wayland sessions
* Tue Nov 10 2020 Neal Gompa <ngompa13@gmail.com> - 0.19.0-1 * Tue Nov 10 2020 Neal Gompa <ngompa13@gmail.com> - 0.19.0-1
- Rebase to version 0.19.0 - Rebase to version 0.19.0
- Refresh patch set and drop upstreamed patches - Refresh patch set and drop upstreamed patches

Loading…
Cancel
Save