From 25138b1b93af9f49600a8d87cd1e0a396a2ca110 Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Sun, 17 Jan 2021 11:45:47 -0500 Subject: [PATCH] Add fix proposed upstream to fix SHELL setting in Wayland sessions --- ...n-Ensure-SHELL-remains-correctly-set.patch | 81 +++++++++++++++++++ sddm.spec | 8 +- 2 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 0001-wayland-session-Ensure-SHELL-remains-correctly-set.patch diff --git a/0001-wayland-session-Ensure-SHELL-remains-correctly-set.patch b/0001-wayland-session-Ensure-SHELL-remains-correctly-set.patch new file mode 100644 index 0000000..28892fa --- /dev/null +++ b/0001-wayland-session-Ensure-SHELL-remains-correctly-set.patch @@ -0,0 +1,81 @@ +From 12d96497e9e60645b21bbe7b48eb160185c41ee5 Mon Sep 17 00:00:00 2001 +From: Neal Gompa +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 + diff --git a/sddm.spec b/sddm.spec index b0081bf..bdf3557 100644 --- a/sddm.spec +++ b/sddm.spec @@ -9,7 +9,7 @@ Name: sddm Version: 0.19.0 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ 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 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 Patch101: sddm-0.19.0-fedora_config.patch @@ -218,6 +221,9 @@ fi %changelog +* Sun Jan 17 2021 Neal Gompa - 0.19.0-2 +- Add fix proposed upstream to fix SHELL setting in Wayland sessions + * Tue Nov 10 2020 Neal Gompa - 0.19.0-1 - Rebase to version 0.19.0 - Refresh patch set and drop upstreamed patches