Index: head/x11/sddm/pkg-message =================================================================== --- head/x11/sddm/pkg-message (revision 525914) +++ head/x11/sddm/pkg-message (nonexistent) @@ -1,8 +0,0 @@ -[ -{ type: install - message: < Index: head/x11/sddm/distinfo =================================================================== --- head/x11/sddm/distinfo (revision 525914) +++ head/x11/sddm/distinfo (revision 525915) @@ -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 Index: head/x11/sddm/files/patch-src_daemon_SignalHandler.cpp =================================================================== --- head/x11/sddm/files/patch-src_daemon_SignalHandler.cpp (revision 525914) +++ head/x11/sddm/files/patch-src_daemon_SignalHandler.cpp (nonexistent) @@ -1,45 +0,0 @@ -From 62d776518594f517dc59de3c87e53afdda339079 Mon Sep 17 00:00:00 2001 -From: Romain Labolle -Date: Sat, 3 Mar 2018 22:09:30 +0100 -Subject: [PATCH] Add SOCK_CLOEXEC to signal handling sockets - -SDDM is currennty leaking 8 sockets file descriptors to the user session. -Adding the CLOEXEC flag to the fd to avoid thoses leaks. ---- - src/daemon/SignalHandler.cpp | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/src/daemon/SignalHandler.cpp b/src/daemon/SignalHandler.cpp -index 5c536603..3054e635 100644 ---- src/daemon/SignalHandler.cpp.orig 2017-12-05 16:00:16 UTC -+++ src/daemon/SignalHandler.cpp -@@ -34,25 +34,25 @@ namespace SDDM { - int sigusr1Fd[2]; - - SignalHandler::SignalHandler(QObject *parent) : QObject(parent) { -- if (::socketpair(AF_UNIX, SOCK_STREAM, 0, sighupFd)) -+ if (::socketpair(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0, sighupFd)) - qCritical() << "Failed to create socket pair for SIGHUP handling."; - - snhup = new QSocketNotifier(sighupFd[1], QSocketNotifier::Read, this); - connect(snhup, SIGNAL(activated(int)), this, SLOT(handleSighup())); - -- if (::socketpair(AF_UNIX, SOCK_STREAM, 0, sigintFd)) -+ if (::socketpair(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0, sigintFd)) - qCritical() << "Failed to create socket pair for SIGINT handling."; - - snint = new QSocketNotifier(sigintFd[1], QSocketNotifier::Read, this); - connect(snint, SIGNAL(activated(int)), this, SLOT(handleSigint())); - -- if (::socketpair(AF_UNIX, SOCK_STREAM, 0, sigtermFd)) -+ if (::socketpair(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0, sigtermFd)) - qCritical() << "Failed to create socket pair for SIGTERM handling."; - - snterm = new QSocketNotifier(sigtermFd[1], QSocketNotifier::Read, this); - connect(snterm, SIGNAL(activated(int)), this, SLOT(handleSigterm())); - -- if (::socketpair(AF_UNIX, SOCK_STREAM, 0, sigusr1Fd)) -+ if (::socketpair(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0, sigusr1Fd)) - qCritical() << "Failed to create socket pair for SIGUSR1 handling."; - - snusr1 = new QSocketNotifier(sigusr1Fd[1], QSocketNotifier::Read, this); Property changes on: head/x11/sddm/files/patch-src_daemon_SignalHandler.cpp ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/x11/sddm/files/patch-services_sddm-greeter.pam =================================================================== --- head/x11/sddm/files/patch-services_sddm-greeter.pam (revision 525914) +++ head/x11/sddm/files/patch-services_sddm-greeter.pam (nonexistent) @@ -1,19 +0,0 @@ ---- services/sddm-greeter.pam.orig 2017-12-05 16:00:16 UTC -+++ services/sddm-greeter.pam -@@ -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,6 +10,4 @@ account required pam_permit.so - password required pam_deny.so - - # Setup session --session required pam_unix.so ---session optional pam_systemd.so ---session optional pam_elogind.so -+session required pam_permit.so Property changes on: head/x11/sddm/files/patch-services_sddm-greeter.pam ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/x11/sddm/files/git-patch-b02b00559 =================================================================== --- head/x11/sddm/files/git-patch-b02b00559 (revision 525914) +++ head/x11/sddm/files/git-patch-b02b00559 (nonexistent) @@ -1,70 +0,0 @@ -diff --git a/src/daemon/Display.cpp b/src/daemon/Display.cpp -index 57d7ecb..c2ea728 100644 ---- src/daemon/Display.cpp -+++ src/daemon/Display.cpp -@@ -280,7 +280,7 @@ namespace SDDM { - return; - } - -- QString existingSessionId; -+ m_reuseSessionId = QString(); - - if (Logind::isAvailable() && mainConfig.Users.ReuseSession.get()) { - OrgFreedesktopLogin1ManagerInterface manager(Logind::serviceName(), Logind::managerPath(), QDBusConnection::systemBus()); -@@ -291,7 +291,7 @@ namespace SDDM { - if (s.userName == user) { - OrgFreedesktopLogin1SessionInterface session(Logind::serviceName(), s.sessionPath.path(), QDBusConnection::systemBus()); - if (session.service() == QLatin1String("sddm")) { -- existingSessionId = s.sessionId; -+ m_reuseSessionId = s.sessionId; - break; - } - } -@@ -334,19 +334,8 @@ namespace SDDM { - m_auth->insertEnvironment(env); - - m_auth->setUser(user); -- if (existingSessionId.isNull()) { -+ if (m_reuseSessionId.isNull()) { - m_auth->setSession(session.exec()); -- } else { -- //we only want to unlock the session if we can lock in, so we want to go via PAM auth, but not start a new session -- //by not setting the session and the helper will emit authentication and then quit -- connect(m_auth, &Auth::authentication, this, [=](const QString &, bool success){ -- if(!success) -- return; -- qDebug() << "activating existing seat"; -- OrgFreedesktopLogin1ManagerInterface manager(Logind::serviceName(), Logind::managerPath(), QDBusConnection::systemBus()); -- manager.UnlockSession(existingSessionId); -- manager.ActivateSession(existingSessionId); -- }); - } - m_auth->start(); - } -@@ -355,7 +344,13 @@ namespace SDDM { - if (success) { - qDebug() << "Authenticated successfully"; - -- m_auth->setCookie(qobject_cast(m_displayServer)->cookie()); -+ if (!m_reuseSessionId.isNull()) { -+ OrgFreedesktopLogin1ManagerInterface manager(Logind::serviceName(), Logind::managerPath(), QDBusConnection::systemBus()); -+ manager.UnlockSession(m_reuseSessionId); -+ manager.ActivateSession(m_reuseSessionId); -+ } else { -+ m_auth->setCookie(qobject_cast(m_displayServer)->cookie()); -+ } - - // save last user and last session - if (mainConfig.Users.RememberLastUser.get()) -diff --git a/src/daemon/Display.h b/src/daemon/Display.h -index 09d3cf9..a6a06b2 100644 ---- src/daemon/Display.h -+++ src/daemon/Display.h -@@ -85,6 +85,7 @@ namespace SDDM { - - QString m_passPhrase; - QString m_sessionName; -+ QString m_reuseSessionId; - - Auth *m_auth { nullptr }; - DisplayServer *m_displayServer { nullptr }; Property changes on: head/x11/sddm/files/git-patch-b02b00559 ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/x11/sddm/files/VirtualTerminal_FreeBSD.cpp =================================================================== --- head/x11/sddm/files/VirtualTerminal_FreeBSD.cpp (nonexistent) +++ head/x11/sddm/files/VirtualTerminal_FreeBSD.cpp (revision 525915) @@ -0,0 +1,37 @@ +/*************************************************************************** +* Copyright (c) 2015 Pier Luigi Fiorini +* +* 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 +#include + +#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"; + } + } +} Property changes on: head/x11/sddm/files/VirtualTerminal_FreeBSD.cpp ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/x11/sddm/files/patch-data_scripts_Xsession =================================================================== --- head/x11/sddm/files/patch-data_scripts_Xsession (revision 525914) +++ head/x11/sddm/files/patch-data_scripts_Xsession (revision 525915) @@ -1,23 +1,19 @@ Fix use of "$@" (see sh(1)). There's no systemd on FreeBSD so start the session using $STARTUP which is defined in 90-consolekit if ConsoleKit2 is installed. By default this allows local users to shutdown/reboot the machine and access devices like USB keys. Also use dbus-run-session so libdbus doesn't have to autolauch the session bus 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 $@ + exec $STARTUP /usr/bin/dbus-run-session --dbus-daemon=/usr/bin/dbus-daemon -- "$@" fi Index: head/x11/sddm/files/patch-services_sddm-greeter.pam.in =================================================================== --- head/x11/sddm/files/patch-services_sddm-greeter.pam.in (nonexistent) +++ head/x11/sddm/files/patch-services_sddm-greeter.pam.in (revision 525915) @@ -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 Property changes on: head/x11/sddm/files/patch-services_sddm-greeter.pam.in ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/x11/sddm/files/patch-src_common_Configuration.h =================================================================== --- head/x11/sddm/files/patch-src_common_Configuration.h (revision 525914) +++ head/x11/sddm/files/patch-src_common_Configuration.h (revision 525915) @@ -1,37 +1,32 @@ Leave InputMethod empty by default since qtvirtualkeyboard does not appear to be supported by the included themes. The keyboard is drawn on top of the login screen and has to be clicked away (button lower-right). Set the default theme and cursor theme to breeze, because sddm is most likely 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")); - Entry(Current, QString, _S(""), _S("Current theme name")); + Entry(Current, QString, _S("breeze"), _S("Current theme name")); 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")); + Entry(CursorTheme, QString, _S("breeze_cursors"), _S("Cursor theme used in the greeter")); 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, - Entry(DefaultPath, QString, _S("/usr/local/bin:/usr/bin:/bin"), _S("Default $PATH for logged in users")); + Entry(DefaultPath, QString, _S("/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin"), _S("Default $PATH for logged in users")); Entry(MinimumUid, int, UID_MIN, _S("Minimum user id for displayed users")); Entry(MaximumUid, int, UID_MAX, _S("Maximum user id for displayed users")); Entry(HideUsers, QStringList, QStringList(), _S("Comma-separated list of users that should not be listed")); Index: head/x11/sddm/files/patch-src_daemon_CMakeLists.txt =================================================================== --- head/x11/sddm/files/patch-src_daemon_CMakeLists.txt (revision 525914) +++ head/x11/sddm/files/patch-src_daemon_CMakeLists.txt (revision 525915) @@ -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) Index: head/x11/sddm/files/patch-src_daemon_Display.cpp =================================================================== --- head/x11/sddm/files/patch-src_daemon_Display.cpp (revision 525914) +++ head/x11/sddm/files/patch-src_daemon_Display.cpp (revision 525915) @@ -1,58 +1,25 @@ VirtualTerminal for Wayland is only present on Linux at the moment. As we are only interested in an X11 session at the moment, we therefore can hide it behind a Q_OS_LINUX. Only set XDG_CURRENT_DESKTOP and XDG_SESSION_DESKTOP if the xsession .desktop file defines DesktopNames. Our xinitrc.desktop does not set it because that 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 - #include -@@ -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()); + if (!session.desktopNames().isEmpty()) env.insert(QStringLiteral("XDG_CURRENT_DESKTOP"), session.desktopNames()); env.insert(QStringLiteral("XDG_SESSION_CLASS"), QStringLiteral("user")); env.insert(QStringLiteral("XDG_SESSION_TYPE"), session.xdgSessionType()); env.insert(QStringLiteral("XDG_SEAT"), seat()->name()); + if (!session.desktopNames().isEmpty()) 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); Index: head/x11/sddm/files/patch-src_helper_Backend.cpp =================================================================== --- head/x11/sddm/files/patch-src_helper_Backend.cpp (nonexistent) +++ head/x11/sddm/files/patch-src_helper_Backend.cpp (revision 525915) @@ -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 + + #include ++#if defined(Q_OS_FREEBSD) ++#include ++#include ++#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); + } Property changes on: head/x11/sddm/files/patch-src_helper_Backend.cpp ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/x11/sddm/files/patch-src_helper_CMakeLists.txt =================================================================== --- head/x11/sddm/files/patch-src_helper_CMakeLists.txt (nonexistent) +++ head/x11/sddm/files/patch-src_helper_CMakeLists.txt (revision 525915) @@ -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}) Property changes on: head/x11/sddm/files/patch-src_helper_CMakeLists.txt ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/x11/sddm/files/patch-src_helper_HelperApp.cpp =================================================================== --- head/x11/sddm/files/patch-src_helper_HelperApp.cpp (revision 525914) +++ head/x11/sddm/files/patch-src_helper_HelperApp.cpp (revision 525915) @@ -1,48 +1,46 @@ ---- 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 - #include +@@ -35,7 +35,9 @@ #include -+#include + #include +#if defined(Q_OS_LINUX) #include +#endif #include #include -@@ -301,12 +304,20 @@ namespace SDDM { +@@ -302,12 +304,20 @@ namespace SDDM { // append to failed login database btmp if (!authSuccessful) { +#if defined(Q_OS_FREEBSD) + pututxline(&entry); +#else updwtmpx("/var/log/btmp", &entry); +#endif } // append to wtmp else { +#if defined(Q_OS_FREEBSD) + pututxline(&entry); +#else updwtmpx("/var/log/wtmp", &entry); +#endif } } -@@ -342,8 +353,12 @@ namespace SDDM { +@@ -343,8 +353,12 @@ namespace SDDM { qWarning() << "Failed to write utmpx: " << strerror(errno); endutxent(); +#if defined(Q_OS_FREEBSD) + pututxline(&entry); +#else // append to wtmp updwtmpx("/var/log/wtmp", &entry); +#endif } } Index: head/x11/sddm/files/patch-src_helper_UserSession.cpp =================================================================== --- head/x11/sddm/files/patch-src_helper_UserSession.cpp (revision 525914) +++ head/x11/sddm/files/patch-src_helper_UserSession.cpp (revision 525915) @@ -1,24 +1,55 @@ -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 + #include + #include ++#if defined(Q_OS_FREEBSD) ++#include ++#endif /* defined(Q_OS_FREEBSD) */ + + namespace SDDM { + UserSession::UserSession(HelperApp *parent) +@@ -46,10 +49,8 @@ namespace SDDM { bool UserSession::start() { QProcessEnvironment env = qobject_cast(parent())->session()->processEnvironment(); - if (env.value(QStringLiteral("XDG_SESSION_CLASS")) == QLatin1String("greeter")) { - QProcess::start(m_path); - } else if (env.value(QStringLiteral("XDG_SESSION_TYPE")) == QLatin1String("x11")) { - const QString cmd = QStringLiteral("%1 \"%2\"").arg(mainConfig.X11.SessionCommand.get()).arg(m_path); + if (env.value(QStringLiteral("XDG_SESSION_TYPE")) == QLatin1String("x11")) { + const QString cmd = QStringLiteral("%1 %2").arg(mainConfig.X11.SessionCommand.get()).arg(m_path); 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(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 Index: head/x11/sddm/pkg-plist =================================================================== --- head/x11/sddm/pkg-plist (revision 525914) +++ head/x11/sddm/pkg-plist (revision 525915) @@ -1,187 +1,188 @@ bin/sddm bin/sddm-greeter etc/dbus-1/system.d/org.freedesktop.DisplayManager.conf etc/pam.d/sddm etc/pam.d/sddm-autologin etc/pam.d/sddm-greeter 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 %%QT_QMLDIR%%/SddmComponents/ComboBox.qml %%QT_QMLDIR%%/SddmComponents/ImageButton.qml %%QT_QMLDIR%%/SddmComponents/LayoutBox.qml %%QT_QMLDIR%%/SddmComponents/Menu.qml %%QT_QMLDIR%%/SddmComponents/PasswordBox.qml %%QT_QMLDIR%%/SddmComponents/PictureBox.qml %%QT_QMLDIR%%/SddmComponents/TextBox.qml %%QT_QMLDIR%%/SddmComponents/TextConstants.qml %%QT_QMLDIR%%/SddmComponents/qmldir %%QT_QMLDIR%%/SddmComponents/warning.png libexec/sddm-helper %%DATADIR%%/faces/.face.icon %%DATADIR%%/faces/root.face.icon %%DATADIR%%/flags/ae.png %%DATADIR%%/flags/am.png %%DATADIR%%/flags/ar.png %%DATADIR%%/flags/at.png %%DATADIR%%/flags/az.png %%DATADIR%%/flags/be.png %%DATADIR%%/flags/bg.png %%DATADIR%%/flags/bh.png %%DATADIR%%/flags/br.png %%DATADIR%%/flags/by.png %%DATADIR%%/flags/ca.png %%DATADIR%%/flags/ch.png %%DATADIR%%/flags/cu.png %%DATADIR%%/flags/cz.png %%DATADIR%%/flags/de.png %%DATADIR%%/flags/dj.png %%DATADIR%%/flags/dk.png %%DATADIR%%/flags/dz.png %%DATADIR%%/flags/ee.png %%DATADIR%%/flags/eg.png %%DATADIR%%/flags/es.png %%DATADIR%%/flags/eu.png %%DATADIR%%/flags/fi.png %%DATADIR%%/flags/fr.png %%DATADIR%%/flags/gb.png %%DATADIR%%/flags/ge.png %%DATADIR%%/flags/gr.png %%DATADIR%%/flags/hr.png %%DATADIR%%/flags/hu.png %%DATADIR%%/flags/il.png %%DATADIR%%/flags/in.png %%DATADIR%%/flags/iq.png %%DATADIR%%/flags/is.png %%DATADIR%%/flags/it.png %%DATADIR%%/flags/jo.png %%DATADIR%%/flags/jp.png %%DATADIR%%/flags/km.png %%DATADIR%%/flags/kr.png %%DATADIR%%/flags/kw.png %%DATADIR%%/flags/la.png %%DATADIR%%/flags/lb.png %%DATADIR%%/flags/lt.png %%DATADIR%%/flags/lv.png %%DATADIR%%/flags/ly.png %%DATADIR%%/flags/ma.png %%DATADIR%%/flags/mk.png %%DATADIR%%/flags/mn.png %%DATADIR%%/flags/mx.png %%DATADIR%%/flags/nl.png %%DATADIR%%/flags/no.png %%DATADIR%%/flags/om.png %%DATADIR%%/flags/pl.png %%DATADIR%%/flags/ps.png %%DATADIR%%/flags/pt.png %%DATADIR%%/flags/qa.png %%DATADIR%%/flags/qc.png %%DATADIR%%/flags/ro.png %%DATADIR%%/flags/ru.png %%DATADIR%%/flags/sa.png %%DATADIR%%/flags/sd.png %%DATADIR%%/flags/se.png %%DATADIR%%/flags/si.png %%DATADIR%%/flags/sk.png %%DATADIR%%/flags/so.png %%DATADIR%%/flags/sr.png %%DATADIR%%/flags/sy.png %%DATADIR%%/flags/th.png %%DATADIR%%/flags/tn.png %%DATADIR%%/flags/tr.png %%DATADIR%%/flags/ua.png %%DATADIR%%/flags/uk.png %%DATADIR%%/flags/un.png %%DATADIR%%/flags/us.png %%DATADIR%%/flags/uy.png %%DATADIR%%/flags/vn.png %%DATADIR%%/flags/ye.png %%DATADIR%%/flags/yu.png %%DATADIR%%/flags/zz.png %%DATADIR%%/scripts/Xsession %%DATADIR%%/scripts/Xsetup %%DATADIR%%/scripts/Xstop %%DATADIR%%/scripts/wayland-session %%DATADIR%%/scripts/xinit-session %%DATADIR%%/themes/elarun/Main.qml %%DATADIR%%/themes/elarun/README %%DATADIR%%/themes/elarun/angle-down.png %%DATADIR%%/themes/elarun/elarun.jpg %%DATADIR%%/themes/elarun/images/background.png %%DATADIR%%/themes/elarun/images/lock.png %%DATADIR%%/themes/elarun/images/login_active.png %%DATADIR%%/themes/elarun/images/login_normal.png %%DATADIR%%/themes/elarun/images/rectangle.png %%DATADIR%%/themes/elarun/images/rectangle_overlay.png %%DATADIR%%/themes/elarun/images/session_normal.png %%DATADIR%%/themes/elarun/images/system_hibernate.png %%DATADIR%%/themes/elarun/images/system_reboot.png %%DATADIR%%/themes/elarun/images/system_shutdown.png %%DATADIR%%/themes/elarun/images/system_suspend.png %%DATADIR%%/themes/elarun/images/system_switch_user.png %%DATADIR%%/themes/elarun/images/user_icon.png %%DATADIR%%/themes/elarun/metadata.desktop %%DATADIR%%/themes/elarun/theme.conf %%DATADIR%%/themes/maldives/LICENSE %%DATADIR%%/themes/maldives/Main.qml %%DATADIR%%/themes/maldives/README %%DATADIR%%/themes/maldives/angle-down.png %%DATADIR%%/themes/maldives/background.jpg %%DATADIR%%/themes/maldives/maldives.jpg %%DATADIR%%/themes/maldives/metadata.desktop %%DATADIR%%/themes/maldives/rectangle.png %%DATADIR%%/themes/maldives/theme.conf %%DATADIR%%/themes/maya/LICENSE %%DATADIR%%/themes/maya/Main.qml %%DATADIR%%/themes/maya/README %%DATADIR%%/themes/maya/components/SpButton.qml %%DATADIR%%/themes/maya/components/SpClock.qml %%DATADIR%%/themes/maya/fonts/OpenSans_CondLight.ttf %%DATADIR%%/themes/maya/images/ic_arrow_drop_down_white_24px.svg %%DATADIR%%/themes/maya/images/ic_power_settings_new_white_24px.svg %%DATADIR%%/themes/maya/images/ic_refresh_white_24px.svg %%DATADIR%%/themes/maya/images/ic_warning_white_24px.svg %%DATADIR%%/themes/maya/metadata.desktop %%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 %%DATADIR%%/translations/de.qm %%DATADIR%%/translations/es.qm %%DATADIR%%/translations/et.qm %%DATADIR%%/translations/fi.qm %%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 %%DATADIR%%/translations/ko.qm %%DATADIR%%/translations/lt.qm %%DATADIR%%/translations/lv.qm %%DATADIR%%/translations/nb.qm %%DATADIR%%/translations/nl.qm %%DATADIR%%/translations/nn.qm %%DATADIR%%/translations/pl.qm %%DATADIR%%/translations/pt_BR.qm %%DATADIR%%/translations/pt_PT.qm %%DATADIR%%/translations/ro.qm %%DATADIR%%/translations/ru.qm %%DATADIR%%/translations/sk.qm %%DATADIR%%/translations/sr.qm %%DATADIR%%/translations/sr@ijekavian.qm %%DATADIR%%/translations/sr@ijekavianlatin.qm %%DATADIR%%/translations/sr@latin.qm %%DATADIR%%/translations/sv.qm %%DATADIR%%/translations/tr.qm %%DATADIR%%/translations/uk.qm %%DATADIR%%/translations/zh_CN.qm %%DATADIR%%/translations/zh_TW.qm share/xsessions/xinitrc.desktop