diff --git a/1522.patch b/1522.patch new file mode 100644 index 0000000..403ac1a --- /dev/null +++ b/1522.patch @@ -0,0 +1,108 @@ +From a5354bf59fd96b613953885064bf5ffb1b9d1336 Mon Sep 17 00:00:00 2001 +From: Aleix Pol +Date: Tue, 1 Mar 2022 04:31:09 +0100 +Subject: [PATCH 1/3] Terminate wayland sessions + +--- + src/helper/waylandhelper.cpp | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/src/helper/waylandhelper.cpp b/src/helper/waylandhelper.cpp +index 64640d83..83dfbc42 100644 +--- a/src/helper/waylandhelper.cpp ++++ b/src/helper/waylandhelper.cpp +@@ -57,7 +57,7 @@ bool WaylandHelper::startCompositor(const QString &cmd) + + void stopProcess(QProcess *process) + { +- if (process) { ++ if (process && process->state() != QProcess::NotRunning) { + qInfo() << "Stopping..." << process->program(); + process->terminate(); + if (!process->waitForFinished(5000)) +@@ -124,7 +124,11 @@ void WaylandHelper::startGreeter(const QString &cmd) + connect(m_greeterProcess, &QProcess::readyReadStandardOutput, this, [this] { + qInfo() << m_greeterProcess->readAllStandardOutput(); + }); +- ++ connect(m_greeterProcess, QOverload::of(&QProcess::finished), ++ m_greeterProcess, [](int exitCode, QProcess::ExitStatus exitStatus) { ++ qDebug() << "wayland greeter finished" << exitCode << exitStatus; ++ QCoreApplication::instance()->quit(); ++ }); + if (m_watcher->status() == WaylandSocketWatcher::Started) { + m_greeterProcess->start(); + } else if (m_watcher->status() == WaylandSocketWatcher::Failed) { + +From acfd780c25753cf785377353297ed2d35046a886 Mon Sep 17 00:00:00 2001 +From: Aleix Pol +Date: Wed, 2 Mar 2022 01:57:43 +0100 +Subject: [PATCH 2/3] Revert "HelperApp: Ensure the session gets terminated + together with the helper app" + +This reverts commit e66b03bfaaa412c7716ad5f3a57bfdef181f3dc5. +--- + src/helper/HelperApp.cpp | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/src/helper/HelperApp.cpp b/src/helper/HelperApp.cpp +index a05d7ed1..3eac6178 100644 +--- a/src/helper/HelperApp.cpp ++++ b/src/helper/HelperApp.cpp +@@ -53,8 +53,7 @@ namespace SDDM { + , m_socket(new QLocalSocket(this)) { + qInstallMessageHandler(HelperMessageHandler); + SignalHandler *s = new SignalHandler(this); +- QObject::connect(s, &SignalHandler::sigtermReceived, m_session, [this] { +- m_session->stop(); ++ QObject::connect(s, &SignalHandler::sigtermReceived, m_session, [] { + QCoreApplication::instance()->exit(-1); + }); + + +From c5932ec5b67a768e8bef6e32043324041fbeb80b Mon Sep 17 00:00:00 2001 +From: Aleix Pol +Date: Tue, 1 Mar 2022 03:53:26 +0100 +Subject: [PATCH 3/3] VirtualTerminal: Only offer v_active when it's not in use + by others + +--- + src/common/VirtualTerminal.cpp | 19 ++++++++++++++----- + 1 file changed, 14 insertions(+), 5 deletions(-) + +diff --git a/src/common/VirtualTerminal.cpp b/src/common/VirtualTerminal.cpp +index 386bfdc4..e9c8784c 100644 +--- a/src/common/VirtualTerminal.cpp ++++ b/src/common/VirtualTerminal.cpp +@@ -127,17 +127,26 @@ namespace SDDM { + close(fd); + }); + +- vt_stat vtState = { 0 }; +- if (ioctl(fd, VT_GETSTATE, &vtState) < 0) { +- qCritical() << "Failed to get current VT:" << strerror(errno); +- ++ auto requestNewVt = [] (int fd) { + int vt = 0; +- // If there's no current tty, request the next to open + if (ioctl(fd, VT_OPENQRY, &vt) < 0) { + qCritical() << "Failed to open new VT:" << strerror(errno); + return -1; + } + return vt; ++ }; ++ ++ vt_stat vtState = { 0 }; ++ if (ioctl(fd, VT_GETSTATE, &vtState) < 0) { ++ qCritical() << "Failed to get current VT:" << strerror(errno); ++ ++ // If there's no current tty, request the next to open ++ return requestNewVt(fd); ++ } ++ ++ // If the active vt is already taken, find a new one ++ if (1 << vtState.v_active & vtState.v_state) { ++ return requestNewVt(fd); + } + return vtState.v_active; + } diff --git a/sddm.spec b/sddm.spec index 405216a..bf67332 100644 --- a/sddm.spec +++ b/sddm.spec @@ -20,7 +20,7 @@ Name: sddm Version: 0.19.0%{?commitdate:^git%{commitdate}.%{shortcommit}} -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ Summary: QML based desktop and login manager @@ -48,6 +48,11 @@ Patch10: sddm-0.20.0-allow-hiding-wayland-sessions.patch # Submmited: https://github.com/sddm/sddm/pull/1494 Patch11: 0001-Delay-for-logind-and-fallback-to-seat0.patch +# https://github.com/sddm/sddm/pull/1522 +# Attempts to SDDM 'crash' preventing logins after the first: +# https://bugzilla.redhat.com/show_bug.cgi?id=2057419 +Patch12: 1522.patch + ## downstream patches Patch101: sddm-0.20.0-fedora_config.patch @@ -299,6 +304,9 @@ fi %changelog +* Mon Feb 28 2022 Adam Williamson - 0.19.0^git20220228.c257a40-2 +- Backport PR#1522 to try and fix crash after login (#2057419) + * Mon Feb 28 2022 Neal Gompa - 0.19.0^git20220228.c257a40-1 - Update to new snapshot - Drop merged proposed patch to not ignore EINTR when activating