Index: x11/gdm/Makefile =================================================================== --- x11/gdm/Makefile +++ x11/gdm/Makefile @@ -2,8 +2,7 @@ # $FreeBSD$ PORTNAME= gdm -PORTVERSION= 3.28.4 -PORTREVISION= 5 +PORTVERSION= 3.38.0 CATEGORIES= x11 gnome MASTER_SITES= GNOME DIST_SUBDIR= gnome @@ -43,45 +42,48 @@ PORTSCOUT= limitw:1,even -USES= cpe gettext gmake gnome libtool localbase:ldflags pathfix pkgconfig tar:xz xorg +USES= cpe gettext gnome localbase:ldflags meson pkgconfig tar:xz xorg CPE_VENDOR= gnome CPE_PRODUCT= gnome_display_manager -USE_GNOME= cairo dconf gconf2 gtk30 intltool introspection +USE_GNOME= cairo dconf gtk30 intltool introspection USE_LDCONFIG= yes USE_XORG= x11 xau xcb xdmcp xorgproto INSTALLS_ICONS= yes USE_RC_SUBR= gdm USE_GNOME_SUBR= yes -GNU_CONFIGURE= yes GLIB_SCHEMAS= org.gnome.login-screen.gschema.xml -CONFIGURE_ARGS= --disable-static \ - --mandir=${PREFIX}/man \ - --with-lang-file=${PREFIX}/etc/gdm/locale.conf \ - --with-at-spi-registryd-directory=${LOCALBASE}/libexec \ - --with-custom-conf=${PREFIX}/etc/gdm/custom.conf \ - --with-dbus-sys=${PREFIX}/etc/dbus-1/system.d \ - --with-log-dir=/var/log/gdm \ - --localstatedir=/var \ - --without-selinux \ - --without-libaudit \ - --with-console-kit \ - --with-working-directory=${PREFIX}/etc/gdm/home \ - --with-sysconfsubdir=gdm \ - --with-pid-file=/var/run/gdm.pid \ - --with-dmconfdir=${LOCALBASE}/share/xsessions \ - --with-screenshot-dir=/var/run/gdm/greeter \ - --enable-authentication-scheme=pam \ - --without-plymouth \ - --without-systemd \ - --with-user=gdm \ - --with-group=gdm \ - --with-initial-vt=09 \ - --enable-gdm-xsession \ - --disable-wayland-support \ - --with-systemd=no +CONFIGURE_ARGS= -Dlang-file=${PREFIX}/etc/gdm/locale.conf \ + -Ddefault-path="${LOCALBASE}/bin:${PREFIX}/bin:/usr/bin:/bin" \ + -Dat-spi-registryd-dir=${LOCALBASE}/libexec \ + -Dcustom-conf=${PREFIX}/etc/gdm/custom.conf \ + -Ddbus-sys=${PREFIX}/etc/dbus-1/system.d \ + -Dlog-dir=/var/log/gdm \ + -Dselinux=disabled \ + -Dlibaudit=disabled \ + -Dconsole-kit=enabled \ + -Dworking-dir=${PREFIX}/etc/gdm/home \ + -Dsysconfsubdir=gdm \ + -Dpid-file=/var/run/gdm.pid \ + -Ddmconfdir=${LOCALBASE}/share/xsessions \ + -Dscreenshot-dir=/var/run/gdm/greeter \ + -Duser-display-server=false \ + -Dplymouth=disabled \ + -Dsystemd=disabled \ + -Duser=gdm \ + -Dgroup=gdm \ + -Dinitial-vt=9 \ + -Dgdm-xsession=true \ + -Dsystemd-journal=false \ + -Dwayland-support=false \ + -Dudev-dir=/ + +# X_SERVER=${LOCALBASE}/bin/Xorg \ +# X_SERVER_PATH=${LOCALBASE}/bin \ +# X_PATH=${LOCALBASE}/bin + # this is a hack until we can get our own pam dir and dir in order. -CONFIGURE_ARGS+=--with-default-pam-config=redhat +CONFIGURE_ARGS+=-Ddefault-pam-config=redhat CPPFLAGS+= -DHAS_SA_LEN INSTALL_TARGET= install-strip @@ -97,7 +99,7 @@ OPTIONS_DEFINE= IPV6 -IPV6_CONFIGURE_ENABLE= ipv6 +IPV6_MESON_TRUE= ipv6 .include @@ -106,33 +108,17 @@ .endif post-patch: - @${REINPLACE_CMD} -e 's|root:root|root:wheel|g' \ - ${WRKSRC}/data/Makefile.in - @${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \ - -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \ - -e 's|/bin/bash|/bin/sh|g' \ - ${WRKSRC}/daemon/gdm-session-worker.c - @${REINPLACE_CMD} -e 's|/usr/X11R6|${LOCALBASE}|g' \ - -e 's|/usr/bin/X|${LOCALBASE}/bin/X|g' \ - -e 's|/usr/bin/Xorg|${LOCALBASE}/bin/Xorg|g' \ - ${WRKSRC}/configure ${WRKSRC}/daemon/*.c ${WRKSRC}/po/*.po - @${REINPLACE_CMD} -e 's|/at-spi-registryd|/at-spi2-registryd|g' \ - ${WRKSRC}/chooser/gdm-host-chooser.c \ - ${WRKSRC}/chooser/chooser-main.c @${REINPLACE_CMD} -e 's|/etc/X11|${LOCALBASE}/etc/X11|g' \ ${WRKSRC}/data/Init.in \ - ${WRKSRC}/data/PostLogin \ - ${WRKSRC}/data/PostSession.in \ - ${WRKSRC}/data/PreSession.in \ - ${WRKSRC}/data/Xsession.in - @${RM} ${WRKSRC}/data/applications/gdm-simple-greeter.desktop \ - ${WRKSRC}/data/applications/gdm-simple-greeter.desktop.in \ - ${WRKSRC}/data/applications/gnome-shell.desktop \ + ${WRKSRC}/data/Xsession.in \ + ${WRKSRC}/libgdm/gdm-sessions.c + @${REINPLACE_CMD} -e 's,/usr/bin/Xwayland,${LOCALBASE}/bin/Xwayland,g' \ + ${WRKSRC}/daemon/gdm-local-display-factory.c + @echo -e "#!/bin/sh\necho ${LOCALBASE}/bin/X" > ${WRKSRC}/build-aux/find-x-server.sh post-install: - ${INSTALL_DATA} ${WRKSRC}/data/gdm.conf-custom \ + ${MV} ${STAGEDIR}${PREFIX}/etc/gdm/custom.conf \ ${STAGEDIR}${PREFIX}/etc/gdm/custom.conf.sample - @${RM} ${STAGEDIR}${PREFIX}/etc/gdm/custom.conf ${MV} ${STAGEDIR}${PREFIX}/etc/gdm/PostSession/Default \ ${STAGEDIR}${PREFIX}/etc/gdm/PostSession/Default.sample ${MV} ${STAGEDIR}${PREFIX}/etc/gdm/PreSession/Default \ @@ -163,9 +149,7 @@ ${INSTALL_DATA} ${WRKDIR}/locale.conf \ ${STAGEDIR}${PREFIX}/etc/gdm/locale.conf.sample - - @${RM} ${STAGEDIR}${PREFIX}/lib/udev/rules.d/61-gdm.rules - @${RMDIR} ${STAGEDIR}${PREFIX}/lib/udev/rules.d - @${RMDIR} ${STAGEDIR}${PREFIX}/lib/udev + ${MKDIR} ${STAGEDIR}/var/log/gdm \ + ${STAGEDIR}/var/run/gdm/greeter \ .include Index: x11/gdm/distinfo =================================================================== --- x11/gdm/distinfo +++ x11/gdm/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1538669234 -SHA256 (gnome/gdm-3.28.4.tar.xz) = 799f524278eb1a663c1d693589878c12ce8fad2293a66ef336e9626e1f933a3b -SIZE (gnome/gdm-3.28.4.tar.xz) = 1133508 +TIMESTAMP = 1602256238 +SHA256 (gnome/gdm-3.38.0.tar.xz) = 46d4415c39c94ccee81fbac21102e2ebcd284d39858c893e759900b1e88435ba +SIZE (gnome/gdm-3.38.0.tar.xz) = 787012 Index: x11/gdm/files/Makefile.am =================================================================== --- x11/gdm/files/Makefile.am +++ /dev/null @@ -1,18 +0,0 @@ -$OpenBSD: patch-Makefile_am,v 1.1 2016/10/31 16:15:46 ajacoutot Exp $ - -REVERT - Linux-PAM -From 714b6af29b916ac7da0cdab6f83460574ed49cf2 Mon Sep 17 00:00:00 2001 -From: Ray Strode -Date: Mon, 15 Aug 2016 13:48:00 -0400 -Subject: pam_gdm: add stub pam module - ---- Makefile.am.orig 2017-10-30 16:21:02.000000000 +0100 -+++ Makefile.am 2018-01-14 12:30:07.298406000 +0100 -@@ -7,7 +7,6 @@ SUBDIRS = \ - daemon \ - libgdm \ - utils \ -- pam_gdm \ - po \ - tests \ - $(NULL) Index: x11/gdm/files/configure.ac =================================================================== --- x11/gdm/files/configure.ac +++ /dev/null @@ -1,154 +0,0 @@ -$OpenBSD: patch-configure_ac,v 1.12 2017/04/17 13:17:07 ajacoutot Exp $ - -REVERT - Linux-PAM -From 714b6af29b916ac7da0cdab6f83460574ed49cf2 Mon Sep 17 00:00:00 2001 -From: Ray Strode -Date: Mon, 15 Aug 2016 13:48:00 -0400 -Subject: pam_gdm: add stub pam module - -REVERT - OpenBSD does not have a systemd implementation (we need ConsoleKit) -From 1ac67f522f5690c27023d98096ca817f12f7eb88 Mon Sep 17 00:00:00 2001 -From: Ray Strode -Date: Fri, 12 Jun 2015 13:28:01 -0400 -Subject: drop consolekit support - -https://bugzilla.gnome.org/show_bug.cgi?id=722482 - ---- configure.ac.orig 2017-10-30 16:21:11.000000000 +0100 -+++ configure.ac 2018-01-14 13:01:16.646216000 +0100 -@@ -232,12 +232,6 @@ AM_CONDITIONAL(ENABLE_EXHERBO_PAM_CONFIG, test x$with_ - AM_CONDITIONAL(ENABLE_LFS_PAM_CONFIG, test x$with_default_pam_config = xlfs) - AM_CONDITIONAL(ENABLE_ARCH_PAM_CONFIG, test x$with_default_pam_config = xarch) - --AC_CHECK_HEADERS([security/pam_modules.h security/pam_modutil.h security/pam_ext.h], -- [have_pam=yes], -- [if test "x$have_pam" = xyes ; then -- AC_MSG_ERROR([PAM development files not found.]) -- fi]) -- - AC_ARG_ENABLE(console-helper, - AS_HELP_STRING([--enable-console-helper], - [Enable PAM console helper @<:@default=auto@:>@]),, -@@ -263,7 +257,15 @@ AC_ARG_WITH(tcp-wrappers, - [Use TCP Wrappers @<:@default=auto@:>@]),, - with_tcp_wrappers=auto) - -+AC_ARG_WITH(console-kit, -+ AS_HELP_STRING([--with-console-kit], -+ [Add ConsoleKit support @<:@default=auto@:>@]),, -+ with_console_kit=no) - -+AC_ARG_WITH(systemd, -+ AS_HELP_STRING([--with-systemd], -+ [Add systemd support @<:@default=auto@:>@]), -+ [with_systemd=$withval], [with_systemd=auto]) - AC_ARG_WITH([systemdsystemunitdir], - AS_HELP_STRING([--with-systemdsystemunitdir=DIR], - [Directory for systemd service files]), -@@ -548,6 +550,8 @@ fi - if test "x$supports_pam_extensions" = "xyes" ; then - AM_CONDITIONAL(SUPPORTS_PAM_EXTENSIONS, true) - AC_DEFINE(SUPPORTS_PAM_EXTENSIONS, 1, [Define if PAM supports GDMs custom extensions]) -+else -+ AM_CONDITIONAL(SUPPORTS_PAM_EXTENSIONS, false) - fi - - AC_CHECK_LIB(keyutils, keyctl_read, [ -@@ -655,14 +659,8 @@ dnl -------------------------------------------------- - dnl - Check for utmp stuff - dnl --------------------------------------------------------------------------- - --AC_CHECK_HEADERS(utmp.h utmpx.h libutil.h sys/param.h) --AC_CHECK_FUNCS([getutxent updwtmpx updwtmp]) --AC_CHECK_LIB(util, login, [ -- AC_DEFINE(HAVE_LOGIN, 1, [Define if have login]) -- EXTRA_DAEMON_LIBS="$EXTRA_DAEMON_LIBS -lutil" ]) --AC_CHECK_LIB(util, logout, [ -- AC_DEFINE(HAVE_LOGOUT, 1, [Define if have logout]) -- EXTRA_DAEMON_LIBS="$EXTRA_DAEMON_LIBS -lutil" ]) -+AC_CHECK_HEADERS(utmp.h utmpx.h util.h sys/param.h) -+AC_CHECK_FUNCS([getutxent getttyent updwtmpx updwtmp]) - AC_CHECK_LIB(util, logwtmp, [ - AC_DEFINE(HAVE_LOGWTMP, 1, [Define if have logwtmp]) - EXTRA_DAEMON_LIBS="$EXTRA_DAEMON_LIBS -lutil" ]) -@@ -911,12 +909,42 @@ AC_SUBST(XINERAMA_LIBS) - CPPFLAGS="$xinerama_save_cppflags" - - dnl --------------------------------------------------------------------------- -+dnl - Check for ConsoleKit support -+dnl --------------------------------------------------------------------------- -+ -+use_console_kit=no -+if test "x$with_console_kit" != "xno" ; then -+ use_console_kit=yes -+ AC_DEFINE(WITH_CONSOLE_KIT, 1, [Define to enable ConsoleKit support]) -+fi -+AM_CONDITIONAL(WITH_CONSOLE_KIT, test x$use_console_kit = xyes) -+AC_SUBST(WITH_CONSOLE_KIT) -+ -+dnl --------------------------------------------------------------------------- - dnl - Check for systemd support - dnl --------------------------------------------------------------------------- - - PKG_CHECK_MODULES(SYSTEMD, -- [libsystemd]) -+ [libsystemd-login >= 186 libsystemd-daemon], -+ [have_systemd=yes], [have_systemd=no]) - -+if test "x$with_systemd" = "xauto" ; then -+ if test x$have_systemd = xno ; then -+ use_systemd=no -+ else -+ use_systemd=yes -+ fi -+else -+ use_systemd="$with_systemd" -+fi -+ -+if test "x$use_systemd" != "xno" ; then -+ if test "x$have_systemd" = "xno"; then -+ AC_MSG_ERROR([Systemd support explicitly required, but systemd not found]) -+ fi -+ -+ AC_DEFINE(WITH_SYSTEMD, 1, [Define to enable systemd support]) -+fi - AC_SUBST(SYSTEMD_CFLAGS) - AC_SUBST(SYSTEMD_LIBS) - -@@ -1111,6 +1139,14 @@ fi - AC_SUBST(GDM_CUSTOM_CONF) - AC_SUBST(GDM_OLD_CONF, '${gdmconfdir}/gdm.conf') - -+AC_ARG_WITH(consolekit-directory, -+ [AC_HELP_STRING([--with-consolekit-directory], -+ [Specify the directory of ck-get-x11-display-device @<:@default=libexecdir@:>@])],, -+ [with_consolekit_directory="\${libexecdir}"]) -+ -+CONSOLEKIT_DIR=$with_consolekit_directory -+AC_SUBST(CONSOLEKIT_DIR) -+ - AC_ARG_WITH(gnome-settings-daemon-directory, - [AC_HELP_STRING([--with-gnome-settings-daemon-directory], - [Specify the directory of gnome-settings-daemon used by the chooser @<:@default=libexecdir@:>@])],, -@@ -1601,6 +1637,7 @@ echo " - dmconfdir: ${dmconfdir} - localstatedir: ${localstatedir} - datadir: ${datadir} -+ consolekit location: ${with_consolekit_directory} - gnome-settings-daemon location: ${with_gnome_settings_daemon_directory} - gnome-session-check-accel location: ${with_check_accelerated_directory} - source code location: ${srcdir} -@@ -1631,6 +1668,8 @@ echo \ - " Xinerama support: ${XINERAMA_SUPPORT} - XDMCP support: ${XDMCP_SUPPORT} - SELinux support: ${use_selinux} -+ ConsoleKit support: ${use_console_kit} -+ systemd support: ${use_systemd} - systemd unit dir: ${with_systemdsystemunitdir} - plymouth support: ${use_plymouth} - wayland support: ${enable_wayland_support} -@@ -1639,3 +1678,4 @@ echo \ - Enable documentation: ${enable_documentation} - Install GDM's Xsession: ${enable_gdm_xsession} - " -+ Index: x11/gdm/files/daemon_Makefile.am =================================================================== --- x11/gdm/files/daemon_Makefile.am +++ /dev/null @@ -1,33 +0,0 @@ ---- daemon/Makefile.am.orig 2017-10-30 16:21:02.000000000 +0100 -+++ daemon/Makefile.am 2018-01-14 12:30:11.501517000 +0100 -@@ -21,6 +21,7 @@ AM_CPPFLAGS = \ - -DGDM_SCREENSHOT_DIR=\"$(GDM_SCREENSHOT_DIR)\" \ - -DGDM_CACHE_DIR=\""$(localstatedir)/cache/gdm"\" \ - -DGDM_SESSION_DEFAULT_PATH=\"$(GDM_SESSION_DEFAULT_PATH)\" \ -+ -DCONSOLEKIT_DIR=\"$(CONSOLEKIT_DIR)\" \ - $(DISABLE_DEPRECATED_CFLAGS) \ - $(DAEMON_CFLAGS) \ - $(XLIB_CFLAGS) \ -@@ -267,6 +268,11 @@ EXTRA_gdm_SOURCES = \ - $(XDMCP_SOURCES) \ - $(NULL) - -+CONSOLE_KIT_SOURCES = \ -+ $(NULL) -+ -+EXTRA_gdm_SOURCES += $(CONSOLE_KIT_SOURCES) -+ - gdm_LDADD = \ - $(top_builddir)/common/libgdmcommon.la \ - $(XLIB_LIBS) \ -@@ -277,6 +283,10 @@ gdm_LDADD = \ - $(JOURNALD_LIBS) \ - $(EXTRA_DAEMON_LIBS) \ - $(NULL) -+ -+if WITH_CONSOLE_KIT -+gdm_SOURCES += $(CONSOLE_KIT_SOURCES) -+endif - - CLEANFILES = \ - gdm-display-glue.c \ Index: x11/gdm/files/find-x-server.sh.in =================================================================== --- /dev/null +++ x11/gdm/files/find-x-server.sh.in @@ -0,0 +1,14 @@ +#!/bin/sh +# +# First check with "! -h" for /usr/X11R6 and /usr/X11 since they often +# symlink to each other, and configure should use the more stable +# location (the real directory) if possible. +# +# On Solaris, the /usr/bin/Xserver script is used to decide whether to +# use Xsun or Xorg, so this is used on Solaris. +# +# When testing for /usr/X11R6, first check with "! -h" for /usr/X11R6 +# and /usr/X11 since they often symlink to each other, and configure +# should use the more stable location (the real directory) if possible. +# +echo "${LOCALBASE}/bin/X" Index: x11/gdm/files/patch-Makefile.in =================================================================== --- x11/gdm/files/patch-Makefile.in +++ /dev/null @@ -1,20 +0,0 @@ ---- Makefile.in.orig 2018-01-14 11:27:57.277621000 +0100 -+++ Makefile.in 2018-01-14 11:28:53.422079000 +0100 -@@ -162,7 +162,7 @@ - ETAGS = etags - CTAGS = ctags - CSCOPE = cscope --DIST_SUBDIRS = data common pam-extensions daemon libgdm utils pam_gdm \ -+DIST_SUBDIRS = data common pam-extensions daemon libgdm utils \ - po tests chooser docs - am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ - $(top_srcdir)/data/dconf/gdm.in AUTHORS COPYING ChangeLog \ -@@ -472,7 +472,7 @@ - top_builddir = @top_builddir@ - top_srcdir = @top_srcdir@ - NULL = --SUBDIRS = data common pam-extensions daemon libgdm utils pam_gdm po \ -+SUBDIRS = data common pam-extensions daemon libgdm utils po \ - tests $(NULL) $(am__append_1) $(am__append_2) - ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} - EXTRA_DIST = \ Index: x11/gdm/files/patch-chooser_chooser-main.c =================================================================== --- /dev/null +++ x11/gdm/files/patch-chooser_chooser-main.c @@ -0,0 +1,11 @@ +--- chooser/chooser-main.c.orig 2019-12-15 18:42:24 UTC ++++ chooser/chooser-main.c +@@ -50,7 +50,7 @@ assistive_registry_launch (void) + char **argv; + gboolean res; + +- command = AT_SPI_REGISTRYD_DIR "/at-spi-registryd"; ++ command = AT_SPI_REGISTRYD_DIR "/at-spi2-registryd"; + + argv = NULL; + error = NULL; Index: x11/gdm/files/patch-chooser_gdm-host-chooser.c =================================================================== --- /dev/null +++ x11/gdm/files/patch-chooser_gdm-host-chooser.c @@ -0,0 +1,11 @@ +--- chooser/gdm-host-chooser.c.orig 2019-12-15 18:42:24 UTC ++++ chooser/gdm-host-chooser.c +@@ -51,7 +51,7 @@ assistive_registry_launch (void) + char **argv; + gboolean res; + +- command = AT_SPI_REGISTRYD_DIR "/at-spi-registryd"; ++ command = AT_SPI_REGISTRYD_DIR "/at-spi2-registryd"; + + argv = NULL; + error = NULL; Index: x11/gdm/files/patch-common_Makefile.in =================================================================== --- x11/gdm/files/patch-common_Makefile.in +++ /dev/null @@ -1,10 +0,0 @@ ---- common/Makefile.in.orig 2014-03-21 08:15:10.657611891 +0000 -+++ common/Makefile.in 2014-03-21 08:17:08.641605278 +0000 -@@ -548,6 +548,7 @@ - $(NULL) - - libgdmcommon_la_LIBADD = \ -+ -lexecinfo \ - $(SYSTEMD_LIBS) \ - $(NULL) - Index: x11/gdm/files/patch-common_gdm-common.h =================================================================== --- x11/gdm/files/patch-common_gdm-common.h +++ x11/gdm/files/patch-common_gdm-common.h @@ -1,20 +1,52 @@ -$OpenBSD: patch-common_gdm-common_h,v 1.2 2016/04/15 14:11:09 ajacoutot Exp $ +$OpenBSD: patch-common_gdm-common_h,v 1.5 2020/05/14 15:25:54 ajacoutot Exp $ REVERT - OpenBSD does not have a systemd implementation (we need ConsoleKit) +From fcba1e1a5d556ce7b52101dbd2d1ba4a19469161 Mon Sep 17 00:00:00 2001 +From: Iain Lane +Date: Fri, 5 Jan 2018 11:53:34 +0000 +Subject: [PATCH] manager: Find user's current graphical session, not session of caller + +REVERT - OpenBSD does not have a systemd implementation (we need ConsoleKit) From 9be58c9ec9a3a411492a5182ac4b0d51fdc3a323 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Fri, 12 Jun 2015 13:48:52 -0400 Subject: require logind support ---- common/gdm-common.h.orig Thu Apr 14 07:27:26 2016 -+++ common/gdm-common.h Fri Apr 15 15:05:26 2016 -@@ -31,6 +31,9 @@ - expr; \ - } while G_UNLIKELY (errno == EINTR); +Index: common/gdm-common.h +--- common/gdm-common.h.orig 2020-07-13 20:36:07 UTC ++++ common/gdm-common.h +@@ -37,6 +37,11 @@ + #define GDM_SYSTEMD_SESSION_REQUIRE_ONLINE 0 + +/* check if logind is running */ +#define LOGIND_RUNNING() (access("/run/systemd/seats/", F_OK) >= 0) + ++#define GDM_SYSTEMD_SESSION_REQUIRE_ONLINE 0 ++ GQuark gdm_common_error_quark (void); #define GDM_COMMON_ERROR gdm_common_error_quark() + +@@ -51,11 +56,6 @@ int gdm_wait_on_and_disown_pid (int pid, + int gdm_signal_pid (int pid, + int signal); + +-gboolean gdm_find_display_session (GPid pid, +- const uid_t uid, +- char **out_session_id, +- GError **error); +- + gboolean gdm_get_pwent_for_name (const char *name, + struct passwd **pwentp); + +@@ -82,10 +82,6 @@ gboolean gdm_shell_var_is_valid_char (char c, + char * gdm_shell_expand (const char *str, + GdmExpandVarFunc expand_func, + gpointer user_data); +- +-gboolean gdm_activate_session_by_id (GDBusConnection *connection, +- const char *seat_id, +- const char *session_id); + + G_END_DECLS Index: x11/gdm/files/patch-common_gdm-common.c =================================================================== --- x11/gdm/files/patch-common_gdm-common.c +++ x11/gdm/files/patch-common_gdm-common.c @@ -1,6 +1,12 @@ -$OpenBSD: patch-common_gdm-common_c,v 1.4 2015/10/18 13:25:54 ajacoutot Exp $ +$OpenBSD: patch-common_gdm-common_c,v 1.8 2020/05/14 15:25:54 ajacoutot Exp $ REVERT - OpenBSD does not have a systemd implementation (we need ConsoleKit) +From fcba1e1a5d556ce7b52101dbd2d1ba4a19469161 Mon Sep 17 00:00:00 2001 +From: Iain Lane +Date: Fri, 5 Jan 2018 11:53:34 +0000 +Subject: [PATCH] manager: Find user's current graphical session, not session of caller + +REVERT - OpenBSD does not have a systemd implementation (we need ConsoleKit) From 9be58c9ec9a3a411492a5182ac4b0d51fdc3a323 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Fri, 12 Jun 2015 13:48:52 -0400 @@ -12,12 +18,13 @@ Date: Fri, 12 Jun 2015 13:28:01 -0400 Subject: drop consolekit support ---- common/gdm-common.c.orig Sun Oct 18 14:26:27 2015 -+++ common/gdm-common.c Sun Oct 18 14:24:34 2015 -@@ -39,12 +39,25 @@ - #include "mkdtemp.h" - #endif +Index: common/gdm-common.c +--- common/gdm-common.c.orig 2020-07-13 20:36:07 UTC ++++ common/gdm-common.c +@@ -36,12 +36,25 @@ + #include "gdm-common.h" + +#ifdef WITH_SYSTEMD #include +#endif @@ -39,24 +46,21 @@ + G_DEFINE_QUARK (gdm-common-error, gdm_common_error); - const char * -@@ -343,15 +356,306 @@ create_transient_display (GDBusConnection *connection, + gboolean +@@ -352,8 +365,87 @@ create_transient_display (GDBusConnection *connection, return TRUE; } +#ifdef WITH_CONSOLE_KIT -+ - static gboolean --activate_session_id (GDBusConnection *connection, -- const char *seat_id, -- const char *session_id) + gboolean +-gdm_activate_session_by_id (GDBusConnection *connection, +get_current_session_id (GDBusConnection *connection, + char **session_id) - { - GError *local_error = NULL; - GVariant *reply; - - reply = g_dbus_connection_call_sync (connection, ++{ ++ GError *local_error = NULL; ++ GVariant *reply; ++ ++ reply = g_dbus_connection_call_sync (connection, + CK_NAME, + CK_MANAGER_PATH, + CK_MANAGER_INTERFACE, @@ -127,15 +131,15 @@ + return seat_id; +} + -+static gboolean ++gboolean +activate_session_id_for_ck (GDBusConnection *connection, -+ const char *seat_id, -+ const char *session_id) -+{ -+ GError *local_error = NULL; -+ GVariant *reply; -+ -+ reply = g_dbus_connection_call_sync (connection, + const char *seat_id, + const char *session_id) + { +@@ -361,6 +453,217 @@ gdm_activate_session_by_id (GDBusConnection *connectio + GVariant *reply; + + reply = g_dbus_connection_call_sync (connection, + CK_NAME, + seat_id, + CK_SEAT_INTERFACE, @@ -259,7 +263,7 @@ + const char *seat_id, + char **session_id) +{ -+ gboolean can_activate_sessions; ++ gboolean can_activate_sessions; + const char **sessions; + int i; + @@ -338,7 +342,7 @@ + +#ifdef WITH_SYSTEMD + -+static gboolean ++gboolean +activate_session_id_for_systemd (GDBusConnection *connection, + const char *seat_id, + const char *session_id) @@ -350,18 +354,18 @@ "org.freedesktop.login1", "/org/freedesktop/login1", "org.freedesktop.login1.Manager", -@@ -373,8 +677,8 @@ activate_session_id (GDBusConnection *connection, +@@ -382,8 +685,8 @@ gdm_activate_session_by_id (GDBusConnection *connectio } - static gboolean --get_login_window_session_id (const char *seat_id, -- char **session_id) + gboolean +-gdm_get_login_window_session_id (const char *seat_id, +- char **session_id) +get_login_window_session_id_for_systemd (const char *seat_id, + char **session_id) { gboolean ret; int res, i; -@@ -442,8 +746,8 @@ out: +@@ -476,15 +779,14 @@ out: } static gboolean @@ -372,19 +376,39 @@ { gboolean ret; int res; -@@ -497,9 +801,9 @@ goto_login_session (GDBusConnection *connection, + char *our_session; + char *session_id; + char *seat_id; +- GError *local_error = NULL; + + ret = FALSE; + session_id = NULL; +@@ -497,8 +799,10 @@ goto_login_session (GDBusConnection *connection, + * since the data allocated is from libsystemd-logind, which + * does not use GLib's g_malloc (). */ + +- if (!gdm_find_display_session (0, getuid (), &our_session, &local_error)) { +- g_propagate_prefixed_error (error, local_error, _("Could not identify the current session: ")); ++ res = sd_pid_get_session (0, &our_session); ++ if (res < 0) { ++ g_debug ("failed to determine own session: %s", strerror (-res)); ++ g_set_error (error, GDM_COMMON_ERROR, 0, _("Could not identify the current session.")); + return FALSE; } +@@ -530,9 +834,9 @@ goto_login_session (GDBusConnection *connection, + return FALSE; + } -- res = get_login_window_session_id (seat_id, &session_id); +- res = gdm_get_login_window_session_id (seat_id, &session_id); + res = get_login_window_session_id_for_systemd (seat_id, &session_id); if (res && session_id != NULL) { -- res = activate_session_id (connection, seat_id, session_id); +- res = gdm_activate_session_by_id (connection, seat_id, session_id); + res = activate_session_id_for_systemd (connection, seat_id, session_id); if (res) { ret = TRUE; -@@ -518,6 +822,7 @@ goto_login_session (GDBusConnection *connection, +@@ -551,6 +855,7 @@ goto_login_session (GDBusConnection *connection, return ret; } @@ -392,7 +416,7 @@ gboolean gdm_goto_login_session (GError **error) -@@ -533,7 +838,17 @@ gdm_goto_login_session (GError **error) +@@ -566,7 +871,17 @@ gdm_goto_login_session (GError **error) return FALSE; } @@ -411,3 +435,140 @@ } static void +@@ -841,136 +1156,4 @@ gdm_shell_expand (const char *str, + } + } + return g_string_free (s, FALSE); +-} +- +-static gboolean +-_systemd_session_is_graphical (const char *session_id) +-{ +- const gchar * const graphical_session_types[] = { "wayland", "x11", "mir", NULL }; +- int saved_errno; +- g_autofree gchar *type = NULL; +- +- saved_errno = sd_session_get_type (session_id, &type); +- if (saved_errno < 0) { +- g_warning ("Couldn't get type for session '%s': %s", +- session_id, +- g_strerror (-saved_errno)); +- return FALSE; +- } +- +- if (!g_strv_contains (graphical_session_types, type)) { +- g_debug ("Session '%s' is not a graphical session (type: '%s')", +- session_id, +- type); +- return FALSE; +- } +- +- return TRUE; +-} +- +-static gboolean +-_systemd_session_is_active (const char *session_id) +-{ +- const gchar * const active_states[] = { "active", "online", NULL }; +- int saved_errno; +- g_autofree gchar *state = NULL; +- +- /* +- * display sessions can be 'closing' if they are logged out but some +- * processes are lingering; we shouldn't consider these (this is +- * checking for a race condition since we specified +- * GDM_SYSTEMD_SESSION_REQUIRE_ONLINE) +- */ +- saved_errno = sd_session_get_state (session_id, &state); +- if (saved_errno < 0) { +- g_warning ("Couldn't get state for session '%s': %s", +- session_id, +- g_strerror (-saved_errno)); +- return FALSE; +- } +- +- if (!g_strv_contains (active_states, state)) { +- g_debug ("Session '%s' is not active or online", session_id); +- return FALSE; +- } +- +- return TRUE; +-} +- +-gboolean +-gdm_find_display_session (GPid pid, +- const uid_t uid, +- char **out_session_id, +- GError **error) +-{ +- char *local_session_id = NULL; +- g_auto(GStrv) sessions = NULL; +- int n_sessions; +- int res; +- +- g_return_val_if_fail (out_session_id != NULL, FALSE); +- +- /* First try to look up the session using the pid. We need this +- * at least for the greeter, because it currently runs multiple +- * sessions under the same user. +- * See also commit 2b52d8933c8ab38e7ee83318da2363d00d8c5581 +- * which added an explicit dbus-run-session for all but seat0. +- */ +- res = sd_pid_get_session (pid, &local_session_id); +- if (res >= 0) { +- g_debug ("GdmCommon: Found session %s for PID %d, using", local_session_id, pid); +- +- *out_session_id = g_strdup (local_session_id); +- free (local_session_id); +- +- return TRUE; +- } else { +- if (res != -ENODATA) +- g_warning ("GdmCommon: Failed to retrieve session information for pid %d: %s", +- pid, strerror (-res)); +- } +- +- g_debug ("Finding a graphical session for user %d", uid); +- +- n_sessions = sd_uid_get_sessions (uid, +- GDM_SYSTEMD_SESSION_REQUIRE_ONLINE, +- &sessions); +- +- if (n_sessions < 0) { +- g_set_error (error, +- GDM_COMMON_ERROR, +- 0, +- "Failed to get sessions for user %d", +- uid); +- return FALSE; +- } +- +- for (int i = 0; i < n_sessions; ++i) { +- g_debug ("Considering session '%s'", sessions[i]); +- +- if (!_systemd_session_is_graphical (sessions[i])) +- continue; +- +- if (!_systemd_session_is_active (sessions[i])) +- continue; +- +- /* +- * We get the sessions from newest to oldest, so take the last +- * one we find that's good +- */ +- local_session_id = sessions[i]; +- } +- +- if (local_session_id == NULL) { +- g_set_error (error, +- GDM_COMMON_ERROR, +- 0, +- "Could not find a graphical session for user %d", +- uid); +- return FALSE; +- } +- +- *out_session_id = g_strdup (local_session_id); +- +- return TRUE; + } Index: x11/gdm/files/patch-common_gdm-log.c =================================================================== --- x11/gdm/files/patch-common_gdm-log.c +++ x11/gdm/files/patch-common_gdm-log.c @@ -1,4 +1,4 @@ -$OpenBSD: patch-common_gdm-log_c,v 1.1 2015/10/18 13:25:54 ajacoutot Exp $ +$OpenBSD: patch-common_gdm-log_c,v 1.2 2018/04/24 08:37:00 ajacoutot Exp $ REVERT - OpenBSD does not have a systemd implementation (we need ConsoleKit) From 9be58c9ec9a3a411492a5182ac4b0d51fdc3a323 Mon Sep 17 00:00:00 2001 @@ -6,8 +6,9 @@ Date: Fri, 12 Jun 2015 13:48:52 -0400 Subject: require logind support ---- common/gdm-log.c.orig 2018-02-19 19:16:32.000000000 +0100 -+++ common/gdm-log.c 2018-04-05 21:59:25.290775000 +0200 +Index: common/gdm-log.c +--- common/gdm-log.c.orig 2019-12-15 18:42:24 UTC ++++ common/gdm-log.c @@ -30,7 +30,9 @@ #include @@ -22,9 +23,9 @@ void gdm_log_init (void) { -+ const char *prg_name; -+ int options; -+ ++ const char *prg_name; ++ int options; ++ if (initialized) return; Index: x11/gdm/files/patch-config.h.in =================================================================== --- x11/gdm/files/patch-config.h.in +++ /dev/null @@ -1,69 +0,0 @@ ---- config.h.in.orig 2018-01-14 13:03:01.638908000 +0100 -+++ config.h.in 2018-01-14 13:03:20.000000000 +0100 -@@ -113,6 +113,9 @@ - /* Define to 1 if you have the header file. */ - #undef HAVE_EXECINFO_H - -+/* Define to 1 if you have the `getttyent' function. */ -+#undef HAVE_GETTTYENT -+ - /* Define to 1 if you have the `getutxent' function. */ - #undef HAVE_GETUTXENT - -@@ -128,21 +131,12 @@ - /* Define if we have libgen.h */ - #undef HAVE_LIBGEN_H - --/* Define to 1 if you have the header file. */ --#undef HAVE_LIBUTIL_H -- - /* Define if have libxdmcp */ - #undef HAVE_LIBXDMCP - --/* Define if have login */ --#undef HAVE_LOGIN -- - /* Define if we have logincap */ - #undef HAVE_LOGINCAP - --/* Define if have logout */ --#undef HAVE_LOGOUT -- - /* Define if have logwtmp */ - #undef HAVE_LOGWTMP - -@@ -167,9 +161,6 @@ - /* Define to 1 if you have the header file. */ - #undef HAVE_SECURITY_PAM_EXT_H - --/* Define to 1 if you have the header file. */ --#undef HAVE_SECURITY_PAM_MODULES_H -- - /* Define to 1 if you have the header file. */ - #undef HAVE_SECURITY_PAM_MODUTIL_H - -@@ -239,6 +230,9 @@ - /* Define to 1 if you have the `updwtmpx' function. */ - #undef HAVE_UPDWTMPX - -+/* Define to 1 if you have the header file. */ -+#undef HAVE_UTIL_H -+ - /* Define to 1 if you have the header file. */ - #undef HAVE_UTMPX_H - -@@ -372,8 +366,14 @@ - /* Version number of package */ - #undef VERSION - -+/* Define to enable ConsoleKit support */ -+#undef WITH_CONSOLE_KIT -+ - /* Define to enable plymouth support */ - #undef WITH_PLYMOUTH -+ -+/* Define to enable systemd support */ -+#undef WITH_SYSTEMD - - /* Define xevie option */ - #undef XEVIE_OPTION Index: x11/gdm/files/patch-configure =================================================================== --- x11/gdm/files/patch-configure +++ /dev/null @@ -1,431 +0,0 @@ ---- configure.orig 2018-01-14 13:01:10.629609000 +0100 -+++ configure 2018-01-14 13:02:06.272152000 +0100 -@@ -677,6 +677,7 @@ HAVE_ADT_TRUE - XEVIE_OPTION - CHECK_ACCELERATED_DIR - GNOME_SETTINGS_DAEMON_DIR -+CONSOLEKIT_DIR - GDM_OLD_CONF - GDM_CUSTOM_CONF - GDM_DEFAULTS_CONF -@@ -697,6 +698,9 @@ JOURNALD_LIBS - JOURNALD_CFLAGS - SYSTEMD_LIBS - SYSTEMD_CFLAGS -+WITH_CONSOLE_KIT -+WITH_CONSOLE_KIT_FALSE -+WITH_CONSOLE_KIT_TRUE - XINERAMA_LIBS - LIBWRAP_LIBS - OS_SOLARIS_FALSE -@@ -983,6 +987,8 @@ enable_authentication_scheme - with_xinerama - with_xdmcp - with_tcp_wrappers -+with_console_kit -+with_systemd - with_systemdsystemunitdir - enable_systemd_journal - enable_wayland_support -@@ -1002,6 +1008,7 @@ with_log_dir - with_at_bindir - with_defaults_conf - with_custom_conf -+with_consolekit_directory - with_gnome_settings_daemon_directory - with_check_accelerated_directory - with_xevie -@@ -1748,6 +1755,8 @@ Optional Packages: - --with-xinerama Add Xinerama support [default=auto] - --with-xdmcp Add XDMCP (remote login) support [default=auto] - --with-tcp-wrappers Use TCP Wrappers [default=auto] -+ --with-console-kit Add ConsoleKit support [default=auto] -+ --with-systemd Add systemd support [default=auto] - --with-systemdsystemunitdir=DIR - Directory for systemd service files - --with-plymouth Add plymouth support [default=yes] -@@ -1776,6 +1785,9 @@ Optional Packages: - --with-custom-conf= - FILENAME to give to custom configuration file - [default=GDMCONFDIR/custom.conf] -+ --with-consolekit-directory -+ Specify the directory of ck-get-x11-display-device -+ [default=libexecdir] - --with-gnome-settings-daemon-directory - Specify the directory of gnome-settings-daemon used - by the chooser [default=libexecdir] -@@ -20860,24 +20872,6 @@ else - fi - - --for ac_header in security/pam_modules.h security/pam_modutil.h security/pam_ext.h --do : -- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` --ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" --if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : -- cat >>confdefs.h <<_ACEOF --#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 --_ACEOF -- have_pam=yes --else -- if test "x$have_pam" = xyes ; then -- as_fn_error $? "PAM development files not found." "$LINENO" 5 -- fi --fi -- --done -- -- - # Check whether --enable-console-helper was given. - if test "${enable_console_helper+set}" = set; then : - enableval=$enable_console_helper; -@@ -20922,7 +20916,23 @@ fi - - - -+# Check whether --with-console-kit was given. -+if test "${with_console_kit+set}" = set; then : -+ withval=$with_console_kit; -+else -+ with_console_kit=no -+fi - -+ -+ -+# Check whether --with-systemd was given. -+if test "${with_systemd+set}" = set; then : -+ withval=$with_systemd; with_systemd=$withval -+else -+ with_systemd=auto -+fi -+ -+ - # Check whether --with-systemdsystemunitdir was given. - if test "${with_systemdsystemunitdir+set}" = set; then : - withval=$with_systemdsystemunitdir; with_systemdsystemunitdir=$withval -@@ -21764,8 +21774,17 @@ fi - - $as_echo "#define SUPPORTS_PAM_EXTENSIONS 1" >>confdefs.h - -+else -+ if false; then -+ SUPPORTS_PAM_EXTENSIONS_TRUE= -+ SUPPORTS_PAM_EXTENSIONS_FALSE='#' -+else -+ SUPPORTS_PAM_EXTENSIONS_TRUE='#' -+ SUPPORTS_PAM_EXTENSIONS_FALSE= - fi - -+fi -+ - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for keyctl_read in -lkeyutils" >&5 - $as_echo_n "checking for keyctl_read in -lkeyutils... " >&6; } - if ${ac_cv_lib_keyutils_keyctl_read+:} false; then : -@@ -22008,7 +22027,7 @@ fi - - - --for ac_header in utmp.h utmpx.h libutil.h sys/param.h -+for ac_header in utmp.h utmpx.h util.h sys/param.h - do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` - ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -@@ -22021,7 +22040,7 @@ fi - - done - --for ac_func in getutxent updwtmpx updwtmp -+for ac_func in getutxent getttyent updwtmpx updwtmp - do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` - ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -@@ -22033,94 +22052,6 @@ _ACEOF - fi - done - --{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for login in -lutil" >&5 --$as_echo_n "checking for login in -lutil... " >&6; } --if ${ac_cv_lib_util_login+:} false; then : -- $as_echo_n "(cached) " >&6 --else -- ac_check_lib_save_LIBS=$LIBS --LIBS="-lutil $LIBS" --cat confdefs.h - <<_ACEOF >conftest.$ac_ext --/* end confdefs.h. */ -- --/* Override any GCC internal prototype to avoid an error. -- Use char because int might match the return type of a GCC -- builtin and then its argument prototype would still apply. */ --#ifdef __cplusplus --extern "C" --#endif --char login (); --int --main () --{ --return login (); -- ; -- return 0; --} --_ACEOF --if ac_fn_c_try_link "$LINENO"; then : -- ac_cv_lib_util_login=yes --else -- ac_cv_lib_util_login=no --fi --rm -f core conftest.err conftest.$ac_objext \ -- conftest$ac_exeext conftest.$ac_ext --LIBS=$ac_check_lib_save_LIBS --fi --{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_util_login" >&5 --$as_echo "$ac_cv_lib_util_login" >&6; } --if test "x$ac_cv_lib_util_login" = xyes; then : -- -- --$as_echo "#define HAVE_LOGIN 1" >>confdefs.h -- -- EXTRA_DAEMON_LIBS="$EXTRA_DAEMON_LIBS -lutil" --fi -- --{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for logout in -lutil" >&5 --$as_echo_n "checking for logout in -lutil... " >&6; } --if ${ac_cv_lib_util_logout+:} false; then : -- $as_echo_n "(cached) " >&6 --else -- ac_check_lib_save_LIBS=$LIBS --LIBS="-lutil $LIBS" --cat confdefs.h - <<_ACEOF >conftest.$ac_ext --/* end confdefs.h. */ -- --/* Override any GCC internal prototype to avoid an error. -- Use char because int might match the return type of a GCC -- builtin and then its argument prototype would still apply. */ --#ifdef __cplusplus --extern "C" --#endif --char logout (); --int --main () --{ --return logout (); -- ; -- return 0; --} --_ACEOF --if ac_fn_c_try_link "$LINENO"; then : -- ac_cv_lib_util_logout=yes --else -- ac_cv_lib_util_logout=no --fi --rm -f core conftest.err conftest.$ac_objext \ -- conftest$ac_exeext conftest.$ac_ext --LIBS=$ac_check_lib_save_LIBS --fi --{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_util_logout" >&5 --$as_echo "$ac_cv_lib_util_logout" >&6; } --if test "x$ac_cv_lib_util_logout" = xyes; then : -- -- --$as_echo "#define HAVE_LOGOUT 1" >>confdefs.h -- -- EXTRA_DAEMON_LIBS="$EXTRA_DAEMON_LIBS -lutil" --fi -- - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for logwtmp in -lutil" >&5 - $as_echo_n "checking for logwtmp in -lutil... " >&6; } - if ${ac_cv_lib_util_logwtmp+:} false; then : -@@ -23207,7 +23138,25 @@ fi - CPPFLAGS="$xinerama_save_cppflags" - - -+use_console_kit=no -+if test "x$with_console_kit" != "xno" ; then -+ use_console_kit=yes - -+$as_echo "#define WITH_CONSOLE_KIT 1" >>confdefs.h -+ -+fi -+ if test x$use_console_kit = xyes; then -+ WITH_CONSOLE_KIT_TRUE= -+ WITH_CONSOLE_KIT_FALSE='#' -+else -+ WITH_CONSOLE_KIT_TRUE='#' -+ WITH_CONSOLE_KIT_FALSE= -+fi -+ -+ -+ -+ -+ - pkg_failed=no - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SYSTEMD" >&5 - $as_echo_n "checking for SYSTEMD... " >&6; } -@@ -23216,12 +23165,12 @@ if test -n "$SYSTEMD_CFLAGS"; then - pkg_cv_SYSTEMD_CFLAGS="$SYSTEMD_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ -- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd\""; } >&5 -- ($PKG_CONFIG --exists --print-errors "libsystemd") 2>&5 -+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd-login >= 186 libsystemd-daemon\""; } >&5 -+ ($PKG_CONFIG --exists --print-errors "libsystemd-login >= 186 libsystemd-daemon") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then -- pkg_cv_SYSTEMD_CFLAGS=`$PKG_CONFIG --cflags "libsystemd" 2>/dev/null` -+ pkg_cv_SYSTEMD_CFLAGS=`$PKG_CONFIG --cflags "libsystemd-login >= 186 libsystemd-daemon" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes - else - pkg_failed=yes -@@ -23233,12 +23182,12 @@ if test -n "$SYSTEMD_LIBS"; then - pkg_cv_SYSTEMD_LIBS="$SYSTEMD_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ -- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd\""; } >&5 -- ($PKG_CONFIG --exists --print-errors "libsystemd") 2>&5 -+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd-login >= 186 libsystemd-daemon\""; } >&5 -+ ($PKG_CONFIG --exists --print-errors "libsystemd-login >= 186 libsystemd-daemon") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then -- pkg_cv_SYSTEMD_LIBS=`$PKG_CONFIG --libs "libsystemd" 2>/dev/null` -+ pkg_cv_SYSTEMD_LIBS=`$PKG_CONFIG --libs "libsystemd-login >= 186 libsystemd-daemon" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes - else - pkg_failed=yes -@@ -23259,50 +23208,49 @@ else - _pkg_short_errors_supported=no - fi - if test $_pkg_short_errors_supported = yes; then -- SYSTEMD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libsystemd" 2>&1` -+ SYSTEMD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libsystemd-login >= 186 libsystemd-daemon" 2>&1` - else -- SYSTEMD_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libsystemd" 2>&1` -+ SYSTEMD_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libsystemd-login >= 186 libsystemd-daemon" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$SYSTEMD_PKG_ERRORS" >&5 - -- as_fn_error $? "Package requirements (libsystemd) were not met: -- --$SYSTEMD_PKG_ERRORS -- --Consider adjusting the PKG_CONFIG_PATH environment variable if you --installed software in a non-standard prefix. -- --Alternatively, you may set the environment variables SYSTEMD_CFLAGS --and SYSTEMD_LIBS to avoid the need to call pkg-config. --See the pkg-config man page for more details." "$LINENO" 5 -+ have_systemd=no - elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 - $as_echo "no" >&6; } -- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 --$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} --as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it --is in your PATH or set the PKG_CONFIG environment variable to the full --path to pkg-config. -- --Alternatively, you may set the environment variables SYSTEMD_CFLAGS --and SYSTEMD_LIBS to avoid the need to call pkg-config. --See the pkg-config man page for more details. -- --To get pkg-config, see . --See \`config.log' for more details" "$LINENO" 5; } -+ have_systemd=no - else - SYSTEMD_CFLAGS=$pkg_cv_SYSTEMD_CFLAGS - SYSTEMD_LIBS=$pkg_cv_SYSTEMD_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 - $as_echo "yes" >&6; } -+ have_systemd=yes -+fi - -+if test "x$with_systemd" = "xauto" ; then -+ if test x$have_systemd = xno ; then -+ use_systemd=no -+ else -+ use_systemd=yes -+ fi -+else -+ use_systemd="$with_systemd" - fi - -+if test "x$use_systemd" != "xno" ; then -+ if test "x$have_systemd" = "xno"; then -+ as_fn_error $? "Systemd support explicitly required, but systemd not found" "$LINENO" 5 -+ fi - - -+$as_echo "#define WITH_SYSTEMD 1" >>confdefs.h - -+fi - -+ -+ -+ - pkg_failed=no - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JOURNALD" >&5 - $as_echo_n "checking for JOURNALD... " >&6; } -@@ -23727,6 +23675,18 @@ GDM_OLD_CONF='${gdmconfdir}/gdm.conf' - - - -+# Check whether --with-consolekit-directory was given. -+if test "${with_consolekit_directory+set}" = set; then : -+ withval=$with_consolekit_directory; -+else -+ with_consolekit_directory="\${libexecdir}" -+fi -+ -+ -+CONSOLEKIT_DIR=$with_consolekit_directory -+ -+ -+ - # Check whether --with-gnome-settings-daemon-directory was given. - if test "${with_gnome_settings_daemon_directory+set}" = set; then : - withval=$with_gnome_settings_daemon_directory; -@@ -24829,6 +24789,10 @@ if test -z "${SUPPORTS_PAM_EXTENSIONS_TRUE}" && test - - as_fn_error $? "conditional \"SUPPORTS_PAM_EXTENSIONS\" was never defined. - Usually this means the macro was only invoked conditionally." "$LINENO" 5 - fi -+if test -z "${SUPPORTS_PAM_EXTENSIONS_TRUE}" && test -z "${SUPPORTS_PAM_EXTENSIONS_FALSE}"; then -+ as_fn_error $? "conditional \"SUPPORTS_PAM_EXTENSIONS\" was never defined. -+Usually this means the macro was only invoked conditionally." "$LINENO" 5 -+fi - if test -z "${XDMCP_SUPPORT_TRUE}" && test -z "${XDMCP_SUPPORT_FALSE}"; then - as_fn_error $? "conditional \"XDMCP_SUPPORT\" was never defined. - Usually this means the macro was only invoked conditionally." "$LINENO" 5 -@@ -24841,6 +24805,10 @@ if test -z "${OS_SOLARIS_TRUE}" && test -z "${OS_SOLAR - as_fn_error $? "conditional \"OS_SOLARIS\" was never defined. - Usually this means the macro was only invoked conditionally." "$LINENO" 5 - fi -+if test -z "${WITH_CONSOLE_KIT_TRUE}" && test -z "${WITH_CONSOLE_KIT_FALSE}"; then -+ as_fn_error $? "conditional \"WITH_CONSOLE_KIT\" was never defined. -+Usually this means the macro was only invoked conditionally." "$LINENO" 5 -+fi - if test -z "${INSTALL_SYSTEMD_UNITS_TRUE}" && test -z "${INSTALL_SYSTEMD_UNITS_FALSE}"; then - as_fn_error $? "conditional \"INSTALL_SYSTEMD_UNITS\" was never defined. - Usually this means the macro was only invoked conditionally." "$LINENO" 5 -@@ -27325,6 +27293,7 @@ echo " - dmconfdir: ${dmconfdir} - localstatedir: ${localstatedir} - datadir: ${datadir} -+ consolekit location: ${with_consolekit_directory} - gnome-settings-daemon location: ${with_gnome_settings_daemon_directory} - gnome-session-check-accel location: ${with_check_accelerated_directory} - source code location: ${srcdir} -@@ -27354,6 +27323,8 @@ echo \ - " Xinerama support: ${XINERAMA_SUPPORT} - XDMCP support: ${XDMCP_SUPPORT} - SELinux support: ${use_selinux} -+ ConsoleKit support: ${use_console_kit} -+ systemd support: ${use_systemd} - systemd unit dir: ${with_systemdsystemunitdir} - plymouth support: ${use_plymouth} - wayland support: ${enable_wayland_support} -@@ -27362,3 +27333,4 @@ echo \ - Enable documentation: ${enable_documentation} - Install GDM's Xsession: ${enable_gdm_xsession} - " -+ Index: x11/gdm/files/patch-daemon_Makefile.in =================================================================== --- x11/gdm/files/patch-daemon_Makefile.in +++ /dev/null @@ -1,94 +0,0 @@ ---- daemon/Makefile.in.orig 2018-01-14 12:25:16.930784000 +0100 -+++ daemon/Makefile.in 2018-01-14 12:25:17.007460000 +0100 -@@ -101,6 +101,7 @@ libexec_PROGRAMS = gdm-session-worker$(EXEEXT) \ - - sbin_PROGRAMS = gdm$(EXEEXT) $(am__EXEEXT_1) - @XDMCP_SUPPORT_TRUE@am__append_4 = $(XDMCP_SOURCES) -+@WITH_CONSOLE_KIT_TRUE@am__append_5 = $(CONSOLE_KIT_SOURCES) - subdir = daemon - ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 - am__aclocal_m4_deps = $(top_srcdir)/m4/intltool.m4 \ -@@ -139,6 +140,8 @@ am__objects_2 = gdm-xdmcp-display-factory.$(OBJEXT) \ - gdm-xdmcp-display.$(OBJEXT) \ - gdm-xdmcp-chooser-display.$(OBJEXT) $(am__objects_1) - @XDMCP_SUPPORT_TRUE@am__objects_3 = $(am__objects_2) -+am__objects_4 = $(am__objects_1) -+@WITH_CONSOLE_KIT_TRUE@am__objects_5 = $(am__objects_4) - am_gdm_OBJECTS = main.$(OBJEXT) gdm-display-access-file.$(OBJEXT) \ - gdm-display-store.$(OBJEXT) gdm-display-factory.$(OBJEXT) \ - gdm-local-display-factory.$(OBJEXT) gdm-display.$(OBJEXT) \ -@@ -148,7 +151,7 @@ am_gdm_OBJECTS = main.$(OBJEXT) gdm-display-access-fil - gdm-session-record.$(OBJEXT) \ - gdm-session-worker-common.$(OBJEXT) \ - gdm-session-worker-job.$(OBJEXT) gdm-dbus-util.$(OBJEXT) \ -- $(am__objects_1) $(am__objects_3) -+ $(am__objects_1) $(am__objects_3) $(am__objects_5) - nodist_gdm_OBJECTS = gdm-display-glue.$(OBJEXT) \ - gdm-local-display-factory-glue.$(OBJEXT) \ - gdm-manager-glue.$(OBJEXT) gdm-local-display-glue.$(OBJEXT) \ -@@ -175,16 +178,16 @@ am__gdm_session_worker_SOURCES_DIST = session-worker-m - $(top_srcdir)/pam-extensions/gdm-pam-extensions.h \ - gdm-session-linux-auditor.h gdm-session-linux-auditor.c \ - gdm-session-solaris-auditor.h gdm-session-solaris-auditor.c --@HAVE_LIBAUDIT_TRUE@am__objects_4 = \ -+@HAVE_LIBAUDIT_TRUE@am__objects_6 = \ - @HAVE_LIBAUDIT_TRUE@ gdm-session-linux-auditor.$(OBJEXT) --@HAVE_ADT_TRUE@am__objects_5 = gdm-session-solaris-auditor.$(OBJEXT) -+@HAVE_ADT_TRUE@am__objects_7 = gdm-session-solaris-auditor.$(OBJEXT) - am_gdm_session_worker_OBJECTS = session-worker-main.$(OBJEXT) \ - gdm-session.$(OBJEXT) gdm-session-settings.$(OBJEXT) \ - gdm-session-auditor.$(OBJEXT) gdm-session-record.$(OBJEXT) \ - gdm-session-worker.$(OBJEXT) gdm-session-worker-job.$(OBJEXT) \ - gdm-session-worker-common.$(OBJEXT) gdm-dbus-util.$(OBJEXT) \ -- $(am__objects_1) $(am__objects_1) $(am__objects_4) \ -- $(am__objects_5) -+ $(am__objects_1) $(am__objects_1) $(am__objects_6) \ -+ $(am__objects_7) - nodist_gdm_session_worker_OBJECTS = gdm-session-glue.$(OBJEXT) \ - gdm-session-worker-glue.$(OBJEXT) \ - gdm-session-enum-types.$(OBJEXT) $(am__objects_1) -@@ -310,6 +313,7 @@ CHECK_CFLAGS = @CHECK_CFLAGS@ - CHECK_LIBS = @CHECK_LIBS@ - COMMON_CFLAGS = @COMMON_CFLAGS@ - COMMON_LIBS = @COMMON_LIBS@ -+CONSOLEKIT_DIR = @CONSOLEKIT_DIR@ - CPP = @CPP@ - CPPFLAGS = @CPPFLAGS@ - CXX = @CXX@ -@@ -466,6 +470,7 @@ SYSTEMD_X_SERVER = @SYSTEMD_X_SERVER@ - USE_NLS = @USE_NLS@ - VERSION = @VERSION@ - WARN_CFLAGS = @WARN_CFLAGS@ -+WITH_CONSOLE_KIT = @WITH_CONSOLE_KIT@ - XDMCP_LIBS = @XDMCP_LIBS@ - XEVIE_OPTION = @XEVIE_OPTION@ - XGETTEXT = @XGETTEXT@ -@@ -571,6 +576,7 @@ AM_CPPFLAGS = \ - -DGDM_SCREENSHOT_DIR=\"$(GDM_SCREENSHOT_DIR)\" \ - -DGDM_CACHE_DIR=\""$(localstatedir)/cache/gdm"\" \ - -DGDM_SESSION_DEFAULT_PATH=\"$(GDM_SESSION_DEFAULT_PATH)\" \ -+ -DCONSOLEKIT_DIR=\"$(CONSOLEKIT_DIR)\" \ - $(DISABLE_DEPRECATED_CFLAGS) \ - $(DAEMON_CFLAGS) \ - $(XLIB_CFLAGS) \ -@@ -674,7 +680,8 @@ gdm_SOURCES = main.c gdm-display-access-file.c \ - gdm-session-record.c gdm-session-record.h \ - gdm-session-worker-common.c gdm-session-worker-common.h \ - gdm-session-worker-job.c gdm-session-worker-job.h \ -- gdm-dbus-util.c gdm-dbus-util.h $(NULL) $(am__append_4) -+ gdm-dbus-util.c gdm-dbus-util.h $(NULL) $(am__append_4) \ -+ $(am__append_5) - nodist_gdm_SOURCES = \ - gdm-display-glue.h \ - gdm-display-glue.c \ -@@ -701,8 +708,8 @@ XDMCP_SOURCES = \ - gdm-xdmcp-chooser-display.h \ - $(NULL) - --EXTRA_gdm_SOURCES = \ -- $(XDMCP_SOURCES) \ -+EXTRA_gdm_SOURCES = $(XDMCP_SOURCES) $(NULL) $(CONSOLE_KIT_SOURCES) -+CONSOLE_KIT_SOURCES = \ - $(NULL) - - gdm_LDADD = \ Index: x11/gdm/files/patch-daemon_gdm-display-access-file.c =================================================================== --- /dev/null +++ x11/gdm/files/patch-daemon_gdm-display-access-file.c @@ -0,0 +1,22 @@ +--- daemon/gdm-display-access-file.c.orig 2020-10-09 16:09:21 UTC ++++ daemon/gdm-display-access-file.c +@@ -22,6 +22,8 @@ + + #include "config.h" + ++#include ++ + #include + #include + #include +@@ -56,6 +58,10 @@ struct _GdmDisplayAccessFile + + #ifndef O_BINARY + #define O_BINARY 0 ++#endif ++ ++#ifndef HOST_NAME_MAX ++#define HOST_NAME_MAX MAXHOSTNAMELEN + #endif + + static void gdm_display_access_file_finalize (GObject * object); Index: x11/gdm/files/patch-daemon_gdm-display.c =================================================================== --- /dev/null +++ x11/gdm/files/patch-daemon_gdm-display.c @@ -0,0 +1,18 @@ +$OpenBSD: patch-daemon_gdm-display_c,v 1.8 2019/11/02 15:34:07 ajacoutot Exp $ + +XXX fix+push upstream + +Index: daemon/gdm-display.c +--- daemon/gdm-display.c.orig ++++ daemon/gdm-display.c +@@ -242,8 +242,8 @@ setup_xhost_auth (XHostAddress *host_entr + host_entries[1].address = "localuser\0" GDM_USERNAME; + host_entries[1].length = sizeof ("localuser\0" GDM_USERNAME); + host_entries[2].family = FamilyServerInterpreted; +- host_entries[2].address = "localuser\0gnome-initial-setup"; +- host_entries[2].length = sizeof ("localuser\0gnome-initial-setup"); ++ host_entries[2].address = "localuser\0_gnome-initial-setup"; ++ host_entries[2].length = sizeof ("localuser\0_gnome-initial-setup"); + } + + gboolean Index: x11/gdm/files/patch-daemon_gdm-launch-environment.c =================================================================== --- x11/gdm/files/patch-daemon_gdm-launch-environment.c +++ x11/gdm/files/patch-daemon_gdm-launch-environment.c @@ -1,4 +1,4 @@ -$OpenBSD: patch-daemon_gdm-launch-environment_c,v 1.8 2017/04/17 13:17:07 ajacoutot Exp $ +$OpenBSD: patch-daemon_gdm-launch-environment_c,v 1.10 2019/11/02 15:34:07 ajacoutot Exp $ XXX fix+push upstream @@ -14,9 +14,19 @@ Date: Fri, 12 Jun 2015 14:33:40 -0400 Subject: session: drop session-type property ---- daemon/gdm-launch-environment.c.orig Wed Apr 12 15:47:09 2017 -+++ daemon/gdm-launch-environment.c Mon Apr 17 14:17:28 2017 -@@ -197,6 +197,9 @@ build_launch_environment (GdmLaunchEnvironment *launch +Index: daemon/gdm-launch-environment.c +--- daemon/gdm-launch-environment.c.orig 2020-07-13 20:36:07 UTC ++++ daemon/gdm-launch-environment.c +@@ -50,7 +50,7 @@ + #include "gdm-settings-direct.h" + #include "gdm-settings-keys.h" + +-#define INITIAL_SETUP_USERNAME "gnome-initial-setup" ++#define INITIAL_SETUP_USERNAME "_gnome-initial-setup" + #define GDM_SESSION_MODE "gdm" + #define INITIAL_SETUP_SESSION_MODE "initial-setup" + #define GNOME_SESSION_SESSIONS_PATH DATADIR "/gnome-session/sessions" +@@ -212,6 +212,9 @@ build_launch_environment (GdmLaunchEnvironment *launch char *seat_id; seat_id = launch_environment->priv->x11_display_seat_id; @@ -26,7 +36,7 @@ g_hash_table_insert (hash, g_strdup ("GDM_SEAT_ID"), g_strdup (seat_id)); } -@@ -224,6 +227,8 @@ on_session_setup_complete (GdmSession *session, +@@ -237,6 +240,8 @@ on_session_setup_complete (GdmSession *session, gdm_session_set_environment_variable (launch_environment->priv->session, key, value); } g_hash_table_destroy (hash); Index: x11/gdm/files/patch-daemon_gdm-local-display-factory.c =================================================================== --- x11/gdm/files/patch-daemon_gdm-local-display-factory.c +++ x11/gdm/files/patch-daemon_gdm-local-display-factory.c @@ -1,4 +1,4 @@ -$OpenBSD: patch-daemon_gdm-local-display-factory_c,v 1.6 2017/03/03 13:01:26 ajacoutot Exp $ +$OpenBSD: patch-daemon_gdm-local-display-factory_c,v 1.14 2020/07/14 06:32:03 ajacoutot Exp $ REVERT - OpenBSD does not have a systemd implementation (we need ConsoleKit) From 1ac67f522f5690c27023d98096ca817f12f7eb88 Mon Sep 17 00:00:00 2001 @@ -12,18 +12,29 @@ Date: Fri, 12 Jun 2015 13:48:52 -0400 Subject: require logind support ---- daemon/gdm-local-display-factory.c.orig Wed Mar 1 16:58:36 2017 -+++ daemon/gdm-local-display-factory.c Fri Mar 3 12:00:56 2017 -@@ -42,6 +42,8 @@ +Index: daemon/gdm-local-display-factory.c +--- daemon/gdm-local-display-factory.c.orig 2020-07-13 20:36:07 UTC ++++ daemon/gdm-local-display-factory.c +@@ -28,7 +28,9 @@ + #include + #include - #define GDM_LOCAL_DISPLAY_FACTORY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GDM_TYPE_LOCAL_DISPLAY_FACTORY, GdmLocalDisplayFactoryPrivate)) ++#ifdef WITH_SYSTEMD + #include ++#endif + #include "gdm-common.h" + #include "gdm-manager.h" +@@ -42,6 +44,8 @@ + #include "gdm-local-display.h" + #include "gdm-legacy-display.h" + +#define CK_SEAT1_PATH "/org/freedesktop/ConsoleKit/Seat1" + #define GDM_DBUS_PATH "/org/gnome/DisplayManager" #define GDM_LOCAL_DISPLAY_FACTORY_DBUS_PATH GDM_DBUS_PATH "/LocalDisplayFactory" #define GDM_MANAGER_DBUS_NAME "org.gnome.DisplayManager.LocalDisplayFactory" -@@ -57,8 +59,10 @@ struct GdmLocalDisplayFactoryPrivate +@@ -60,8 +64,10 @@ struct _GdmLocalDisplayFactory /* FIXME: this needs to be per seat? */ guint num_failures; @@ -31,33 +42,76 @@ guint seat_new_id; guint seat_removed_id; +#endif - }; - enum { -@@ -206,8 +210,10 @@ gdm_local_display_factory_create_transient_display (Gd + #if defined(ENABLE_WAYLAND_SUPPORT) && defined(ENABLE_USER_DISPLAY_SERVER) + unsigned int active_vt; +@@ -87,7 +93,9 @@ static void on_display_status_changed + GParamSpec *arg1, + GdmLocalDisplayFactory *factory); ++#ifdef WITH_SYSTEMD + static gboolean gdm_local_display_factory_sync_seats (GdmLocalDisplayFactory *factory); ++#endif + static gpointer local_display_factory_object = NULL; + static gboolean lookup_by_session_id (const char *id, + GdmDisplay *display, +@@ -232,7 +240,7 @@ gdm_local_display_factory_create_transient_display (Gd + g_debug ("GdmLocalDisplayFactory: Creating transient display"); -#ifdef ENABLE_USER_DISPLAY_SERVER -- display = gdm_local_display_new (); +#if defined ENABLE_USER_DISPLAY_SERVER && defined WITH_SYSTEMD -+ if (LOGIND_RUNNING() > 0) { -+ display = gdm_local_display_new (); -+ } - #else - if (display == NULL) { - guint32 num; -@@ -289,7 +295,7 @@ on_display_status_changed (GdmDisplay *dis + display = gdm_local_display_new (); + if (gdm_local_display_factory_use_wayland ()) + g_object_set (G_OBJECT (display), "session-type", "wayland", NULL); +@@ -373,7 +381,7 @@ on_display_status_changed (GdmDisplay *dis /* reset num failures */ - factory->priv->num_failures = 0; + factory->num_failures = 0; - gdm_local_display_factory_sync_seats (factory); + create_display (factory, seat_id, session_type, is_initial); } break; case GDM_DISPLAY_FAILED: -@@ -368,7 +374,7 @@ create_display (GdmLocalDisplayFactory *factory, +@@ -467,15 +475,19 @@ create_display (GdmLocalDisplayFactory *factory, + { + GdmDisplayStore *store; + GdmDisplay *display = NULL; ++#ifdef WITH_SYSTEMD + g_autofree char *login_session_id = NULL; ++#endif + g_debug ("GdmLocalDisplayFactory: %s login display for seat %s requested", + session_type? : "X11", seat_id); + store = gdm_display_factory_get_display_store (GDM_DISPLAY_FACTORY (factory)); + ++#ifdef WITH_SYSTEMD + if (sd_seat_can_multi_session (seat_id)) + display = gdm_display_store_find (store, lookup_prepared_display_by_seat_id, (gpointer) seat_id); + else ++#endif + display = gdm_display_store_find (store, lookup_by_seat_id, (gpointer) seat_id); + + /* Ensure we don't create the same display more than once */ +@@ -484,6 +496,7 @@ create_display (GdmLocalDisplayFactory *factory, + return NULL; + } + ++#ifdef WITH_SYSTEMD + /* If we already have a login window, switch to it */ + if (gdm_get_login_window_session_id (seat_id, &login_session_id)) { + GdmDisplay *display; +@@ -497,14 +510,15 @@ create_display (GdmLocalDisplayFactory *factory, + g_object_set (G_OBJECT (display), "status", GDM_DISPLAY_MANAGED, NULL); + g_debug ("GdmLocalDisplayFactory: session %s found, activating.", + login_session_id); +- gdm_activate_session_by_id (factory->connection, seat_id, login_session_id); ++ activate_session_id (factory->connection, seat_id, login_session_id); + return NULL; + } + } ++#endif + g_debug ("GdmLocalDisplayFactory: Adding display on seat %s", seat_id); -#ifdef ENABLE_USER_DISPLAY_SERVER @@ -65,24 +119,23 @@ if (g_strcmp0 (seat_id, "seat0") == 0) { display = gdm_local_display_new (); if (session_type != NULL) { -@@ -400,6 +406,8 @@ create_display (GdmLocalDisplayFactory *factory, +@@ -536,6 +550,7 @@ create_display (GdmLocalDisplayFactory *factory, return display; } +#ifdef WITH_SYSTEMD -+ static void delete_display (GdmLocalDisplayFactory *factory, const char *seat_id) { -@@ -536,6 +544,7 @@ gdm_local_display_factory_stop_monitor (GdmLocalDispla - factory->priv->seat_removed_id = 0; +@@ -914,6 +929,7 @@ gdm_local_display_factory_stop_monitor (GdmLocalDispla } + #endif } +#endif static void on_display_added (GdmDisplayStore *display_store, -@@ -576,6 +585,7 @@ static gboolean +@@ -947,6 +963,7 @@ static gboolean gdm_local_display_factory_start (GdmDisplayFactory *base_factory) { GdmLocalDisplayFactory *factory = GDM_LOCAL_DISPLAY_FACTORY (base_factory); @@ -90,7 +143,7 @@ GdmDisplayStore *store; g_return_val_if_fail (GDM_IS_LOCAL_DISPLAY_FACTORY (factory), FALSE); -@@ -594,8 +604,17 @@ gdm_local_display_factory_start (GdmDisplayFactory *ba +@@ -965,8 +982,17 @@ gdm_local_display_factory_start (GdmDisplayFactory *ba factory, 0); @@ -110,7 +163,7 @@ } static gboolean -@@ -606,7 +625,9 @@ gdm_local_display_factory_stop (GdmDisplayFactory *bas +@@ -977,7 +1003,9 @@ gdm_local_display_factory_stop (GdmDisplayFactory *bas g_return_val_if_fail (GDM_IS_LOCAL_DISPLAY_FACTORY (factory), FALSE); @@ -120,9 +173,9 @@ store = gdm_display_factory_get_display_store (GDM_DISPLAY_FACTORY (factory)); -@@ -762,7 +783,9 @@ gdm_local_display_factory_finalize (GObject *object) +@@ -1129,7 +1157,9 @@ gdm_local_display_factory_finalize (GObject *object) - g_hash_table_destroy (factory->priv->used_display_numbers); + g_hash_table_destroy (factory->used_display_numbers); +#ifdef WITH_SYSTEMD gdm_local_display_factory_stop_monitor (factory); Index: x11/gdm/files/patch-daemon_gdm-manager.c =================================================================== --- x11/gdm/files/patch-daemon_gdm-manager.c +++ x11/gdm/files/patch-daemon_gdm-manager.c @@ -1,6 +1,12 @@ -$OpenBSD: patch-daemon_gdm-manager_c,v 1.14 2017/05/10 10:18:15 ajacoutot Exp $ +$OpenBSD: patch-daemon_gdm-manager_c,v 1.24 2020/05/14 15:25:54 ajacoutot Exp $ REVERT - OpenBSD does not have a systemd implementation (we need ConsoleKit) +From fcba1e1a5d556ce7b52101dbd2d1ba4a19469161 Mon Sep 17 00:00:00 2001 +From: Iain Lane +Date: Fri, 5 Jan 2018 11:53:34 +0000 +Subject: [PATCH] manager: Find user's current graphical session, not session of caller + +REVERT - OpenBSD does not have a systemd implementation (we need ConsoleKit) From 21905303afbd508f3bf599ad219c9209413c53a2 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Wed, 5 Apr 2017 12:11:20 -0400 @@ -24,9 +30,9 @@ Date: Fri, 12 Jun 2015 13:48:52 -0400 Subject: require logind support - ---- daemon/gdm-manager.c.orig 2017-10-24 21:33:58.000000000 +0200 -+++ daemon/gdm-manager.c 2018-01-14 13:33:21.588929000 +0100 +Index: daemon/gdm-manager.c +--- daemon/gdm-manager.c.orig 2020-07-13 20:36:07 UTC ++++ daemon/gdm-manager.c @@ -36,7 +36,9 @@ #include @@ -37,9 +43,13 @@ #include "gdm-common.h" -@@ -63,6 +65,15 @@ +@@ -61,9 +63,18 @@ + #define GDM_MANAGER_PATH GDM_DBUS_PATH "/Manager" + #define GDM_MANAGER_DISPLAYS_PATH GDM_DBUS_PATH "/Displays" - #define INITIAL_SETUP_USERNAME "gnome-initial-setup" +-#define INITIAL_SETUP_USERNAME "gnome-initial-setup" ++#define INITIAL_SETUP_USERNAME "_gnome-initial-setup" + #define ALREADY_RAN_INITIAL_SETUP_ON_THIS_BOOT GDM_RUN_DIR "/gdm.ran-initial-setup" +#define CK_NAME "org.freedesktop.ConsoleKit" +#define CK_PATH "/org/freedesktop/ConsoleKit" @@ -53,7 +63,7 @@ typedef struct { GdmManager *manager; -@@ -206,9 +217,10 @@ plymouth_quit_without_transition (void) +@@ -205,9 +216,10 @@ plymouth_quit_without_transition (void) } #endif @@ -66,7 +76,7 @@ { char *session, *gsession; int ret; -@@ -233,11 +245,61 @@ get_session_id_for_pid (pid_t pid, +@@ -232,11 +244,61 @@ get_session_id_for_pid (pid_t pid, return NULL; } } @@ -131,7 +141,7 @@ { int ret; -@@ -254,8 +316,62 @@ get_uid_for_session_id (const char *session_id, +@@ -253,8 +315,62 @@ get_uid_for_session_id (const char *session_id, return TRUE; } @@ -194,7 +204,7 @@ lookup_by_session_id (const char *id, GdmDisplay *display, gpointer user_data) -@@ -267,11 +383,51 @@ lookup_by_session_id (const char *id, +@@ -266,11 +382,51 @@ lookup_by_session_id (const char *id, return g_strcmp0 (current, looking_for) == 0; } @@ -249,16 +259,15 @@ char *session_class = NULL; int ret; -@@ -295,12 +451,33 @@ is_login_session (GdmManager *self, +@@ -294,29 +450,49 @@ is_login_session (GdmManager *self, g_free (session_class); return TRUE; } +#endif static gboolean --activate_session_id (GdmManager *manager, -- const char *seat_id, -- const char *session_id) +-session_unlock (GdmManager *manager, +- const char *ssid) +is_login_session (GdmManager *self, + GDBusConnection *connection, + const char *session_id, @@ -286,24 +295,42 @@ GError *error = NULL; GVariant *reply; -@@ -326,16 +503,75 @@ activate_session_id (GdmManager *manager, +- g_debug ("Unlocking session %s", ssid); +- + reply = g_dbus_connection_call_sync (manager->priv->connection, + "org.freedesktop.login1", + "/org/freedesktop/login1", + "org.freedesktop.login1.Manager", +- "UnlockSession", +- g_variant_new ("(s)", ssid), ++ "ActivateSessionOnSeat", ++ g_variant_new ("(ss)", session_id, seat_id), + NULL, /* expected reply */ + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + &error); + if (reply == NULL) { +- g_debug ("GdmManager: logind 'UnlockSession' %s raised:\n %s\n\n", ++ g_debug ("GdmManager: logind 'ActivateSessionOnSeat' %s raised:\n %s\n\n", + g_dbus_error_get_remote_error (error), error->message); + g_error_free (error); + return FALSE; +@@ -326,7 +502,119 @@ session_unlock (GdmManager *manager, return TRUE; } +#endif +#ifdef WITH_CONSOLE_KIT - static gboolean --session_unlock (GdmManager *manager, -- const char *ssid) ++static gboolean +activate_session_id_for_ck (GdmManager *manager, + const char *seat_id, + const char *session_id) - { - GError *error = NULL; - GVariant *reply; - -- g_debug ("Unlocking session %s", ssid); ++{ ++ GError *error = NULL; ++ GVariant *reply; ++ + reply = g_dbus_connection_call_sync (manager->priv->connection, + CK_NAME, + seat_id, @@ -319,7 +346,7 @@ + g_debug ("GdmManager: ConsoleKit %s raised:\n %s\n\n", + g_dbus_error_get_remote_error (error), error->message); + g_error_free (error); - ++ + /* It is very likely that the "error" just reported is + * that the session is already active. Unfortunately, + * ConsoleKit doesn't use proper error codes and it @@ -350,27 +377,10 @@ +#ifdef WITH_CONSOLE_KIT + return activate_session_id_for_ck (manager, seat_id, session_id); +#else -+ return FALSE; ++ return FALSE; +#endif +} + -+#ifdef WITH_SYSTEMD -+static gboolean -+session_unlock_for_systemd (GdmManager *manager, -+ const char *ssid) -+{ -+ GError *error = NULL; -+ GVariant *reply; -+ - reply = g_dbus_connection_call_sync (manager->priv->connection, - "org.freedesktop.login1", - "/org/freedesktop/login1", -@@ -358,7 +594,60 @@ session_unlock (GdmManager *manager, - - return TRUE; - } -+#endif - +#ifdef WITH_CONSOLE_KIT +static gboolean +session_unlock_for_ck (GdmManager *manager, @@ -426,7 +436,7 @@ static GdmSession * find_session_for_user_on_seat (GdmManager *manager, const char *username, -@@ -389,11 +678,44 @@ find_session_for_user_on_seat (GdmManager *manager, +@@ -374,11 +662,44 @@ find_session_for_user_on_seat (GdmManager *manager, return NULL; } @@ -474,12 +484,27 @@ char *seat; int ret; gboolean is_remote; -@@ -418,10 +740,31 @@ is_remote_session (GdmManager *self, +@@ -403,10 +724,12 @@ is_remote_session (GdmManager *self, return is_remote; } +#endif ++#ifdef WITH_SYSTEMD + static char * +-get_seat_id_for_session_id (const char *session_id, +- GError **error) ++get_seat_id_for_systemd_session_id (const char *session_id, ++ GError **error) + { + int ret; + char *seat, *out_seat; +@@ -431,11 +754,85 @@ get_seat_id_for_session_id (const char *session_id, + + return out_seat; + } ++#endif + +static gboolean +is_remote_session (GdmManager *self, + GDBusConnection *connection, @@ -499,21 +524,6 @@ + return FALSE; +} + -+#ifdef WITH_SYSTEMD - static char * --get_seat_id_for_session_id (const char *session_id, -- GError **error) -+get_seat_id_for_systemd_session_id (const char *session_id, -+ GError **error) - { - int ret; - char *seat, *out_seat; -@@ -446,11 +789,62 @@ get_seat_id_for_session_id (const char *session_id, - - return out_seat; - } -+#endif - +#ifdef WITH_CONSOLE_KIT static char * -get_tty_for_session_id (const char *session_id, @@ -570,10 +580,14 @@ +get_tty_for_systemd_session_id (const char *session_id, + GError **error) +{ ++ ++ ++ ++ int ret; char *tty, *out_tty; -@@ -473,7 +867,21 @@ get_tty_for_session_id (const char *session_id, +@@ -458,7 +855,21 @@ get_tty_for_session_id (const char *session_id, return out_tty; } @@ -595,16 +609,22 @@ static void get_display_and_details_for_bus_sender (GdmManager *self, GDBusConnection *connection, -@@ -516,7 +924,7 @@ get_display_and_details_for_bus_sender (GdmManager +@@ -501,11 +912,10 @@ get_display_and_details_for_bus_sender (GdmManager goto out; } -- session_id = get_session_id_for_pid (pid, &error); +- ret = gdm_find_display_session (pid, caller_uid, &session_id, &error); + session_id = get_session_id_for_pid (connection, pid, &error); - if (session_id == NULL) { - g_debug ("GdmManager: Error while retrieving session id for sender: %s", -@@ -530,7 +938,7 @@ get_display_and_details_for_bus_sender (GdmManager +- if (!ret) { +- g_debug ("GdmManager: Unable to find display session for uid %d: %s", +- (int) caller_uid, ++ if (session_id == NULL) { ++ g_debug ("GdmManager: Error while retrieving session id for sender: %s", + error->message); + g_error_free (error); + goto out; +@@ -516,7 +926,7 @@ get_display_and_details_for_bus_sender (GdmManager } if (out_is_login_screen != NULL) { @@ -613,7 +633,7 @@ if (error != NULL) { g_debug ("GdmManager: Error while checking if sender is login screen: %s", -@@ -540,7 +948,7 @@ get_display_and_details_for_bus_sender (GdmManager +@@ -526,7 +936,7 @@ get_display_and_details_for_bus_sender (GdmManager } } @@ -622,7 +642,7 @@ g_debug ("GdmManager: Error while retrieving uid for session: %s", error->message); g_error_free (error); -@@ -557,7 +965,7 @@ get_display_and_details_for_bus_sender (GdmManager +@@ -543,7 +953,7 @@ get_display_and_details_for_bus_sender (GdmManager } if (out_seat_id != NULL) { @@ -631,7 +651,7 @@ if (error != NULL) { g_debug ("GdmManager: Error while retrieving seat id for session: %s", -@@ -567,7 +975,7 @@ get_display_and_details_for_bus_sender (GdmManager +@@ -553,7 +963,7 @@ get_display_and_details_for_bus_sender (GdmManager } if (out_is_remote != NULL) { @@ -640,7 +660,16 @@ if (error != NULL) { g_debug ("GdmManager: Error while retrieving remoteness for session: %s", -@@ -725,29 +1133,6 @@ out: +@@ -609,7 +1019,7 @@ switch_to_compatible_user_session (GdmManager *manager + if (existing_session != NULL) { + ssid_to_activate = gdm_session_get_session_id (existing_session); + if (seat_id != NULL) { +- res = gdm_activate_session_by_id (manager->priv->connection, seat_id, ssid_to_activate); ++ res = activate_session_id (manager, seat_id, ssid_to_activate); + if (! res) { + g_debug ("GdmManager: unable to activate session: %s", ssid_to_activate); + goto out; +@@ -711,29 +1121,6 @@ out: return recorded; } @@ -670,7 +699,7 @@ static gboolean gdm_manager_handle_register_display (GdmDBusManager *manager, GDBusMethodInvocation *invocation, -@@ -787,7 +1172,7 @@ gdm_manager_handle_register_display (GdmDBusManager +@@ -773,7 +1160,7 @@ gdm_manager_handle_register_display (GdmDBusManager } } @@ -679,7 +708,7 @@ if (session != NULL) { GPid pid; -@@ -961,7 +1346,8 @@ on_reauthentication_client_rejected (GdmSession +@@ -980,7 +1367,8 @@ on_reauthentication_client_rejected (GdmSession * same audit session, ignore it since it doesn't "own" the * reauthentication session */ @@ -689,7 +718,7 @@ NULL); session_id = g_object_get_data (G_OBJECT (session), "caller-session-id"); -@@ -1173,16 +1559,20 @@ static gboolean +@@ -1199,16 +1587,19 @@ static gboolean display_is_on_seat0 (GdmDisplay *display) { gboolean is_on_seat0 = TRUE; @@ -699,168 +728,26 @@ +#ifdef WITH_SYSTEMD + if (LOGIND_RUNNING()) { + char *seat_id = NULL; ++ g_object_get (G_OBJECT (display), "seat-id", &seat_id, NULL); - if (g_strcmp0 (seat_id, "seat0") != 0) { - is_on_seat0 = FALSE; - } -+ g_object_get (G_OBJECT (display), "seat-id", &seat_id, NULL); - -- g_free (seat_id); + if (g_strcmp0 (seat_id, "seat0") != 0) { + is_on_seat0 = FALSE; + } +- g_free (seat_id); +- + g_free (seat_id); + } +#endif return is_on_seat0; } -@@ -1320,133 +1710,6 @@ maybe_start_pending_initial_login (GdmManager *manager - g_free (user_session_seat_id); +@@ -2031,11 +2422,57 @@ on_user_session_died (GdmSession *session, } --static gboolean --get_login_window_session_id (const char *seat_id, -- char **session_id) --{ -- gboolean ret; -- int res, i; -- char **sessions; -- char *service_id; -- char *service_class; -- char *state; -- -- res = sd_seat_get_sessions (seat_id, &sessions, NULL, NULL); -- if (res < 0) { -- g_debug ("Failed to determine sessions: %s", strerror (-res)); -- return FALSE; -- } -- -- if (sessions == NULL || sessions[0] == NULL) { -- *session_id = NULL; -- ret = TRUE; -- goto out; -- } -- -- for (i = 0; sessions[i]; i ++) { -- -- res = sd_session_get_class (sessions[i], &service_class); -- if (res < 0) { -- g_debug ("failed to determine class of session %s: %s", sessions[i], strerror (-res)); -- ret = FALSE; -- goto out; -- } -- -- if (strcmp (service_class, "greeter") != 0) { -- free (service_class); -- continue; -- } -- -- free (service_class); -- -- ret = sd_session_get_state (sessions[i], &state); -- if (ret < 0) { -- g_debug ("failed to determine state of session %s: %s", sessions[i], strerror (-res)); -- ret = FALSE; -- goto out; -- } -- -- if (g_strcmp0 (state, "closing") == 0) { -- free (state); -- continue; -- } -- free (state); -- -- res = sd_session_get_service (sessions[i], &service_id); -- if (res < 0) { -- g_debug ("failed to determine service of session %s: %s", sessions[i], strerror (-res)); -- ret = FALSE; -- goto out; -- } -- -- if (strcmp (service_id, "gdm-launch-environment") == 0) { -- *session_id = g_strdup (sessions[i]); -- ret = TRUE; -- -- free (service_id); -- goto out; -- } -- -- free (service_id); -- } -- -- *session_id = NULL; -- ret = TRUE; -- --out: -- if (sessions) { -- for (i = 0; sessions[i]; i ++) { -- free (sessions[i]); -- } -- -- free (sessions); -- } -- -- return ret; --} -- --static void --activate_login_window_session_on_seat (GdmManager *self, -- const char *seat_id) --{ -- char *session_id; -- -- if (!get_login_window_session_id (seat_id, &session_id)) { -- return; -- } -- -- activate_session_id (self, seat_id, session_id); --} -- --static void --maybe_activate_other_session (GdmManager *self, -- GdmDisplay *old_display) --{ -- char *seat_id = NULL; -- char *session_id; -- int ret; -- -- g_object_get (G_OBJECT (old_display), -- "seat-id", &seat_id, -- NULL); -- -- ret = sd_seat_get_active (seat_id, &session_id, NULL); -- -- if (ret == 0) { -- GdmDisplay *display; -- -- display = gdm_display_store_find (self->priv->display_store, -- lookup_by_session_id, -- (gpointer) session_id); -- -- if (display == NULL) { -- activate_login_window_session_on_seat (self, seat_id); -- } -- } -- -- g_free (seat_id); --} -- - static const char * - get_username_for_greeter_display (GdmManager *manager, - GdmDisplay *display) -@@ -1692,7 +1955,6 @@ on_display_status_changed (GdmDisplay *display, - manager->priv->ran_once = TRUE; - } - maybe_start_pending_initial_login (manager, display); -- maybe_activate_other_session (manager, display); - break; - default: - break; -@@ -2027,11 +2289,57 @@ on_user_session_died (GdmSession *session, - } - static char * +query_ck_for_display_device (GdmManager *manager, + GdmDisplay *display) @@ -918,7 +805,7 @@ } static void -@@ -2040,25 +2348,6 @@ on_session_reauthenticated (GdmSession *session, +@@ -2044,25 +2481,6 @@ on_session_reauthenticated (GdmSession *session, GdmManager *manager) { gboolean fail_if_already_switched = FALSE; @@ -928,7 +815,7 @@ - char *session_id; - - seat_id = gdm_session_get_display_seat_id (session); -- if (get_login_window_session_id (seat_id, &session_id)) { +- if (gdm_get_login_window_session_id (seat_id, &session_id)) { - GdmDisplay *display = gdm_display_store_find (manager->priv->display_store, - lookup_by_session_id, - (gpointer) session_id); Index: x11/gdm/files/patch-daemon_gdm-server.c =================================================================== --- x11/gdm/files/patch-daemon_gdm-server.c +++ x11/gdm/files/patch-daemon_gdm-server.c @@ -1,5 +1,26 @@ ---- daemon/gdm-server.c.orig 2017-05-05 16:40:44.000000000 +0200 -+++ daemon/gdm-server.c 2017-06-08 10:39:30.725180000 +0200 +$OpenBSD: patch-daemon_gdm-server_c,v 1.12 2019/05/08 21:58:04 ajacoutot Exp $ + +REVERT - OpenBSD lacks sigwaitinfo(2) +From 956d7d1c7a0cfbf2beacdb9e88e645e15ad32047 Mon Sep 17 00:00:00 2001 +From: Jasper St. Pierre +Date: Fri, 14 Feb 2014 19:32:50 +0000 +Subject: server: Process SIGUSR1 more carefully + +REVERT - OpenBSD does not have a systemd implementation (we need ConsoleKit) +From 1ac67f522f5690c27023d98096ca817f12f7eb88 Mon Sep 17 00:00:00 2001 +From: Ray Strode +Date: Fri, 12 Jun 2015 13:28:01 -0400 +Subject: drop consolekit support + +REVERT - OpenBSD does not have a systemd implementation (we need ConsoleKit) +From 9be58c9ec9a3a411492a5182ac4b0d51fdc3a323 Mon Sep 17 00:00:00 2001 +From: Ray Strode +Date: Fri, 12 Jun 2015 13:48:52 -0400 +Subject: require logind support + +Index: daemon/gdm-server.c +--- daemon/gdm-server.c.orig 2020-07-13 20:36:07 UTC ++++ daemon/gdm-server.c @@ -43,7 +43,9 @@ #include #endif @@ -10,25 +31,67 @@ #ifdef ENABLE_SYSTEMD_JOURNAL #include -@@ -122,23 +124,65 @@ +@@ -84,6 +86,7 @@ struct _GdmServer + char *auth_file; + guint child_watch_id; ++ guint sigusr1_id; + + gboolean is_initial; + }; +@@ -114,90 +117,74 @@ static void gdm_server_finalize (GObject + G_DEFINE_TYPE (GdmServer, gdm_server, G_TYPE_OBJECT) +-char * +-gdm_server_get_display_device (GdmServer *server) +static char * +_gdm_server_query_ck_for_display_device (GdmServer *server) -+{ + { +- /* systemd finds the display device out on its own based on the display */ +- return NULL; +-} + char *out; + char *command; + int status; + gboolean res; + GError *error; -+ + +-static void +-gdm_server_ready (GdmServer *server) +-{ +- g_debug ("GdmServer: Got USR1 from X server - emitting READY"); + g_return_val_if_fail (GDM_IS_SERVER (server), NULL); -+ + +- gdm_run_script (GDMCONFDIR "/Init", GDM_USERNAME, +- server->display_name, +- NULL, /* hostname */ +- server->auth_file); + error = NULL; + command = g_strdup_printf (CONSOLEKIT_DIR "/ck-get-x11-display-device --display %s", -+ server->priv->display_name); -+ ++ server->display_name); + +- g_signal_emit (server, signals[READY], 0); +-} +- +-static GSList *active_servers; +-static gboolean sigusr1_thread_running; +-static GCond sigusr1_thread_cond; +-static GMutex sigusr1_thread_mutex; +- +-static gboolean +-got_sigusr1 (gpointer user_data) +-{ +- GPid pid = GPOINTER_TO_UINT (user_data); +- GSList *l; +- +- g_debug ("GdmServer: got SIGUSR1 from PID %d", pid); +- +- for (l = active_servers; l; l = l->next) { +- GdmServer *server = l->data; +- +- if (server->pid == pid) +- gdm_server_ready (server); + g_debug ("GdmServer: Running helper %s", command); + out = NULL; + res = g_spawn_command_line_sync (command, @@ -42,49 +105,83 @@ + } else { + out = g_strstrip (out); + g_debug ("GdmServer: Got tty: '%s'", out); -+ } -+ + } + +- return G_SOURCE_REMOVE; + g_free (command); + + return out; -+} -+ - char * - gdm_server_get_display_device (GdmServer *server) + } + +-static gpointer +-sigusr1_thread_main (gpointer user_data) ++char * ++gdm_server_get_display_device (GdmServer *server) { -- /* systemd finds the display device out on its own based on the display */ -- return NULL; +- sigset_t sigusr1_mask; +#ifdef WITH_SYSTEMD + if (LOGIND_RUNNING()) { + /* systemd finds the display device out on its own based on the display */ + return NULL; + } +#endif -+ -+ if (server->priv->display_device == NULL) { -+ server->priv->display_device = + +- /* Handle only SIGUSR1 */ +- sigemptyset (&sigusr1_mask); +- sigaddset (&sigusr1_mask, SIGUSR1); +- sigprocmask (SIG_SETMASK, &sigusr1_mask, NULL); +- +- g_mutex_lock (&sigusr1_thread_mutex); +- sigusr1_thread_running = TRUE; +- g_cond_signal (&sigusr1_thread_cond); +- g_mutex_unlock (&sigusr1_thread_mutex); +- +- /* Spin waiting for a SIGUSR1 */ +- while (TRUE) { +- siginfo_t info; +- +- if (sigwaitinfo (&sigusr1_mask, &info) == -1) +- continue; +- +- g_idle_add (got_sigusr1, GUINT_TO_POINTER (info.si_pid)); ++ if (server->display_device == NULL) { ++ server->display_device = + _gdm_server_query_ck_for_display_device (server); -+ + g_object_notify (G_OBJECT (server), "display-device"); -+ } -+ -+ return g_strdup (server->priv->display_device); + } + +- return NULL; ++ return g_strdup (server->display_device); } - static void - gdm_server_ready (GdmServer *server) +-static void +-gdm_server_launch_sigusr1_thread_if_needed (void) ++static gboolean ++on_sigusr1 (gpointer user_data) { - g_debug ("GdmServer: Got USR1 from X server - emitting READY"); -- -- gdm_run_script (GDMCONFDIR "/Init", GDM_USERNAME, -- server->priv->display_name, -- NULL, /* hostname */ -- server->priv->auth_file); -- - g_signal_emit (server, signals[READY], 0); +- static GThread *sigusr1_thread; ++ GdmServer *server = user_data; + +- if (sigusr1_thread == NULL) { +- sigusr1_thread = g_thread_new ("gdm SIGUSR1 catcher", sigusr1_thread_main, NULL); ++ g_debug ("GdmServer: Got USR1 from X server - emitting READY"); + +- g_mutex_lock (&sigusr1_thread_mutex); +- while (!sigusr1_thread_running) +- g_cond_wait (&sigusr1_thread_cond, &sigusr1_thread_mutex); +- g_mutex_unlock (&sigusr1_thread_mutex); +- } ++ gdm_run_script (GDMCONFDIR "/Init", GDM_USERNAME, ++ server->display_name, ++ NULL, /* hostname */ ++ server->auth_file); ++ ++ g_signal_emit (server, signals[READY], 0); ++ return FALSE; } -@@ -226,8 +270,10 @@ + static void +@@ -218,8 +205,10 @@ gdm_server_init_command (GdmServer *server) debug_options = ""; } @@ -96,7 +193,7 @@ /* This is a temporary hack to work around the fact that XOrg * currently lacks support for multi-seat hotplugging for * display devices. This bit should be removed as soon as XOrg -@@ -242,6 +288,10 @@ +@@ -234,6 +223,10 @@ gdm_server_init_command (GdmServer *server) * wasn't booted using systemd, or b) the wrapper tool is * missing, or c) we are running for the main seat 'seat0'. */ @@ -107,40 +204,31 @@ #ifdef ENABLE_SYSTEMD_JOURNAL /* For systemd, we don't have a log file but instead log to stdout, so set it to the xserver's built-in default verbosity */ -@@ -264,8 +314,9 @@ +@@ -256,8 +249,8 @@ gdm_server_init_command (GdmServer *server) return; fallback: -- server->priv->command = g_strdup_printf (X_SERVER X_SERVER_ARG_FORMAT, verbosity, debug_options); +#endif - -+ server->priv->command = g_strdup_printf (X_SERVER X_SERVER_ARG_FORMAT, verbosity, debug_options); + server->command = g_strdup_printf (X_SERVER X_SERVER_ARG_FORMAT, verbosity, debug_options); +- } static gboolean -@@ -315,10 +366,12 @@ - argv[len++] = g_strdup (server->priv->auth_file); +@@ -307,10 +300,12 @@ gdm_server_resolve_command_line (GdmServer *server, + argv[len++] = g_strdup (server->auth_file); } -- if (server->priv->display_seat_id != NULL) { +- if (server->display_seat_id != NULL) { +#ifdef WITH_SYSTEMD + if (LOGIND_RUNNING() && server->priv->display_seat_id != NULL) { argv[len++] = g_strdup ("-seat"); - argv[len++] = g_strdup (server->priv->display_seat_id); + argv[len++] = g_strdup (server->display_seat_id); } +#endif /* If we were compiled with Xserver >= 1.17 we need to specify * '-listen tcp' as the X server dosen't listen on tcp sockets -@@ -657,18 +710,14 @@ - g_signal_emit (server, signals [DIED], 0, num); - } - -+ active_servers = g_slist_remove (active_servers, server); -+ - g_spawn_close_pid (server->priv->pid); - server->priv->pid = -1; - +@@ -655,12 +650,6 @@ server_child_watch (GPid pid, g_object_unref (server); } @@ -153,15 +241,40 @@ static gboolean gdm_server_spawn (GdmServer *server, const char *vtarg, -@@ -707,11 +756,6 @@ +@@ -698,15 +687,6 @@ gdm_server_spawn (GdmServer *server, + g_debug ("GdmServer: Starting X server process: %s", freeme); g_free (freeme); - active_servers = g_slist_append (active_servers, server); +- active_servers = g_slist_append (active_servers, server); - - g_object_weak_ref (G_OBJECT (server), - (GWeakNotify) - prune_active_servers_list, - server); +- +- gdm_server_launch_sigusr1_thread_if_needed (); +- + if (!g_spawn_async_with_pipes (NULL, + argv, + (char **)env->pdata, +@@ -1043,6 +1023,10 @@ gdm_server_init (GdmServer *server) + server->pid = -1; - gdm_server_launch_sigusr1_thread_if_needed (); + server->log_dir = g_strdup (LOGDIR); ++ ++ server->sigusr1_id = g_unix_signal_add (SIGUSR1, ++ on_sigusr1, ++ server); + } + + static void +@@ -1054,6 +1038,9 @@ gdm_server_finalize (GObject *object) + g_return_if_fail (GDM_IS_SERVER (object)); + + server = GDM_SERVER (object); ++ ++ if (server->sigusr1_id > 0) ++ g_source_remove (server->sigusr1_id); + + gdm_server_stop (server); Index: x11/gdm/files/patch-daemon_gdm-session-worker-job.c =================================================================== --- x11/gdm/files/patch-daemon_gdm-session-worker-job.c +++ x11/gdm/files/patch-daemon_gdm-session-worker-job.c @@ -1,13 +1,5 @@ -$OpenBSD: patch-daemon_gdm-session-worker-job_c,v 1.1 2015/10/18 13:25:54 ajacoutot Exp $ - -REVERT - OpenBSD does not have a systemd implementation (we need ConsoleKit) -From 9be58c9ec9a3a411492a5182ac4b0d51fdc3a323 Mon Sep 17 00:00:00 2001 -From: Ray Strode -Date: Fri, 12 Jun 2015 13:48:52 -0400 -Subject: require logind support - ---- daemon/gdm-session-worker-job.c.orig Mon Sep 21 16:12:33 2015 -+++ daemon/gdm-session-worker-job.c Sun Oct 18 14:23:39 2015 +--- daemon/gdm-session-worker-job.c.orig 2020-07-13 20:36:07 UTC ++++ daemon/gdm-session-worker-job.c @@ -36,7 +36,9 @@ #include #endif Index: x11/gdm/files/patch-daemon_gdm-session-worker.c =================================================================== --- x11/gdm/files/patch-daemon_gdm-session-worker.c +++ x11/gdm/files/patch-daemon_gdm-session-worker.c @@ -1,4 +1,4 @@ -$OpenBSD: patch-daemon_gdm-session-worker_c,v 1.15 2017/03/12 12:58:03 nigel Exp $ +$OpenBSD: patch-daemon_gdm-session-worker_c,v 1.21 2020/05/14 15:25:54 ajacoutot Exp $ REVERT - OpenBSD does not have a systemd implementation (we need ConsoleKit) From 1ac67f522f5690c27023d98096ca817f12f7eb88 Mon Sep 17 00:00:00 2001 @@ -24,8 +24,9 @@ Date: Mon, 11 Apr 2016 23:18:10 +1000 Subject: gdm-session: set PAM_TTY when initialising pam ---- daemon/gdm-session-worker.c.orig 2017-10-31 18:16:51.000000000 +0100 -+++ daemon/gdm-session-worker.c 2018-01-17 17:38:41.826277000 +0100 +Index: daemon/gdm-session-worker.c +--- daemon/gdm-session-worker.c.orig 2020-07-13 20:36:07 UTC ++++ daemon/gdm-session-worker.c @@ -28,9 +28,11 @@ #include #include @@ -48,17 +49,8 @@ #ifdef ENABLE_SYSTEMD_JOURNAL #include -@@ -93,7 +97,7 @@ - #endif +@@ -125,6 +129,10 @@ struct GdmSessionWorkerPrivate - #ifndef GDM_SESSION_DEFAULT_PATH --#define GDM_SESSION_DEFAULT_PATH "/usr/local/bin:/usr/bin:/bin" -+#define GDM_SESSION_DEFAULT_PATH "%%LOCALBASE%%/bin:/usr/bin:/bin" - #endif - - #ifndef GDM_SESSION_ROOT_UID -@@ -136,6 +140,10 @@ struct GdmSessionWorkerPrivate - int exit_code; +#ifdef WITH_CONSOLE_KIT @@ -68,7 +60,7 @@ pam_handle_t *pam_handle; GPid child_pid; -@@ -150,6 +158,7 @@ struct GdmSessionWorkerPrivate +@@ -139,6 +147,7 @@ struct GdmSessionWorkerPrivate char *hostname; char *username; char *log_file; @@ -76,9 +68,9 @@ char *session_id; uid_t uid; gid_t gid; -@@ -223,6 +232,204 @@ G_DEFINE_TYPE_WITH_CODE (GdmSessionWorker, - G_IMPLEMENT_INTERFACE (GDM_DBUS_TYPE_WORKER, - worker_interface_init)) +@@ -213,6 +222,204 @@ G_DEFINE_TYPE_WITH_CODE (GdmSessionWorker, + worker_interface_init) + G_ADD_PRIVATE (GdmSessionWorker)) +#ifdef WITH_CONSOLE_KIT +static gboolean @@ -281,7 +273,7 @@ /* adapted from glib script_execute */ static void script_execute (const gchar *file, -@@ -674,7 +881,9 @@ gdm_session_worker_process_pam_message (GdmSessionWork +@@ -664,7 +871,9 @@ gdm_session_worker_process_pam_message (GdmSessionWork char *user_answer; gboolean res; char *utf8_msg; @@ -291,7 +283,7 @@ if (response != NULL) { *response = NULL; -@@ -878,6 +1087,7 @@ gdm_session_worker_stop_auditor (GdmSessionWorker *wor +@@ -868,6 +1077,7 @@ gdm_session_worker_stop_auditor (GdmSessionWorker *wor worker->priv->auditor = NULL; } @@ -299,62 +291,23 @@ static void on_release_display (int signal) { -@@ -1003,6 +1213,7 @@ jump_to_vt (GdmSessionWorker *worker, +@@ -1010,6 +1220,7 @@ jump_to_vt (GdmSessionWorker *worker, close (active_vt_tty_fd); } +#endif static void - gdm_session_worker_uninitialize_pam (GdmSessionWorker *worker, -@@ -1033,11 +1244,13 @@ gdm_session_worker_uninitialize_pam (GdmSessionWorker - - gdm_session_worker_stop_auditor (worker); - -+#ifdef WITH_SYSTEMD - if (g_strcmp0 (worker->priv->display_seat_id, "seat0") == 0) { - if (worker->priv->login_vt != worker->priv->session_vt) { - jump_to_vt (worker, worker->priv->login_vt); - } - } -+#endif - - worker->priv->login_vt = 0; - worker->priv->session_vt = 0; -@@ -1088,6 +1301,7 @@ _get_xauth_for_pam (const char *x11_authority_file) - } - #endif - -+#ifdef WITH_SYSTEMD - static gboolean - ensure_login_vt (GdmSessionWorker *worker) + gdm_session_worker_set_state (GdmSessionWorker *worker, +@@ -1126,7 +1337,6 @@ gdm_session_worker_initialize_pam (GdmSessionWorker { -@@ -1099,7 +1313,7 @@ ensure_login_vt (GdmSessionWorker *worker) - - if (fd < 0) { - g_debug ("GdmSessionWorker: couldn't open VT master: %m"); -- return FALSE; -+ return FALSE; - } - - if (ioctl (fd, VT_GETSTATE, &vt_state) < 0) { -@@ -1113,6 +1327,7 @@ out: - close (fd); - return got_login_vt; - } -+#endif - - static gboolean - gdm_session_worker_initialize_pam (GdmSessionWorker *worker, -@@ -1129,7 +1344,6 @@ gdm_session_worker_initialize_pam (GdmSessionWorker - { struct pam_conv pam_conversation; int error_code; - char tty_string[256]; g_assert (worker->priv->pam_handle == NULL); -@@ -1196,10 +1410,12 @@ gdm_session_worker_initialize_pam (GdmSessionWorker +@@ -1193,10 +1403,12 @@ gdm_session_worker_initialize_pam (GdmSessionWorker } } @@ -368,15 +321,14 @@ if (strcmp (service, "gdm-launch-environment") == 0) { gdm_session_worker_set_environment_variable (worker, "XDG_SESSION_CLASS", "greeter"); -@@ -1208,6 +1424,7 @@ gdm_session_worker_initialize_pam (GdmSessionWorker +@@ -1205,12 +1417,14 @@ gdm_session_worker_initialize_pam (GdmSessionWorker g_debug ("GdmSessionWorker: state SETUP_COMPLETE"); - worker->priv->state = GDM_SESSION_WORKER_STATE_SETUP_COMPLETE; + gdm_session_worker_set_state (worker, GDM_SESSION_WORKER_STATE_SETUP_COMPLETE); +#ifdef WITH_SYSTEMD - /* Temporarily set PAM_TTY with the currently active VT (login screen) + /* Temporarily set PAM_TTY with the login VT, PAM_TTY will be reset with the users VT right before the user session is opened */ - ensure_login_vt (worker); -@@ -1215,6 +1432,7 @@ gdm_session_worker_initialize_pam (GdmSessionWorker + g_snprintf (tty_string, 256, "/dev/tty%d", GDM_INITIAL_VT); pam_set_item (worker->priv->pam_handle, PAM_TTY, tty_string); if (!display_is_local) worker->priv->password_is_required = TRUE; @@ -384,16 +336,16 @@ out: if (error_code != PAM_SUCCESS) { -@@ -1509,7 +1727,7 @@ _lookup_passwd_info (const char *username, +@@ -1506,7 +1720,7 @@ _lookup_passwd_info (const char *username, if (passwd_entry->pw_shell != NULL && passwd_entry->pw_shell[0] != '\0') { *shellp = g_strdup (passwd_entry->pw_shell); } else { - *shellp = g_strdup ("/bin/bash"); -+ *shellp = g_strdup ("/bin/sh"); ++ *shellp = g_strdup ("/bin/ksh"); } } ret = TRUE; -@@ -1762,6 +1980,26 @@ gdm_session_worker_get_environment (GdmSessionWorker * +@@ -1759,6 +1973,26 @@ gdm_session_worker_get_environment (GdmSessionWorker * return (const char * const *) pam_getenvlist (worker->priv->pam_handle); } @@ -420,7 +372,7 @@ static gboolean run_script (GdmSessionWorker *worker, const char *dir) -@@ -1792,6 +2030,9 @@ session_worker_child_watch (GPid pid, +@@ -1789,6 +2023,9 @@ session_worker_child_watch (GPid pid, : WIFSIGNALED (status) ? WTERMSIG (status) : -1); @@ -430,7 +382,7 @@ gdm_session_worker_uninitialize_pam (worker, PAM_SUCCESS); -@@ -1982,6 +2223,7 @@ gdm_session_worker_start_session (GdmSessionWorker *w +@@ -1979,6 +2216,7 @@ gdm_session_worker_start_session (GdmSessionWorker *w error_code = PAM_SUCCESS; @@ -438,7 +390,7 @@ /* If we're in new vt mode, jump to the new vt now. There's no need to jump for * the other two modes: in the logind case, the session will activate itself when * ready, and in the reuse server case, we're already on the correct VT. */ -@@ -1990,6 +2232,7 @@ gdm_session_worker_start_session (GdmSessionWorker *w +@@ -1987,6 +2225,7 @@ gdm_session_worker_start_session (GdmSessionWorker *w jump_to_vt (worker, worker->priv->session_vt); } } @@ -446,7 +398,7 @@ if (!worker->priv->is_program_session && !run_script (worker, GDMCONFDIR "/PostLogin")) { g_set_error (error, -@@ -2054,6 +2297,7 @@ gdm_session_worker_start_session (GdmSessionWorker *w +@@ -2049,6 +2288,7 @@ gdm_session_worker_start_session (GdmSessionWorker *w _exit (EXIT_FAILURE); } @@ -454,7 +406,7 @@ /* Take control of the tty */ if (needs_controlling_terminal) { -@@ -2061,6 +2305,7 @@ gdm_session_worker_start_session (GdmSessionWorker *w +@@ -2056,6 +2296,7 @@ gdm_session_worker_start_session (GdmSessionWorker *w g_debug ("GdmSessionWorker: could not take control of tty: %m"); } } @@ -462,7 +414,7 @@ #ifdef HAVE_LOGINCAP if (setusercontext (NULL, passwd_entry, passwd_entry->pw_uid, LOGIN_SETALL) < 0) { -@@ -2205,11 +2450,13 @@ gdm_session_worker_start_session (GdmSessionWorker *w +@@ -2187,11 +2428,13 @@ gdm_session_worker_start_session (GdmSessionWorker *w return TRUE; } @@ -470,13 +422,13 @@ static gboolean set_up_for_new_vt (GdmSessionWorker *worker) { - int fd; + int initial_vt_fd; char vt_string[256], tty_string[256]; + struct vt_stat vt_state = { 0 }; int session_vt = 0; - fd = open ("/dev/tty0", O_RDWR | O_NOCTTY); -@@ -2219,6 +2466,11 @@ set_up_for_new_vt (GdmSessionWorker *worker) + /* open the initial vt. We need it for two scenarios: +@@ -2209,6 +2452,11 @@ set_up_for_new_vt (GdmSessionWorker *worker) return FALSE; } @@ -486,25 +438,25 @@ + } + if (worker->priv->display_is_initial) { - session_vt = atoi (GDM_INITIAL_VT); + session_vt = GDM_INITIAL_VT; } else { -@@ -2228,6 +2480,7 @@ set_up_for_new_vt (GdmSessionWorker *worker) +@@ -2222,6 +2470,7 @@ set_up_for_new_vt (GdmSessionWorker *worker) } } + worker->priv->login_vt = vt_state.v_active; worker->priv->session_vt = session_vt; + g_assert (session_vt > 0); +@@ -2287,6 +2536,7 @@ fail: close (fd); -@@ -2290,6 +2543,7 @@ fail: - close (fd); return FALSE; } +#endif static gboolean set_up_for_current_vt (GdmSessionWorker *worker, -@@ -2357,12 +2611,14 @@ set_up_for_current_vt (GdmSessionWorker *worker, +@@ -2354,12 +2604,14 @@ set_up_for_current_vt (GdmSessionWorker *worker, } #endif @@ -519,25 +471,25 @@ return TRUE; out: -@@ -2386,6 +2642,7 @@ gdm_session_worker_open_session (GdmSessionWorker *wo - return FALSE; - } +@@ -2385,6 +2637,7 @@ gdm_session_worker_open_session (GdmSessionWorker *wo break; -+#ifdef WITH_SYSTEMD case GDM_SESSION_DISPLAY_MODE_NEW_VT: case GDM_SESSION_DISPLAY_MODE_LOGIND_MANAGED: ++#ifdef WITH_SYSTEMD if (!set_up_for_new_vt (worker)) { -@@ -2396,6 +2653,7 @@ gdm_session_worker_open_session (GdmSessionWorker *wo + g_set_error (error, + GDM_SESSION_WORKER_ERROR, +@@ -2392,6 +2645,7 @@ gdm_session_worker_open_session (GdmSessionWorker *wo + "Unable to open VT"); return FALSE; } - break; +#endif + break; } - flags = 0; -@@ -2417,8 +2675,18 @@ gdm_session_worker_open_session (GdmSessionWorker *wo +@@ -2414,8 +2668,18 @@ gdm_session_worker_open_session (GdmSessionWorker *wo g_debug ("GdmSessionWorker: state SESSION_OPENED"); - worker->priv->state = GDM_SESSION_WORKER_STATE_SESSION_OPENED; + gdm_session_worker_set_state (worker, GDM_SESSION_WORKER_STATE_SESSION_OPENED); +#ifdef WITH_SYSTEMD session_id = gdm_session_worker_get_environment_variable (worker, "XDG_SESSION_ID"); @@ -554,7 +506,7 @@ if (session_id != NULL) { g_free (worker->priv->session_id); worker->priv->session_id = session_id; -@@ -2523,6 +2791,19 @@ gdm_session_worker_handle_set_session_name (GdmDBusWor +@@ -2523,6 +2787,19 @@ gdm_session_worker_handle_set_session_name (GdmDBusWor } static gboolean @@ -574,7 +526,7 @@ gdm_session_worker_handle_set_session_display_mode (GdmDBusWorker *object, GDBusMethodInvocation *invocation, const char *str) -@@ -2949,6 +3230,7 @@ gdm_session_worker_handle_open (GdmDBusWorker +@@ -2949,6 +3226,7 @@ gdm_session_worker_handle_open (GdmDBusWorker return TRUE; } @@ -582,7 +534,7 @@ static char ** filter_extensions (const char * const *extensions) { -@@ -2974,6 +3256,7 @@ filter_extensions (const char * const *extensions) +@@ -2974,6 +3252,7 @@ filter_extensions (const char * const *extensions) return filtered_extensions; } @@ -590,7 +542,7 @@ static gboolean gdm_session_worker_handle_initialize (GdmDBusWorker *object, -@@ -2993,8 +3276,10 @@ gdm_session_worker_handle_initialize (GdmDBusWorker +@@ -2993,8 +3272,10 @@ gdm_session_worker_handle_initialize (GdmDBusWorker while (g_variant_iter_loop (&iter, "{sv}", &key, &value)) { if (g_strcmp0 (key, "service") == 0) { worker->priv->service = g_variant_dup_string (value, NULL); @@ -601,7 +553,7 @@ } else if (g_strcmp0 (key, "username") == 0) { worker->priv->username = g_variant_dup_string (value, NULL); } else if (g_strcmp0 (key, "is-program-session") == 0) { -@@ -3434,6 +3719,7 @@ worker_interface_init (GdmDBusWorkerIface *interface) +@@ -3434,6 +3715,7 @@ worker_interface_init (GdmDBusWorkerIface *interface) interface->handle_open = gdm_session_worker_handle_open; interface->handle_set_language_name = gdm_session_worker_handle_set_language_name; interface->handle_set_session_name = gdm_session_worker_handle_set_session_name; Index: x11/gdm/files/patch-daemon_gdm-session-worker.xml =================================================================== --- x11/gdm/files/patch-daemon_gdm-session-worker.xml +++ x11/gdm/files/patch-daemon_gdm-session-worker.xml @@ -1,4 +1,12 @@ ---- daemon/gdm-session-worker.xml.orig 2015-07-20 13:13:42 UTC +$OpenBSD: patch-daemon_gdm-session-worker_xml,v 1.1 2015/10/18 13:25:54 ajacoutot Exp $ + +REVERT - OpenBSD does not have a systemd implementation (we need ConsoleKit) +From a9cacb929470eb82582396984c61d5b611bfeb1a Mon Sep 17 00:00:00 2001 +From: Ray Strode +Date: Fri, 12 Jun 2015 14:33:40 -0400 +Subject: session: drop session-type property + +--- daemon/gdm-session-worker.xml.orig 2020-07-13 20:36:07 UTC +++ daemon/gdm-session-worker.xml @@ -13,6 +13,9 @@ Index: x11/gdm/files/patch-daemon_gdm-session.h =================================================================== --- x11/gdm/files/patch-daemon_gdm-session.h +++ x11/gdm/files/patch-daemon_gdm-session.h @@ -1,4 +1,4 @@ -$OpenBSD: patch-daemon_gdm-session_h,v 1.4 2016/04/26 08:25:04 ajacoutot Exp $ +$OpenBSD: patch-daemon_gdm-session_h,v 1.6 2019/11/02 15:34:07 ajacoutot Exp $ REVERT - OpenBSD does not have a systemd implementation (we need ConsoleKit) From a9cacb929470eb82582396984c61d5b611bfeb1a Mon Sep 17 00:00:00 2001 @@ -6,9 +6,10 @@ Date: Fri, 12 Jun 2015 14:33:40 -0400 Subject: session: drop session-type property ---- daemon/gdm-session.h.orig Tue Apr 19 07:00:04 2016 -+++ daemon/gdm-session.h Tue Apr 26 10:02:48 2016 -@@ -180,6 +180,8 @@ void gdm_session_answer_query +Index: daemon/gdm-session.h +--- daemon/gdm-session.h.orig 2020-07-13 20:36:07 UTC ++++ daemon/gdm-session.h +@@ -122,6 +122,8 @@ void gdm_session_answer_query const char *text); void gdm_session_select_program (GdmSession *session, const char *command_line); Index: x11/gdm/files/patch-daemon_gdm-session.c =================================================================== --- x11/gdm/files/patch-daemon_gdm-session.c +++ x11/gdm/files/patch-daemon_gdm-session.c @@ -1,4 +1,4 @@ -$OpenBSD: patch-daemon_gdm-session_c,v 1.12 2017/05/10 10:18:15 ajacoutot Exp $ +$OpenBSD: patch-daemon_gdm-session_c,v 1.22 2020/05/14 15:25:54 ajacoutot Exp $ REVERT - OpenBSD does not have a systemd implementation (we need ConsoleKit) From 9be58c9ec9a3a411492a5182ac4b0d51fdc3a323 Mon Sep 17 00:00:00 2001 @@ -13,9 +13,9 @@ Subject: session: drop session-type property Index: daemon/gdm-session.c ---- daemon/gdm-session.c.orig +--- daemon/gdm-session.c.orig 2020-07-13 20:36:07 UTC +++ daemon/gdm-session.c -@@ -3076,6 +3076,10 @@ gdm_session_bypasses_xsession (GdmSession *self) +@@ -3238,6 +3238,10 @@ gdm_session_bypasses_xsession (GdmSession *self) g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (GDM_IS_SESSION (self), FALSE); @@ -26,10 +26,10 @@ #ifdef ENABLE_WAYLAND_SUPPORT if (gdm_session_is_wayland_session (self)) { bypasses_xsession = TRUE; -@@ -3168,6 +3172,27 @@ gdm_session_select_program (GdmSession *self, - g_free (self->priv->selected_program); +@@ -3330,6 +3334,27 @@ gdm_session_select_program (GdmSession *self, + g_free (self->selected_program); - self->priv->selected_program = g_strdup (text); + self->selected_program = g_strdup (text); +} + +void @@ -41,7 +41,7 @@ + + g_debug ("GdmSession: selecting session type '%s'", text); + -+ g_hash_table_iter_init (&iter, self->priv->conversations); ++ g_hash_table_iter_init (&iter, self->conversations); + while (g_hash_table_iter_next (&iter, &key, &value)) { + GdmSessionConversation *conversation; + Index: x11/gdm/files/patch-daemon_gdm-x-session.c =================================================================== --- /dev/null +++ x11/gdm/files/patch-daemon_gdm-x-session.c @@ -0,0 +1,21 @@ +--- daemon/gdm-x-session.c.orig 2020-09-11 20:34:27 UTC ++++ daemon/gdm-x-session.c +@@ -19,6 +19,7 @@ + */ + #include "config.h" + ++#include + #include + #include + +@@ -36,6 +37,10 @@ + #include + #include + #include ++ ++#ifndef HOST_NAME_MAX ++#define HOST_NAME_MAX MAXHOSTNAMELEN ++#endif + + #define DISPLAY_FILENO (STDERR_FILENO + 1) + #define BUS_ADDRESS_FILENO (DISPLAY_FILENO + 1) Index: x11/gdm/files/patch-daemon_main.c =================================================================== --- /dev/null +++ x11/gdm/files/patch-daemon_main.c @@ -0,0 +1,40 @@ +$OpenBSD: patch-daemon_main_c,v 1.4 2017/11/05 02:17:07 ajacoutot Exp $ + +REVERT - OpenBSD lacks sigwaitinfo(2) +From 956d7d1c7a0cfbf2beacdb9e88e645e15ad32047 Mon Sep 17 00:00:00 2001 +From: Jasper St. Pierre +Date: Fri, 14 Feb 2014 19:32:50 +0000 +Subject: server: Process SIGUSR1 more carefully + +Index: daemon/main.c +--- daemon/main.c.orig ++++ daemon/main.c +@@ -289,19 +289,6 @@ is_debug_set (void) + return debug; + } + +-/* SIGUSR1 is used by the X server to tell us that we're ready, so +- * block it. We'll unblock it in the worker thread in gdm-server.c +- */ +-static void +-block_sigusr1 (void) +-{ +- sigset_t mask; +- +- sigemptyset (&mask); +- sigaddset (&mask, SIGUSR1); +- sigprocmask (SIG_BLOCK, &mask, NULL); +-} +- + int + main (int argc, + char **argv) +@@ -320,8 +307,6 @@ main (int argc, + + { NULL } + }; +- +- block_sigusr1 (); + + bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR); + textdomain (GETTEXT_PACKAGE); Index: x11/gdm/files/patch-data_gdm.schemas.in =================================================================== --- /dev/null +++ x11/gdm/files/patch-data_gdm.schemas.in @@ -0,0 +1,11 @@ +--- data/gdm.schemas.in.orig 2009-05-16 18:17:53.000000000 -0400 ++++ data/gdm.schemas.in 2009-05-16 18:18:01.000000000 -0400 +@@ -77,7 +77,7 @@ + + xdmcp/DisplaysPerHost + i +- 1 ++ 2 + + + xdmcp/Port Index: x11/gdm/files/patch-data_gdm.schemas.in.in =================================================================== --- x11/gdm/files/patch-data_gdm.schemas.in.in +++ /dev/null @@ -1,11 +0,0 @@ ---- data/gdm.schemas.in.in.orig 2009-05-16 18:17:53.000000000 -0400 -+++ data/gdm.schemas.in.in 2009-05-16 18:18:01.000000000 -0400 -@@ -77,7 +77,7 @@ - - xdmcp/DisplaysPerHost - i -- 1 -+ 2 - - - xdmcp/Port Index: x11/gdm/files/patch-data_gnome-login.session.in =================================================================== --- x11/gdm/files/patch-data_gnome-login.session.in +++ /dev/null @@ -1,7 +0,0 @@ ---- data/gnome-login.session.in.orig 2018-08-01 19:00:01 UTC -+++ data/gnome-login.session.in -@@ -1,3 +1,3 @@ - [GNOME Session] - Name=Display Manager --RequiredComponents=org.gnome.Shell;org.gnome.SettingsDaemon.A11ySettings;org.gnome.SettingsDaemon.Clipboard;org.gnome.SettingsDaemon.Color;org.gnome.SettingsDaemon.Datetime;org.gnome.SettingsDaemon.Housekeeping;org.gnome.SettingsDaemon.Keyboard;org.gnome.SettingsDaemon.MediaKeys;org.gnome.SettingsDaemon.Mouse;org.gnome.SettingsDaemon.Power;org.gnome.SettingsDaemon.PrintNotifications;org.gnome.SettingsDaemon.Rfkill;org.gnome.SettingsDaemon.ScreensaverProxy;org.gnome.SettingsDaemon.Sharing;org.gnome.SettingsDaemon.Smartcard;org.gnome.SettingsDaemon.Sound;org.gnome.SettingsDaemon.Wacom;org.gnome.SettingsDaemon.XSettings; -+RequiredComponents=org.gnome.Shell;org.gnome.SettingsDaemon.A11ySettings;org.gnome.SettingsDaemon.Color;org.gnome.SettingsDaemon.Datetime;org.gnome.SettingsDaemon.Housekeeping;org.gnome.SettingsDaemon.Keyboard;org.gnome.SettingsDaemon.MediaKeys;org.gnome.SettingsDaemon.Power;org.gnome.SettingsDaemon.PrintNotifications;org.gnome.SettingsDaemon.Rfkill;org.gnome.SettingsDaemon.ScreensaverProxy;org.gnome.SettingsDaemon.Sharing;org.gnome.SettingsDaemon.Smartcard;org.gnome.SettingsDaemon.Sound;org.gnome.SettingsDaemon.Wacom;org.gnome.SettingsDaemon.XSettings; Index: x11/gdm/files/patch-data_meson.build =================================================================== --- /dev/null +++ x11/gdm/files/patch-data_meson.build @@ -0,0 +1,34 @@ +--- data/meson.build.orig 2020-10-09 15:42:18 UTC ++++ data/meson.build +@@ -170,6 +170,7 @@ else + service_config.set('PLYMOUTH_QUIT_SERVICE', '') + endif + ++if systemd_dep.found() + if get_option('systemdsystemunitdir') != '' + systemd_systemunitdir = get_option('systemdsystemunitdir') + else +@@ -181,7 +182,6 @@ if get_option('systemduserunitdir') != '' + else + systemd_userunitdir = systemd_dep.get_pkgconfig_variable('systemduserunitdir', + define_variable: ['prefix', get_option('prefix')]) +-endif + + configure_file( + input: 'gdm.service.in', +@@ -190,6 +190,7 @@ configure_file( + install_dir: systemd_systemunitdir, + format: 'cmake' + ) ++endif + + gdm_gnome_session_wanted_targets = [] + foreach component: gdm_gnome_user_session_wanted_components +@@ -205,6 +206,7 @@ configure_file( + }, + install_dir: systemd_userunitdir / 'gnome-session@gnome-login.target.d', + ) ++endif + + # XSession + if get_option('gdm-xsession') Index: x11/gdm/files/patch-libgdm_gdm-user-switching.c =================================================================== --- x11/gdm/files/patch-libgdm_gdm-user-switching.c +++ x11/gdm/files/patch-libgdm_gdm-user-switching.c @@ -1,4 +1,25 @@ ---- libgdm/gdm-user-switching.c.orig 2015-07-20 13:13:45 UTC +$OpenBSD: patch-libgdm_gdm-user-switching_c,v 1.4 2020/05/14 15:25:54 ajacoutot Exp $ + +REVERT - OpenBSD does not have a systemd implementation (we need ConsoleKit) +From fcba1e1a5d556ce7b52101dbd2d1ba4a19469161 Mon Sep 17 00:00:00 2001 +From: Iain Lane +Date: Fri, 5 Jan 2018 11:53:34 +0000 +Subject: [PATCH] manager: Find user's current graphical session, not session of caller + +REVERT - OpenBSD does not have a systemd implementation (we need ConsoleKit) +From 1ac67f522f5690c27023d98096ca817f12f7eb88 Mon Sep 17 00:00:00 2001 +From: Ray Strode +Date: Fri, 12 Jun 2015 13:28:01 -0400 +Subject: drop consolekit support + +REVERT - OpenBSD does not have a systemd implementation (we need ConsoleKit) +From 9be58c9ec9a3a411492a5182ac4b0d51fdc3a323 Mon Sep 17 00:00:00 2001 +From: Ray Strode +Date: Fri, 12 Jun 2015 13:48:52 -0400 +Subject: require logind support + +Index: libgdm/gdm-user-switching.c +--- libgdm/gdm-user-switching.c.orig 2020-07-13 20:36:07 UTC +++ libgdm/gdm-user-switching.c @@ -31,12 +31,25 @@ #include @@ -26,7 +47,7 @@ static gboolean create_transient_display (GDBusConnection *connection, GCancellable *cancellable, -@@ -67,12 +80,304 @@ create_transient_display (GDBusConnectio +@@ -67,16 +80,308 @@ create_transient_display (GDBusConnection *connection, return TRUE; } @@ -40,11 +61,11 @@ - GError **error) +get_current_session_id (GDBusConnection *connection, + char **session_id) -+{ + { + GError *local_error = NULL; -+ GVariant *reply; -+ -+ reply = g_dbus_connection_call_sync (connection, + GVariant *reply; + + reply = g_dbus_connection_call_sync (connection, + CK_NAME, + CK_MANAGER_PATH, + CK_MANAGER_INTERFACE, @@ -115,7 +136,7 @@ + return seat_id; +} + -+static gboolean ++gboolean +activate_session_id_for_ck (GDBusConnection *connection, + GCancellable *cancellable, + const char *seat_id, @@ -327,16 +348,20 @@ + +#ifdef WITH_SYSTEMD + -+static gboolean ++gboolean +activate_session_id_for_systemd (GDBusConnection *connection, + GCancellable *cancellable, + const char *seat_id, + const char *session_id, + GError **error) - { - GVariant *reply; - -@@ -97,8 +402,8 @@ activate_session_id (GDBusConnection *c ++{ ++ GVariant *reply; ++ ++ reply = g_dbus_connection_call_sync (connection, + "org.freedesktop.login1", + "/org/freedesktop/login1", + "org.freedesktop.login1.Manager", +@@ -97,8 +402,8 @@ activate_session_id (GDBusConnection *connection, } static gboolean @@ -347,7 +372,7 @@ { gboolean ret; int res, i; -@@ -182,9 +487,9 @@ out: +@@ -182,16 +487,15 @@ out: } static gboolean @@ -360,9 +385,29 @@ { gboolean ret; int res; -@@ -238,9 +543,9 @@ goto_login_session (GDBusConnection *co + char *our_session; + char *session_id; + char *seat_id; +- GError *local_error = NULL; + + ret = FALSE; + session_id = NULL; +@@ -203,8 +507,10 @@ goto_login_session (GDBusConnection *connection, + /* Note that we mostly use free () here, instead of g_free () + * since the data allocated is from libsystemd-logind, which + * does not use GLib's g_malloc (). */ +- if (!gdm_find_display_session (0, getuid (), &our_session, &local_error)) { +- g_propagate_prefixed_error (error, local_error, _("Could not identify the current session: ")); ++ res = sd_pid_get_session (0, &our_session); ++ if (res < 0) { ++ g_debug ("failed to determine own session: %s", strerror (-res)); ++ g_set_error (error, GDM_CLIENT_ERROR, 0, _("Could not identify the current session.")); + return FALSE; } +@@ -236,9 +542,9 @@ goto_login_session (GDBusConnection *connection, + return FALSE; + } - res = get_login_window_session_id (seat_id, &session_id); + res = get_login_window_session_id_for_systemd (seat_id, &session_id); @@ -372,7 +417,7 @@ if (res) { ret = TRUE; -@@ -259,10 +564,11 @@ goto_login_session (GDBusConnection *co +@@ -257,10 +563,11 @@ goto_login_session (GDBusConnection *connection, return ret; } @@ -385,7 +430,7 @@ { GDBusConnection *connection; gboolean retval; -@@ -271,8 +577,23 @@ gdm_goto_login_session_sync (GCancellabl +@@ -269,8 +576,23 @@ gdm_goto_login_session_sync (GCancellable *cancellabl if (!connection) return FALSE; @@ -395,7 +440,7 @@ + retval = goto_login_session_for_systemd (connection, + cancellable, + error); -+ + + g_object_unref (connection); + return retval; + } @@ -403,7 +448,7 @@ + +#ifdef WITH_CONSOLE_KIT + retval = goto_login_session_for_ck (connection, cancellable, error); - ++ g_object_unref (connection); return retval; +#else Index: x11/gdm/files/patch-meson.build =================================================================== --- /dev/null +++ x11/gdm/files/patch-meson.build @@ -0,0 +1,73 @@ +--- meson.build.orig 2020-09-11 20:34:27 UTC ++++ meson.build +@@ -33,12 +33,13 @@ ran_once_marker_dir = (get_option('ran-once-marker-dir + working_dir = (get_option('working-dir') != '')? get_option('working-dir') : gdm_prefix / get_option('localstatedir') / 'lib' / 'gdm' + gdm_xauth_dir = (get_option('xauth-dir') != '')? get_option('xauth-dir') : gdm_run_dir + gdm_screenshot_dir = (get_option('screenshot-dir') != '')? get_option('screenshot-dir') : gdm_run_dir / 'greeter' ++consolekit_dir=(get_option('consolekit-dir') != '')? get_option('consolekit-dir') : get_option('libexecdir') + + # Common variables + config_h_dir = include_directories('.') + + # Dependencies +-udev_dep = dependency('udev') ++# udev_dep = dependency('udev') + + glib_min_version = '2.44.0' + +@@ -52,6 +53,7 @@ accountsservice_dep = dependency('accountsservice', ve + xcb_dep = dependency('xcb') + keyutils_dep = dependency('libkeyutils', required: false) + libselinux_dep = dependency('libselinux', required: get_option('selinux')) ++libconsolekit_dep = dependency('libconsolekit', required: get_option('consolekit')) + + # udev + if udev_dir == '' +@@ -94,9 +96,9 @@ if xdmcp_dep.found() and get_option('tcp-wrappers') + libwrap_dep = cc.find_library('libwrap') + endif + # systemd +-systemd_dep = dependency('systemd') +-libsystemd_dep = dependency('libsystemd') +-if meson.version().version_compare('>= 0.53') ++systemd_dep = dependency('systemd', required: get_option('systemd')) ++libsystemd_dep = dependency('libsystemd', required: get_option('systemd')) ++if meson.version().version_compare('>= 0.53') and systemd_dep.found() + systemd_multiseat_x = find_program('systemd-multi-seat-x', + required: false, + dirs: [ +@@ -226,6 +228,9 @@ conf.set('HAVE_PAM_SYSLOG', have_pam_syslog) + conf.set('HAVE_KEYUTILS', keyutils_dep.found()) + conf.set('SUPPORTS_PAM_EXTENSIONS', pam_extensions_supported) + conf.set('HAVE_SELINUX', libselinux_dep.found()) ++conf.set('WITH_SYSTEMD', libsystemd_dep.found()) ++conf.set('WITH_CONSOLE_KIT', libconsolekit_dep.found()) ++conf.set_quoted('CONSOLEKIT_DIR', consolekit_dir) + conf.set('ENABLE_USER_DISPLAY_SERVER', get_option('user-display-server')) + conf.set('ENABLE_SYSTEMD_JOURNAL', get_option('systemd-journal')) + conf.set('ENABLE_WAYLAND_SUPPORT', get_option('wayland-support')) +@@ -264,7 +269,6 @@ endif + subdir('daemon') + subdir('libgdm') + subdir('utils') +-subdir('pam_gdm') + subdir('po') + if libcheck_dep.found() + subdir('tests') +@@ -302,6 +306,7 @@ summary({ + 'Lang config file': lang_config_file, + 'Pam MOD': pam_mod_dir, + 'Udev rules': udev_dir, ++ 'ConsoleKit dir': consolekit_dir, + 'XServer': x_bin, + 'XPath': x_path, + 'Systemd XServer': systemd_x_server, +@@ -314,6 +319,8 @@ summary({ + 'PAM Syslog': have_pam_syslog, + 'Supports PAM Extensions': pam_extensions_supported, + 'SeLinux': libselinux_dep.found(), ++ 'Systemd': libsystemd_dep.found(), ++ 'Console-kit': libconsolekit_dep.found(), + 'Use GDM Xsession': get_option('gdm-xsession'), + 'Use UserDisplayServer': get_option('user-display-server'), + 'Use SystemdJournal': get_option('systemd-journal'), Index: x11/gdm/files/patch-meson__options.txt =================================================================== --- /dev/null +++ x11/gdm/files/patch-meson__options.txt @@ -0,0 +1,9 @@ +--- meson_options.txt.orig 2020-09-11 20:34:27 UTC ++++ meson_options.txt +@@ -38,3 +38,6 @@ option('wayland-support', type: 'boolean', value: true + option('working-dir', type: 'string', value: '', description: 'Working directory.') + option('xauth-dir', type: 'string', value: '', description: 'XAuth cookie directory.') + option('xdmcp', type: 'feature', value: 'auto', description: 'Add XDMCP (remote login) support.') ++option('systemd', type: 'feature', value: 'auto', description: 'Add support for systemd') ++option('consolekit', type: 'feature', value: 'auto', description: 'Add support for consolekit') ++option('consolekit-dir', type: 'string', value: '', description: 'directory of ck-get-x11-display-device') Index: x11/gdm/pkg-plist =================================================================== --- x11/gdm/pkg-plist +++ x11/gdm/pkg-plist @@ -1,3 +1,4 @@ +@comment /61-gdm.rules bin/gdm-screenshot bin/gdmflexiserver @sample etc/dbus-1/system.d/gdm.conf.sample @@ -10,8 +11,11 @@ @sample %%ETCDIR%%/home/.pulse/client.conf.sample @sample %%ETCDIR%%/locale.conf.sample @sample etc/pam.d/gdm-autologin.sample +@comment etc/pam.d/gdm-fingerprint @sample etc/pam.d/gdm-launch-environment.sample @sample etc/pam.d/gdm-password.sample +@comment etc/pam.d/gdm-pin +@comment etc/pam.d/gdm-smartcard include/gdm/gdm-client-glue.h include/gdm/gdm-client.h include/gdm/gdm-sessions.h @@ -84,9 +88,6 @@ share/help/uk/gdm/legal.xml share/help/zh_CN/gdm/index.docbook share/help/zh_CN/gdm/legal.xml -share/icons/hicolor/16x16/apps/gdm-xnest.png -share/icons/hicolor/32x32/apps/gdm-setup.png -share/icons/hicolor/32x32/apps/gdm-xnest.png share/locale/af/LC_MESSAGES/gdm.mo share/locale/am/LC_MESSAGES/gdm.mo share/locale/an/LC_MESSAGES/gdm.mo @@ -103,6 +104,7 @@ share/locale/bs/LC_MESSAGES/gdm.mo share/locale/ca/LC_MESSAGES/gdm.mo share/locale/ca@valencia/LC_MESSAGES/gdm.mo +share/locale/ckb/LC_MESSAGES/gdm.mo share/locale/crh/LC_MESSAGES/gdm.mo share/locale/cs/LC_MESSAGES/gdm.mo share/locale/csb/LC_MESSAGES/gdm.mo @@ -150,6 +152,7 @@ share/locale/mai/LC_MESSAGES/gdm.mo share/locale/mg/LC_MESSAGES/gdm.mo share/locale/mi/LC_MESSAGES/gdm.mo +share/locale/mjw/LC_MESSAGES/gdm.mo share/locale/mk/LC_MESSAGES/gdm.mo share/locale/ml/LC_MESSAGES/gdm.mo share/locale/mn/LC_MESSAGES/gdm.mo @@ -178,6 +181,7 @@ share/locale/sr/LC_MESSAGES/gdm.mo share/locale/sr@latin/LC_MESSAGES/gdm.mo share/locale/sv/LC_MESSAGES/gdm.mo +share/locale/sw/LC_MESSAGES/gdm.mo share/locale/ta/LC_MESSAGES/gdm.mo share/locale/te/LC_MESSAGES/gdm.mo share/locale/tg/LC_MESSAGES/gdm.mo @@ -194,26 +198,13 @@ share/locale/zh_HK/LC_MESSAGES/gdm.mo share/locale/zh_TW/LC_MESSAGES/gdm.mo share/locale/zu/LC_MESSAGES/gdm.mo -share/pixmaps/gdm-foot-logo.png -share/pixmaps/gdm-setup.png -share/pixmaps/gdm-xnest.png -share/pixmaps/gdm.png -share/pixmaps/nobody.png -share/pixmaps/nohost.png -@postexec mkdir -p %D/share/xsessions @postexec dconf update @postunexec dconf update -@mode 1775 -@dir etc/gdm/home -@mode -@postunexec rm -rf %D/etc/gdm/home/.gconf* @dir %%ETCDIR%%/Sessions -@dir %%ETCDIR%%/home/.local/share/applications @dir etc/dm @dir etc/dm/Sessions @dir share/xsessions -@dir /var/cache/gdm/ @dir /var/run/gdm/greeter @dir /var/run/gdm/ @dir /var/log/gdm/ -@postunexec rm -fr /var/gdm +