Date: Wed, 12 Feb 2020 15:31:25 +0000 (UTC) From: Gleb Popov <arrowd@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r525915 - in head/x11/sddm: . files Message-ID: <202002121531.01CFVP0S041402@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: arrowd Date: Wed Feb 12 15:31:25 2020 New Revision: 525915 URL: https://svnweb.freebsd.org/changeset/ports/525915 Log: x11/sddm: Update to 0.18.1. Upstream does not provide a config file anymore. SDDM still reads /usr/local/etc/sddm.conf if it is present, but the intended way to configure it now is using /usr/local/etc/sddm.conf.d/ directory. See man sddm.conf(5) for details. Also include a patch to make SDDM take /etc/login.conf into account. PR: 241519 Submitted by: Martin Birgmeier <d8zNeCFG@aon.at> (login.conf patch) Differential Revision: https://reviews.freebsd.org/D23579 Added: head/x11/sddm/files/VirtualTerminal_FreeBSD.cpp (contents, props changed) head/x11/sddm/files/patch-services_sddm-greeter.pam.in (contents, props changed) head/x11/sddm/files/patch-src_helper_Backend.cpp (contents, props changed) head/x11/sddm/files/patch-src_helper_CMakeLists.txt (contents, props changed) Deleted: head/x11/sddm/files/git-patch-b02b00559 head/x11/sddm/files/patch-services_sddm-greeter.pam head/x11/sddm/files/patch-src_daemon_SignalHandler.cpp head/x11/sddm/pkg-message Modified: head/x11/sddm/Makefile head/x11/sddm/distinfo head/x11/sddm/files/patch-data_scripts_Xsession head/x11/sddm/files/patch-src_common_Configuration.h head/x11/sddm/files/patch-src_daemon_CMakeLists.txt head/x11/sddm/files/patch-src_daemon_Display.cpp head/x11/sddm/files/patch-src_helper_HelperApp.cpp head/x11/sddm/files/patch-src_helper_UserSession.cpp head/x11/sddm/pkg-plist Modified: head/x11/sddm/Makefile ============================================================================== --- head/x11/sddm/Makefile Wed Feb 12 14:53:32 2020 (r525914) +++ head/x11/sddm/Makefile Wed Feb 12 15:31:25 2020 (r525915) @@ -1,9 +1,8 @@ # $FreeBSD$ PORTNAME= sddm -PORTVERSION= 0.17.0 +PORTVERSION= 0.18.1 DISTVERSIONPREFIX= v -PORTREVISION= 8 CATEGORIES= x11 MAINTAINER= kde@FreeBSD.org @@ -40,20 +39,15 @@ SUB_FILES= xinitrc.desktop USERS= sddm GROUPS= sddm -# There are multiple patches that apply to Display.cpp, -# fixing CVE-2018-14345 and backported from 0.18. -EXTRA_PATCHES= ${PATCHDIR}/git-patch-147cec38d ${PATCHDIR}/git-patch-b02b00559 - post-patch: @${REINPLACE_CMD} -e 's#/etc/X11#${LOCALBASE}/etc/X11#' \ -e 's#/usr/bin/#${LOCALBASE}/bin/#g' \ -e 's#/usr/share/#${LOCALBASE}/share/#' \ ${WRKSRC}/data/scripts/Xsession \ ${WRKSRC}/src/common/Configuration.h + @${CP} ${PATCHDIR}/VirtualTerminal_FreeBSD.cpp ${WRKSRC}/src/daemon post-install: - ${MV} ${STAGEDIR}${PREFIX}/etc/sddm.conf \ - ${STAGEDIR}${PREFIX}/etc/sddm.conf.sample # Install xsession.desktop to launch .xinitrc via sddm. ${MKDIR} ${STAGEDIR}${PREFIX}/share/xsessions ${INSTALL_DATA} ${WRKDIR}/xinitrc.desktop ${STAGEDIR}${PREFIX}/share/xsessions Modified: head/x11/sddm/distinfo ============================================================================== --- head/x11/sddm/distinfo Wed Feb 12 14:53:32 2020 (r525914) +++ head/x11/sddm/distinfo Wed Feb 12 15:31:25 2020 (r525915) @@ -1,3 +1,3 @@ -TIMESTAMP = 1525019041 -SHA256 (sddm-sddm-v0.17.0_GH0.tar.gz) = c6da2862688d21a091f1568b78a5f5900cd2e02a83dd42c016f0c5867e69a92d -SIZE (sddm-sddm-v0.17.0_GH0.tar.gz) = 3524362 +TIMESTAMP = 1581010748 +SHA256 (sddm-sddm-v0.18.1_GH0.tar.gz) = 07296fc747010a5dd58a45f16c3224b439997afad42566e4b043c841b1b71700 +SIZE (sddm-sddm-v0.18.1_GH0.tar.gz) = 3526726 Added: head/x11/sddm/files/VirtualTerminal_FreeBSD.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/x11/sddm/files/VirtualTerminal_FreeBSD.cpp Wed Feb 12 15:31:25 2020 (r525915) @@ -0,0 +1,37 @@ +/*************************************************************************** +* Copyright (c) 2015 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the +* Free Software Foundation, Inc., +* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +***************************************************************************/ + +#include <QDebug> +#include <QString> + +#include "VirtualTerminal.h" + + +namespace SDDM { + namespace VirtualTerminal { + int setUpNewVt() { + qDebug() << "New VT is unsupported on FreeBSD"; + return -1; + } + + void jumpToVt(int vt, bool vt_auto) { + qDebug() << "Jumping to VT" << vt << "is unsupported on FreeBSD"; + } + } +} Modified: head/x11/sddm/files/patch-data_scripts_Xsession ============================================================================== --- head/x11/sddm/files/patch-data_scripts_Xsession Wed Feb 12 14:53:32 2020 (r525914) +++ head/x11/sddm/files/patch-data_scripts_Xsession Wed Feb 12 15:31:25 2020 (r525915) @@ -8,14 +8,10 @@ Also use dbus-run-session so libdbus doesn't have to a daemon on first use. Autolaunched dbus daemons tend to linger and may only exit if the X server exits. ---- data/scripts/Xsession.orig 2017-12-05 16:00:16 UTC +--- data/scripts/Xsession.orig 2019-03-13 09:22:35 UTC +++ data/scripts/Xsession -@@ -94,8 +94,8 @@ if [ -f "$USERXSESSION" ]; then - . "$USERXSESSION" - fi - --if [ -z "$@" ]; then -+if [ -z "$1" ]; then +@@ -98,5 +98,5 @@ fi + if [ -z "$*" ]; then exec xmessage -center -buttons OK:0 -default OK "Sorry, $DESKTOP_SESSION is no valid session." else - exec $@ Added: head/x11/sddm/files/patch-services_sddm-greeter.pam.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/x11/sddm/files/patch-services_sddm-greeter.pam.in Wed Feb 12 15:31:25 2020 (r525915) @@ -0,0 +1,18 @@ +--- services/sddm-greeter.pam.in.orig 2019-03-13 09:22:35 UTC ++++ services/sddm-greeter.pam.in +@@ -1,8 +1,5 @@ + #%PAM-1.0 + +-# Load environment from /etc/environment and ~/.pam_environment +-auth required pam_env.so +- + # Always let the greeter start without authentication + auth required pam_permit.so + +@@ -13,5 +10,4 @@ account required pam_permit.so + password required pam_deny.so + + # Setup session +-session required pam_unix.so +-session optional @LOGIND_PAM_MODULE@ ++session required pam_permit.so Modified: head/x11/sddm/files/patch-src_common_Configuration.h ============================================================================== --- head/x11/sddm/files/patch-src_common_Configuration.h Wed Feb 12 14:53:32 2020 (r525914) +++ head/x11/sddm/files/patch-src_common_Configuration.h Wed Feb 12 15:31:25 2020 (r525915) @@ -6,14 +6,9 @@ Set the default theme and cursor theme to breeze, beca used together with Plasma. If they aren't available sddm falls back to a compiled-in theme. ---- src/common/Configuration.h.orig 2017-12-05 16:00:16 UTC +--- src/common/Configuration.h.orig 2019-03-13 09:22:35 UTC +++ src/common/Configuration.h -@@ -42,14 +42,14 @@ namespace SDDM { - Entry(Numlock, NumState, NUM_NONE, _S("Initial NumLock state. Can be on, off or none.\n" - "If property is set to none, numlock won't be changed\n" - "NOTE: Currently ignored if autologin is enabled.")); -- Entry(InputMethod, QString, QStringLiteral("qtvirtualkeyboard"), _S("Input method module")); -+ Entry(InputMethod, QString, QString(), _S("Input method module")); +@@ -47,10 +47,10 @@ 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")); @@ -26,7 +21,7 @@ compiled-in theme. Entry(EnableAvatars, bool, true, _S("Enable display of custom user avatars")); Entry(DisableAvatarsThreshold,int, 7, _S("Number of users to use as threshold\n" "above which avatars are disabled\n" -@@ -80,7 +80,7 @@ namespace SDDM { +@@ -81,7 +81,7 @@ namespace SDDM { ); Section(Users, Modified: head/x11/sddm/files/patch-src_daemon_CMakeLists.txt ============================================================================== --- head/x11/sddm/files/patch-src_daemon_CMakeLists.txt Wed Feb 12 14:53:32 2020 (r525914) +++ head/x11/sddm/files/patch-src_daemon_CMakeLists.txt Wed Feb 12 15:31:25 2020 (r525915) @@ -1,13 +1,11 @@ -Remove VirtualTerminal.cpp from the sources that need to be built. -See also 'patch-src_daemon_Display.cpp'. - ---- src/daemon/CMakeLists.txt.orig 2017-12-05 16:00:16 UTC +--- src/daemon/CMakeLists.txt.orig 2019-03-13 09:22:35 UTC +++ src/daemon/CMakeLists.txt -@@ -29,7 +29,6 @@ set(DAEMON_SOURCES +@@ -29,7 +29,7 @@ set(DAEMON_SOURCES SeatManager.cpp SignalHandler.cpp SocketServer.cpp - VirtualTerminal.cpp ++ VirtualTerminal_FreeBSD.cpp ) qt5_add_dbus_adaptor(DAEMON_SOURCES "${CMAKE_SOURCE_DIR}/data/interfaces/org.freedesktop.DisplayManager.xml" "DisplayManager.h" SDDM::DisplayManager) Modified: head/x11/sddm/files/patch-src_daemon_Display.cpp ============================================================================== --- head/x11/sddm/files/patch-src_daemon_Display.cpp Wed Feb 12 14:53:32 2020 (r525914) +++ head/x11/sddm/files/patch-src_daemon_Display.cpp Wed Feb 12 15:31:25 2020 (r525915) @@ -7,30 +7,9 @@ file defines DesktopNames. Our xinitrc.desktop does n may confuse the desktop session started from ~/.xinitrc. These environment variables are used for OnlyShowIn and NotShowIn in .desktop files. ---- src/daemon/Display.cpp.orig 2017-12-05 16:00:16 UTC +--- src/daemon/Display.cpp.orig 2019-03-13 09:22:35 UTC +++ src/daemon/Display.cpp -@@ -30,7 +30,9 @@ - #include "Greeter.h" - #include "Utils.h" - #include "SignalHandler.h" -+#if defined(Q_OS_LINUX) - #include "VirtualTerminal.h" -+#endif - - #include <QDebug> - #include <QFile> -@@ -310,8 +312,10 @@ namespace SDDM { - - // create new VT for Wayland sessions otherwise use greeter vt - int vt = terminalId(); -+#if defined(Q_OS_LINUX) - if (session.xdgSessionType() == QLatin1String("wayland")) - vt = VirtualTerminal::setUpNewVt(); -+#endif - m_lastSession.setVt(vt); - - QProcessEnvironment env; -@@ -321,11 +325,13 @@ namespace SDDM { +@@ -321,11 +321,13 @@ namespace SDDM { env.insert(QStringLiteral("XDG_SEAT_PATH"), daemonApp->displayManager()->seatPath(seat()->name())); env.insert(QStringLiteral("XDG_SESSION_PATH"), daemonApp->displayManager()->sessionPath(QStringLiteral("Session%1").arg(daemonApp->newSessionId()))); env.insert(QStringLiteral("DESKTOP_SESSION"), session.desktopSession()); @@ -44,15 +23,3 @@ variables are used for OnlyShowIn and NotShowIn in .de env.insert(QStringLiteral("XDG_SESSION_DESKTOP"), session.desktopNames()); if (seat()->name() == QLatin1String("seat0")) { env.insert(QStringLiteral("XDG_VTNR"), QString::number(vt)); -@@ -366,9 +372,11 @@ namespace SDDM { - stateConfig.Last.Session.setDefault(); - stateConfig.save(); - -+#if defined(Q_OS_LINUX) - // switch to the new VT for Wayland sessions - if (m_lastSession.xdgSessionType() == QLatin1String("wayland")) - VirtualTerminal::jumpToVt(m_lastSession.vt()); -+#endif - - if (m_socket) - emit loginSucceeded(m_socket); Added: head/x11/sddm/files/patch-src_helper_Backend.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/x11/sddm/files/patch-src_helper_Backend.cpp Wed Feb 12 15:31:25 2020 (r525915) @@ -0,0 +1,33 @@ +--- src/helper/Backend.cpp.orig 2019-03-13 09:22:35 UTC ++++ src/helper/Backend.cpp +@@ -29,6 +29,10 @@ + #include <QtCore/QProcessEnvironment> + + #include <pwd.h> ++#if defined(Q_OS_FREEBSD) ++#include <sys/types.h> ++#include <login_cap.h> ++#endif /* defined(Q_OS_FREEBSD) */ + + namespace SDDM { + Backend::Backend(HelperApp* parent) +@@ -70,6 +74,19 @@ namespace SDDM { + .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 ++ as the environment for execve() is prepared here */ ++ login_cap_t *lc; ++ ++ if ((lc = login_getpwclass(pw)) != 0) { ++ setclassenvironment(lc, pw, 1); /* path variables */ ++ setclassenvironment(lc, pw, 0); /* non-path variables */ ++ /* copy all environment variables that are now set */ ++ env.insert(QProcessEnvironment::systemEnvironment()); ++ } ++#endif /* defined(Q_OS_FREEBSD) */ + // TODO: I'm fairly sure this shouldn't be done for PAM sessions, investigate! + m_app->session()->setProcessEnvironment(env); + } Added: head/x11/sddm/files/patch-src_helper_CMakeLists.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/x11/sddm/files/patch-src_helper_CMakeLists.txt Wed Feb 12 15:31:25 2020 (r525915) @@ -0,0 +1,12 @@ +--- src/helper/CMakeLists.txt.orig 2019-03-13 09:22:35 UTC ++++ src/helper/CMakeLists.txt +@@ -37,6 +37,9 @@ if(PAM_FOUND) + else() + target_link_libraries(sddm-helper crypt) + endif() ++if("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD") ++ target_link_libraries(sddm-helper util) ++endif() + + if(JOURNALD_FOUND) + target_link_libraries(sddm-helper ${JOURNALD_LIBRARIES}) Modified: head/x11/sddm/files/patch-src_helper_HelperApp.cpp ============================================================================== --- head/x11/sddm/files/patch-src_helper_HelperApp.cpp Wed Feb 12 14:53:32 2020 (r525914) +++ head/x11/sddm/files/patch-src_helper_HelperApp.cpp Wed Feb 12 15:31:25 2020 (r525915) @@ -1,10 +1,8 @@ ---- src/helper/HelperApp.cpp.orig 2017-12-05 16:00:16 UTC +--- src/helper/HelperApp.cpp.orig 2019-03-13 09:22:35 UTC +++ src/helper/HelperApp.cpp -@@ -33,8 +33,11 @@ - #include <iostream> - #include <unistd.h> +@@ -35,7 +35,9 @@ #include <sys/socket.h> -+#include <sys/time.h> + #include <sys/time.h> +#if defined(Q_OS_LINUX) #include <utmp.h> @@ -12,7 +10,7 @@ #include <utmpx.h> #include <QByteArray> -@@ -301,12 +304,20 @@ namespace SDDM { +@@ -302,12 +304,20 @@ namespace SDDM { // append to failed login database btmp if (!authSuccessful) { @@ -33,7 +31,7 @@ } } -@@ -342,8 +353,12 @@ namespace SDDM { +@@ -343,8 +353,12 @@ namespace SDDM { qWarning() << "Failed to write utmpx: " << strerror(errno); endutxent(); Modified: head/x11/sddm/files/patch-src_helper_UserSession.cpp ============================================================================== --- head/x11/sddm/files/patch-src_helper_UserSession.cpp Wed Feb 12 14:53:32 2020 (r525914) +++ head/x11/sddm/files/patch-src_helper_UserSession.cpp Wed Feb 12 15:31:25 2020 (r525915) @@ -1,15 +1,16 @@ -Run sddm-greeter via the session command (Xsession script) so it also gets X -resources and a ConsoleKit and D-Bus session. The ConsoleKit session has its -session-class set to "user" instead of "greeter" because ck-launch-session -doesn't provide a way to change this. ConsoleKit doesn't do anything with -this value though so it is believed to be harmless. The XDG_SESSION_CLASS -environment variable does have the value "greeter". - -Remove double quotes because we fixed the use of "$@" in the script. - ---- src/helper/UserSession.cpp.orig 2017-12-05 16:00:16 UTC +--- src/helper/UserSession.cpp.orig 2019-03-13 09:22:35 UTC +++ src/helper/UserSession.cpp -@@ -45,10 +45,8 @@ namespace SDDM { +@@ -33,6 +33,9 @@ + #include <unistd.h> + #include <fcntl.h> + #include <sched.h> ++#if defined(Q_OS_FREEBSD) ++#include <login_cap.h> ++#endif /* defined(Q_OS_FREEBSD) */ + + namespace SDDM { + UserSession::UserSession(HelperApp *parent) +@@ -46,10 +49,8 @@ namespace SDDM { bool UserSession::start() { QProcessEnvironment env = qobject_cast<HelperApp*>(parent())->session()->processEnvironment(); @@ -22,3 +23,33 @@ Remove double quotes because we fixed the use of "$@" qInfo() << "Starting:" << cmd; QProcess::start(cmd); } else if (env.value(QStringLiteral("XDG_SESSION_TYPE")) == QLatin1String("wayland")) { +@@ -130,6 +131,21 @@ namespace SDDM { + + // switch user + const QByteArray username = qobject_cast<HelperApp*>(parent())->user().toLocal8Bit(); ++#if defined(Q_OS_FREEBSD) ++ struct passwd *pw = getpwnam(username.constData()); ++ /* execve() uses the environment prepared in Backend::openSession(), ++ therefore environment variables which are set here are ignored. */ ++ if (setusercontext(NULL, pw, pw->pw_uid, LOGIN_SETALL) != 0) { ++ qCritical() << "setusercontext(NULL, *, " << pw->pw_uid << ", LOGIN_SETALL) failed for user: " << username; ++ exit(Auth::HELPER_OTHER_ERROR); ++ } ++ if (chdir(pw->pw_dir) != 0) { ++ qCritical() << "chdir(" << pw->pw_dir << ") failed for user: " << username; ++ qCritical() << "verify directory exist and has sufficient permissions"; ++ exit(Auth::HELPER_OTHER_ERROR); ++ } ++ const QString homeDir = QString::fromLocal8Bit(pw->pw_dir); ++#else /* defined(Q_OS_FREEBSD) */ + struct passwd pw; + struct passwd *rpw; + long bufsize = sysconf(_SC_GETPW_R_SIZE_MAX); +@@ -221,6 +237,7 @@ namespace SDDM { + exit(Auth::HELPER_OTHER_ERROR); + } + const QString homeDir = QString::fromLocal8Bit(pw.pw_dir); ++#endif /* defined(Q_OS_FREEBSD) */ + + //we cannot use setStandardError file as this code is run in the child process + //we want to redirect after we setuid so that the log file is owned by the user Modified: head/x11/sddm/pkg-plist ============================================================================== --- head/x11/sddm/pkg-plist Wed Feb 12 14:53:32 2020 (r525914) +++ head/x11/sddm/pkg-plist Wed Feb 12 15:31:25 2020 (r525915) @@ -8,7 +8,6 @@ man/man1/sddm.1.gz man/man1/sddm-greeter.1.gz man/man5/sddm.conf.5.gz man/man5/sddm-state.conf.5.gz -@sample etc/sddm.conf.sample %%QT_QMLDIR%%/SddmComponents/Background.qml %%QT_QMLDIR%%/SddmComponents/Button.qml %%QT_QMLDIR%%/SddmComponents/Clock.qml @@ -150,6 +149,7 @@ libexec/sddm-helper %%DATADIR%%/themes/maya/screenshots/hi_IN.png %%DATADIR%%/themes/maya/theme.conf %%DATADIR%%/translations/ar.qm +%%DATADIR%%/translations/bn.qm %%DATADIR%%/translations/ca.qm %%DATADIR%%/translations/cs.qm %%DATADIR%%/translations/da.qm @@ -160,6 +160,7 @@ libexec/sddm-helper %%DATADIR%%/translations/fr.qm %%DATADIR%%/translations/hi_IN.qm %%DATADIR%%/translations/hu.qm +%%DATADIR%%/translations/is.qm %%DATADIR%%/translations/it.qm %%DATADIR%%/translations/ja.qm %%DATADIR%%/translations/kk.qm
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202002121531.01CFVP0S041402>