Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package sddm for openSUSE:Factory checked in 
at 2024-04-18 22:10:45
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/sddm (Old)
 and      /work/SRC/openSUSE:Factory/.sddm.new.26366 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "sddm"

Thu Apr 18 22:10:45 2024 rev:69 rq:1168481 version:0.21.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/sddm/sddm.changes        2024-03-11 
15:29:47.989282399 +0100
+++ /work/SRC/openSUSE:Factory/.sddm.new.26366/sddm.changes     2024-04-18 
22:11:30.087045556 +0200
@@ -1,0 +2,8 @@
+Tue Apr 16 13:44:51 UTC 2024 - Fabian Vogt <fab...@ritter-vogt.de>
+
+- Add various fixes from upstream PRs:
+  * 0001-Fix-terminal-clearing.patch
+  * 0001-Redesign-login-shell-use-in-session-scripts.patch
+  * 0001-Use-xrdb-to-set-Xcursor.theme.patch
+
+-------------------------------------------------------------------

New:
----
  0001-Fix-terminal-clearing.patch
  0001-Redesign-login-shell-use-in-session-scripts.patch
  0001-Use-xrdb-to-set-Xcursor.theme.patch

BETA DEBUG BEGIN:
  New:- Add various fixes from upstream PRs:
  * 0001-Fix-terminal-clearing.patch
  * 0001-Redesign-login-shell-use-in-session-scripts.patch
  New:  * 0001-Fix-terminal-clearing.patch
  * 0001-Redesign-login-shell-use-in-session-scripts.patch
  * 0001-Use-xrdb-to-set-Xcursor.theme.patch
  New:  * 0001-Redesign-login-shell-use-in-session-scripts.patch
  * 0001-Use-xrdb-to-set-Xcursor.theme.patch
BETA DEBUG END:

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ sddm.spec ++++++
--- /var/tmp/diff_new_pack.i2v8Uc/_old  2024-04-18 22:11:30.807072017 +0200
+++ /var/tmp/diff_new_pack.i2v8Uc/_new  2024-04-18 22:11:30.807072017 +0200
@@ -59,6 +59,12 @@
 Source21:       sddm-autologin.pam
 Source22:       sddm-greeter.pam
 # Patch0-100: PATCH-FIX-UPSTREAM
+# https://github.com/sddm/sddm/pull/1779
+Patch50:        0001-Redesign-login-shell-use-in-session-scripts.patch
+# Part of https://github.com/sddm/sddm/pull/1896
+Patch51:        0001-Fix-terminal-clearing.patch
+# https://github.com/sddm/sddm/pull/1904
+Patch52:        0001-Use-xrdb-to-set-Xcursor.theme.patch
 # Patch100-?: PATCH-FIX-OPENSUSE
 Patch101:       0001-Write-the-daemon-s-PID-to-a-file-on-startup.patch
 Patch102:       0001-Set-XAUTHLOCALHOSTNAME-in-sessions.patch

++++++ 0001-Fix-terminal-clearing.patch ++++++
>From d021e6d191a388b0dae8b1e0eea675423b86099d Mon Sep 17 00:00:00 2001
From: Fabian Vogt <fab...@ritter-vogt.de>
Date: Sun, 17 Mar 2024 19:00:20 +0100
Subject: [PATCH] Fix terminal clearing

sizeof(char *) wasn't the intention there.
---
 src/common/VirtualTerminal.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/common/VirtualTerminal.cpp b/src/common/VirtualTerminal.cpp
index 9c0261e..020405a 100644
--- a/src/common/VirtualTerminal.cpp
+++ b/src/common/VirtualTerminal.cpp
@@ -209,8 +209,8 @@ out:
                 fd = vtFd;
 
                 // Clear VT
-                static const char *clearEscapeSequence = "\33[H\33[2J";
-                if (write(vtFd, clearEscapeSequence, 
sizeof(clearEscapeSequence)) == -1) {
+                static const char clearEscapeSequence[] = "\33[H\33[2J";
+                if (write(vtFd, clearEscapeSequence, 
sizeof(clearEscapeSequence) - 1) == -1) {
                     qWarning("Failed to clear VT %d: %s", vt, strerror(errno));
                 }
 
-- 
2.44.0


++++++ 0001-Redesign-login-shell-use-in-session-scripts.patch ++++++
>From 505e5c6665e68fac58d9f6c689cc0c1bea2a83bc Mon Sep 17 00:00:00 2001
From: Fabian Vogt <fab...@ritter-vogt.de>
Date: Fri, 4 Aug 2023 23:34:08 +0200
Subject: [PATCH] Redesign login shell use in session scripts

Avoid the re-import of variables into sh by using the user's login shell
to invoke the session.

For the wayland-session script it's straightforward: Just exec the session
command directly within the login shell.

For the Xsession script it's a bit more complex: The login shell environment
has to be loaded first, then the xprofile files, so that they can overwrite
the login shell environment. To achieve this, the script runs in two stages:
The first uses the login shell to exec the second stage, which then reads
xprofile and execs the session.
---
 data/scripts/Xsession        | 69 ++++++++++++++++++------------------
 data/scripts/wayland-session | 35 +++++-------------
 2 files changed, 43 insertions(+), 61 deletions(-)

diff --git a/data/scripts/Xsession b/data/scripts/Xsession
index a971d40..235a671 100755
--- a/data/scripts/Xsession
+++ b/data/scripts/Xsession
@@ -5,39 +5,34 @@
 # This file is extracted from kde-workspace (kdm/kfrontend/genkdmconf.c)
 # Copyright (C) 2001-2005 Oswald Buddenhagen <o...@kde.org>
 
-# Note that the respective logout scripts are not sourced.
-case $SHELL in
-  */bash)
-    [ -z "$BASH" ] && exec $SHELL --login $0 "$@"
-    shopt -q login_shell || exec $SHELL --login $0 "$@"
-    set +o posix
-    ;;
-  */zsh)
-    [ -z "$ZSH_NAME" ] && exec $SHELL --login $0 "$@"
-    [[ -o login ]] || exec $SHELL --login $0 "$@"
-    emulate -R sh
-    ;;
-  */csh|*/tcsh)
-    # [t]cshrc is always sourced automatically.
-    # Note that sourcing csh.login after .cshrc is non-standard.
-    xsess_tmp=`mktemp /tmp/xsess-env-XXXXXX`
-    $SHELL -c "if (-f /etc/csh.login) source /etc/csh.login; if (-f ~/.login) 
source ~/.login; /bin/sh -c 'export -p' >! $xsess_tmp"
-    . $xsess_tmp
-    rm -f $xsess_tmp
-    ;;
-  */fish)
-    [ -f /etc/profile ] && . /etc/profile
-    [ -f $HOME/.profile ] && . $HOME/.profile
-    xsess_tmp=`mktemp /tmp/xsess-env-XXXXXX`
-    $SHELL --login -c "/bin/sh -c 'export -p' > $xsess_tmp"
-    . $xsess_tmp
-    rm -f $xsess_tmp
-    ;;
-  *) # Plain sh, ksh, and anything we do not know.
-    [ -f /etc/profile ] && . /etc/profile
-    [ -f $HOME/.profile ] && . $HOME/.profile
-    ;;
-esac
+# Import the login environment for some shells by starting them as login shell
+# and executing this script. Inside, SDDM_XSESSION_PROFILE_READ will be set and
+# it continues below.
+if [ -z "$SDDM_XSESSION_PROFILE_READ" ]; then
+  export SDDM_XSESSION_PROFILE_READ=1
+
+  case $SHELL in
+    */bash|*/zsh)
+      exec $SHELL --login -c 'exec "$@"' - $0 "$@"
+      ;;
+    */csh|*/tcsh)
+      exec $SHELL -c 'if (-f /etc/csh.login) source /etc/csh.login; if (-f 
~/.login) source ~/.login; exec $argv' $0 "$@"
+      ;;
+    */fish)
+      [ -f /etc/profile ] && . /etc/profile
+      [ -f $HOME/.profile ] && . $HOME/.profile
+      exec $SHELL --login -c 'exec $argv' $0 "$@"
+      ;;
+    *) # Plain sh, ksh, and anything we do not know.
+      [ -f /etc/profile ] && . /etc/profile
+      [ -f $HOME/.profile ] && . $HOME/.profile
+      exec $0 "$@"
+      ;;
+  esac
+
+  exit 1
+fi
+unset SDDM_XSESSION_PROFILE_READ
 
 [ -f /etc/xprofile ] && . /etc/xprofile
 [ -f /usr/local/etc/xprofile ] && . /usr/local/etc/xprofile
@@ -89,6 +84,10 @@ fi
 
 if [ -z "$*" ]; then
     exec xmessage -center -buttons OK:0 -default OK "Sorry, $DESKTOP_SESSION 
is no valid session."
-else
-    exec $@
+    exit 1
 fi
+
+# Note: This script is called with the whole session commandline as a single 
first argument.
+# To run it properly, word splitting has to be performed by the shell, i.e. $@ 
or $0 without quotes.
+exec $@
+exit 1
diff --git a/data/scripts/wayland-session b/data/scripts/wayland-session
index bbeb7ce..3ed44b0 100755
--- a/data/scripts/wayland-session
+++ b/data/scripts/wayland-session
@@ -5,45 +5,28 @@
 # This file is extracted from kde-workspace (kdm/kfrontend/genkdmconf.c)
 # Copyright (C) 2001-2005 Oswald Buddenhagen <o...@kde.org>
 
-# Note that the respective logout scripts are not sourced.
+# Note: This script is called with the whole session commandline as a single 
first argument.
+# To run it properly, word splitting has to be performed by the shell, i.e. $@ 
or $0 without quotes.
 
-# Backup the user shell setting into SDDM specific variable
-SDDM_USER_SHELL=$SHELL
+# Note that the respective logout scripts are not sourced.
 
 case $SHELL in
-  */bash)
-    [ -z "$BASH" ] && exec $SHELL --login $0 "$@"
-    shopt -q login_shell || exec $SHELL --login $0 "$@"
-    set +o posix
-    ;;
-  */zsh)
-    [ -z "$ZSH_NAME" ] && exec $SHELL --login $0 "$@"
-    [[ -o login ]] || exec $SHELL --login $0 "$@"
-    emulate -R sh
+  */bash|*/zsh)
+    exec $SHELL --login -c 'exec "$@"' - $@
     ;;
   */csh|*/tcsh)
-    # [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
+    exec $SHELL -c 'if (-f /etc/csh.login) source /etc/csh.login; if (-f 
~/.login) source ~/.login; exec $argv' $@
     ;;
   */fish)
     [ -f /etc/profile ] && . /etc/profile
     [ -f $HOME/.profile ] && . $HOME/.profile
-    xsess_tmp=`mktemp /tmp/xsess-env-XXXXXX`
-    $SHELL --login -c "/bin/sh -c 'export -p' > $xsess_tmp"
-    . $xsess_tmp
-    rm -f $xsess_tmp
+    exec $SHELL --login -c 'exec $argv' $@
     ;;
   *) # Plain sh, ksh, and anything we do not know.
     [ -f /etc/profile ] && . /etc/profile
     [ -f $HOME/.profile ] && . $HOME/.profile
+    exec $@
     ;;
 esac
 
-# Restore user shell setting that may have been clobbered by setting 
environment
-export SHELL=$SDDM_USER_SHELL
-
-exec $@
+exit 1
-- 
2.44.0


++++++ 0001-Use-xrdb-to-set-Xcursor.theme.patch ++++++
>From 1e8920dc85f9c80950c41ecb9923024264cc243d Mon Sep 17 00:00:00 2001
From: Fabian Vogt <fab...@ritter-vogt.de>
Date: Thu, 4 Apr 2024 21:47:23 +0200
Subject: [PATCH] Use xrdb to set Xcursor.theme

XCURSOR_THEME is no longer enough.
---
 src/daemon/XorgDisplayServer.cpp | 17 +++++++++++++++--
 src/helper/xorguserhelper.cpp    | 13 +++++++++++++
 2 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/src/daemon/XorgDisplayServer.cpp b/src/daemon/XorgDisplayServer.cpp
index 5101cfb..2249ac2 100644
--- a/src/daemon/XorgDisplayServer.cpp
+++ b/src/daemon/XorgDisplayServer.cpp
@@ -261,6 +261,9 @@ namespace SDDM {
         // create display setup script process
         QProcess *displayScript = new QProcess();
 
+        const QString xcursorTheme = mainConfig.Theme.CursorTheme.get(),
+                      xcursorSize = mainConfig.Theme.CursorSize.get();
+
         // set process environment
         QProcessEnvironment env;
         env.insert(QStringLiteral("DISPLAY"), m_display);
@@ -268,8 +271,8 @@ namespace SDDM {
         env.insert(QStringLiteral("PATH"), mainConfig.Users.DefaultPath.get());
         env.insert(QStringLiteral("XAUTHORITY"), m_xauth.authPath());
         env.insert(QStringLiteral("SHELL"), QStringLiteral("/bin/sh"));
-        env.insert(QStringLiteral("XCURSOR_THEME"), 
mainConfig.Theme.CursorTheme.get());
-        QString xcursorSize = mainConfig.Theme.CursorSize.get();
+        if (!xcursorTheme.isEmpty())
+            env.insert(QStringLiteral("XCURSOR_THEME"), xcursorTheme);
         if (!xcursorSize.isEmpty())
             env.insert(QStringLiteral("XCURSOR_SIZE"), xcursorSize);
         setCursor->setProcessEnvironment(env);
@@ -287,6 +290,16 @@ namespace SDDM {
             setCursor->kill();
         }
 
+        // Unlike libXcursor, xcb-util-cursor no longer looks at 
XCURSOR_THEME. Set the resource.
+        if (!xcursorTheme.isEmpty()) {
+            QProcess xrdbProcess;
+            xrdbProcess.setProcessEnvironment(env);
+            xrdbProcess.start(QStringLiteral("xrdb"), 
QStringList{QStringLiteral("-nocpp"), QStringLiteral("-merge")});
+            xrdbProcess.write(QStringLiteral("Xcursor.theme: 
%1").arg(xcursorTheme).toUtf8());
+            xrdbProcess.closeWriteChannel();
+            xrdbProcess.waitForFinished(1000);
+        }
+
         // start display setup script
         qDebug() << "Running display setup script " << 
mainConfig.X11.DisplayCommand.get();
         QStringList displayCommand = 
QProcess::splitCommand(mainConfig.X11.DisplayCommand.get());
diff --git a/src/helper/xorguserhelper.cpp b/src/helper/xorguserhelper.cpp
index 3f564a2..1d8213e 100644
--- a/src/helper/xorguserhelper.cpp
+++ b/src/helper/xorguserhelper.cpp
@@ -200,9 +200,12 @@ bool XOrgUserHelper::startServer(const QString &cmd)
 
 void XOrgUserHelper::startDisplayCommand()
 {
+    const QString xcursorTheme = mainConfig.Theme.CursorTheme.get();
+
     auto env = QProcessEnvironment::systemEnvironment();
     env.insert(QStringLiteral("DISPLAY"), m_display);
     env.insert(QStringLiteral("XAUTHORITY"), m_xauth.authPath());
+    env.insert(QStringLiteral("XCURSOR_THEME"), xcursorTheme);
 
     // Set cursor
     qInfo("Setting default cursor...");
@@ -215,6 +218,16 @@ void XOrgUserHelper::startDisplayCommand()
         setCursor->deleteLater();
     }
 
+    // Unlike libXcursor, xcb-util-cursor no longer looks at XCURSOR_THEME. 
Set the resource.
+    if (!xcursorTheme.isEmpty()) {
+        QProcess xrdbProcess;
+        xrdbProcess.setProcessEnvironment(env);
+        xrdbProcess.start(QStringLiteral("xrdb"), 
QStringList{QStringLiteral("-nocpp"), QStringLiteral("-merge")});
+        xrdbProcess.write(QStringLiteral("Xcursor.theme: 
%1").arg(xcursorTheme).toUtf8());
+        xrdbProcess.closeWriteChannel();
+        xrdbProcess.waitForFinished(1000);
+    }
+
     // Display setup script
     auto cmd = mainConfig.X11.DisplayCommand.get();
     qInfo("Running display setup script: %s", qPrintable(cmd));
-- 
2.44.0

Reply via email to