aboutsummaryrefslogtreecommitdiffstats
path: root/x11/sddm/files
diff options
context:
space:
mode:
Diffstat (limited to 'x11/sddm/files')
-rw-r--r--x11/sddm/files/patch-CMakeLists.txt16
-rw-r--r--x11/sddm/files/patch-src_common_Configuration.h39
-rw-r--r--x11/sddm/files/patch-src_daemon_CMakeLists.txt23
-rw-r--r--x11/sddm/files/patch-src_daemon_Display.cpp39
-rw-r--r--x11/sddm/files/patch-src_greeter_UserModel.cpp12
-rw-r--r--x11/sddm/files/patch-src_helper_UserSession.cpp12
-rw-r--r--x11/sddm/files/patch-src_helper_backend_PasswdBackend.cpp46
-rw-r--r--x11/sddm/files/sddm.in75
-rw-r--r--x11/sddm/files/xinit-session12
-rw-r--r--x11/sddm/files/xinitrc.desktop7
10 files changed, 281 insertions, 0 deletions
diff --git a/x11/sddm/files/patch-CMakeLists.txt b/x11/sddm/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..2a7e3aa57836
--- /dev/null
+++ b/x11/sddm/files/patch-CMakeLists.txt
@@ -0,0 +1,16 @@
+1) On FreeBSD X is normally started on VT9.
+2) The shutdown command uses '-p' and not '-P' on FreeBSD.
+
+--- CMakeLists.txt.orig 2016-08-28 11:54:03 UTC
++++ CMakeLists.txt
+@@ -143,8 +143,8 @@ if(SYSTEMD_FOUND)
+ set(REBOOT_COMMAND "/usr/bin/systemctl reboot")
+ else()
+ set(SYSTEMD_FOUND 0)
+- set(MINIMUM_VT 7)
+- set(HALT_COMMAND "/sbin/shutdown -h -P now")
++ set(MINIMUM_VT 9)
++ set(HALT_COMMAND "/sbin/shutdown -h -p now")
+ set(REBOOT_COMMAND "/sbin/shutdown -r now")
+ endif()
+ add_feature_info("systemd" SYSTEMD_FOUND "systemd support")
diff --git a/x11/sddm/files/patch-src_common_Configuration.h b/x11/sddm/files/patch-src_common_Configuration.h
new file mode 100644
index 000000000000..b166b904512c
--- /dev/null
+++ b/x11/sddm/files/patch-src_common_Configuration.h
@@ -0,0 +1,39 @@
+Modify the default configuration to fit in to FreeBSD. That is replace '/usr/bin'
+with '/usr/local/bin' and so on.
+The setting of '$PATH' I find a bit dumb... this should respect the values of the
+users profile...
+
+--- src/common/Configuration.h.orig 2016-08-28 11:54:03 UTC
++++ src/common/Configuration.h
+@@ -58,11 +58,11 @@ namespace SDDM {
+
+ // TODO: Not absolutely sure if everything belongs here. Xsessions, VT and probably some more seem universal
+ Section(X11,
+- Entry(ServerPath, QString, _S("/usr/bin/X"), _S("Path to X server binary"));
++ Entry(ServerPath, QString, _S("/usr/local/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(XephyrPath, QString, _S("/usr/local/bin/Xephyr"), _S("Path to Xephyr binary"));
++ Entry(XauthPath, QString, _S("/usr/local/bin/xauth"), _S("Path to xauth binary"));
++ Entry(SessionDir, QString, _S("/usr/local/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"));
+@@ -72,13 +72,13 @@ namespace SDDM {
+ );
+
+ Section(Wayland,
+- Entry(SessionDir, QString, _S("/usr/share/wayland-sessions"), _S("Directory containing available Wayland sessions"));
++ Entry(SessionDir, QString, _S("/usr/local/share/wayland-sessions"), _S("Directory containing available Wayland sessions"));
+ Entry(SessionCommand, QString, _S(WAYLAND_SESSION_COMMAND), _S("Path to a script to execute when starting the desktop session"));
+ Entry(SessionLogFile, QString, _S(".local/share/sddm/wayland-session.log"),_S("Path to the user session log file"));
+ );
+
+ Section(Users,
+- Entry(DefaultPath, QString, _S("/bin:/usr/bin:/usr/local/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"));
diff --git a/x11/sddm/files/patch-src_daemon_CMakeLists.txt b/x11/sddm/files/patch-src_daemon_CMakeLists.txt
new file mode 100644
index 000000000000..6e4e688fe83c
--- /dev/null
+++ b/x11/sddm/files/patch-src_daemon_CMakeLists.txt
@@ -0,0 +1,23 @@
+This patch does two things:
+1) Add the include directories for 'libxcb' to the compiler search directories,
+2) Remove VirtualTerminal.cpp from the sources that need to be built.
+ see also 'patch-src_daemon_Display.cpp'
+
+--- src/daemon/CMakeLists.txt.orig 2016-08-28 11:54:03 UTC
++++ src/daemon/CMakeLists.txt
+@@ -3,6 +3,7 @@ include_directories(
+ "${CMAKE_SOURCE_DIR}/src/auth"
+ )
+ include_directories("${CMAKE_BINARY_DIR}/src/common")
++include_directories("${LIBXCB_INCLUDE_DIR}")
+
+ set(DAEMON_SOURCES
+ ${CMAKE_SOURCE_DIR}/src/common/Configuration.cpp
+@@ -26,7 +27,6 @@ set(DAEMON_SOURCES
+ SeatManager.cpp
+ SignalHandler.cpp
+ SocketServer.cpp
+- VirtualTerminal.cpp
+ )
+
+ qt5_add_dbus_adaptor(DAEMON_SOURCES "${CMAKE_SOURCE_DIR}/data/interfaces/org.freedesktop.DisplayManager.xml" "DisplayManager.h" SDDM::DisplayManager)
diff --git a/x11/sddm/files/patch-src_daemon_Display.cpp b/x11/sddm/files/patch-src_daemon_Display.cpp
new file mode 100644
index 000000000000..548b57f5d031
--- /dev/null
+++ b/x11/sddm/files/patch-src_daemon_Display.cpp
@@ -0,0 +1,39 @@
+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.
+
+--- src/daemon/Display.cpp.orig 2016-08-28 11:54:03 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>
+@@ -280,8 +282,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,9 +325,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);
diff --git a/x11/sddm/files/patch-src_greeter_UserModel.cpp b/x11/sddm/files/patch-src_greeter_UserModel.cpp
new file mode 100644
index 000000000000..421c946818f5
--- /dev/null
+++ b/x11/sddm/files/patch-src_greeter_UserModel.cpp
@@ -0,0 +1,12 @@
+Call 'setpwent' to rewind to the beginning of the passwd database.
+
+--- src/greeter/UserModel.cpp.orig 2016-07-10 21:26:13 UTC
++++ src/greeter/UserModel.cpp
+@@ -55,6 +55,7 @@ namespace SDDM {
+ const QString defaultFace = QStringLiteral("%1/.face.icon").arg(facesDir);
+
+ struct passwd *current_pw;
++ setpwent();
+ while ((current_pw = getpwent()) != nullptr) {
+
+ // skip entries with uids smaller than minimum uid
diff --git a/x11/sddm/files/patch-src_helper_UserSession.cpp b/x11/sddm/files/patch-src_helper_UserSession.cpp
new file mode 100644
index 000000000000..b89fbd121a76
--- /dev/null
+++ b/x11/sddm/files/patch-src_helper_UserSession.cpp
@@ -0,0 +1,12 @@
+Include '<errno.h>' as 'errno' is used.
+
+--- src/helper/UserSession.cpp.orig 2016-07-06 14:00:10 UTC
++++ src/helper/UserSession.cpp
+@@ -25,6 +25,7 @@
+
+ #include <sys/types.h>
+ #include <sys/ioctl.h>
++#include <errno.h>
+ #include <unistd.h>
+ #include <pwd.h>
+ #include <grp.h>
diff --git a/x11/sddm/files/patch-src_helper_backend_PasswdBackend.cpp b/x11/sddm/files/patch-src_helper_backend_PasswdBackend.cpp
new file mode 100644
index 000000000000..f356b30c74ba
--- /dev/null
+++ b/x11/sddm/files/patch-src_helper_backend_PasswdBackend.cpp
@@ -0,0 +1,46 @@
+Implement password authentication on FreeBSD.
+This needs review :)
+
+--- src/helper/backend/PasswdBackend.cpp.orig 2016-07-06 14:00:10 UTC
++++ src/helper/backend/PasswdBackend.cpp
+@@ -27,8 +27,13 @@
+
+ #include <sys/types.h>
+ #include <pwd.h>
++#if defined(Q_OS_LINUX)
+ #include <shadow.h>
+ #include <crypt.h>
++#endif
++#if defined(Q_OS_FREEBSD)
++#include <unistd.h>
++#endif
+
+ namespace SDDM {
+ PasswdBackend::PasswdBackend(HelperApp *parent)
+@@ -72,6 +77,17 @@ namespace SDDM {
+ return false;
+ }
+
++#if defined(Q_OS_FREEBSD)
++ if (!*pw->pw_passwd)
++ {
++ //empty password
++ return true;
++ }
++ char *crypted = crypt(qPrintable(password), pw->pw_passwd);
++ if (0 == strcmp(crypted, pw->pw_passwd)) {
++ return true;
++ }
++#else
+ struct spwd *spw = getspnam(pw->pw_name);
+ if (!spw) {
+ qWarning() << "[Passwd] Could get passwd but not shadow";
+@@ -85,7 +101,7 @@ namespace SDDM {
+ if (0 == strcmp(crypted, spw->sp_pwdp)) {
+ return true;
+ }
+-
++#endif
+ m_app->error(QStringLiteral("Wrong user/password combination"), Auth::ERROR_AUTHENTICATION);
+ return false;
+ }
diff --git a/x11/sddm/files/sddm.in b/x11/sddm/files/sddm.in
new file mode 100644
index 000000000000..8855b0f60a97
--- /dev/null
+++ b/x11/sddm/files/sddm.in
@@ -0,0 +1,75 @@
+#!/bin/sh
+# $FreeBSD$
+#
+# PROVIDE: sddm
+# REQUIRE: LOGIN cleanvar moused syscons dbus hald
+# KEYWORD: shutdown
+#
+# Add the following to /etc/rc.conf to start SDDM at boot time:
+#
+# sddm_enable="YES"
+
+. /etc/rc.subr
+
+name=sddm
+rcvar=sddm_enable
+
+load_rc_config ${name}
+
+: ${sddm_lang="en_US"} # .UTF-8 suffix will be added later to comply with locale format
+
+command="/usr/local/bin/sddm"
+pidfile="/var/run/sddm.pid"
+start_cmd="sddm_start"
+stop_cmd="sddm_stop"
+
+# Creates /etc/sddm.conf after `sddm --example-config` if it's not there already.
+sddm_genconf()
+{
+ if [ ! -r /etc/sddm.conf ]; then
+ echo "Generating SDDM configuration."
+ ${command} --example-config > /etc/sddm.conf
+ fi
+}
+
+sddm_start()
+{
+ echo "Starting ${name}."
+ local iter
+ sddm_genconf
+
+ ( iter=0
+ while ! ps -axoargs | grep "^/usr/libexec/getty" | grep -qv grep > /dev/null 2>&1; do
+ if [ ${iter} -eq 60 ]; then
+ break
+ fi
+ sleep 1
+ iter=$((${iter} + 1))
+ done
+
+ if checkyesno hald_enable; then
+ if [ ! -x /usr/local/sbin/hald ]; then
+ err 1 "Hald does not seem to be installed."
+ fi
+
+ iter=0
+ while [ ${iter} -lt 60 ] &&
+ !pgrep -f "^/usr/local/sbin/hald" > /dev/null 2>&1; do
+ sleep 1
+ iter=$((${iter} + 1))
+ done
+ fi
+
+ LANG=${sddm_lang}.UTF-8 ${command} ${sddm_flags} ) &
+}
+
+# Only takes the user back to the sddm screen when run from X
+sddm_stop()
+{
+ echo "Stopping ${name}."
+ /bin/kill -9 $(/bin/cat "${pidfile}")
+ pkill -9 -U ${name}
+ pkill -9 X
+}
+
+run_rc_command "$1"
diff --git a/x11/sddm/files/xinit-session b/x11/sddm/files/xinit-session
new file mode 100644
index 000000000000..804728c9ca53
--- /dev/null
+++ b/x11/sddm/files/xinit-session
@@ -0,0 +1,12 @@
+#!/bin/sh
+#
+# Runs the user's .xinitrc (at this point, .xsession has already
+# been sourced).
+
+RC="$HOME/.xinitrc"
+
+test -f "$RC" || exit 1
+
+test -x "$RC" && exec "$RC"
+test -f "$RC" && exec /bin/sh "$RC"
+
diff --git a/x11/sddm/files/xinitrc.desktop b/x11/sddm/files/xinitrc.desktop
new file mode 100644
index 000000000000..72c266b4260f
--- /dev/null
+++ b/x11/sddm/files/xinitrc.desktop
@@ -0,0 +1,7 @@
+[Desktop Entry]
+Encoding=UTF-8
+Type=XSession
+Exec=/usr/local/share/sddm/scripts/xinit-session
+TryExec=/usr/local/share/sddm/scripts/xinit-session
+DesktopNames=User Session
+Name=User Session