From f86cc42e02c9e1bf5559616618c194af323da4a6 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Fri, 5 Jan 2024 17:41:28 +0100 Subject: [PATCH] added upstream patch to fix autologin sessions being start with wrong type (e.g. wayland with plasma-X11) pam/sddm-autologin: fix arguments passed to pam_faillock.so [release 0.19.0-3mamba;Fri Apr 01 2022] --- sddm-0.19.0-fix-build.patch | 13 ++++++++ ...arted-as-the-wrong-type-on-autologin.patch | 31 +++++++++++++++++++ sddm-0.19.0-openmamba-pam.patch | 2 +- sddm.spec | 10 +++++- 4 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 sddm-0.19.0-fix-build.patch create mode 100644 sddm-0.19.0-fix-sessions-being-started-as-the-wrong-type-on-autologin.patch diff --git a/sddm-0.19.0-fix-build.patch b/sddm-0.19.0-fix-build.patch new file mode 100644 index 0000000..8e6cde8 --- /dev/null +++ b/sddm-0.19.0-fix-build.patch @@ -0,0 +1,13 @@ +diff --git a/src/daemon/XorgDisplayServer.cpp b/src/daemon/XorgDisplayServer.cpp +index 5f93a1b..d5f29a9 100644 +--- a/src/daemon/XorgDisplayServer.cpp ++++ b/src/daemon/XorgDisplayServer.cpp +@@ -65,7 +65,7 @@ namespace SDDM { + // create a random hexadecimal number + const char *digits = "0123456789abcdef"; + for (int i = 0; i < 32; ++i) +- m_cookie[i] = digits[dis(gen)]; ++ m_cookie[i] = QLatin1Char(digits[dis(gen)]); + } + + XorgDisplayServer::~XorgDisplayServer() { diff --git a/sddm-0.19.0-fix-sessions-being-started-as-the-wrong-type-on-autologin.patch b/sddm-0.19.0-fix-sessions-being-started-as-the-wrong-type-on-autologin.patch new file mode 100644 index 0000000..8d5a6f3 --- /dev/null +++ b/sddm-0.19.0-fix-sessions-being-started-as-the-wrong-type-on-autologin.patch @@ -0,0 +1,31 @@ +From e81dfcd6913c4fbd1801597168291b1e396633d8 Mon Sep 17 00:00:00 2001 +From: Fabian Vogt +Date: Wed, 6 Jan 2021 16:00:34 +0100 +Subject: [PATCH] Fix sessions being started as the wrong type on autologin + +For autologin, the last session is used, which contains a full path. +Display::findSessionEntry didn't handle that correctly, which led to +X11 sessions getting started as Wayland ones (or the other way around +before 994fa67). + +Fixes #1348 +--- + src/daemon/Display.cpp | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/src/daemon/Display.cpp b/src/daemon/Display.cpp +index b95f6e51..9f1fabc6 100644 +--- a/src/daemon/Display.cpp ++++ b/src/daemon/Display.cpp +@@ -245,6 +245,11 @@ namespace SDDM { + } + + bool Display::findSessionEntry(const QDir &dir, const QString &name) const { ++ // Given an absolute path: Check that it matches dir ++ const QFileInfo fileInfo(name); ++ if (fileInfo.isAbsolute() && fileInfo.absolutePath() != dir.absolutePath()) ++ return false; ++ + QString fileName = name; + + // append extension diff --git a/sddm-0.19.0-openmamba-pam.patch b/sddm-0.19.0-openmamba-pam.patch index 07d96c3..b065dab 100644 --- a/sddm-0.19.0-openmamba-pam.patch +++ b/sddm-0.19.0-openmamba-pam.patch @@ -29,7 +29,7 @@ diff -ru sddm-0.18.1.orig/services/sddm.pam sddm-0.18.1/services/sddm.pam auth required pam_env.so -auth required pam_tally2.so file=/var/log/tallylog onerr=succeed +auth required pam_group.so -+auth required pam_faillock.so file=/var/log/tallylog onerr=succeed ++auth required pam_faillock.so preauth auth required pam_shells.so auth required pam_nologin.so auth required pam_permit.so diff --git a/sddm.spec b/sddm.spec index 7a06a61..1a47015 100644 --- a/sddm.spec +++ b/sddm.spec @@ -3,7 +3,7 @@ Name: sddm Epoch: 1 Version: 0.19.0 -Release: 2mamba +Release: 3mamba Summary: QML based X11 and Wayland display manager Group: Graphical Desktop/Applications/Environment Vendor: openmamba @@ -19,6 +19,8 @@ Patch3: sddm-0.19.0-fix-xorg-autologin.patch Patch4: sddm-0.19.0-upstream-Merge_normal_and_testing_paths_in_XorgDisplayServer__start.patch Patch5: sddm-0.19.0-upstream-retry-starting-the-xserver.patch Patch6: sddm-0.19.0-upstream-only_use_the_basename_for_desktop_session.patch +Patch7: sddm-0.19.0-fix-sessions-being-started-as-the-wrong-type-on-autologin.patch +Patch8: sddm-0.19.0-fix-build.patch License: GPL ## AUTOBUILDREQ-BEGIN BuildRequires: glibc-devel @@ -46,6 +48,8 @@ QML based X11 and Wayland display manager. %patch4 -p1 %patch5 -p1 %patch6 -p1 +%patch7 -p1 -b .fix-sessions-being-started-as-the-wrong-type-on-autologin +%patch8 -p1 -b .fix-build %build %cmake -d build @@ -141,6 +145,10 @@ fi %doc LICENSE %changelog +* Fri Apr 01 2022 Silvan Calarco 0.19.0-3mamba +- added upstream patch to fix autologin sessions being start with wrong type (e.g. wayland with plasma-X11) +- pam/sddm-autologin: fix arguments passed to pam_faillock.so + * Fri Dec 03 2021 Silvan Calarco 0.19.0-2mamba - revert to stable version (bump epoch); remove obsolete requirement for haveged