Commit 90a85be9 authored by Olivier Duchateau's avatar Olivier Duchateau
Browse files

Update to 3.38.2.1

parent 93353d09
# Created by: Joe Marcus Clarke <marcus@FreeBSD.org>
# $FreeBSD: head/x11/gdm/Makefile 554135 2020-11-05 15:54:11Z 0mp $
PORTNAME= gdm
PORTVERSION= 3.38.2.1
CATEGORIES= x11 gnome
MASTER_SITES= GNOME
DIST_SUBDIR= gnome
MAINTAINER= gnome@FreeBSD.org
COMMENT= GNOME display manager
LICENSE= GPLv2
LICENSE_FILE= ${WRKSRC}/COPYING
BUILD_DEPENDS= zenity>=3.0.0:x11/zenity \
itstool:textproc/itstool \
iso-codes>=0:misc/iso-codes
LIB_DEPENDS= libck-connector.so:sysutils/consolekit2 \
libaccountsservice.so:sysutils/accountsservice \
libfribidi.so:converters/fribidi \
libcanberra.so:audio/libcanberra \
libcanberra-gtk3.so:audio/libcanberra-gtk3
RUN_DEPENDS= zenity>=3.0.0:x11/zenity \
gnome-settings-daemon>=3.0.0:sysutils/gnome-settings-daemon \
gnome-keyring-3:security/gnome-keyring \
gnome-session>=3.0.0:x11/gnome-session \
at-spi2-core>=0:accessibility/at-spi2-core \
iso-codes>=0:misc/iso-codes
# used in scripts
RUN_DEPENDS+= xrdb:x11/xrdb \
setxkbmap:x11/setxkbmap \
xsetroot:x11/xsetroot \
xhost:x11/xhost \
xmodmap:x11/xmodmap \
xterm:x11/xterm
USERS= gdm
GROUPS= gdm video
PORTSCOUT= limitw:1,even
USES= cpe gettext gmake gnome localbase:ldflags meson pkgconfig \
tar:xz xorg
CPE_VENDOR= gnome
CPE_PRODUCT= gnome_display_manager
USE_GNOME= cairo dconf glib20 gdkpixbuf2 gtk30 intltool introspection
USE_LDCONFIG= yes
USE_XORG= x11 xau xcb xdmcp xorgproto
USE_RC_SUBR= gdm
USE_GNOME_SUBR= yes
GLIB_SCHEMAS= org.gnome.login-screen.gschema.xml
MESON_ARGS= -Dlocalstatedir=/var \
-Dlang-file=${PREFIX}/etc/gdm/locale.conf.sample \
-Dat-spi-registryd-dir=${LOCALBASE}/libexec \
-Dcustom-conf=${PREFIX}/etc/gdm/custom.conf.sample \
-Ddbus-sys=${PREFIX}/etc/dbus-1/system.d \
-Dlog-dir=/var/log/gdm \
-Dplymouth=disabled \
-Dlibaudit=disabled \
-Dselinux=disabled \
-Dsysconfsubdir=gdm \
-Dpid-file=/var/run/gdm.pid \
-Ddmconfdir=${LOCALBASE}/share/xsessions \
-Dsystemd-journal=false \
-Dinitial-vt=09 \
-Dgdm-xsession=true \
-Dwayland-support=false \
-Duser-display-server=false
# this is a hack until we can get our own pam dir and dir in order.
MESON_ARGS+= -Ddefault-pam-config=none
CPPFLAGS+= -DHAS_SA_LEN \
SUB_FILES+= gdm-launch-environment \
gdm-password \
gdm-autologin \
client.conf \
locale.conf
GDMDIR?= ${PREFIX}/etc/gdm
GNOME_LOCALSTATEDIR= /var
OPTIONS_DEFINE= IPV6
IPV6_MESON_TRUE= ipv6
post-patch:
@${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/Xsession.in
post-install:
${MKDIR} ${STAGEDIR}/var/log/gdm
${MKDIR} ${STAGEDIR}/var/run/gdm/greeter
.for i in .cache .color .config .dbus .local
${MKDIR} ${STAGEDIR}/var/lib/gdm/${i}
.endfor
${MKDIR} ${STAGEDIR}/var/lib/gdm/.config/pulse
${INSTALL_DATA} ${WRKDIR}/gdm-autologin \
${STAGEDIR}${PREFIX}/etc/pam.d/gdm-autologin.sample
${INSTALL_DATA} ${WRKDIR}/gdm-launch-environment \
${STAGEDIR}${PREFIX}/etc/pam.d/gdm-launch-environment.sample
${INSTALL_DATA} ${WRKDIR}/gdm-password \
${STAGEDIR}${PREFIX}/etc/pam.d/gdm-password.sample
${INSTALL_DATA} ${WRKDIR}/client.conf \
${STAGEDIR}/var/lib/gdm/.config/pulse/client.conf
${INSTALL_DATA} ${WRKDIR}/locale.conf \
${STAGEDIR}${PREFIX}/etc/gdm/locale.conf.sample
.include <bsd.port.mk>
TIMESTAMP = 1610894878
SHA256 (gnome/gdm-3.38.2.1.tar.xz) = ca58a205d5ebfcbdab56a11716b898e16ae5dff21aee79d076046444628ec4da
SIZE (gnome/gdm-3.38.2.1.tar.xz) = 789036
autospawn = no
daemon-binary = /usr/bin/true
# $OpenBSD: gdm-autologin,v 1.4 2012/10/10 08:47:14 ajacoutot Exp $
#
# gdm-autologin settings for pam(3)
auth required pam_permit.so
account required pam_nologin.so
account include system
password include system
session include system
# $OpenBSD: gdm-launch-environment,v 1.3 2012/10/10 08:47:14 ajacoutot Exp $
#
# gdm-launch-environment settings for pam(3)
auth required pam_permit.so
account required pam_nologin.so
account include system
password include system
session include system
# $OpenBSD: gdm-password,v 1.4 2012/10/10 08:47:14 ajacoutot Exp $
#
# gdm-password settings for pam(3)
auth include system
auth optional %%LOCALBASE%%/lib/pam_ck_connector.so
auth optional %%LOCALBASE%%/lib/pam_gnome_keyring.so
account required pam_nologin.so
account include system
password include system
session include system
session optional %%LOCALBASE%%/lib/pam_gnome_keyring.so auto_start
#!/bin/sh
# $FreeBSD: head/x11/gdm/files/gdm.in 480951 2018-09-30 11:58:29Z kwm $
# $MCom: ports/trunk/x11/gdm3/files/gdm.in 18610 2013-06-30 16:33:05Z marcus $
# PROVIDE: gdm
# REQUIRE: LOGIN cleanvar moused syscons dbus
#
# Add the following to /etc/rc.conf to start GDM at boot time:
#
# gdm_enable="YES"
#
. /etc/rc.subr
. %%GNOME_SUBR%%
gdm_enable=${gdm_enable-${gnome_enable}}
gdm_preserve_base_pam_conf=${gdm_preserve_base_pam_conf-NO}
gdm_lang=${gdm_lang-${LANG}}
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:%%LOCALBASE%%/bin:%%LOCALBASE%%/sbin
name="gdm"
rcvar=gdm_enable
command="%%PREFIX%%/sbin/${name}"
pidfile="/var/run/${name}.pid"
start_cmd="gdm_start"
stop_cmd="gdm_stop"
gdm_start()
{
if ! checkyesno gdm_enable ; then
return 0
fi
echo "Starting ${name}."
# we need to remove locking files
# until XDG_RUNTIME_DIR can be set and used
rm -fr /var/lib/gdm/.cache/gnome-shell/runtime-state*
# make sure there is no pam configuration for gdm service in base system
if ! checkyesno gdm_preserve_base_pam_conf && [ -f /etc/pam.d/gdm ]; then
cp -p /etc/pam.d/gdm /etc/pam.d/gdm_disabled
rm -f /etc/pam.d/gdm
fi
( iter=0
while ! ps -axoargs | grep "^/usr/libexec/getty " | grep -qv grep >/dev/null 2>&1; do
if [ ${iter} -eq 60 ]; then
break
fi
sleep 1
iter=$(expr ${iter} + 1)
done
LANG=${gdm_lang} ${command} ${gdm_flags} ) &
}
gdm_stop()
{
echo "Stopping ${name}."
/bin/kill -9 $(/bin/cat "${pidfile}")
pkill -9 -u gdm
pkill -9 X
pkill -9 gdm-session-worker
}
load_rc_config ${name}
run_rc_command "$1"
LANG="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
--- build-aux/find-x-server.sh.orig 2020-12-15 18:17:03 UTC
+++ build-aux/find-x-server.sh
@@ -29,6 +29,8 @@ elif test -x /usr/openwin/bin/Xsun; then
echo "/usr/openwin/bin/Xsun"
elif test -x /opt/X11R6/bin/X; then
echo "/opt/X11R6/bin/X"
+elif test -x /usr/local/bin/Xorg; then
+ echo "/usr/local/bin/Xorg"
else
echo ""
fi
--- common/gdm-address.c.orig 2010-01-13 17:32:59.000000000 +0000
+++ common/gdm-address.c 2010-01-17 12:55:48.000000000 +0000
@@ -29,6 +29,8 @@
#include <stropts.h>
#endif
#include <string.h>
+#include <sys/types.h>
+#include <sys/param.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
@@ -37,7 +39,6 @@
#endif
#include <netdb.h>
#include <sys/ioctl.h>
-#include <net/if.h>
#ifndef G_OS_WIN32
#include <sys/select.h>
@@ -47,6 +48,7 @@
#include <winsock2.h>
#include <ws2tcpip.h>
#endif
+#include <net/if.h>
#include <glib-object.h>
This diff is collapsed.
$OpenBSD: patch-common_gdm-common_h,v 1.2 2016/04/15 14:11:09 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 <rstrode@redhat.com>
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);
+/* check if logind is running */
+#define LOGIND_RUNNING() (access("/run/systemd/seats/", F_OK) >= 0)
+
GQuark gdm_common_error_quark (void);
#define GDM_COMMON_ERROR gdm_common_error_quark()
$OpenBSD: patch-common_gdm-log_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 <rstrode@redhat.com>
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
@@ -30,7 +30,9 @@
#include <unistd.h>
#include <syslog.h>
+#ifdef WITH_SYSTEMD
#include <systemd/sd-daemon.h>
+#endif
#include <glib.h>
#include <glib/gstdio.h>
@@ -125,12 +127,35 @@ gdm_log_set_debug (gboolean debug)
void
gdm_log_init (void)
{
+ const char *prg_name;
+ int options;
+
if (initialized)
return;
initialized = TRUE;
+#ifdef WITH_SYSTEMD
+ is_sd_booted = sd_booted () > 0;
+#endif
+
g_log_set_default_handler (gdm_log_default_handler, NULL);
+
+ /* Only set up syslog if !systemd, otherwise with systemd
+ * enabled, we keep the default GLib log handler which goes to
+ * stderr, which is routed to the appropriate place in the
+ * systemd service file.
+ */
+ if (!is_sd_booted) {
+ prg_name = g_get_prgname ();
+
+ options = LOG_PID;
+#ifdef LOG_PERROR
+ options |= LOG_PERROR;
+#endif
+
+ openlog (prg_name, options, LOG_DAEMON);
+ }
}
void
--- common/meson.build.orig 2020-12-15 18:17:03 UTC
+++ common/meson.build
@@ -11,11 +11,18 @@ libgdmcommon_src = files(
)
libgdmcommon_deps = [
- libsystemd_dep,
gobject_dep,
gio_dep,
gio_unix_dep,
]
+
+if libsystemd_dep.found()
+ libgdmcommon_deps += libsystemd_dep
+endif
+
+if libconsolekit_dep.found()
+ libgdmcommon_deps += libconsolekit_dep
+endif
if libselinux_dep.found()
libgdmcommon_deps += libselinux_dep
--- daemon/gdm-display-access-file.c.orig 2020-12-15 18:17:04 UTC
+++ daemon/gdm-display-access-file.c
@@ -337,9 +337,16 @@ _create_xauth_file_for_user (const char *username,
g_debug ("GdmDisplayAccessFile: creating %s", auth_filename);
/* mode 00600 */
errno = 0;
- fd = g_open (auth_filename,
- O_RDWR | O_CREAT | O_EXCL | O_BINARY,
- S_IRUSR | S_IWUSR);
+ /* It is reserved UID for 'gdm' user, register in ports/UIDs */
+ if (uid == 92) {
+ fd = g_open (auth_filename,
+ O_RDWR | O_CREAT | O_EXCL | O_BINARY,
+ S_IRUSR | S_IWUSR | S_IRGRP);
+ } else {
+ fd = g_open (auth_filename,
+ O_RDWR | O_CREAT | O_EXCL | O_BINARY,
+ S_IRUSR | S_IWUSR);
+ }
if (fd < 0) {
g_set_error (error,
@@ -441,10 +448,14 @@ _get_auth_info_for_display (GdmDisplayAccessFile *file
*
* https://bugs.freedesktop.org/show_bug.cgi?id=43425
*/
- char localhost[HOST_NAME_MAX + 1] = "";
+ char *localhost = NULL;
+ size_t name_max = sysconf (_SC_HOST_NAME_MAX) + 1;
+ localhost = malloc (name_max);
+
*family = FamilyLocal;
- if (gethostname (localhost, HOST_NAME_MAX) == 0) {
+ if (gethostname (localhost, name_max) == 0) {
*address = g_strdup (localhost);
+ free (localhost);
} else {
*address = g_strdup ("localhost");
}
$OpenBSD: patch-daemon_gdm-launch-environment_c,v 1.8 2017/04/17 13:17:07 ajacoutot Exp $
XXX fix+push upstream
REVERT - OpenBSD does not have a systemd implementation (we need ConsoleKit)
From 1ac67f522f5690c27023d98096ca817f12f7eb88 Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
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 a9cacb929470eb82582396984c61d5b611bfeb1a Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
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
char *seat_id;
seat_id = launch_environment->priv->x11_display_seat_id;
+ if (g_str_has_prefix (seat_id, "/org/freedesktop/ConsoleKit/")) {
+ seat_id += strlen ("/org/freedesktop/ConsoleKit/");
+ }
g_hash_table_insert (hash, g_strdup ("GDM_SEAT_ID"), g_strdup (seat_id));
}
@@ -224,6 +227,8 @@ on_session_setup_complete (GdmSession *session,
gdm_session_set_environment_variable (launch_environment->priv->session, key, value);
}
g_hash_table_destroy (hash);
+
+ gdm_session_select_session_type (launch_environment->priv->session, "LoginWindow");
}
static void
$OpenBSD: patch-daemon_gdm-local-display-factory_c,v 1.6 2017/03/03 13:01:26 ajacoutot Exp $
REVERT - OpenBSD does not have a systemd implementation (we need ConsoleKit)
From 1ac67f522f5690c27023d98096ca817f12f7eb88 Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
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 <rstrode@redhat.com>
Date: Fri, 12 Jun 2015 13:48:52 -0400
Subject: require logind support
--- daemon/gdm-local-display-factory.c.orig 2020-12-15 18:17:04 UTC
+++ daemon/gdm-local-display-factory.c
@@ -28,7 +28,9 @@
#include <glib-object.h>
#include <gio/gio.h>
+#ifdef WITH_SYSTEMD
#include <systemd/sd-login.h>
+#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"
@@ -60,8 +64,10 @@ struct _GdmLocalDisplayFactory
/* FIXME: this needs to be per seat? */
guint num_failures;
+#ifdef WITH_SYSTEMD
guint seat_new_id;
guint seat_removed_id;
+#endif
#if 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
+#if defined ENABLE_USER_DISPLAY_SERVER && defined WITH_SYSTEMD
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->num_failures = 0;
- gdm_local_display_factory_sync_seats (factory);
+ create_display (factory, seat_id, session_type, is_initial);
}
break;
case GDM_DISPLAY_FAILED:
@@ -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
+#if defined ENABLE_USER_DISPLAY_SERVER && defined WITH_SYSTEMD
if (g_strcmp0 (seat_id, "seat0") == 0) {
display = gdm_local_display_new ();
if (session_type != NULL) {
@@ -536,6 +550,7 @@ create_display (GdmLocalDisplayFactory *factory,
return display;
}
+#ifdef WITH_SYSTEMD
static void
delete_display (GdmLocalDisplayFactory *factory,
const char *seat_id) {
@@ -905,6 +920,7 @@ gdm_local_display_factory_stop_monitor (GdmLocalDispla
}
#endif
}
+#endif
static void
on_display_added (GdmDisplayStore *display_store,
@@ -938,6 +954,7 @@ static gboolean
gdm_local_display_factory_start (<