From 116bfcbf7102c199110c0160ead1d55f365bcc3a Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Tue, 10 Nov 2020 16:46:41 -0500 Subject: [PATCH] Rebase to version 0.19.0 - Refresh patch set and drop upstreamed patches --- .gitignore | 1 + 0001-Port-from-xauth-to-libXau.patch | 298 --------- 0001-Redesign-Xauth-handling.patch | 619 ++++++++++++++++++ 0001-Remove-suffix-for-Wayland-session.patch | 44 ++ 1305.patch | 87 --- 735.patch | 66 -- ...g.patch => sddm-0.19.0-fedora_config.patch | 18 +- sddm.spec | 45 +- sources | 4 +- 9 files changed, 690 insertions(+), 492 deletions(-) delete mode 100644 0001-Port-from-xauth-to-libXau.patch create mode 100644 0001-Redesign-Xauth-handling.patch create mode 100644 0001-Remove-suffix-for-Wayland-session.patch delete mode 100644 1305.patch delete mode 100644 735.patch rename sddm-0.17.0-fedora_config.patch => sddm-0.19.0-fedora_config.patch (79%) diff --git a/.gitignore b/.gitignore index 8419291..9b09f88 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ /v0.18.1.tar.gz /0035-Prevent-duplicate-session-name.patch /0037-Fix-build.patch +/sddm-0.19.0.tar.gz diff --git a/0001-Port-from-xauth-to-libXau.patch b/0001-Port-from-xauth-to-libXau.patch deleted file mode 100644 index e648b41..0000000 --- a/0001-Port-from-xauth-to-libXau.patch +++ /dev/null @@ -1,298 +0,0 @@ -From c450793f314547eb3573d3a3dc8c75aef82c19bf Mon Sep 17 00:00:00 2001 -From: Rex Dieter -Date: Wed, 18 Jul 2018 13:41:29 -0500 -Subject: [PATCH] Port from xauth to libXau - -Rebase -https://github.com/sddm/sddm/pull/863 - -As part of an effort to support -https://github.com/sddm/sddm/issues/733 -and make sddm more resilient to hostname changes ---- - CMakeLists.txt | 3 ++ - cmake/FindXAU.cmake | 54 ++++++++++++++++++++++++++++ - src/daemon/CMakeLists.txt | 4 ++- - src/daemon/XorgDisplayServer.cpp | 62 ++++++++++++++++++++++++-------- - src/helper/CMakeLists.txt | 2 +- - src/helper/UserSession.cpp | 55 +++++++++++++++++++++------- - 6 files changed, 150 insertions(+), 30 deletions(-) - create mode 100644 cmake/FindXAU.cmake - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 8500c65..4e62a4d 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -94,6 +94,9 @@ find_package(XCB REQUIRED) - # XKB - find_package(XKB REQUIRED) - -+# XAU -+find_package(XAU REQUIRED) -+ - # Qt 5 - find_package(Qt5 5.8.0 CONFIG REQUIRED Core DBus Gui Qml Quick LinguistTools Test) - -diff --git a/cmake/FindXAU.cmake b/cmake/FindXAU.cmake -new file mode 100644 -index 0000000..03cafb7 ---- /dev/null -+++ b/cmake/FindXAU.cmake -@@ -0,0 +1,54 @@ -+# - Try to find libXau -+# Once done this will define -+# -+# LIBXAU_FOUND - system has libXau -+# LIBXAU_LIBRARIES - Link these to use libXau -+# LIBXAU_INCLUDE_DIR - the libXau include dir -+# LIBXAU_DEFINITIONS - compiler switches required for using libXau -+ -+# Copyright (c) 2008 Helio Chissini de Castro, -+# Copyright (c) 2007, Matthias Kretz, -+# -+# Redistribution and use in source and binary forms, with or without -+# modification, are permitted provided that the following conditions -+# are met: -+# -+# 1. Redistributions of source code must retain the copyright -+# notice, this list of conditions and the following disclaimer. -+# 2. Redistributions in binary form must reproduce the copyright -+# notice, this list of conditions and the following disclaimer in the -+# documentation and/or other materials provided with the distribution. -+# 3. The name of the author may not be used to endorse or promote products -+# derived from this software without specific prior written permission. -+# -+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -+ -+ -+IF (NOT WIN32) -+ IF (LIBXAU_INCLUDE_DIR AND LIBXAU_LIBRARIES) -+ # in cache already -+ SET(XAU_FIND_QUIETLY TRUE) -+ ENDIF (LIBXAU_INCLUDE_DIR AND LIBXAU_LIBRARIES) -+ -+ FIND_PACKAGE(PkgConfig) -+ PKG_CHECK_MODULES(PKG_XAU xau) -+ -+ SET(LIBXAU_DEFINITIONS ${PKG_XAU_CFLAGS}) -+ -+ FIND_PATH(LIBXAU_INCLUDE_DIR XAuth.h ${PKG_XAU_INCLUDE_DIR}) -+ FIND_LIBRARY(LIBXAU_LIBRARIES NAMES Xau libXau PATHS ${PKG_XAU_LIBRARY_DIRS}) -+ -+ include(FindPackageHandleStandardArgs) -+ FIND_PACKAGE_HANDLE_STANDARD_ARGS(XAU DEFAULT_MSG LIBXAU_LIBRARIES) -+ -+ MARK_AS_ADVANCED(LIBXAU_INCLUDE_DIR LIBXAU_LIBRARIES) -+ENDIF (NOT WIN32) -diff --git a/src/daemon/CMakeLists.txt b/src/daemon/CMakeLists.txt -index 5d767c8..befc13d 100644 ---- a/src/daemon/CMakeLists.txt -+++ b/src/daemon/CMakeLists.txt -@@ -57,7 +57,9 @@ target_link_libraries(sddm - Qt5::DBus - Qt5::Network - Qt5::Qml -- ${LIBXCB_LIBRARIES}) -+ ${LIBXCB_LIBRARIES} -+ ${LIBXAU_LIBRARIES} -+) - if(PAM_FOUND) - target_link_libraries(sddm ${PAM_LIBRARIES}) - else() -diff --git a/src/daemon/XorgDisplayServer.cpp b/src/daemon/XorgDisplayServer.cpp -index 28ce524..13faf03 100644 ---- a/src/daemon/XorgDisplayServer.cpp -+++ b/src/daemon/XorgDisplayServer.cpp -@@ -34,6 +34,7 @@ - #include - - #include -+#include - - #include - #include -@@ -88,28 +89,59 @@ namespace SDDM { - } - - void XorgDisplayServer::addCookie(const QString &file) { -- // log message -+ Xauth auth = { 0 }; -+ char localhost[HOST_NAME_MAX + 1] = { 0 }; -+ - qDebug() << "Adding cookie to" << file; - -- // Touch file -- QFile file_handler(file); -- file_handler.open(QIODevice::Append); -- file_handler.close(); -+ if (gethostname(localhost, HOST_NAME_MAX) < 0) { -+ strcpy(localhost, "localhost"); -+ } - -- QString cmd = QStringLiteral("%1 -f %2 -q").arg(mainConfig.X11.XauthPath.get()).arg(file); -+ // libXau expects binary data, not a string -+ QByteArray cookieBinary = QByteArray::fromHex(m_cookie.toLatin1()); -+ -+ // set up the auth entry -+ char cookieName[] = "MIT-MAGIC-COOKIE-1"; -+ char displayNumber[m_display.size() + 1] = { 0 }; -+ strcpy(displayNumber, qPrintable(m_display.mid(1))); // Need to skip the ':' -+ auth.family = FamilyLocal; -+ auth.address = localhost; -+ auth.address_length = strlen(auth.address); -+ auth.number = displayNumber; -+ auth.number_length = strlen(auth.number); -+ auth.name = cookieName; -+ auth.name_length = strlen(cookieName); -+ auth.data_length = cookieBinary.count(); -+ auth.data = cookieBinary.data(); -+ -+ // create the path -+ QFileInfo finfo(file); -+ QDir().mkpath(finfo.absolutePath()); -+ -+ // open the file -+ FILE *fp = fopen(qPrintable(file), "w"); -+ if (!fp) { -+ qWarning() << "Opening the Xauthority file at" << file << "failed"; -+ return; -+ } - -- // execute xauth -- FILE *fp = popen(qPrintable(cmd), "w"); -+ // write the Xauth data -+ if (!XauWriteAuth (fp, &auth) || fflush (fp) == EOF) { -+ qWarning() << "Writing the FamilyLocal information to" << file << "failed"; -+ fclose(fp); -+ return; -+ } - -- // check file -- if (!fp) -+ auth.family = FamilyWild; -+ -+ if (!XauWriteAuth (fp, &auth) || fflush (fp) == EOF) { -+ qWarning() << "Writing the FamilyWild information to" << file << "failed"; -+ fclose(fp); - return; -- fprintf(fp, "remove %s\n", qPrintable(m_display)); -- fprintf(fp, "add %s . %s\n", qPrintable(m_display), qPrintable(m_cookie)); -- fprintf(fp, "exit\n"); -+ } - -- // close pipe -- pclose(fp); -+ fclose(fp); - } - - bool XorgDisplayServer::start() { -diff --git a/src/helper/CMakeLists.txt b/src/helper/CMakeLists.txt -index ebf4a6e..51d47ef 100644 ---- a/src/helper/CMakeLists.txt -+++ b/src/helper/CMakeLists.txt -@@ -31,7 +31,7 @@ else() - endif() - - add_executable(sddm-helper ${HELPER_SOURCES}) --target_link_libraries(sddm-helper Qt5::Network Qt5::DBus Qt5::Qml) -+target_link_libraries(sddm-helper Qt5::Network Qt5::DBus Qt5::Qml ${LIBXAU_LIBRARIES}) - if(PAM_FOUND) - target_link_libraries(sddm-helper ${PAM_LIBRARIES}) - else() -diff --git a/src/helper/UserSession.cpp b/src/helper/UserSession.cpp -index d4fd2cf..d597935 100644 ---- a/src/helper/UserSession.cpp -+++ b/src/helper/UserSession.cpp -@@ -34,6 +34,9 @@ - #include - #include - -+#include -+ -+ - namespace SDDM { - UserSession::UserSession(HelperApp *parent) - : QProcess(parent) { -@@ -270,31 +273,57 @@ namespace SDDM { - if (!cookie.isEmpty()) { - QString file = processEnvironment().value(QStringLiteral("XAUTHORITY")); - QString display = processEnvironment().value(QStringLiteral("DISPLAY")); -+ Xauth auth = { 0 }; -+ char localhost[HOST_NAME_MAX + 1] = { 0 }; -+ - qDebug() << "Adding cookie to" << file; - -+ if (gethostname(localhost, HOST_NAME_MAX) < 0) { -+ strcpy(localhost, "localhost"); -+ } -+ -+ // libXau expects binary data, not a string -+ QByteArray cookieBinary = QByteArray::fromHex(cookie.toLatin1()); -+ -+ // set up the auth entry -+ char cookieName[] = "MIT-MAGIC-COOKIE-1"; -+ char displayNumber[display.size() + 1] = { 0 }; -+ strcpy(displayNumber, qPrintable(display.mid(1))); // Need to skip the ':' -+ auth.family = FamilyLocal; -+ auth.address = localhost; -+ auth.address_length = strlen(auth.address); -+ auth.number = displayNumber; -+ auth.number_length = strlen(auth.number); -+ auth.name = cookieName; -+ auth.name_length = strlen(cookieName); -+ auth.data_length = cookieBinary.count(); -+ auth.data = cookieBinary.data(); - - // create the path - QFileInfo finfo(file); - QDir().mkpath(finfo.absolutePath()); - -- QFile file_handler(file); -- file_handler.open(QIODevice::Append); -- file_handler.close(); -+ // open the file -+ FILE *fp = fopen(qPrintable(file), "w"); -+ if (!fp) -+ qWarning() << "Opening the Xauthority file at" << file << "failed"; - -- QString cmd = QStringLiteral("%1 -f %2 -q").arg(mainConfig.X11.XauthPath.get()).arg(file); -+ // write the Xauth data -+ if (!XauWriteAuth (fp, &auth) || fflush (fp) == EOF) { -+ qCritical() << "Writing the FamilyLocal information to" << file << "failed"; -+ fclose(fp); -+ return; -+ } - -- // execute xauth -- FILE *fp = popen(qPrintable(cmd), "w"); -+ auth.family = FamilyWild; - -- // check file -- if (!fp) -+ if (!XauWriteAuth (fp, &auth) || fflush (fp) == EOF) { -+ qCritical() << "Writing the FamilyWild information to" << file << "failed"; -+ fclose(fp); - return; -- fprintf(fp, "remove %s\n", qPrintable(display)); -- fprintf(fp, "add %s . %s\n", qPrintable(display), qPrintable(cookie)); -- fprintf(fp, "exit\n"); -+ } - -- // close pipe -- pclose(fp); -+ fclose(fp); - } - } - --- -2.17.1 - diff --git a/0001-Redesign-Xauth-handling.patch b/0001-Redesign-Xauth-handling.patch new file mode 100644 index 0000000..088e736 --- /dev/null +++ b/0001-Redesign-Xauth-handling.patch @@ -0,0 +1,619 @@ +From fbdf20d59d1c63cd2b8fd78efb3125478a2ea07c Mon Sep 17 00:00:00 2001 +From: Fabian Vogt +Date: Wed, 21 Aug 2019 16:32:03 +0200 +Subject: [PATCH] Redesign Xauth handling + +This commit moves Xauthority handling over to libXau. +Advantage is that this allows use of FamilyWild, is faster, more reliable +and easier to read. However, we lose the ability to merge the new cookie into +an existing Xauthority file, so support for using a non-temporary file is +dropped. Even if merging was implemented manually, use of FamilyWild would +"infect" such a file and break it for DMs which don't write it. + +Unfortunately, a hack in UserSession is required to get XAUTHORITY into +the process environment. The Xauthority file has to be created as the target +user, but that's only possible in setupChildProcess(). In there, changes to +processEnvironment() to set XAUTHORITY to the generated path are not effective, +so configure the process to inherit the environment instead and use qputenv. +--- + CMakeLists.txt | 3 ++ + data/man/sddm.conf.rst.in | 8 ---- + src/auth/Auth.cpp | 6 +-- + src/auth/Auth.h | 6 +-- + src/common/Configuration.h | 2 - + src/common/XauthUtils.cpp | 82 ++++++++++++++++++++++++++++++++ + src/common/XauthUtils.h | 16 +++++++ + src/daemon/CMakeLists.txt | 3 ++ + src/daemon/XorgDisplayServer.cpp | 45 ++---------------- + src/daemon/XorgDisplayServer.h | 4 +- + src/helper/Backend.cpp | 7 --- + src/helper/CMakeLists.txt | 8 +++- + src/helper/HelperApp.cpp | 4 +- + src/helper/HelperApp.h | 4 +- + src/helper/UserSession.cpp | 53 +++++++++++---------- + src/helper/UserSession.h | 9 ++++ + 16 files changed, 165 insertions(+), 95 deletions(-) + create mode 100644 src/common/XauthUtils.cpp + create mode 100644 src/common/XauthUtils.h + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e52e0e9..fc3f2ce 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -88,6 +88,9 @@ add_feature_info("PAM" PAM_FOUND "PAM support") + include(CheckFunctionExists) + check_function_exists(getspnam HAVE_GETSPNAM) + ++# XAU ++pkg_check_modules(LIBXAU REQUIRED "xau") ++ + # XCB + find_package(XCB REQUIRED) + +diff --git a/data/man/sddm.conf.rst.in b/data/man/sddm.conf.rst.in +index bee0768..e91280a 100644 +--- a/data/man/sddm.conf.rst.in ++++ b/data/man/sddm.conf.rst.in +@@ -110,10 +110,6 @@ OPTIONS + Path of the Xephyr. + Default value is "/usr/bin/Xephyr". + +-`XauthPath=` +- Path of the Xauth. +- Default value is "/usr/bin/xauth". +- + `SessionDir=` + Path of the directory containing session files. + Default value is "/usr/share/xsessions". +@@ -128,10 +124,6 @@ OPTIONS + Path to the user session log file, relative to the home directory. + Default value is ".local/share/sddm/xorg-session.log". + +-`UserAuthFile=` +- Path to the Xauthority file, relative to the home directory. +- Default value is ".Xauthority". +- + `DisplayCommand=` + Path of script to execute when starting the display server. + Default value is "@DATA_INSTALL_DIR@/scripts/Xsetup". +diff --git a/src/auth/Auth.cpp b/src/auth/Auth.cpp +index caca314..c2228ae 100644 +--- a/src/auth/Auth.cpp ++++ b/src/auth/Auth.cpp +@@ -64,7 +64,7 @@ namespace SDDM { + QLocalSocket *socket { nullptr }; + QString sessionPath { }; + QString user { }; +- QString cookie { }; ++ QByteArray cookie { }; + bool autologin { false }; + bool greeter { false }; + QProcessEnvironment environment { }; +@@ -266,7 +266,7 @@ namespace SDDM { + return d->greeter; + } + +- const QString& Auth::cookie() const { ++ const QByteArray& Auth::cookie() const { + return d->cookie; + } + +@@ -298,7 +298,7 @@ namespace SDDM { + d->environment.insert(key, value); + } + +- void Auth::setCookie(const QString& cookie) { ++ void Auth::setCookie(const QByteArray& cookie) { + if (cookie != d->cookie) { + d->cookie = cookie; + Q_EMIT cookieChanged(); +diff --git a/src/auth/Auth.h b/src/auth/Auth.h +index 87f5f44..38d63fc 100644 +--- a/src/auth/Auth.h ++++ b/src/auth/Auth.h +@@ -54,7 +54,7 @@ namespace SDDM { + Q_PROPERTY(bool autologin READ autologin WRITE setAutologin NOTIFY autologinChanged) + Q_PROPERTY(bool greeter READ isGreeter WRITE setGreeter NOTIFY greeterChanged) + Q_PROPERTY(bool verbose READ verbose WRITE setVerbose NOTIFY verboseChanged) +- Q_PROPERTY(QString cookie READ cookie WRITE setCookie NOTIFY cookieChanged) ++ Q_PROPERTY(QByteArray cookie READ cookie WRITE setCookie NOTIFY cookieChanged) + Q_PROPERTY(QString user READ user WRITE setUser NOTIFY userChanged) + Q_PROPERTY(QString session READ session WRITE setSession NOTIFY sessionChanged) + Q_PROPERTY(AuthRequest* request READ request NOTIFY requestChanged) +@@ -90,7 +90,7 @@ namespace SDDM { + bool autologin() const; + bool isGreeter() const; + bool verbose() const; +- const QString &cookie() const; ++ const QByteArray &cookie() const; + const QString &user() const; + const QString &session() const; + AuthRequest *request(); +@@ -149,7 +149,7 @@ namespace SDDM { + * Set the display server cookie, to be inserted into the user's $XAUTHORITY + * @param cookie cookie data + */ +- void setCookie(const QString &cookie); ++ void setCookie(const QByteArray &cookie); + + public Q_SLOTS: + /** +diff --git a/src/common/Configuration.h b/src/common/Configuration.h +index cf44a62..a7e0585 100644 +--- a/src/common/Configuration.h ++++ b/src/common/Configuration.h +@@ -63,11 +63,9 @@ namespace SDDM { + Entry(ServerPath, QString, _S("/usr/bin/X"), _S("Path to X server binary")); + Entry(ServerArguments, QString, _S("-nolisten tcp"), _S("Arguments passed to the X server invocation")); + Entry(XephyrPath, QString, _S("/usr/bin/Xephyr"), _S("Path to Xephyr binary")); +- Entry(XauthPath, QString, _S("/usr/bin/xauth"), _S("Path to xauth binary")); + Entry(SessionDir, QString, _S("/usr/share/xsessions"), _S("Directory containing available X sessions")); + Entry(SessionCommand, QString, _S(SESSION_COMMAND), _S("Path to a script to execute when starting the desktop session")); + Entry(SessionLogFile, QString, _S(".local/share/sddm/xorg-session.log"), _S("Path to the user session log file")); +- Entry(UserAuthFile, QString, _S(".Xauthority"), _S("Path to the Xauthority file")); + Entry(DisplayCommand, QString, _S(DATA_INSTALL_DIR "/scripts/Xsetup"), _S("Path to a script to execute when starting the display server")); + Entry(DisplayStopCommand, QString, _S(DATA_INSTALL_DIR "/scripts/Xstop"), _S("Path to a script to execute when stopping the display server")); + Entry(MinimumVT, int, MINIMUM_VT, _S("The lowest virtual terminal number that will be used.")); +diff --git a/src/common/XauthUtils.cpp b/src/common/XauthUtils.cpp +new file mode 100644 +index 0000000..da1c691 +--- /dev/null ++++ b/src/common/XauthUtils.cpp +@@ -0,0 +1,82 @@ ++/**************************************************************************** ++ * SPDX-FileCopyrightText: 2020 Fabian Vogt ++ * ++ * SPDX-License-Identifier: GPL-2.0-or-later ++ ***************************************************************************/ ++ ++#include ++#include ++#include ++ ++#include ++ ++#include ++ ++#include "XauthUtils.h" ++ ++namespace SDDM { namespace Xauth { ++ QByteArray generateCookie() ++ { ++ std::random_device rd; ++ std::mt19937 gen(rd()); ++ std::uniform_int_distribution<> dis(0, 0xFF); ++ ++ QByteArray cookie; ++ cookie.reserve(16); ++ ++ for(int i = 0; i < 16; i++) ++ cookie[i] = dis(gen); ++ ++ return cookie; ++ } ++ ++ bool writeCookieToFile(const QString &filename, const QString &display, QByteArray cookie) ++ { ++ if(display.size() < 2 || display[0] != QLatin1Char(':') || cookie.count() != 16) ++ return false; ++ ++ // Truncate the file. We don't support merging like the xauth tool does. ++ FILE * const authFp = fopen(qPrintable(filename), "wb"); ++ if (authFp == nullptr) ++ return false; ++ ++ char localhost[HOST_NAME_MAX + 1] = ""; ++ if (gethostname(localhost, HOST_NAME_MAX) < 0) ++ strcpy(localhost, "localhost"); ++ ++ ::Xauth auth = {}; ++ char cookieName[] = "MIT-MAGIC-COOKIE-1"; ++ ++ // Skip the ':' ++ QByteArray displayNumberUtf8 = display.midRef(1).toUtf8(); ++ ++ auth.family = FamilyLocal; ++ auth.address = localhost; ++ auth.address_length = strlen(auth.address); ++ auth.number = displayNumberUtf8.data(); ++ auth.number_length = displayNumberUtf8.size(); ++ auth.name = cookieName; ++ auth.name_length = sizeof(cookieName) - 1; ++ auth.data = cookie.data(); ++ auth.data_length = cookie.count(); ++ ++ if (XauWriteAuth(authFp, &auth) == 0) { ++ fclose(authFp); ++ return false; ++ } ++ ++ // Write the same entry again, just with FamilyWild ++ auth.family = FamilyWild; ++ auth.address_length = 0; ++ if (XauWriteAuth(authFp, &auth) == 0) { ++ fclose(authFp); ++ return false; ++ } ++ ++ bool success = fflush(authFp) != EOF; ++ ++ fclose(authFp); ++ ++ return success; ++ } ++}} +diff --git a/src/common/XauthUtils.h b/src/common/XauthUtils.h +new file mode 100644 +index 0000000..112d003 +--- /dev/null ++++ b/src/common/XauthUtils.h +@@ -0,0 +1,16 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later ++ ++#ifndef SDDM_XAUTHUTILS_H ++#define SDDM_XAUTHUTILS_H ++ ++class QString; ++class QByteArray; ++ ++namespace SDDM { ++ namespace Xauth { ++ QByteArray generateCookie(); ++ bool writeCookieToFile(const QString &filename, const QString &display, QByteArray cookie); ++ } ++} ++ ++#endif // SDDM_XAUTHUTILS_H +diff --git a/src/daemon/CMakeLists.txt b/src/daemon/CMakeLists.txt +index 86d014b..9145607 100644 +--- a/src/daemon/CMakeLists.txt ++++ b/src/daemon/CMakeLists.txt +@@ -2,6 +2,7 @@ include_directories( + "${CMAKE_SOURCE_DIR}/src/common" + "${CMAKE_SOURCE_DIR}/src/auth" + "${CMAKE_BINARY_DIR}/src/common" ++ ${LIBXAU_INCLUDE_DIRS} + "${LIBXCB_INCLUDE_DIR}" + ) + +@@ -13,6 +14,7 @@ set(DAEMON_SOURCES + ${CMAKE_SOURCE_DIR}/src/common/ThemeMetadata.cpp + ${CMAKE_SOURCE_DIR}/src/common/Session.cpp + ${CMAKE_SOURCE_DIR}/src/common/SocketWriter.cpp ++ ${CMAKE_SOURCE_DIR}/src/common/XauthUtils.cpp + ${CMAKE_SOURCE_DIR}/src/auth/Auth.cpp + ${CMAKE_SOURCE_DIR}/src/auth/AuthPrompt.cpp + ${CMAKE_SOURCE_DIR}/src/auth/AuthRequest.cpp +@@ -64,6 +66,7 @@ target_link_libraries(sddm + Qt5::DBus + Qt5::Network + Qt5::Qml ++ ${LIBXAU_LIBRARIES} + ${LIBXCB_LIBRARIES}) + if(PAM_FOUND) + target_link_libraries(sddm ${PAM_LIBRARIES}) +diff --git a/src/daemon/XorgDisplayServer.cpp b/src/daemon/XorgDisplayServer.cpp +index 5f93a1b..148ebcc 100644 +--- a/src/daemon/XorgDisplayServer.cpp ++++ b/src/daemon/XorgDisplayServer.cpp +@@ -25,6 +25,7 @@ + #include "Display.h" + #include "SignalHandler.h" + #include "Seat.h" ++#include "XauthUtils.h" + + #include + #include +@@ -55,17 +56,7 @@ namespace SDDM { + m_authPath = QStringLiteral("%1/%2").arg(authDir).arg(QUuid::createUuid().toString()); + + // generate cookie +- std::random_device rd; +- std::mt19937 gen(rd()); +- std::uniform_int_distribution<> dis(0, 15); +- +- // resever 32 bytes +- m_cookie.reserve(32); +- +- // create a random hexadecimal number +- const char *digits = "0123456789abcdef"; +- for (int i = 0; i < 32; ++i) +- m_cookie[i] = digits[dis(gen)]; ++ m_cookie = Xauth::generateCookie(); + } + + XorgDisplayServer::~XorgDisplayServer() { +@@ -84,35 +75,10 @@ namespace SDDM { + return QStringLiteral("x11"); + } + +- const QString &XorgDisplayServer::cookie() const { ++ const QByteArray &XorgDisplayServer::cookie() const { + return m_cookie; + } + +- bool XorgDisplayServer::addCookie(const QString &file) { +- // log message +- qDebug() << "Adding cookie to" << file; +- +- // Touch file +- QFile file_handler(file); +- file_handler.open(QIODevice::Append); +- file_handler.close(); +- +- QString cmd = QStringLiteral("%1 -f %2 -q").arg(mainConfig.X11.XauthPath.get()).arg(file); +- +- // execute xauth +- FILE *fp = popen(qPrintable(cmd), "w"); +- +- // check file +- if (!fp) +- return false; +- fprintf(fp, "remove %s\n", qPrintable(m_display)); +- fprintf(fp, "add %s . %s\n", qPrintable(m_display), qPrintable(m_cookie)); +- fprintf(fp, "exit\n"); +- +- // close pipe +- return pclose(fp) == 0; +- } +- + bool XorgDisplayServer::start() { + // check flag + if (m_started) +@@ -130,8 +96,7 @@ namespace SDDM { + // generate auth file. + // For the X server's copy, the display number doesn't matter. + // An empty file would result in no access control! +- m_display = QStringLiteral(":0"); +- if(!addCookie(m_authPath)) { ++ if(!Xauth::writeCookieToFile(m_authPath, QStringLiteral(":0"), m_cookie)) { + qCritical() << "Failed to write xauth file"; + return false; + } +@@ -229,7 +194,7 @@ namespace SDDM { + // The file is also used by the greeter, which does care about the + // display number. Write the proper entry, if it's different. + if(m_display != QStringLiteral(":0")) { +- if(!addCookie(m_authPath)) { ++ if(!Xauth::writeCookieToFile(m_authPath, m_display, m_cookie)) { + qCritical() << "Failed to write xauth file"; + return false; + } +diff --git a/src/daemon/XorgDisplayServer.h b/src/daemon/XorgDisplayServer.h +index e97a0b5..05e0a4c 100644 +--- a/src/daemon/XorgDisplayServer.h ++++ b/src/daemon/XorgDisplayServer.h +@@ -38,7 +38,7 @@ namespace SDDM { + + QString sessionType() const; + +- const QString &cookie() const; ++ const QByteArray &cookie() const; + + bool addCookie(const QString &file); + +@@ -50,7 +50,7 @@ namespace SDDM { + + private: + QString m_authPath; +- QString m_cookie; ++ QByteArray m_cookie; + + QProcess *process { nullptr }; + +diff --git a/src/helper/Backend.cpp b/src/helper/Backend.cpp +index a324b39..a053310 100644 +--- a/src/helper/Backend.cpp ++++ b/src/helper/Backend.cpp +@@ -68,13 +68,6 @@ namespace SDDM { + env.insert(QStringLiteral("SHELL"), QString::fromLocal8Bit(pw->pw_shell)); + env.insert(QStringLiteral("USER"), QString::fromLocal8Bit(pw->pw_name)); + env.insert(QStringLiteral("LOGNAME"), QString::fromLocal8Bit(pw->pw_name)); +- if (env.contains(QStringLiteral("DISPLAY")) && !env.contains(QStringLiteral("XAUTHORITY"))) { +- // determine Xauthority path +- QString value = QStringLiteral("%1/%2") +- .arg(QString::fromLocal8Bit(pw->pw_dir)) +- .arg(mainConfig.X11.UserAuthFile.get()); +- env.insert(QStringLiteral("XAUTHORITY"), value); +- } + #if defined(Q_OS_FREEBSD) + /* get additional environment variables via setclassenvironment(); + this needs to be done here instead of in UserSession::setupChildProcess +diff --git a/src/helper/CMakeLists.txt b/src/helper/CMakeLists.txt +index 8914ea7..81b939b 100644 +--- a/src/helper/CMakeLists.txt ++++ b/src/helper/CMakeLists.txt +@@ -3,6 +3,7 @@ include(CheckLibraryExists) + include_directories( + "${CMAKE_SOURCE_DIR}/src/common" + "${CMAKE_SOURCE_DIR}/src/auth" ++ ${LIBXAU_INCLUDE_DIRS} + ) + include_directories("${CMAKE_BINARY_DIR}/src/common") + +@@ -10,6 +11,7 @@ set(HELPER_SOURCES + ${CMAKE_SOURCE_DIR}/src/common/Configuration.cpp + ${CMAKE_SOURCE_DIR}/src/common/ConfigReader.cpp + ${CMAKE_SOURCE_DIR}/src/common/SafeDataStream.cpp ++ ${CMAKE_SOURCE_DIR}/src/common/XauthUtils.cpp + Backend.cpp + HelperApp.cpp + UserSession.cpp +@@ -41,7 +43,11 @@ else() + endif() + + add_executable(sddm-helper ${HELPER_SOURCES}) +-target_link_libraries(sddm-helper Qt5::Network Qt5::DBus Qt5::Qml) ++target_link_libraries(sddm-helper ++ Qt5::Network ++ Qt5::DBus ++ Qt5::Qml ++ ${LIBXAU_LIBRARIES}) + if("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD") + # On FreeBSD (possibly other BSDs as well), we want to use + # setusercontext() to set up the login configuration from login.conf +diff --git a/src/helper/HelperApp.cpp b/src/helper/HelperApp.cpp +index 672359a..4ad9cbd 100644 +--- a/src/helper/HelperApp.cpp ++++ b/src/helper/HelperApp.cpp +@@ -237,7 +237,7 @@ namespace SDDM { + str >> m >> env >> m_cookie; + if (m != AUTHENTICATED) { + env = QProcessEnvironment(); +- m_cookie = QString(); ++ m_cookie = {}; + qCritical() << "Received a wrong opcode instead of AUTHENTICATED:" << m; + } + return env; +@@ -263,7 +263,7 @@ namespace SDDM { + return m_user; + } + +- const QString& HelperApp::cookie() const { ++ const QByteArray& HelperApp::cookie() const { + return m_cookie; + } + +diff --git a/src/helper/HelperApp.h b/src/helper/HelperApp.h +index 3742df1..d417494 100644 +--- a/src/helper/HelperApp.h ++++ b/src/helper/HelperApp.h +@@ -40,7 +40,7 @@ namespace SDDM { + + UserSession *session(); + const QString &user() const; +- const QString &cookie() const; ++ const QByteArray &cookie() const; + + public slots: + Request request(const Request &request); +@@ -62,7 +62,7 @@ namespace SDDM { + QLocalSocket *m_socket { nullptr }; + QString m_user { }; + // TODO: get rid of this in a nice clean way along the way with moving to user session X server +- QString m_cookie { }; ++ QByteArray m_cookie { }; + + /*! + \brief Write utmp/wtmp/btmp records when a user logs in +diff --git a/src/helper/UserSession.cpp b/src/helper/UserSession.cpp +index c9a8a20..e55e69e 100644 +--- a/src/helper/UserSession.cpp ++++ b/src/helper/UserSession.cpp +@@ -23,6 +23,7 @@ + #include "UserSession.h" + #include "HelperApp.h" + #include "VirtualTerminal.h" ++#include "XauthUtils.h" + + #include + #include +@@ -35,6 +36,8 @@ + #include + #include + ++#include ++ + namespace SDDM { + UserSession::UserSession(HelperApp *parent) + : QProcess(parent) { +@@ -260,38 +263,38 @@ namespace SDDM { + qWarning() << "Could not redirect stdout"; + } + ++ // Drop the current environment ++ for (QString key : QProcessEnvironment::systemEnvironment().keys()) ++ qunsetenv(qPrintable(key)); ++ ++ // Apply the new one. This has the nice effect that XDG_RUNTIME_DIR etc are effective ++ for (QString key : processEnvironment().keys()) ++ qputenv(qPrintable(key), processEnvironment().value(key).toLocal8Bit()); ++ + // set X authority for X11 sessions only + if (sessionType != QLatin1String("x11")) + return; +- QString cookie = qobject_cast(parent())->cookie(); +- if (!cookie.isEmpty()) { +- QString file = processEnvironment().value(QStringLiteral("XAUTHORITY")); +- QString display = processEnvironment().value(QStringLiteral("DISPLAY")); +- qDebug() << "Adding cookie to" << file; +- +- +- // create the path +- QFileInfo finfo(file); +- QDir().mkpath(finfo.absolutePath()); + +- QFile file_handler(file); +- file_handler.open(QIODevice::Append); +- file_handler.close(); +- +- QString cmd = QStringLiteral("%1 -f %2 -q").arg(mainConfig.X11.XauthPath.get()).arg(file); ++ QByteArray cookie = qobject_cast(parent())->cookie(); ++ if (cookie.isEmpty()) ++ return; + +- // execute xauth +- FILE *fp = popen(qPrintable(cmd), "w"); ++ QString dir = QStandardPaths::writableLocation(QStandardPaths::RuntimeLocation); ++ if (!dir.isEmpty()) { ++ m_xauthFile.setFileTemplate(dir + QStringLiteral("/xauth_XXXXXX")); ++ m_xauthFile.open(); ++ } + +- // check file +- if (!fp) +- return; +- fprintf(fp, "remove %s\n", qPrintable(display)); +- fprintf(fp, "add %s . %s\n", qPrintable(display), qPrintable(cookie)); +- fprintf(fp, "exit\n"); ++ if (m_xauthFile.fileName().isEmpty()) ++ qWarning() << "Could not create the Xauthority file"; ++ else { ++ QString display = processEnvironment().value(QStringLiteral("DISPLAY")); ++ qDebug() << "Adding cookie to" << m_xauthFile.fileName(); + +- // close pipe +- pclose(fp); ++ if (!Xauth::writeCookieToFile(m_xauthFile.fileName(), display, cookie)) ++ qWarning() << "Failed to write the Xauthority file"; ++ else ++ qputenv("XAUTHORITY", m_xauthFile.fileName().toUtf8()); + } + } + +diff --git a/src/helper/UserSession.h b/src/helper/UserSession.h +index 7069084..23776f4 100644 +--- a/src/helper/UserSession.h ++++ b/src/helper/UserSession.h +@@ -25,6 +25,7 @@ + #include + #include + #include ++#include + + namespace SDDM { + class HelperApp; +@@ -53,12 +54,20 @@ namespace SDDM { + */ + qint64 cachedProcessId(); + ++ /* Hack! QProcess does not allow changing processEnvironment by ++ setupChildProcess(), but this is needed for creating XAUTHORITY. ++ So inherit the caller's environment and apply the assignments manually. */ ++ QProcessEnvironment processEnvironment() { return m_processEnv; } ++ void setProcessEnvironment(QProcessEnvironment env) { m_processEnv = env; } ++ + protected: + void setupChildProcess(); + + private: + QString m_path { }; + qint64 m_cachedProcessId; ++ QProcessEnvironment m_processEnv; ++ QTemporaryFile m_xauthFile; + }; + } + +-- +2.25.1 + diff --git a/0001-Remove-suffix-for-Wayland-session.patch b/0001-Remove-suffix-for-Wayland-session.patch new file mode 100644 index 0000000..656d75e --- /dev/null +++ b/0001-Remove-suffix-for-Wayland-session.patch @@ -0,0 +1,44 @@ +From 0f207a9cc6c0fda8ff47f53598404e1c878f7610 Mon Sep 17 00:00:00 2001 +From: Pier Luigi Fiorini +Date: Tue, 20 Mar 2018 18:22:39 +0100 +Subject: [PATCH] Remove suffix for Wayland session + +Some desktops like GNOME specify which windowing system is in use +with the Name entry of their desktop file. + +For Wayland-only desktops such as Liri this information is +redundant and so is for X11-only window managers. + +Do not append the Wayland suffix and let desktops handle it +themeselves. + +[ChangeLog][Greeter] Remove suffix for Wayland sessions +--- + src/common/Session.cpp | 11 ++--------- + 1 file changed, 2 insertions(+), 9 deletions(-) + +diff --git a/src/common/Session.cpp b/src/common/Session.cpp +index 2d7b04f..cb4cef7 100644 +--- a/src/common/Session.cpp ++++ b/src/common/Session.cpp +@@ -157,15 +157,8 @@ namespace SDDM { + if (current_section != QLatin1String("Desktop Entry")) + continue; // We are only interested in the "Desktop Entry" section + +- if (line.startsWith(QLatin1String("Name="))) { +- if (type == WaylandSession) +- if (line.mid(5).endsWith(QLatin1String(" (Wayland)"))) +- m_displayName = QObject::tr("%1").arg(line.mid(5)); +- else +- m_displayName = QObject::tr("%1 (Wayland)").arg(line.mid(5)); +- else +- m_displayName = line.mid(5); +- } ++ if (line.startsWith(QLatin1String("Name="))) ++ m_displayName = line.mid(5); + if (line.startsWith(QLatin1String("Comment="))) + m_comment = line.mid(8); + if (line.startsWith(QLatin1String("Exec="))) +-- +2.25.1 + diff --git a/1305.patch b/1305.patch deleted file mode 100644 index 43c1525..0000000 --- a/1305.patch +++ /dev/null @@ -1,87 +0,0 @@ -From 2a4d84ec01abb7d59bcba0af36a1dc5ccee12055 Mon Sep 17 00:00:00 2001 -From: Neal Gompa -Date: Sun, 18 Oct 2020 19:33:52 -0400 -Subject: [PATCH] Prefer Wayland sessions over X11 ones - -As a general goal and preference, we want to make the change -to Wayland as the default and X11 as the fallback. - -This change codifies that preference. - -Reference: https://fedoraproject.org/wiki/Changes/WaylandByDefaultForPlasma ---- - src/common/Session.cpp | 8 ++++---- - src/daemon/Display.cpp | 6 +++--- - src/greeter/SessionModel.cpp | 6 +++--- - 3 files changed, 10 insertions(+), 10 deletions(-) - -diff --git a/src/common/Session.cpp b/src/common/Session.cpp -index ab25822b..f8c91450 100644 ---- a/src/common/Session.cpp -+++ b/src/common/Session.cpp -@@ -131,14 +131,14 @@ namespace SDDM { - m_desktopNames.clear(); - - switch (type) { -- case X11Session: -- m_dir = QDir(mainConfig.X11.SessionDir.get()); -- m_xdgSessionType = QStringLiteral("x11"); -- break; - case WaylandSession: - m_dir = QDir(mainConfig.Wayland.SessionDir.get()); - m_xdgSessionType = QStringLiteral("wayland"); - break; -+ case X11Session: -+ m_dir = QDir(mainConfig.X11.SessionDir.get()); -+ m_xdgSessionType = QStringLiteral("x11"); -+ break; - default: - m_xdgSessionType.clear(); - break; -diff --git a/src/daemon/Display.cpp b/src/daemon/Display.cpp -index 99497d10..d8ece80c 100644 ---- a/src/daemon/Display.cpp -+++ b/src/daemon/Display.cpp -@@ -122,10 +122,10 @@ namespace SDDM { - if (autologinSession.isEmpty()) { - autologinSession = stateConfig.Last.Session.get(); - } -- if (findSessionEntry(mainConfig.X11.SessionDir.get(), autologinSession)) { -- sessionType = Session::X11Session; -- } else if (findSessionEntry(mainConfig.Wayland.SessionDir.get(), autologinSession)) { -+ if (findSessionEntry(mainConfig.Wayland.SessionDir.get(), autologinSession)) { - sessionType = Session::WaylandSession; -+ } else if (findSessionEntry(mainConfig.X11.SessionDir.get(), autologinSession)) { -+ sessionType = Session::X11Session; - } else { - qCritical() << "Unable to find autologin session entry" << autologinSession; - return false; -diff --git a/src/greeter/SessionModel.cpp b/src/greeter/SessionModel.cpp -index 655f793d..1953c76a 100644 ---- a/src/greeter/SessionModel.cpp -+++ b/src/greeter/SessionModel.cpp -@@ -41,8 +41,8 @@ namespace SDDM { - SessionModel::SessionModel(QObject *parent) : QAbstractListModel(parent), d(new SessionModelPrivate()) { - // initial population - beginResetModel(); -- populate(Session::X11Session, mainConfig.X11.SessionDir.get()); - populate(Session::WaylandSession, mainConfig.Wayland.SessionDir.get()); -+ populate(Session::X11Session, mainConfig.X11.SessionDir.get()); - endResetModel(); - - // refresh everytime a file is changed, added or removed -@@ -50,12 +50,12 @@ namespace SDDM { - connect(watcher, &QFileSystemWatcher::directoryChanged, [this](const QString &path) { - beginResetModel(); - d->sessions.clear(); -- populate(Session::X11Session, mainConfig.X11.SessionDir.get()); - populate(Session::WaylandSession, mainConfig.Wayland.SessionDir.get()); -+ populate(Session::X11Session, mainConfig.X11.SessionDir.get()); - endResetModel(); - }); -- watcher->addPath(mainConfig.X11.SessionDir.get()); - watcher->addPath(mainConfig.Wayland.SessionDir.get()); -+ watcher->addPath(mainConfig.X11.SessionDir.get()); - } - - SessionModel::~SessionModel() { diff --git a/735.patch b/735.patch deleted file mode 100644 index 6ea5e2c..0000000 --- a/735.patch +++ /dev/null @@ -1,66 +0,0 @@ -From e128a1b4ea74f02bc4a9047ea0e95e7563e6d3ac Mon Sep 17 00:00:00 2001 -From: Martin Briza -Date: Wed, 2 Nov 2016 17:13:40 +0100 -Subject: [PATCH] Switch to another managed VT when the current one quits - ---- - src/daemon/Seat.cpp | 27 +++++++++++++++++++++++++-- - 1 file changed, 25 insertions(+), 2 deletions(-) - -diff --git a/src/daemon/Seat.cpp b/src/daemon/Seat.cpp -index 3ef1b2f..966d445 100644 ---- a/src/daemon/Seat.cpp -+++ b/src/daemon/Seat.cpp -@@ -30,6 +30,12 @@ - - #include - -+#include -+#include -+#include -+#include -+#include -+ - namespace SDDM { - int findUnused(int minimum, std::function used) { - // initialize with minimum -@@ -84,7 +90,6 @@ namespace SDDM { - void Seat::removeDisplay(Display* display) { - qDebug() << "Removing display" << display->displayId() << "..."; - -- - // remove display from list - m_displays.removeAll(display); - -@@ -102,12 +107,30 @@ namespace SDDM { - - void Seat::displayStopped() { - Display *display = qobject_cast(sender()); -+ int oldVT = display->terminalId(); - - // remove display - removeDisplay(display); - -+ // try switching to some other active VT -+ bool success = false; -+ char path[33] = { 0 }; -+ snprintf(path, 32, "/dev/tty%d", oldVT); -+ int ttyfd = open(path, O_RDONLY); -+ -+ if (ttyfd >= 0) { -+ for (int newVT : m_terminalIds) { -+ int result = ioctl(ttyfd, VT_ACTIVATE, newVT); -+ if (result == 0) { -+ success = true; -+ break; -+ } -+ } -+ close(ttyfd); -+ } -+ - // restart otherwise -- if (m_displays.isEmpty()) -+ if (!success) - createDisplay(); - } - } diff --git a/sddm-0.17.0-fedora_config.patch b/sddm-0.19.0-fedora_config.patch similarity index 79% rename from sddm-0.17.0-fedora_config.patch rename to sddm-0.19.0-fedora_config.patch index 5efc0a3..e376f93 100644 --- a/sddm-0.17.0-fedora_config.patch +++ b/sddm-0.19.0-fedora_config.patch @@ -1,7 +1,8 @@ -diff -up sddm-0.17.0/src/common/Configuration.h.fedora_config sddm-0.17.0/src/common/Configuration.h ---- sddm-0.17.0/src/common/Configuration.h.fedora_config 2017-12-05 10:00:16.000000000 -0600 -+++ sddm-0.17.0/src/common/Configuration.h 2017-12-05 16:14:04.887614387 -0600 -@@ -46,7 +46,7 @@ namespace SDDM { +diff --git a/src/common/Configuration.h b/src/common/Configuration.h +index a7e0585..36cf9d0 100644 +--- a/src/common/Configuration.h ++++ b/src/common/Configuration.h +@@ -47,7 +47,7 @@ namespace SDDM { // Name Entries (but it's a regular class again) Section(Theme, Entry(ThemeDir, QString, _S(DATA_INSTALL_DIR "/themes"), _S("Theme directory path")); @@ -10,17 +11,16 @@ diff -up sddm-0.17.0/src/common/Configuration.h.fedora_config sddm-0.17.0/src/co Entry(FacesDir, QString, _S(DATA_INSTALL_DIR "/faces"), _S("Global directory for user avatars\n" "The files should be named .face.icon")); Entry(CursorTheme, QString, QString(), _S("Cursor theme used in the greeter")); -@@ -64,10 +64,10 @@ namespace SDDM { - Entry(XauthPath, QString, _S("/usr/bin/xauth"), _S("Path to xauth binary")); +@@ -65,9 +65,9 @@ namespace SDDM { + Entry(XephyrPath, QString, _S("/usr/bin/Xephyr"), _S("Path to Xephyr binary")); Entry(SessionDir, QString, _S("/usr/share/xsessions"), _S("Directory containing available X sessions")); Entry(SessionCommand, QString, _S(SESSION_COMMAND), _S("Path to a script to execute when starting the desktop session")); - Entry(SessionLogFile, QString, _S(".local/share/sddm/xorg-session.log"), _S("Path to the user session log file")); -+ Entry(SessionLogFile, QString, _S(".cache/xsession-errors"), _S("Path to the user session log file")); - Entry(UserAuthFile, QString, _S(".Xauthority"), _S("Path to the Xauthority file")); - Entry(DisplayCommand, QString, _S(DATA_INSTALL_DIR "/scripts/Xsetup"), _S("Path to a script to execute when starting the display server")); - Entry(DisplayStopCommand, QString, _S(DATA_INSTALL_DIR "/scripts/Xstop"), _S("Path to a script to execute when stopping the display server")); ++ Entry(SessionLogFile, QString, _S(".cache/xsession-errors"), _S("Path to the user session log file")); + Entry(DisplayCommand, QString, _S(SYS_CONFIG_DIR "/sddm/Xsetup"), _S("Path to a script to execute when starting the display server")); -+ Entry(DisplayStopCommand, QString, _S(SYS_CONFIG_DIR "/sddm/Xstop"), _S("Path to a script to execute when stopping the display server")); ++ Entry(DisplayStopCommand, QString, _S(SYS_CONFIG_DIR "/sddm/Xstop"), _S("Path to a script to execute when stopping the display server")); Entry(MinimumVT, int, MINIMUM_VT, _S("The lowest virtual terminal number that will be used.")); Entry(EnableHiDPI, bool, false, _S("Enable Qt's automatic high-DPI scaling")); ); diff --git a/sddm.spec b/sddm.spec index c24dd4b..b0081bf 100644 --- a/sddm.spec +++ b/sddm.spec @@ -8,30 +8,26 @@ %endif Name: sddm -Version: 0.18.1 -Release: 9%{?dist} +Version: 0.19.0 +Release: 1%{?dist} License: GPLv2+ Summary: QML based X11 desktop manager Url: https://github.com/sddm/sddm -Source0: https://github.com/sddm/sddm/archive/v%{version}.tar.gz +Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz -## upstream patches (in lookaside cache) -Patch35: 0035-Prevent-duplicate-session-name.patch -Patch37: 0037-Fix-build.patch +## upstream patches ## upstreamable patches -# Fixes RHBZ #1392654 -#Patch54: https://github.com/sddm/sddm/pull/735.patch -# Prefer Wayland sessions by default -# https://github.com/sddm/sddm/pull/1305 -Patch55: https://github.com/sddm/sddm/pull/1305.patch +# From: https://github.com/sddm/sddm/pull/997 +Patch051: 0001-Remove-suffix-for-Wayland-session.patch -## downstream patches -Patch101: sddm-0.17.0-fedora_config.patch +# From: https://github.com/sddm/sddm/pull/1230 +Patch052: 0001-Redesign-Xauth-handling.patch -Patch102: 0001-Port-from-xauth-to-libXau.patch +## downstream patches +Patch101: sddm-0.19.0-fedora_config.patch # sddm.service: +EnvironmentFile=-/etc/sysconfig/sddm Patch103: sddm-0.18.0-environment_file.patch @@ -104,19 +100,7 @@ A collection of sddm themes, including: elarun, maldives, maya %prep -%setup -q - -%patch35 -p1 -b .0035 -%patch37 -p1 -b .0037 - -#patch54 -p1 -b .0054 -%if %{with wayland_default} -%patch55 -p1 -b .0055 -%endif - -%patch101 -p1 -b .fedora_config -%patch102 -p1 -b .libxau -%patch103 -p1 -b .environment_file +%autosetup -p1 %if 0%{?fedora} #FIXME/TODO: use version on filesystem instead of using a bundled copy @@ -196,8 +180,7 @@ fi %systemd_postun sddm.service %files -%{!?_licensedir:%global license %%doc} -%license LICENSE +%license LICENSE %doc README.md CONTRIBUTORS %dir %{_sysconfdir}/sddm/ %config(noreplace) %{_sysconfdir}/sddm/* @@ -235,6 +218,10 @@ fi %changelog +* Tue Nov 10 2020 Neal Gompa - 0.19.0-1 +- Rebase to version 0.19.0 +- Refresh patch set and drop upstreamed patches + * Sun Oct 18 2020 Neal Gompa - 0.18.1-9 - Add patch to prefer Wayland sessions on F34+ - Correctly handle Plasma session filename changes on upgrade to F34+ diff --git a/sources b/sources index af10b8a..b3aedfd 100644 --- a/sources +++ b/sources @@ -1,3 +1 @@ -SHA512 (v0.18.1.tar.gz) = 18d5b9ee5e4d022ac86e10cde1c70c5475aeaff86d41d8b9897bc26953f5b6d042a7fef1d6e727865ebeb003a730455656765ba53350a665891113afd4dfa7d8 -SHA512 (0035-Prevent-duplicate-session-name.patch) = 043c11b122cd8749ec8dba06e9f33a1446398d321d6297fbb24709c8ff5b48201dc33e8c60a9f493765fdf7d4ef7fe257e12a78deb985a8a368f2a28472e8ff6 -SHA512 (0037-Fix-build.patch) = fff3e6623e51bb4ca8f9b4a4daf6573586b866d63e98fde0db9209e8c76d6a817334c63dcdf3411a45ffb650016cf2c8712e91757007f9766ca15bf1fedb9929 +SHA512 (sddm-0.19.0.tar.gz) = f4de3d2da844caa8c5639ec39d4f41305d4fcad9ca29fe381c2c1d4b1bba0e54d47b8644e2c72d41fe9d11f3792959c3dd14f76d9ebc0de2b8ab7675c3e9acf7