Compare commits
No commits in common. "imports/c8s/gdm-40.0-2.el8" and "c8" have entirely different histories.
imports/c8
...
c8
SOURCES
0001-Revert-gdm-wayland-x-session-don-t-overwrite-user-en.patch0001-build-Support-keyutils-1.5.11-and-older.patch0001-daemon-Don-t-error-on-shutdown.patch0001-daemon-Infer-session-type-from-desktop-file-if-user-.patch0001-data-Disable-network-configuration-on-login-screen.patch0001-data-add-system-dconf-databases-to-gdm-profile.patch0001-data-disable-wayland-on-certain-hardware.patch0001-display-Handle-failure-before-display-registration.patch0001-local-display-factory-Don-t-try-to-respawn-displays-.patch0001-local-display-factory-Provide-more-flexibility-for-c.patch0001-manager-allow-multiple-xdmcp-logins-for-the-same-use.patch0001-meson-Fix-detection-of-Xorg-versions-that-need-liste.patch0001-meson-set-D_GNU_SOURCE-for-updwtmpx.patch0001-session-worker-Set-session_vt-0-out-of-pam-uninitial.patch0001-worker-don-t-load-user-settings-for-program-sessions.patch0002-daemon-Support-X-servers-built-with-Dlisten_tcp-true.patch0002-gdm-x-session-run-session-bus-on-non-seat0-seats.patch0002-libgdm-Sort-session-list.patch0002-manager-Fix-btmp-record-accounting.patch0002-pam_gdm-Use-the-last-cryptsetup-password-instead-of-.patch0002-session-support-new-accountsservice-Session-and-Sess.patch0003-daemon-save-os-release-in-accountsservice.patch0003-session-ensure-login-screen-over-XDMCP-connects-to-i.patch0003-xdmcp-display-factory-Set-supported-session-types-fo.patch0004-daemon-handle-upgrades-from-RHEL-7.patch0004-local-display-factory-Don-t-crash-if-Xorg-and-Waylan.patch0005-daemon-fix-wayland-detection-when-deciding-to-bypass.patchdefault.pa-for-gdm
SPECS
@ -1,7 +1,7 @@
|
||||
From 911780e9980fe16b18d139f757ff795da1d1882d Mon Sep 17 00:00:00 2001
|
||||
From 85951a0384cb7f37d99669575fad4aea155f25a8 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Wed, 5 May 2021 10:50:56 -0400
|
||||
Subject: [PATCH] Revert "gdm-{wayland,x}-session: don't overwrite user env
|
||||
Subject: [PATCH 1/5] Revert "gdm-{wayland,x}-session: don't overwrite user env
|
||||
with fallback vars"
|
||||
|
||||
This reverts commit ccecd9c975d04da80db4cd547b67a1a94fa83292.
|
||||
@ -237,5 +237,5 @@ index 5962da572..b15483614 100644
|
||||
state->session_command,
|
||||
NULL);
|
||||
--
|
||||
2.31.1
|
||||
2.30.1
|
||||
|
||||
|
86
SOURCES/0001-build-Support-keyutils-1.5.11-and-older.patch
Normal file
86
SOURCES/0001-build-Support-keyutils-1.5.11-and-older.patch
Normal file
@ -0,0 +1,86 @@
|
||||
From 2fc7d94280a82e079129468d9b0db312725e5926 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Mon, 12 Dec 2022 15:37:38 -0500
|
||||
Subject: [PATCH 1/2] build: Support keyutils 1.5.11 and older
|
||||
|
||||
keyutils didn't get a pkgconfig file until 1.6.
|
||||
|
||||
This commit looks for the library directly if it can't find
|
||||
the pkgconfig file.
|
||||
---
|
||||
meson.build | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/meson.build b/meson.build
|
||||
index 4a286f97..1a557e9a 100644
|
||||
--- a/meson.build
|
||||
+++ b/meson.build
|
||||
@@ -26,60 +26,65 @@ lang_config_file = (get_option('lang-file') != '')? get_option('lang-file') : gd
|
||||
pam_mod_dir = (get_option('pam-mod-dir') != '')? get_option('pam-mod-dir') : gdm_prefix / get_option('libdir') / 'security'
|
||||
dbus_sys_dir = (get_option('dbus-sys') != '')? get_option('dbus-sys') : get_option('sysconfdir') / 'dbus-1' / 'system.d'
|
||||
gdm_defaults_conf = (get_option('defaults-conf') != '')? get_option('defaults-conf') : gdm_prefix / get_option('datadir') / 'gdm' / 'defaults.conf'
|
||||
gdm_custom_conf = (get_option('custom-conf') != '')? get_option('custom-conf') : gdmconfdir / 'custom.conf'
|
||||
gnome_settings_daemon_dir = (get_option('gnome-settings-daemon-dir') != '')? get_option('gnome-settings-daemon-dir') : gdm_prefix / get_option('libexecdir')
|
||||
gdm_run_dir = (get_option('run-dir') != '')? get_option('run-dir') : gdm_prefix / get_option('localstatedir') / 'run' / 'gdm'
|
||||
gdm_runtime_conf = (get_option('runtime-conf') != '')? get_option('runtime-conf') : gdm_run_dir / 'custom.conf'
|
||||
gdm_pid_file = (get_option('pid-file') != '')? get_option('pid-file') : gdm_run_dir / 'gdm.pid'
|
||||
ran_once_marker_dir = (get_option('ran-once-marker-dir') != '')? get_option('ran-once-marker-dir') : gdm_run_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'
|
||||
|
||||
# Common variables
|
||||
config_h_dir = include_directories('.')
|
||||
|
||||
# Dependencies
|
||||
udev_dep = dependency('udev')
|
||||
|
||||
glib_min_version = '2.56.0'
|
||||
|
||||
glib_dep = dependency('glib-2.0', version: '>=' + glib_min_version)
|
||||
gobject_dep = dependency('gobject-2.0', version: '>=' + glib_min_version)
|
||||
gio_dep = dependency('gio-2.0', version: '>=' + glib_min_version)
|
||||
gio_unix_dep = dependency('gio-unix-2.0', version: '>=' + glib_min_version)
|
||||
gtk_dep = dependency('gtk+-3.0', version: '>= 2.91.1')
|
||||
libcanberra_gtk_dep = dependency('libcanberra-gtk3', version: '>= 0.4')
|
||||
accountsservice_dep = dependency('accountsservice', version: '>= 0.6.35')
|
||||
xcb_dep = dependency('xcb')
|
||||
keyutils_dep = dependency('libkeyutils', required: false)
|
||||
+
|
||||
+if not keyutils_dep.found()
|
||||
+ keyutils_dep = cc.find_library('libkeyutils')
|
||||
+endif
|
||||
+
|
||||
libselinux_dep = dependency('libselinux', required: get_option('selinux'))
|
||||
|
||||
# udev
|
||||
if udev_dir == ''
|
||||
if udev_dep.found()
|
||||
udev_prefix = udev_dep.get_pkgconfig_variable('udevdir')
|
||||
else
|
||||
udev_prefix = gdm_prefix / 'lib' / 'udev'
|
||||
endif
|
||||
udev_dir = udev_prefix / 'rules.d'
|
||||
endif
|
||||
|
||||
# X11
|
||||
x_deps = declare_dependency(
|
||||
dependencies: [
|
||||
dependency('x11'),
|
||||
dependency('xau'),
|
||||
],
|
||||
)
|
||||
# Xserver 1.17 & later default to -nolisten and require -listen for remote access
|
||||
xserver_deps = dependency('xorg-server', version : '>=1.17', required : false)
|
||||
xserver_has_listen = xserver_deps.found()
|
||||
find_x_server_script = find_program('build-aux/find-x-server.sh', native: true)
|
||||
find_x_server_out = run_command(find_x_server_script).stdout().strip()
|
||||
if find_x_server_out != ''
|
||||
x_bin = find_x_server_out
|
||||
x_bin_path_split = x_bin.split('/')
|
||||
i = 0
|
||||
x_path = '/'
|
||||
foreach dir : x_bin_path_split
|
||||
--
|
||||
2.35.1
|
||||
|
570
SOURCES/0001-daemon-Don-t-error-on-shutdown.patch
Normal file
570
SOURCES/0001-daemon-Don-t-error-on-shutdown.patch
Normal file
@ -0,0 +1,570 @@
|
||||
From fbdb5fdfc5f4c5569643239cae1d6fe5fac13717 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Mon, 12 Dec 2022 10:52:58 -0500
|
||||
Subject: [PATCH] daemon: Don't error on shutdown
|
||||
|
||||
Right now we complain if shutdown happens while the display is
|
||||
comming up.
|
||||
|
||||
This commit detects that case and avoids the error in that case.
|
||||
---
|
||||
daemon/gdm-display.c | 28 +++++++++++++++++++++++++++-
|
||||
daemon/gdm-manager.c | 11 +++++++----
|
||||
2 files changed, 34 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/daemon/gdm-display.c b/daemon/gdm-display.c
|
||||
index 9438fe72..a93857e9 100644
|
||||
--- a/daemon/gdm-display.c
|
||||
+++ b/daemon/gdm-display.c
|
||||
@@ -66,86 +66,88 @@ typedef struct _GdmDisplayPrivate
|
||||
char *x11_display_name;
|
||||
int status;
|
||||
time_t creation_time;
|
||||
|
||||
char *x11_cookie;
|
||||
gsize x11_cookie_size;
|
||||
GdmDisplayAccessFile *access_file;
|
||||
|
||||
guint finish_idle_id;
|
||||
|
||||
xcb_connection_t *xcb_connection;
|
||||
int xcb_screen_number;
|
||||
|
||||
GDBusConnection *connection;
|
||||
GdmDisplayAccessFile *user_access_file;
|
||||
|
||||
GdmDBusDisplay *display_skeleton;
|
||||
GDBusObjectSkeleton *object_skeleton;
|
||||
|
||||
GDBusProxy *accountsservice_proxy;
|
||||
|
||||
/* this spawns and controls the greeter session */
|
||||
GdmLaunchEnvironment *launch_environment;
|
||||
|
||||
guint is_local : 1;
|
||||
guint is_initial : 1;
|
||||
guint allow_timed_login : 1;
|
||||
guint have_existing_user_accounts : 1;
|
||||
guint doing_initial_setup : 1;
|
||||
guint session_registered : 1;
|
||||
+ guint shutting_down : 1;
|
||||
|
||||
GStrv supported_session_types;
|
||||
} GdmDisplayPrivate;
|
||||
|
||||
enum {
|
||||
PROP_0,
|
||||
PROP_ID,
|
||||
PROP_STATUS,
|
||||
PROP_SEAT_ID,
|
||||
PROP_SESSION_ID,
|
||||
PROP_SESSION_CLASS,
|
||||
PROP_SESSION_TYPE,
|
||||
PROP_REMOTE_HOSTNAME,
|
||||
PROP_X11_DISPLAY_NUMBER,
|
||||
PROP_X11_DISPLAY_NAME,
|
||||
PROP_X11_COOKIE,
|
||||
PROP_X11_AUTHORITY_FILE,
|
||||
PROP_IS_CONNECTED,
|
||||
PROP_IS_LOCAL,
|
||||
PROP_LAUNCH_ENVIRONMENT,
|
||||
PROP_IS_INITIAL,
|
||||
PROP_ALLOW_TIMED_LOGIN,
|
||||
PROP_HAVE_EXISTING_USER_ACCOUNTS,
|
||||
PROP_DOING_INITIAL_SETUP,
|
||||
PROP_SESSION_REGISTERED,
|
||||
PROP_SUPPORTED_SESSION_TYPES,
|
||||
+ PROP_SHUTTING_DOWN,
|
||||
};
|
||||
|
||||
static void gdm_display_class_init (GdmDisplayClass *klass);
|
||||
static void gdm_display_init (GdmDisplay *self);
|
||||
static void gdm_display_finalize (GObject *object);
|
||||
static void queue_finish (GdmDisplay *self);
|
||||
static void _gdm_display_set_status (GdmDisplay *self,
|
||||
int status);
|
||||
static gboolean wants_initial_setup (GdmDisplay *self);
|
||||
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GdmDisplay, gdm_display, G_TYPE_OBJECT)
|
||||
|
||||
GQuark
|
||||
gdm_display_error_quark (void)
|
||||
{
|
||||
static GQuark ret = 0;
|
||||
if (ret == 0) {
|
||||
ret = g_quark_from_static_string ("gdm_display_error");
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
time_t
|
||||
gdm_display_get_creation_time (GdmDisplay *self)
|
||||
{
|
||||
GdmDisplayPrivate *priv;
|
||||
|
||||
g_return_val_if_fail (GDM_IS_DISPLAY (self), 0);
|
||||
|
||||
priv = gdm_display_get_instance_private (self);
|
||||
@@ -665,61 +667,61 @@ gdm_display_disconnect (GdmDisplay *self)
|
||||
}
|
||||
|
||||
xcb_flush (priv->xcb_connection);
|
||||
|
||||
g_clear_pointer (&priv->xcb_connection, xcb_disconnect);
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdm_display_unmanage (GdmDisplay *self)
|
||||
{
|
||||
GdmDisplayPrivate *priv;
|
||||
|
||||
g_return_val_if_fail (GDM_IS_DISPLAY (self), FALSE);
|
||||
|
||||
priv = gdm_display_get_instance_private (self);
|
||||
|
||||
gdm_display_disconnect (self);
|
||||
|
||||
if (priv->user_access_file != NULL) {
|
||||
gdm_display_access_file_close (priv->user_access_file);
|
||||
g_object_unref (priv->user_access_file);
|
||||
priv->user_access_file = NULL;
|
||||
}
|
||||
|
||||
if (priv->access_file != NULL) {
|
||||
gdm_display_access_file_close (priv->access_file);
|
||||
g_object_unref (priv->access_file);
|
||||
priv->access_file = NULL;
|
||||
}
|
||||
|
||||
- if (!priv->session_registered) {
|
||||
+ if (!priv->session_registered && !priv->shutting_down) {
|
||||
g_warning ("GdmDisplay: Session never registered, failing");
|
||||
_gdm_display_set_status (self, GDM_DISPLAY_FAILED);
|
||||
} else {
|
||||
_gdm_display_set_status (self, GDM_DISPLAY_UNMANAGED);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdm_display_get_id (GdmDisplay *self,
|
||||
char **id,
|
||||
GError **error)
|
||||
{
|
||||
GdmDisplayPrivate *priv;
|
||||
|
||||
g_return_val_if_fail (GDM_IS_DISPLAY (self), FALSE);
|
||||
|
||||
priv = gdm_display_get_instance_private (self);
|
||||
if (id != NULL) {
|
||||
*id = g_strdup (priv->id);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdm_display_get_x11_display_name (GdmDisplay *self,
|
||||
char **x11_display,
|
||||
GError **error)
|
||||
@@ -851,60 +853,70 @@ _gdm_display_set_x11_cookie (GdmDisplay *self,
|
||||
{
|
||||
GdmDisplayPrivate *priv;
|
||||
|
||||
priv = gdm_display_get_instance_private (self);
|
||||
g_free (priv->x11_cookie);
|
||||
priv->x11_cookie = g_strdup (x11_cookie);
|
||||
}
|
||||
|
||||
static void
|
||||
_gdm_display_set_is_local (GdmDisplay *self,
|
||||
gboolean is_local)
|
||||
{
|
||||
GdmDisplayPrivate *priv;
|
||||
|
||||
priv = gdm_display_get_instance_private (self);
|
||||
g_debug ("GdmDisplay: local: %s", is_local? "yes" : "no");
|
||||
priv->is_local = is_local;
|
||||
}
|
||||
|
||||
static void
|
||||
_gdm_display_set_session_registered (GdmDisplay *self,
|
||||
gboolean registered)
|
||||
{
|
||||
GdmDisplayPrivate *priv;
|
||||
|
||||
priv = gdm_display_get_instance_private (self);
|
||||
g_debug ("GdmDisplay: session registered: %s", registered? "yes" : "no");
|
||||
priv->session_registered = registered;
|
||||
}
|
||||
|
||||
+static void
|
||||
+_gdm_display_set_shutting_down (GdmDisplay *self,
|
||||
+ gboolean shutting_down)
|
||||
+{
|
||||
+ GdmDisplayPrivate *priv;
|
||||
+
|
||||
+ priv = gdm_display_get_instance_private (self);
|
||||
+ priv->shutting_down = shutting_down;
|
||||
+}
|
||||
+
|
||||
static void
|
||||
_gdm_display_set_launch_environment (GdmDisplay *self,
|
||||
GdmLaunchEnvironment *launch_environment)
|
||||
{
|
||||
GdmDisplayPrivate *priv;
|
||||
|
||||
priv = gdm_display_get_instance_private (self);
|
||||
|
||||
g_clear_object (&priv->launch_environment);
|
||||
|
||||
priv->launch_environment = g_object_ref (launch_environment);
|
||||
}
|
||||
|
||||
static void
|
||||
_gdm_display_set_is_initial (GdmDisplay *self,
|
||||
gboolean initial)
|
||||
{
|
||||
GdmDisplayPrivate *priv;
|
||||
|
||||
priv = gdm_display_get_instance_private (self);
|
||||
g_debug ("GdmDisplay: initial: %s", initial? "yes" : "no");
|
||||
priv->is_initial = initial;
|
||||
}
|
||||
|
||||
static void
|
||||
_gdm_display_set_allow_timed_login (GdmDisplay *self,
|
||||
gboolean allow_timed_login)
|
||||
{
|
||||
GdmDisplayPrivate *priv;
|
||||
|
||||
@@ -962,60 +974,63 @@ gdm_display_set_property (GObject *object,
|
||||
case PROP_REMOTE_HOSTNAME:
|
||||
_gdm_display_set_remote_hostname (self, g_value_get_string (value));
|
||||
break;
|
||||
case PROP_X11_DISPLAY_NUMBER:
|
||||
_gdm_display_set_x11_display_number (self, g_value_get_int (value));
|
||||
break;
|
||||
case PROP_X11_DISPLAY_NAME:
|
||||
_gdm_display_set_x11_display_name (self, g_value_get_string (value));
|
||||
break;
|
||||
case PROP_X11_COOKIE:
|
||||
_gdm_display_set_x11_cookie (self, g_value_get_string (value));
|
||||
break;
|
||||
case PROP_IS_LOCAL:
|
||||
_gdm_display_set_is_local (self, g_value_get_boolean (value));
|
||||
break;
|
||||
case PROP_ALLOW_TIMED_LOGIN:
|
||||
_gdm_display_set_allow_timed_login (self, g_value_get_boolean (value));
|
||||
break;
|
||||
case PROP_LAUNCH_ENVIRONMENT:
|
||||
_gdm_display_set_launch_environment (self, g_value_get_object (value));
|
||||
break;
|
||||
case PROP_IS_INITIAL:
|
||||
_gdm_display_set_is_initial (self, g_value_get_boolean (value));
|
||||
break;
|
||||
case PROP_SESSION_REGISTERED:
|
||||
_gdm_display_set_session_registered (self, g_value_get_boolean (value));
|
||||
break;
|
||||
case PROP_SUPPORTED_SESSION_TYPES:
|
||||
_gdm_display_set_supported_session_types (self, g_value_get_boxed (value));
|
||||
break;
|
||||
+ case PROP_SHUTTING_DOWN:
|
||||
+ _gdm_display_set_shutting_down (self, g_value_get_boolean (value));
|
||||
+ break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gdm_display_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GdmDisplay *self;
|
||||
GdmDisplayPrivate *priv;
|
||||
|
||||
self = GDM_DISPLAY (object);
|
||||
priv = gdm_display_get_instance_private (self);
|
||||
|
||||
switch (prop_id) {
|
||||
case PROP_ID:
|
||||
g_value_set_string (value, priv->id);
|
||||
break;
|
||||
case PROP_STATUS:
|
||||
g_value_set_int (value, priv->status);
|
||||
break;
|
||||
case PROP_SEAT_ID:
|
||||
g_value_set_string (value, priv->seat_id);
|
||||
break;
|
||||
case PROP_SESSION_ID:
|
||||
g_value_set_string (value, priv->session_id);
|
||||
@@ -1043,60 +1058,63 @@ gdm_display_get_property (GObject *object,
|
||||
priv->access_file?
|
||||
gdm_display_access_file_get_path (priv->access_file) : NULL);
|
||||
break;
|
||||
case PROP_IS_LOCAL:
|
||||
g_value_set_boolean (value, priv->is_local);
|
||||
break;
|
||||
case PROP_IS_CONNECTED:
|
||||
g_value_set_boolean (value, priv->xcb_connection != NULL);
|
||||
break;
|
||||
case PROP_LAUNCH_ENVIRONMENT:
|
||||
g_value_set_object (value, priv->launch_environment);
|
||||
break;
|
||||
case PROP_IS_INITIAL:
|
||||
g_value_set_boolean (value, priv->is_initial);
|
||||
break;
|
||||
case PROP_HAVE_EXISTING_USER_ACCOUNTS:
|
||||
g_value_set_boolean (value, priv->have_existing_user_accounts);
|
||||
break;
|
||||
case PROP_DOING_INITIAL_SETUP:
|
||||
g_value_set_boolean (value, priv->doing_initial_setup);
|
||||
break;
|
||||
case PROP_SESSION_REGISTERED:
|
||||
g_value_set_boolean (value, priv->session_registered);
|
||||
break;
|
||||
case PROP_ALLOW_TIMED_LOGIN:
|
||||
g_value_set_boolean (value, priv->allow_timed_login);
|
||||
break;
|
||||
case PROP_SUPPORTED_SESSION_TYPES:
|
||||
g_value_set_boxed (value, priv->supported_session_types);
|
||||
break;
|
||||
+ case PROP_SHUTTING_DOWN:
|
||||
+ g_value_set_boolean (value, priv->shutting_down);
|
||||
+ break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
handle_get_id (GdmDBusDisplay *skeleton,
|
||||
GDBusMethodInvocation *invocation,
|
||||
GdmDisplay *self)
|
||||
{
|
||||
char *id;
|
||||
|
||||
gdm_display_get_id (self, &id, NULL);
|
||||
|
||||
gdm_dbus_display_complete_get_id (skeleton, invocation, id);
|
||||
|
||||
g_free (id);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
handle_get_remote_hostname (GdmDBusDisplay *skeleton,
|
||||
GDBusMethodInvocation *invocation,
|
||||
GdmDisplay *self)
|
||||
{
|
||||
char *hostname;
|
||||
|
||||
gdm_display_get_remote_hostname (self, &hostname, NULL);
|
||||
|
||||
@@ -1397,60 +1415,68 @@ gdm_display_class_init (GdmDisplayClass *klass)
|
||||
g_param_spec_boolean ("session-registered",
|
||||
NULL,
|
||||
NULL,
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_LAUNCH_ENVIRONMENT,
|
||||
g_param_spec_object ("launch-environment",
|
||||
NULL,
|
||||
NULL,
|
||||
GDM_TYPE_LAUNCH_ENVIRONMENT,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_STATUS,
|
||||
g_param_spec_int ("status",
|
||||
"status",
|
||||
"status",
|
||||
-1,
|
||||
G_MAXINT,
|
||||
GDM_DISPLAY_UNMANAGED,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS));
|
||||
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_SUPPORTED_SESSION_TYPES,
|
||||
g_param_spec_boxed ("supported-session-types",
|
||||
"supported session types",
|
||||
"supported session types",
|
||||
G_TYPE_STRV,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS));
|
||||
+
|
||||
+ g_object_class_install_property (object_class,
|
||||
+ PROP_SHUTTING_DOWN,
|
||||
+ g_param_spec_boolean ("shutting-down",
|
||||
+ NULL,
|
||||
+ NULL,
|
||||
+ FALSE,
|
||||
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||
}
|
||||
|
||||
static void
|
||||
gdm_display_init (GdmDisplay *self)
|
||||
{
|
||||
GdmDisplayPrivate *priv;
|
||||
|
||||
priv = gdm_display_get_instance_private (self);
|
||||
|
||||
priv->creation_time = time (NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
gdm_display_finalize (GObject *object)
|
||||
{
|
||||
GdmDisplay *self;
|
||||
GdmDisplayPrivate *priv;
|
||||
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (GDM_IS_DISPLAY (object));
|
||||
|
||||
self = GDM_DISPLAY (object);
|
||||
priv = gdm_display_get_instance_private (self);
|
||||
|
||||
g_return_if_fail (priv != NULL);
|
||||
|
||||
g_debug ("GdmDisplay: Finalizing display: %s", priv->id);
|
||||
g_free (priv->id);
|
||||
g_free (priv->seat_id);
|
||||
g_free (priv->session_class);
|
||||
diff --git a/daemon/gdm-manager.c b/daemon/gdm-manager.c
|
||||
index c70248f3..05851001 100644
|
||||
--- a/daemon/gdm-manager.c
|
||||
+++ b/daemon/gdm-manager.c
|
||||
@@ -2759,117 +2759,120 @@ gdm_manager_init (GdmManager *manager)
|
||||
NULL,
|
||||
(GDestroyNotify)
|
||||
g_object_unref);
|
||||
manager->priv->transient_sessions = g_hash_table_new_full (NULL,
|
||||
NULL,
|
||||
(GDestroyNotify)
|
||||
NULL,
|
||||
(GDestroyNotify)
|
||||
g_object_unref);
|
||||
g_signal_connect (G_OBJECT (manager->priv->display_store),
|
||||
"display-added",
|
||||
G_CALLBACK (on_display_added),
|
||||
manager);
|
||||
|
||||
g_signal_connect (G_OBJECT (manager->priv->display_store),
|
||||
"display-removed",
|
||||
G_CALLBACK (on_display_removed),
|
||||
manager);
|
||||
}
|
||||
|
||||
static void
|
||||
unexport_display (const char *id,
|
||||
GdmDisplay *display,
|
||||
GdmManager *manager)
|
||||
{
|
||||
if (!g_dbus_connection_is_closed (manager->priv->connection))
|
||||
g_dbus_object_manager_server_unexport (manager->priv->object_manager, id);
|
||||
}
|
||||
|
||||
static void
|
||||
-finish_display (const char *id,
|
||||
- GdmDisplay *display,
|
||||
- GdmManager *manager)
|
||||
+shut_down_display (const char *id,
|
||||
+ GdmDisplay *display,
|
||||
+ GdmManager *manager)
|
||||
{
|
||||
gdm_display_stop_greeter_session (display);
|
||||
+
|
||||
+ g_object_set (G_OBJECT (display), "shutting-down", TRUE, NULL);
|
||||
+
|
||||
if (gdm_display_get_status (display) == GDM_DISPLAY_MANAGED)
|
||||
gdm_display_unmanage (display);
|
||||
gdm_display_finish (display);
|
||||
}
|
||||
|
||||
static void
|
||||
gdm_manager_dispose (GObject *object)
|
||||
{
|
||||
GdmManager *manager;
|
||||
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (GDM_IS_MANAGER (object));
|
||||
|
||||
manager = GDM_MANAGER (object);
|
||||
|
||||
g_return_if_fail (manager->priv != NULL);
|
||||
|
||||
gdm_manager_stop (manager);
|
||||
|
||||
g_clear_weak_pointer (&manager->priv->automatic_login_display);
|
||||
|
||||
#ifdef HAVE_LIBXDMCP
|
||||
g_clear_object (&manager->priv->xdmcp_factory);
|
||||
#endif
|
||||
g_clear_object (&manager->priv->local_factory);
|
||||
g_clear_pointer (&manager->priv->open_reauthentication_requests,
|
||||
g_hash_table_unref);
|
||||
g_clear_pointer (&manager->priv->transient_sessions,
|
||||
g_hash_table_unref);
|
||||
|
||||
g_list_foreach (manager->priv->user_sessions,
|
||||
(GFunc) gdm_session_close,
|
||||
NULL);
|
||||
g_list_free_full (manager->priv->user_sessions, (GDestroyNotify) g_object_unref);
|
||||
manager->priv->user_sessions = NULL;
|
||||
|
||||
g_signal_handlers_disconnect_by_func (G_OBJECT (manager->priv->display_store),
|
||||
G_CALLBACK (on_display_added),
|
||||
manager);
|
||||
g_signal_handlers_disconnect_by_func (G_OBJECT (manager->priv->display_store),
|
||||
G_CALLBACK (on_display_removed),
|
||||
manager);
|
||||
|
||||
if (!g_dbus_connection_is_closed (manager->priv->connection)) {
|
||||
gdm_display_store_foreach (manager->priv->display_store,
|
||||
(GdmDisplayStoreFunc)unexport_display,
|
||||
manager);
|
||||
g_dbus_interface_skeleton_unexport (G_DBUS_INTERFACE_SKELETON (manager));
|
||||
}
|
||||
|
||||
gdm_display_store_foreach (manager->priv->display_store,
|
||||
- (GdmDisplayStoreFunc) finish_display,
|
||||
+ (GdmDisplayStoreFunc) shut_down_display,
|
||||
manager);
|
||||
|
||||
gdm_display_store_clear (manager->priv->display_store);
|
||||
|
||||
g_dbus_object_manager_server_set_connection (manager->priv->object_manager, NULL);
|
||||
|
||||
g_clear_object (&manager->priv->connection);
|
||||
g_clear_object (&manager->priv->object_manager);
|
||||
g_clear_object (&manager->priv->display_store);
|
||||
|
||||
G_OBJECT_CLASS (gdm_manager_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
GdmManager *
|
||||
gdm_manager_new (void)
|
||||
{
|
||||
if (manager_object != NULL) {
|
||||
g_object_ref (manager_object);
|
||||
} else {
|
||||
gboolean res;
|
||||
|
||||
manager_object = g_object_new (GDM_TYPE_MANAGER, NULL);
|
||||
g_object_add_weak_pointer (manager_object,
|
||||
(gpointer *) &manager_object);
|
||||
res = register_manager (manager_object);
|
||||
if (! res) {
|
||||
g_object_unref (manager_object);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
--
|
||||
2.37.0.rc1
|
||||
|
@ -0,0 +1,87 @@
|
||||
From ff689b18fd0a5fd03e5941723cb2adff3b7e4b24 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Wed, 29 Sep 2021 11:03:41 -0400
|
||||
Subject: [PATCH] daemon: Infer session type from desktop file if user has no
|
||||
saved session type
|
||||
|
||||
The accountsservice user cache file can specify a session type
|
||||
associated with the saved session. This is optional though. If one
|
||||
isn't specified GDM needs to figure out the session type based on the
|
||||
list of preferred session types for the system and the session file
|
||||
itself.
|
||||
|
||||
It was failing to do the latter, though. This commit fixes that.
|
||||
---
|
||||
daemon/gdm-session.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
|
||||
index 29459346..72afe7b2 100644
|
||||
--- a/daemon/gdm-session.c
|
||||
+++ b/daemon/gdm-session.c
|
||||
@@ -988,60 +988,62 @@ worker_on_saved_language_name_read (GdmDBusWorker *worker,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
worker_on_saved_session_name_read (GdmDBusWorker *worker,
|
||||
const char *session_name,
|
||||
GdmSessionConversation *conversation)
|
||||
{
|
||||
GdmSession *self = conversation->session;
|
||||
|
||||
if (! get_session_command_for_name (self, session_name, NULL)) {
|
||||
/* ignore sessions that don't exist */
|
||||
g_debug ("GdmSession: not using invalid .dmrc session: %s", session_name);
|
||||
g_free (self->saved_session);
|
||||
self->saved_session = NULL;
|
||||
update_session_type (self);
|
||||
} else {
|
||||
if (strcmp (session_name,
|
||||
get_default_session_name (self)) != 0) {
|
||||
g_free (self->saved_session);
|
||||
self->saved_session = g_strdup (session_name);
|
||||
|
||||
if (self->greeter_interface != NULL) {
|
||||
gdm_dbus_greeter_emit_default_session_name_changed (self->greeter_interface,
|
||||
session_name);
|
||||
}
|
||||
}
|
||||
if (self->saved_session_type != NULL)
|
||||
set_session_type (self, self->saved_session_type);
|
||||
+ else
|
||||
+ update_session_type (self);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static GdmSessionConversation *
|
||||
find_conversation_by_pid (GdmSession *self,
|
||||
GPid pid)
|
||||
{
|
||||
GHashTableIter iter;
|
||||
gpointer key, value;
|
||||
|
||||
g_hash_table_iter_init (&iter, self->conversations);
|
||||
while (g_hash_table_iter_next (&iter, &key, &value)) {
|
||||
GdmSessionConversation *conversation;
|
||||
|
||||
conversation = (GdmSessionConversation *) value;
|
||||
|
||||
if (conversation->worker_pid == pid) {
|
||||
return conversation;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
allow_worker_function (GDBusAuthObserver *observer,
|
||||
GIOStream *stream,
|
||||
GCredentials *credentials,
|
||||
GdmSession *self)
|
||||
--
|
||||
2.33.1
|
||||
|
@ -0,0 +1,103 @@
|
||||
From cebcf2a4d29f01061dedf8714db2842b9582900c Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
|
||||
Date: Tue, 8 Jun 2021 20:45:00 +0200
|
||||
Subject: [PATCH 1/3] data: Disable network configuration on login screen
|
||||
|
||||
---
|
||||
data/meson.build | 10 ++++++++++
|
||||
data/org.gnome.gdm.rules.in | 8 ++++++++
|
||||
2 files changed, 18 insertions(+)
|
||||
create mode 100644 data/org.gnome.gdm.rules.in
|
||||
|
||||
diff --git a/data/meson.build b/data/meson.build
|
||||
index 23e2d7f9f..cbd6a6a21 100644
|
||||
--- a/data/meson.build
|
||||
+++ b/data/meson.build
|
||||
@@ -131,60 +131,70 @@ pam_data_files_map = {
|
||||
'arch': [
|
||||
'gdm-autologin',
|
||||
'gdm-launch-environment',
|
||||
'gdm-fingerprint',
|
||||
'gdm-smartcard',
|
||||
'gdm-password',
|
||||
'gdm-pin',
|
||||
],
|
||||
'none': [],
|
||||
# We should no longer have 'autodetect' at this point
|
||||
}
|
||||
|
||||
pam_data_files = pam_data_files_map[default_pam_config]
|
||||
pam_prefix = (get_option('pam-prefix') != '')? get_option('pam-prefix') : get_option('sysconfdir')
|
||||
foreach _pam_filename : pam_data_files
|
||||
install_data('pam-@0@/@1@.pam'.format(default_pam_config, _pam_filename),
|
||||
rename: _pam_filename,
|
||||
install_dir: pam_prefix / 'pam.d',
|
||||
)
|
||||
endforeach
|
||||
|
||||
gdm_rules = configure_file(
|
||||
input: '61-gdm.rules.in',
|
||||
output: '@BASENAME@',
|
||||
configuration: {
|
||||
'libexecdir': gdm_prefix / get_option('libexecdir'),
|
||||
},
|
||||
install_dir: udev_dir,
|
||||
)
|
||||
|
||||
+# Polkit rules
|
||||
+polkit_rules = configure_file(
|
||||
+ input: 'org.gnome.gdm.rules.in',
|
||||
+ output: '@BASENAME@',
|
||||
+ configuration: {
|
||||
+ 'GDM_USERNAME': get_option('user'),
|
||||
+ },
|
||||
+ install_dir: get_option('datadir') / 'polkit-1' / 'rules.d',
|
||||
+)
|
||||
+
|
||||
# DBus service files
|
||||
service_config = configuration_data()
|
||||
service_config.set('sbindir', gdm_prefix / get_option('sbindir'))
|
||||
service_config.set('GDM_INITIAL_VT', get_option('initial-vt'))
|
||||
service_config.set('LANG_CONFIG_FILE', lang_config_file)
|
||||
if plymouth_dep.found()
|
||||
service_config.set('PLYMOUTH_QUIT_SERVICE', 'plymouth-quit.service')
|
||||
else
|
||||
service_config.set('PLYMOUTH_QUIT_SERVICE', '')
|
||||
endif
|
||||
|
||||
if get_option('systemdsystemunitdir') != ''
|
||||
systemd_systemunitdir = get_option('systemdsystemunitdir')
|
||||
else
|
||||
systemd_systemunitdir = systemd_dep.get_pkgconfig_variable('systemdsystemunitdir')
|
||||
endif
|
||||
|
||||
if get_option('systemduserunitdir') != ''
|
||||
systemd_userunitdir = 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',
|
||||
output: '@BASENAME@',
|
||||
configuration: service_config,
|
||||
install_dir: systemd_systemunitdir,
|
||||
format: 'cmake'
|
||||
diff --git a/data/org.gnome.gdm.rules.in b/data/org.gnome.gdm.rules.in
|
||||
new file mode 100644
|
||||
index 000000000..09544f11e
|
||||
--- /dev/null
|
||||
+++ b/data/org.gnome.gdm.rules.in
|
||||
@@ -0,0 +1,8 @@
|
||||
+polkit.addRule(function(action, subject) {
|
||||
+ if (action.id == "org.freedesktop.NetworkManager.network-control" &&
|
||||
+ subject.user == "@GDM_USERNAME@") {
|
||||
+ return polkit.Result.NO;
|
||||
+ }
|
||||
+
|
||||
+ return polkit.Result.NOT_HANDLED;
|
||||
+});
|
||||
--
|
||||
2.30.1
|
||||
|
@ -1,7 +1,7 @@
|
||||
From b1557adf711577c62609f8a784f11fad66eb54ef Mon Sep 17 00:00:00 2001
|
||||
From 8c9fe8ebd9e584adaec0a80ee4c4eaf5357422a5 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Wed, 31 Jul 2013 17:32:55 -0400
|
||||
Subject: [PATCH] data: add system dconf databases to gdm profile
|
||||
Subject: [PATCH 1/2] data: add system dconf databases to gdm profile
|
||||
|
||||
This way system settings can affect the login screen.
|
||||
---
|
||||
@ -20,5 +20,5 @@ index 4d8bf1748..9694078fb 100644
|
||||
+system-db:distro
|
||||
file-db:@DATADIR@/@PACKAGE@/greeter-dconf-defaults
|
||||
--
|
||||
2.28.0
|
||||
2.30.1
|
||||
|
||||
|
@ -1,26 +1,51 @@
|
||||
From 53afc21a17f002730a53fe790de564f055c07352 Mon Sep 17 00:00:00 2001
|
||||
From e01c0894669f5fe3d1a1c4148b7507e61b95d035 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Mon, 11 Feb 2019 18:14:07 -0500
|
||||
Subject: [PATCH] data: disable wayland on certain hardware
|
||||
|
||||
We're having issues with wayland on passthrough to virt
|
||||
setups and with the vendor nvidia driver, so
|
||||
disable it in those cases.
|
||||
setups and with the vendor nvidia driver on hybrid graphics
|
||||
setups, so disable it in those cases.
|
||||
|
||||
Also disable it on server chips for performance reasons.
|
||||
---
|
||||
data/61-gdm.rules.in | 15 ++++++++++++---
|
||||
1 file changed, 12 insertions(+), 3 deletions(-)
|
||||
data/61-gdm.rules.in | 39 +++++++++++++++++++++++++++++++++++----
|
||||
1 file changed, 35 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/data/61-gdm.rules.in b/data/61-gdm.rules.in
|
||||
index b1da191f8..0230e5ca5 100644
|
||||
index b1da191f..d599a146 100644
|
||||
--- a/data/61-gdm.rules.in
|
||||
+++ b/data/61-gdm.rules.in
|
||||
@@ -1,6 +1,15 @@
|
||||
@@ -1,6 +1,37 @@
|
||||
# disable Wayland on Hi1710 chipsets
|
||||
-ATTR{vendor}=="0x19e5", ATTR{device}=="0x1711", RUN+="@libexecdir@/gdm-runtime-config set daemon WaylandEnable false"
|
||||
+ATTR{vendor}=="0x19e5", ATTR{device}=="0x1711", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
# disable Wayland when using the proprietary nvidia driver
|
||||
-# disable Wayland when using the proprietary nvidia driver
|
||||
-DRIVER=="nvidia", RUN+="@libexecdir@/gdm-runtime-config set daemon WaylandEnable false"
|
||||
+DRIVER=="nvidia", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
+ATTR{vendor}=="0x19e5", ATTR{device}=="0x1711", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
+
|
||||
+# disable Wayland on Matrox chipsets
|
||||
+ATTR{vendor}=="0x102b", ATTR{device}=="0x0522", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
+ATTR{vendor}=="0x102b", ATTR{device}=="0x0524", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
+ATTR{vendor}=="0x102b", ATTR{device}=="0x0530", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
+ATTR{vendor}=="0x102b", ATTR{device}=="0x0532", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
+ATTR{vendor}=="0x102b", ATTR{device}=="0x0533", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
+ATTR{vendor}=="0x102b", ATTR{device}=="0x0534", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
+ATTR{vendor}=="0x102b", ATTR{device}=="0x0536", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
+ATTR{vendor}=="0x102b", ATTR{device}=="0x0538", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
+
|
||||
+# disable Wayland on aspeed chipsets
|
||||
+ATTR{vendor}=="0x1a03", ATTR{device}=="0x2010", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
+ATTR{vendor}=="0x1a03", ATTR{device}=="0x2000", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
+
|
||||
+# disable Wayland on hybrid systems with vendor nvidia driver
|
||||
+# default to Xorg on single gpu vendor nvidia systems
|
||||
+DRIVER=="nvidia", ENV{GDM_HAS_VENDOR_NVIDIA_DRIVER}="1"
|
||||
+DRIVER=="nvidia", RUN+="@libexecdir@/gdm-runtime-config set daemon PreferredDisplayServer xorg"
|
||||
+SUBSYSTEM=="drm", KERNEL=="card[1-9]*", ENV{GDM_HAS_NVIDIA_DRIVER}=="1", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
+ACTION=="add", SUBSYSTEM=="module", KERNEL=="nvidia_drm", ATTR{parameters/modeset}=="N", RUN+="/usr/libexec/gdm-disable-wayland"
|
||||
+
|
||||
+# disable Wayland on HyperV guests
|
||||
+DRIVER=="hyperv_fb", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
+
|
||||
+# disable Wayland on passthrough graphics setups for now (assumes passthrough if
|
||||
+# there is more than one card, and one of the cards is virt: cirrus, bochs, qxl)
|
||||
@ -34,5 +59,5 @@ index b1da191f8..0230e5ca5 100644
|
||||
-IMPORT{cmdline}="nomodeset", RUN+="@libexecdir@/gdm-runtime-config set daemon WaylandEnable false"
|
||||
+IMPORT{cmdline}="nomodeset", RUN+="@libexecdir@/gdm-disable-wayland"
|
||||
--
|
||||
2.31.1
|
||||
2.27.0
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
From f860f60771cd4f07ae1d06c56621a5aa8545e60b Mon Sep 17 00:00:00 2001
|
||||
From cbfb3ef99ecc9cbb4e6850e5dd0cc9fb65dd398a Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Tue, 1 Sep 2020 13:49:27 -0400
|
||||
Subject: [PATCH] display: Handle failure before display registration
|
||||
Subject: [PATCH 1/3] display: Handle failure before display registration
|
||||
|
||||
Normally, e.g., gdm-wayland-session would register its display
|
||||
before starting the session. This display registration is how
|
||||
|
@ -0,0 +1,325 @@
|
||||
From d8fd8d4d6ff6a119f6bd27eb07316384c4776d12 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Wed, 15 Sep 2021 11:23:17 -0400
|
||||
Subject: [PATCH] local-display-factory: Don't try to respawn displays on
|
||||
shutdown
|
||||
|
||||
At the moment in the shutdown path we may try to respawn displays
|
||||
that just got killed.
|
||||
|
||||
The respawning happens when things are half torn down leading to
|
||||
crashes.
|
||||
|
||||
This commit makes sure we turn off the respawn logic in the shutdown
|
||||
path.
|
||||
---
|
||||
daemon/gdm-local-display-factory.c | 11 ++++++++++-
|
||||
daemon/gdm-manager.c | 2 ++
|
||||
2 files changed, 12 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c
|
||||
index 11dcda2c..a0884893 100644
|
||||
--- a/daemon/gdm-local-display-factory.c
|
||||
+++ b/daemon/gdm-local-display-factory.c
|
||||
@@ -46,60 +46,62 @@
|
||||
#define GDM_LOCAL_DISPLAY_FACTORY_DBUS_PATH GDM_DBUS_PATH "/LocalDisplayFactory"
|
||||
#define GDM_MANAGER_DBUS_NAME "org.gnome.DisplayManager.LocalDisplayFactory"
|
||||
|
||||
#define MAX_DISPLAY_FAILURES 5
|
||||
#define WAIT_TO_FINISH_TIMEOUT 10 /* seconds */
|
||||
#define SEAT0_GRAPHICS_CHECK_TIMEOUT 10 /* seconds */
|
||||
|
||||
struct _GdmLocalDisplayFactory
|
||||
{
|
||||
GdmDisplayFactory parent;
|
||||
|
||||
GdmDBusLocalDisplayFactory *skeleton;
|
||||
GDBusConnection *connection;
|
||||
GHashTable *used_display_numbers;
|
||||
|
||||
/* FIXME: this needs to be per seat? */
|
||||
guint num_failures;
|
||||
|
||||
guint seat_new_id;
|
||||
guint seat_removed_id;
|
||||
guint seat_properties_changed_id;
|
||||
|
||||
gboolean seat0_graphics_check_timed_out;
|
||||
guint seat0_graphics_check_timeout_id;
|
||||
|
||||
#if defined(ENABLE_USER_DISPLAY_SERVER)
|
||||
unsigned int active_vt;
|
||||
guint active_vt_watch_id;
|
||||
guint wait_to_finish_timeout_id;
|
||||
#endif
|
||||
+
|
||||
+ gboolean is_started;
|
||||
};
|
||||
|
||||
enum {
|
||||
PROP_0,
|
||||
};
|
||||
|
||||
static void gdm_local_display_factory_class_init (GdmLocalDisplayFactoryClass *klass);
|
||||
static void gdm_local_display_factory_init (GdmLocalDisplayFactory *factory);
|
||||
static void gdm_local_display_factory_finalize (GObject *object);
|
||||
|
||||
static void ensure_display_for_seat (GdmLocalDisplayFactory *factory,
|
||||
const char *seat_id);
|
||||
|
||||
static void on_display_status_changed (GdmDisplay *display,
|
||||
GParamSpec *arg1,
|
||||
GdmLocalDisplayFactory *factory);
|
||||
|
||||
static gboolean gdm_local_display_factory_sync_seats (GdmLocalDisplayFactory *factory);
|
||||
static gpointer local_display_factory_object = NULL;
|
||||
static gboolean lookup_by_session_id (const char *id,
|
||||
GdmDisplay *display,
|
||||
gpointer user_data);
|
||||
|
||||
G_DEFINE_TYPE (GdmLocalDisplayFactory, gdm_local_display_factory, GDM_TYPE_DISPLAY_FACTORY)
|
||||
|
||||
GQuark
|
||||
gdm_local_display_factory_error_quark (void)
|
||||
{
|
||||
static GQuark ret = 0;
|
||||
if (ret == 0) {
|
||||
@@ -478,60 +480,64 @@ on_session_registered_cb (GObject *gobject,
|
||||
GParamSpec *pspec,
|
||||
gpointer user_data)
|
||||
{
|
||||
GdmDisplay *display = GDM_DISPLAY (gobject);
|
||||
GdmLocalDisplayFactory *factory = GDM_LOCAL_DISPLAY_FACTORY (user_data);
|
||||
gboolean registered;
|
||||
|
||||
g_object_get (display, "session-registered", ®istered, NULL);
|
||||
|
||||
if (!registered)
|
||||
return;
|
||||
|
||||
g_debug ("GdmLocalDisplayFactory: session registered on display, looking for any background displays to kill");
|
||||
|
||||
finish_waiting_displays_on_seat (factory, "seat0");
|
||||
}
|
||||
|
||||
static void
|
||||
on_display_status_changed (GdmDisplay *display,
|
||||
GParamSpec *arg1,
|
||||
GdmLocalDisplayFactory *factory)
|
||||
{
|
||||
int status;
|
||||
int num;
|
||||
char *seat_id = NULL;
|
||||
char *session_type = NULL;
|
||||
char *session_class = NULL;
|
||||
gboolean is_initial = TRUE;
|
||||
gboolean is_local = TRUE;
|
||||
|
||||
+
|
||||
+ if (!factory->is_started)
|
||||
+ return;
|
||||
+
|
||||
num = -1;
|
||||
gdm_display_get_x11_display_number (display, &num, NULL);
|
||||
|
||||
g_object_get (display,
|
||||
"seat-id", &seat_id,
|
||||
"is-initial", &is_initial,
|
||||
"is-local", &is_local,
|
||||
"session-type", &session_type,
|
||||
"session-class", &session_class,
|
||||
NULL);
|
||||
|
||||
status = gdm_display_get_status (display);
|
||||
|
||||
g_debug ("GdmLocalDisplayFactory: display status changed: %d", status);
|
||||
switch (status) {
|
||||
case GDM_DISPLAY_FINISHED:
|
||||
/* remove the display number from factory->used_display_numbers
|
||||
so that it may be reused */
|
||||
if (num != -1) {
|
||||
g_hash_table_remove (factory->used_display_numbers, GUINT_TO_POINTER (num));
|
||||
}
|
||||
gdm_display_factory_queue_purge_displays (GDM_DISPLAY_FACTORY (factory));
|
||||
|
||||
/* if this is a local display, do a full resync. Only
|
||||
* seats without displays will get created anyway. This
|
||||
* ensures we get a new login screen when the user logs out,
|
||||
* if there isn't one.
|
||||
*/
|
||||
if (is_local && g_strcmp0 (session_class, "greeter") != 0) {
|
||||
/* reset num failures */
|
||||
@@ -1250,99 +1256,102 @@ on_display_added (GdmDisplayStore *display_store,
|
||||
|
||||
display = gdm_display_store_lookup (display_store, id);
|
||||
|
||||
if (display != NULL) {
|
||||
g_signal_connect_object (display, "notify::status",
|
||||
G_CALLBACK (on_display_status_changed),
|
||||
factory,
|
||||
0);
|
||||
|
||||
g_object_weak_ref (G_OBJECT (display), (GWeakNotify)on_display_disposed, factory);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
on_display_removed (GdmDisplayStore *display_store,
|
||||
GdmDisplay *display,
|
||||
GdmLocalDisplayFactory *factory)
|
||||
{
|
||||
g_signal_handlers_disconnect_by_func (display, G_CALLBACK (on_display_status_changed), factory);
|
||||
g_object_weak_unref (G_OBJECT (display), (GWeakNotify)on_display_disposed, factory);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdm_local_display_factory_start (GdmDisplayFactory *base_factory)
|
||||
{
|
||||
GdmLocalDisplayFactory *factory = GDM_LOCAL_DISPLAY_FACTORY (base_factory);
|
||||
GdmDisplayStore *store;
|
||||
|
||||
g_return_val_if_fail (GDM_IS_LOCAL_DISPLAY_FACTORY (factory), FALSE);
|
||||
|
||||
+ factory->is_started = TRUE;
|
||||
+
|
||||
store = gdm_display_factory_get_display_store (GDM_DISPLAY_FACTORY (factory));
|
||||
|
||||
g_signal_connect_object (G_OBJECT (store),
|
||||
"display-added",
|
||||
G_CALLBACK (on_display_added),
|
||||
factory,
|
||||
0);
|
||||
|
||||
g_signal_connect_object (G_OBJECT (store),
|
||||
"display-removed",
|
||||
G_CALLBACK (on_display_removed),
|
||||
factory,
|
||||
0);
|
||||
|
||||
gdm_local_display_factory_start_monitor (factory);
|
||||
return gdm_local_display_factory_sync_seats (factory);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdm_local_display_factory_stop (GdmDisplayFactory *base_factory)
|
||||
{
|
||||
GdmLocalDisplayFactory *factory = GDM_LOCAL_DISPLAY_FACTORY (base_factory);
|
||||
GdmDisplayStore *store;
|
||||
|
||||
g_return_val_if_fail (GDM_IS_LOCAL_DISPLAY_FACTORY (factory), FALSE);
|
||||
|
||||
gdm_local_display_factory_stop_monitor (factory);
|
||||
|
||||
store = gdm_display_factory_get_display_store (GDM_DISPLAY_FACTORY (factory));
|
||||
|
||||
g_signal_handlers_disconnect_by_func (G_OBJECT (store),
|
||||
G_CALLBACK (on_display_added),
|
||||
factory);
|
||||
g_signal_handlers_disconnect_by_func (G_OBJECT (store),
|
||||
G_CALLBACK (on_display_removed),
|
||||
factory);
|
||||
-
|
||||
g_clear_handle_id (&factory->seat0_graphics_check_timeout_id, g_source_remove);
|
||||
|
||||
+ factory->is_started = FALSE;
|
||||
+
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gdm_local_display_factory_set_property (GObject *object,
|
||||
guint prop_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
switch (prop_id) {
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gdm_local_display_factory_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
switch (prop_id) {
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
diff --git a/daemon/gdm-manager.c b/daemon/gdm-manager.c
|
||||
index b3d0a2b5..4b62b8b1 100644
|
||||
--- a/daemon/gdm-manager.c
|
||||
+++ b/daemon/gdm-manager.c
|
||||
@@ -2774,60 +2774,62 @@ unexport_display (const char *id,
|
||||
GdmDisplay *display,
|
||||
GdmManager *manager)
|
||||
{
|
||||
if (!g_dbus_connection_is_closed (manager->priv->connection))
|
||||
g_dbus_object_manager_server_unexport (manager->priv->object_manager, id);
|
||||
}
|
||||
|
||||
static void
|
||||
finish_display (const char *id,
|
||||
GdmDisplay *display,
|
||||
GdmManager *manager)
|
||||
{
|
||||
gdm_display_stop_greeter_session (display);
|
||||
if (gdm_display_get_status (display) == GDM_DISPLAY_MANAGED)
|
||||
gdm_display_unmanage (display);
|
||||
gdm_display_finish (display);
|
||||
}
|
||||
|
||||
static void
|
||||
gdm_manager_dispose (GObject *object)
|
||||
{
|
||||
GdmManager *manager;
|
||||
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (GDM_IS_MANAGER (object));
|
||||
|
||||
manager = GDM_MANAGER (object);
|
||||
|
||||
g_return_if_fail (manager->priv != NULL);
|
||||
|
||||
+ gdm_manager_stop (manager);
|
||||
+
|
||||
g_clear_weak_pointer (&manager->priv->automatic_login_display);
|
||||
|
||||
#ifdef HAVE_LIBXDMCP
|
||||
g_clear_object (&manager->priv->xdmcp_factory);
|
||||
#endif
|
||||
g_clear_object (&manager->priv->local_factory);
|
||||
g_clear_pointer (&manager->priv->open_reauthentication_requests,
|
||||
g_hash_table_unref);
|
||||
g_clear_pointer (&manager->priv->transient_sessions,
|
||||
g_hash_table_unref);
|
||||
|
||||
g_list_foreach (manager->priv->user_sessions,
|
||||
(GFunc) gdm_session_close,
|
||||
NULL);
|
||||
g_list_free_full (manager->priv->user_sessions, (GDestroyNotify) g_object_unref);
|
||||
manager->priv->user_sessions = NULL;
|
||||
|
||||
g_signal_handlers_disconnect_by_func (G_OBJECT (manager->priv->display_store),
|
||||
G_CALLBACK (on_display_added),
|
||||
manager);
|
||||
g_signal_handlers_disconnect_by_func (G_OBJECT (manager->priv->display_store),
|
||||
G_CALLBACK (on_display_removed),
|
||||
manager);
|
||||
|
||||
if (!g_dbus_connection_is_closed (manager->priv->connection)) {
|
||||
gdm_display_store_foreach (manager->priv->display_store,
|
||||
(GdmDisplayStoreFunc)unexport_display,
|
||||
manager);
|
||||
g_dbus_interface_skeleton_unexport (G_DBUS_INTERFACE_SKELETON (manager));
|
||||
}
|
||||
--
|
||||
2.31.1
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
||||
From d99f12385d6b04023cbe17f3f6fc2a917066c6e8 Mon Sep 17 00:00:00 2001
|
||||
From d80807171a457ff87bdc9bd861939161749a37a8 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Thu, 20 Dec 2018 14:51:38 -0500
|
||||
Subject: [PATCH 1/3] manager: allow multiple xdmcp logins for the same user
|
||||
@ -10,19 +10,19 @@ Subject: [PATCH 1/3] manager: allow multiple xdmcp logins for the same user
|
||||
3 files changed, 59 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/common/gdm-settings-keys.h b/common/gdm-settings-keys.h
|
||||
index f0059b5cf..33676a851 100644
|
||||
index 87685d3cd..4b3a1ffeb 100644
|
||||
--- a/common/gdm-settings-keys.h
|
||||
+++ b/common/gdm-settings-keys.h
|
||||
@@ -28,37 +28,38 @@ G_BEGIN_DECLS
|
||||
#define GDM_KEY_USER "daemon/User"
|
||||
#define GDM_KEY_GROUP "daemon/Group"
|
||||
@@ -30,37 +30,38 @@ G_BEGIN_DECLS
|
||||
#define GDM_KEY_AUTO_LOGIN_ENABLE "daemon/AutomaticLoginEnable"
|
||||
#define GDM_KEY_AUTO_LOGIN_USER "daemon/AutomaticLogin"
|
||||
#define GDM_KEY_TIMED_LOGIN_ENABLE "daemon/TimedLoginEnable"
|
||||
#define GDM_KEY_TIMED_LOGIN_USER "daemon/TimedLogin"
|
||||
#define GDM_KEY_TIMED_LOGIN_DELAY "daemon/TimedLoginDelay"
|
||||
#define GDM_KEY_INITIAL_SETUP_ENABLE "daemon/InitialSetupEnable"
|
||||
#define GDM_KEY_PREFERRED_DISPLAY_SERVER "daemon/PreferredDisplayServer"
|
||||
#define GDM_KEY_WAYLAND_ENABLE "daemon/WaylandEnable"
|
||||
#define GDM_KEY_XORG_ENABLE "daemon/XorgEnable"
|
||||
|
||||
#define GDM_KEY_DEBUG "debug/Enable"
|
||||
|
||||
@ -53,7 +53,7 @@ index f0059b5cf..33676a851 100644
|
||||
|
||||
#endif /* _GDM_SETTINGS_KEYS_H */
|
||||
diff --git a/daemon/gdm-manager.c b/daemon/gdm-manager.c
|
||||
index 9c10adff3..b96295ab6 100644
|
||||
index e433acf3b..ce8565bf9 100644
|
||||
--- a/daemon/gdm-manager.c
|
||||
+++ b/daemon/gdm-manager.c
|
||||
@@ -566,93 +566,106 @@ get_display_and_details_for_bus_sender (GdmManager *self,
|
||||
@ -297,10 +297,10 @@ index 9c10adff3..b96295ab6 100644
|
||||
uid,
|
||||
is_remote);
|
||||
diff --git a/data/gdm.schemas.in b/data/gdm.schemas.in
|
||||
index 255bff023..86059c02e 100644
|
||||
index a1035f95e..929d13d90 100644
|
||||
--- a/data/gdm.schemas.in
|
||||
+++ b/data/gdm.schemas.in
|
||||
@@ -102,33 +102,38 @@
|
||||
@@ -112,33 +112,38 @@
|
||||
<schema>
|
||||
<key>xdmcp/DisplaysPerHost</key>
|
||||
<signature>i</signature>
|
||||
@ -340,5 +340,5 @@ index 255bff023..86059c02e 100644
|
||||
</gdmschemafile>
|
||||
|
||||
--
|
||||
2.31.1
|
||||
2.30.1
|
||||
|
||||
|
@ -0,0 +1,144 @@
|
||||
From f101371f418bb0013af1e5e1ef522277011fd48d Mon Sep 17 00:00:00 2001
|
||||
From: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
Date: Thu, 7 Oct 2021 18:22:11 -0700
|
||||
Subject: [PATCH 1/2] meson: Fix detection of Xorg versions that need -listen
|
||||
tcp
|
||||
|
||||
Closes #704
|
||||
---
|
||||
meson.build | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/meson.build b/meson.build
|
||||
index e6fcf4b8..06d09659 100644
|
||||
--- a/meson.build
|
||||
+++ b/meson.build
|
||||
@@ -42,60 +42,63 @@ udev_dep = dependency('udev')
|
||||
glib_min_version = '2.56.0'
|
||||
|
||||
glib_dep = dependency('glib-2.0', version: '>=' + glib_min_version)
|
||||
gobject_dep = dependency('gobject-2.0', version: '>=' + glib_min_version)
|
||||
gio_dep = dependency('gio-2.0', version: '>=' + glib_min_version)
|
||||
gio_unix_dep = dependency('gio-unix-2.0', version: '>=' + glib_min_version)
|
||||
gtk_dep = dependency('gtk+-3.0', version: '>= 2.91.1')
|
||||
libcanberra_gtk_dep = dependency('libcanberra-gtk3', version: '>= 0.4')
|
||||
accountsservice_dep = dependency('accountsservice', version: '>= 0.6.35')
|
||||
xcb_dep = dependency('xcb')
|
||||
keyutils_dep = dependency('libkeyutils', required: false)
|
||||
libselinux_dep = dependency('libselinux', required: get_option('selinux'))
|
||||
|
||||
# udev
|
||||
if udev_dir == ''
|
||||
if udev_dep.found()
|
||||
udev_prefix = udev_dep.get_pkgconfig_variable('udevdir')
|
||||
else
|
||||
udev_prefix = gdm_prefix / 'lib' / 'udev'
|
||||
endif
|
||||
udev_dir = udev_prefix / 'rules.d'
|
||||
endif
|
||||
|
||||
# X11
|
||||
x_deps = declare_dependency(
|
||||
dependencies: [
|
||||
dependency('x11'),
|
||||
dependency('xau'),
|
||||
],
|
||||
)
|
||||
+# Xserver 1.17 & later default to -nolisten and require -listen for remote access
|
||||
+xserver_deps = dependency('xorg-server', version : '>=1.17', required : false)
|
||||
+xserver_nolisten_default = xserver_deps.found()
|
||||
find_x_server_script = find_program('build-aux/find-x-server.sh', native: true)
|
||||
find_x_server_out = run_command(find_x_server_script).stdout().strip()
|
||||
if find_x_server_out != ''
|
||||
x_bin = find_x_server_out
|
||||
x_bin_path_split = x_bin.split('/')
|
||||
i = 0
|
||||
x_path = '/'
|
||||
foreach dir : x_bin_path_split
|
||||
if i < x_bin_path_split.length() - 1
|
||||
x_path = x_path / dir
|
||||
endif
|
||||
i = i + 1
|
||||
endforeach
|
||||
else
|
||||
# what to do, what to do, this is wrong, but this just sets the
|
||||
# defaults, perhaps this user is cross compiling or some such
|
||||
x_path = '/usr/bin/X11:/usr/X11R6/bin:/opt/X11R6/bin'
|
||||
x_bin = '/usr/bin/X'
|
||||
endif
|
||||
xdmcp_dep = cc.find_library('Xdmcp', required: get_option('xdmcp'))
|
||||
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_multiseat_x = find_program('systemd-multi-seat-x',
|
||||
required: false,
|
||||
dirs: [
|
||||
@@ -197,60 +200,61 @@ conf.set_quoted('SYSCONFDIR', gdm_prefix / get_option('sysconfdir'))
|
||||
conf.set_quoted('BINDIR', gdm_prefix / get_option('bindir'))
|
||||
conf.set_quoted('LIBDIR', gdm_prefix / get_option('libdir'))
|
||||
conf.set_quoted('LIBEXECDIR', gdm_prefix / get_option('libexecdir'))
|
||||
conf.set_quoted('LOGDIR', get_option('log-dir'))
|
||||
conf.set_quoted('DMCONFDIR', dmconfdir)
|
||||
conf.set_quoted('GDMCONFDIR', gdmconfdir)
|
||||
conf.set_quoted('GDM_SCREENSHOT_DIR', gdm_screenshot_dir)
|
||||
conf.set_quoted('GDM_XAUTH_DIR', gdm_xauth_dir)
|
||||
conf.set_quoted('GDM_RAN_ONCE_MARKER_DIR', ran_once_marker_dir)
|
||||
conf.set_quoted('GDM_RUN_DIR', gdm_run_dir)
|
||||
conf.set_quoted('GNOMELOCALEDIR', gdm_prefix / get_option('localedir'))
|
||||
conf.set_quoted('AT_SPI_REGISTRYD_DIR', at_spi_registryd_dir)
|
||||
conf.set_quoted('GDM_PID_FILE', gdm_pid_file)
|
||||
conf.set_quoted('GNOME_SETTINGS_DAEMON_DIR', gnome_settings_daemon_dir)
|
||||
conf.set_quoted('LANG_CONFIG_FILE', lang_config_file)
|
||||
conf.set('HAVE_ADT', have_adt)
|
||||
conf.set('HAVE_UTMP_H', have_utmp_header)
|
||||
conf.set('HAVE_UTMPX_H', have_utmpx_header)
|
||||
conf.set('HAVE_POSIX_GETPWNAM_R', have_posix_getpwnam_r)
|
||||
conf.set('UTMP', utmp_struct)
|
||||
conf.set('HAVE_GETUTXENT', cc.has_function('getutxent'))
|
||||
conf.set('HAVE_UPDWTMP', cc.has_function('updwtmp'))
|
||||
conf.set('HAVE_UPDWTMPX', cc.has_function('updwtmpx'))
|
||||
conf.set('HAVE_LOGIN', cc.has_function('login', args: '-lutil'))
|
||||
conf.set('HAVE_LOGOUT', cc.has_function('logout', args: '-lutil'))
|
||||
conf.set('HAVE_LOGWTMP', cc.has_function('logwtmp', args: '-lutil'))
|
||||
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('HAVE_XSERVER_THAT_DEFAULTS_TO_LOCAL_ONLY', xserver_nolisten_default)
|
||||
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'))
|
||||
conf.set('ENABLE_PROFILING', get_option('profiling'))
|
||||
conf.set('GDM_INITIAL_VT', get_option('initial-vt'))
|
||||
conf.set_quoted('GDM_DEFAULTS_CONF', gdm_defaults_conf)
|
||||
conf.set_quoted('GDM_CUSTOM_CONF', gdm_custom_conf)
|
||||
conf.set_quoted('GDM_RUNTIME_CONF', gdm_runtime_conf)
|
||||
conf.set_quoted('GDM_SESSION_DEFAULT_PATH', get_option('default-path'))
|
||||
conf.set_quoted('GDM_USERNAME', get_option('user'))
|
||||
conf.set_quoted('GDM_GROUPNAME', get_option('group'))
|
||||
conf.set('HAVE_LIBXDMCP', xdmcp_dep.found())
|
||||
conf.set_quoted('SYSTEMD_X_SERVER', systemd_x_server)
|
||||
conf.set('WITH_PLYMOUTH', plymouth_dep.found())
|
||||
conf.set_quoted('X_SERVER', x_bin)
|
||||
conf.set_quoted('X_PATH', x_path)
|
||||
conf.set('HAVE_UT_UT_HOST', utmp_has_host_field)
|
||||
conf.set('HAVE_UT_UT_PID', utmp_has_pid_field)
|
||||
conf.set('HAVE_UT_UT_ID', utmp_has_id_field)
|
||||
conf.set('HAVE_UT_UT_NAME', utmp_has_name_field)
|
||||
conf.set('HAVE_UT_UT_TYPE', utmp_has_type_field)
|
||||
conf.set('HAVE_UT_UT_EXIT_E_TERMINATION', utmp_has_exit_e_termination_field)
|
||||
conf.set('HAVE_UT_UT_USER', utmp_has_user_field)
|
||||
conf.set('HAVE_UT_UT_TIME', utmp_has_time_field)
|
||||
conf.set('HAVE_UT_UT_TV', utmp_has_tv_field)
|
||||
conf.set('HAVE_UT_UT_SYSLEN', utmp_has_syslen_field)
|
||||
conf.set('ENABLE_IPV6', get_option('ipv6'))
|
||||
configure_file(output: 'config.h', configuration: conf)
|
||||
|
||||
# Subdirs
|
||||
--
|
||||
2.33.1
|
||||
|
81
SOURCES/0001-meson-set-D_GNU_SOURCE-for-updwtmpx.patch
Normal file
81
SOURCES/0001-meson-set-D_GNU_SOURCE-for-updwtmpx.patch
Normal file
@ -0,0 +1,81 @@
|
||||
From 5a2d5dbdf8c6f6d3c896082a5a07b4292f5fb410 Mon Sep 17 00:00:00 2001
|
||||
From: Sam James <sam@gentoo.org>
|
||||
Date: Tue, 5 Jul 2022 01:47:35 +0100
|
||||
Subject: [PATCH 1/2] meson: set -D_GNU_SOURCE for updwtmpx
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Without setting GNU_SOURCE, we end up getting:
|
||||
```
|
||||
../gdm-42.0/daemon/gdm-session-record.c:200:9: error: implicit declaration of function ‘updwtmpx’; did you mean ‘updwtmp’? [-Werror=implicit-function-declaration]
|
||||
updwtmpx (GDM_NEW_SESSION_RECORDS_FILE, &session_record);
|
||||
```
|
||||
|
||||
This ended up exposing a bug in updwtmp(3) (which is now fixed
|
||||
thanks to the man-pages maintainers!) as it didn't mention that updwtmpx
|
||||
is a GNU extension (and hence needs GNU_SOURCE in order to be available).
|
||||
|
||||
Alternatively, we could just #define _GNU_SOURCE in gdm-session-record.c
|
||||
for updwtmpx.
|
||||
|
||||
Bug: https://bugzilla.kernel.org/show_bug.cgi?id=216168
|
||||
---
|
||||
meson.build | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/meson.build b/meson.build
|
||||
index 8328dd97..4a286f97 100644
|
||||
--- a/meson.build
|
||||
+++ b/meson.build
|
||||
@@ -1,44 +1,47 @@
|
||||
project('gdm', 'c',
|
||||
version: '40.0',
|
||||
license: 'GPL2+',
|
||||
meson_version: '>= 0.50',
|
||||
)
|
||||
|
||||
# Modules
|
||||
gnome = import('gnome')
|
||||
pkgconfig = import('pkgconfig')
|
||||
i18n = import('i18n')
|
||||
|
||||
# Compiler
|
||||
cc = meson.get_compiler('c')
|
||||
|
||||
+# Use GNU extensions if available
|
||||
+add_project_arguments('-D_GNU_SOURCE', language: 'c')
|
||||
+
|
||||
# Options
|
||||
gdm_prefix = get_option('prefix')
|
||||
|
||||
gdmconfdir = (get_option('sysconfsubdir') == '')? gdm_prefix / get_option('sysconfdir') : gdm_prefix / get_option('sysconfdir') / get_option('sysconfsubdir')
|
||||
dmconfdir = (get_option('dmconfdir') != '')? get_option('dmconfdir') : gdm_prefix / get_option('sysconfdir') / 'dm'
|
||||
udev_dir = get_option('udev-dir')
|
||||
at_spi_registryd_dir = (get_option('at-spi-registryd-dir') != '')? get_option('at-spi-registryd-dir') : gdm_prefix / get_option('libexecdir')
|
||||
lang_config_file = (get_option('lang-file') != '')? get_option('lang-file') : gdm_prefix / get_option('sysconfdir') / 'locale.conf'
|
||||
pam_mod_dir = (get_option('pam-mod-dir') != '')? get_option('pam-mod-dir') : gdm_prefix / get_option('libdir') / 'security'
|
||||
dbus_sys_dir = (get_option('dbus-sys') != '')? get_option('dbus-sys') : get_option('sysconfdir') / 'dbus-1' / 'system.d'
|
||||
gdm_defaults_conf = (get_option('defaults-conf') != '')? get_option('defaults-conf') : gdm_prefix / get_option('datadir') / 'gdm' / 'defaults.conf'
|
||||
gdm_custom_conf = (get_option('custom-conf') != '')? get_option('custom-conf') : gdmconfdir / 'custom.conf'
|
||||
gnome_settings_daemon_dir = (get_option('gnome-settings-daemon-dir') != '')? get_option('gnome-settings-daemon-dir') : gdm_prefix / get_option('libexecdir')
|
||||
gdm_run_dir = (get_option('run-dir') != '')? get_option('run-dir') : gdm_prefix / get_option('localstatedir') / 'run' / 'gdm'
|
||||
gdm_runtime_conf = (get_option('runtime-conf') != '')? get_option('runtime-conf') : gdm_run_dir / 'custom.conf'
|
||||
gdm_pid_file = (get_option('pid-file') != '')? get_option('pid-file') : gdm_run_dir / 'gdm.pid'
|
||||
ran_once_marker_dir = (get_option('ran-once-marker-dir') != '')? get_option('ran-once-marker-dir') : gdm_run_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'
|
||||
|
||||
# Common variables
|
||||
config_h_dir = include_directories('.')
|
||||
|
||||
# Dependencies
|
||||
udev_dep = dependency('udev')
|
||||
|
||||
glib_min_version = '2.56.0'
|
||||
|
||||
glib_dep = dependency('glib-2.0', version: '>=' + glib_min_version)
|
||||
--
|
||||
2.31.1
|
||||
|
@ -0,0 +1,84 @@
|
||||
From 56d12ad9697d5695c780a5be0065d23fec6bd1a5 Mon Sep 17 00:00:00 2001
|
||||
From: Chingkai Chu <3013329+chuchingkai@users.noreply.github.com>
|
||||
Date: Thu, 12 Aug 2021 10:34:01 +0800
|
||||
Subject: [PATCH] session-worker: Set session_vt=0 out of pam uninitialization
|
||||
|
||||
MR GNOME/gdm!123 moved jump_to_vt and session_vt reseting to a
|
||||
separate function, so we don't need to reset session_vt in pam
|
||||
uninitialization.
|
||||
|
||||
https://gitlab.gnome.org/GNOME/gdm/-/issues/719
|
||||
---
|
||||
daemon/gdm-session-worker.c | 2 --
|
||||
1 file changed, 2 deletions(-)
|
||||
|
||||
diff --git a/daemon/gdm-session-worker.c b/daemon/gdm-session-worker.c
|
||||
index c1201b70..9cff53a5 100644
|
||||
--- a/daemon/gdm-session-worker.c
|
||||
+++ b/daemon/gdm-session-worker.c
|
||||
@@ -1076,62 +1076,60 @@ gdm_session_worker_set_state (GdmSessionWorker *worker,
|
||||
|
||||
static void
|
||||
gdm_session_worker_uninitialize_pam (GdmSessionWorker *worker,
|
||||
int status)
|
||||
{
|
||||
g_debug ("GdmSessionWorker: uninitializing PAM");
|
||||
|
||||
if (worker->priv->pam_handle == NULL)
|
||||
return;
|
||||
|
||||
gdm_session_worker_get_username (worker, NULL);
|
||||
|
||||
if (worker->priv->state >= GDM_SESSION_WORKER_STATE_SESSION_OPENED) {
|
||||
pam_close_session (worker->priv->pam_handle, 0);
|
||||
gdm_session_auditor_report_logout (worker->priv->auditor);
|
||||
} else {
|
||||
gdm_session_auditor_report_login_failure (worker->priv->auditor,
|
||||
status,
|
||||
pam_strerror (worker->priv->pam_handle, status));
|
||||
}
|
||||
|
||||
if (worker->priv->state >= GDM_SESSION_WORKER_STATE_ACCREDITED) {
|
||||
pam_setcred (worker->priv->pam_handle, PAM_DELETE_CRED);
|
||||
}
|
||||
|
||||
pam_end (worker->priv->pam_handle, status);
|
||||
worker->priv->pam_handle = NULL;
|
||||
|
||||
gdm_session_worker_stop_auditor (worker);
|
||||
|
||||
- worker->priv->session_vt = 0;
|
||||
-
|
||||
g_debug ("GdmSessionWorker: state NONE");
|
||||
gdm_session_worker_set_state (worker, GDM_SESSION_WORKER_STATE_NONE);
|
||||
}
|
||||
|
||||
static char *
|
||||
_get_tty_for_pam (const char *x11_display_name,
|
||||
const char *display_device)
|
||||
{
|
||||
#ifdef __sun
|
||||
return g_strdup (display_device);
|
||||
#else
|
||||
return g_strdup (x11_display_name);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef PAM_XAUTHDATA
|
||||
static struct pam_xauth_data *
|
||||
_get_xauth_for_pam (const char *x11_authority_file)
|
||||
{
|
||||
FILE *fh;
|
||||
Xauth *auth = NULL;
|
||||
struct pam_xauth_data *retval = NULL;
|
||||
gsize len = sizeof (*retval) + 1;
|
||||
|
||||
fh = fopen (x11_authority_file, "r");
|
||||
if (fh) {
|
||||
auth = XauReadAuth (fh);
|
||||
fclose (fh);
|
||||
}
|
||||
if (auth) {
|
||||
--
|
||||
2.31.1
|
||||
|
@ -1,7 +1,7 @@
|
||||
From 4fde9e7882e5d2e42a4ed5a0d71943d5ea966131 Mon Sep 17 00:00:00 2001
|
||||
From f0dce28fa02210caa445e96d9cbec1d150b79e80 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Wed, 15 Aug 2018 10:48:16 -0400
|
||||
Subject: [PATCH 1/5] worker: don't load user settings for program sessions
|
||||
Subject: [PATCH 1/4] worker: don't load user settings for program sessions
|
||||
|
||||
We don't need or want the login greeter to access accountsservice
|
||||
for its session name
|
||||
@ -10,7 +10,7 @@ for its session name
|
||||
1 file changed, 26 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/daemon/gdm-session-worker.c b/daemon/gdm-session-worker.c
|
||||
index 774298b95..88fe36c16 100644
|
||||
index 9b8e0d87..438348df 100644
|
||||
--- a/daemon/gdm-session-worker.c
|
||||
+++ b/daemon/gdm-session-worker.c
|
||||
@@ -400,103 +400,108 @@ gdm_session_execute (const char *file,
|
||||
@ -124,7 +124,7 @@ index 774298b95..88fe36c16 100644
|
||||
worker->priv->service,
|
||||
question,
|
||||
answerp,
|
||||
@@ -2600,87 +2605,89 @@ gdm_session_worker_get_property (GObject *object,
|
||||
@@ -2598,87 +2603,89 @@ gdm_session_worker_get_property (GObject *object,
|
||||
g_value_set_boolean (value, self->priv->is_reauth_session);
|
||||
break;
|
||||
case PROP_STATE:
|
||||
@ -218,7 +218,7 @@ index 774298b95..88fe36c16 100644
|
||||
g_free (session_name);
|
||||
}
|
||||
|
||||
@@ -2758,110 +2765,113 @@ do_authorize (GdmSessionWorker *worker)
|
||||
@@ -2756,110 +2763,113 @@ do_authorize (GdmSessionWorker *worker)
|
||||
g_dbus_method_invocation_take_error (worker->priv->pending_invocation, error);
|
||||
}
|
||||
worker->priv->pending_invocation = NULL;
|
||||
@ -336,7 +336,7 @@ index 774298b95..88fe36c16 100644
|
||||
}
|
||||
|
||||
gdm_dbus_worker_complete_open (GDM_DBUS_WORKER (worker), worker->priv->pending_invocation, session_id);
|
||||
@@ -3105,155 +3115,161 @@ gdm_session_worker_handle_initialize (GdmDBusWorker *object,
|
||||
@@ -3103,155 +3113,161 @@ gdm_session_worker_handle_initialize (GdmDBusWorker *object,
|
||||
if (g_strcmp0 (key, "service") == 0) {
|
||||
worker->priv->service = g_variant_dup_string (value, NULL);
|
||||
} else if (g_strcmp0 (key, "extensions") == 0) {
|
||||
@ -498,7 +498,7 @@ index 774298b95..88fe36c16 100644
|
||||
GDBusMethodInvocation *invocation,
|
||||
const char *service,
|
||||
const char *username,
|
||||
@@ -3591,61 +3607,60 @@ static void
|
||||
@@ -3589,61 +3605,60 @@ static void
|
||||
reauthentication_request_free (ReauthenticationRequest *request)
|
||||
{
|
||||
|
||||
@ -561,5 +561,5 @@ index 774298b95..88fe36c16 100644
|
||||
g_return_if_fail (worker->priv != NULL);
|
||||
|
||||
--
|
||||
2.31.1
|
||||
2.33.1
|
||||
|
||||
|
@ -0,0 +1,327 @@
|
||||
From d3823a5084e12d8f342fd4cbec29e23bdb646de7 Mon Sep 17 00:00:00 2001
|
||||
From: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
Date: Thu, 7 Oct 2021 18:22:11 -0700
|
||||
Subject: [PATCH 2/2] daemon: Support X servers built with -Dlisten_tcp=true
|
||||
|
||||
Xorg since version 1.17 doesn't listen to tcp sockets by default
|
||||
unless it's explicitly built with -Dlisten_tcp=true.
|
||||
|
||||
GDM currently assumes X servers 1.17 and later are always built
|
||||
without specifying -Dlisten_tcp=true and doesn't work properly
|
||||
otherwise.
|
||||
|
||||
This commit enhances GDM to better handle these non-standard builds by
|
||||
always passing '-nolisten tcp' on the command line when tcp should
|
||||
be disabled, and likewise always passing '-listen tcp' on the command
|
||||
line, assuming the X server is new enough to support it, when tcp
|
||||
should be enabled.
|
||||
|
||||
Related #704
|
||||
---
|
||||
daemon/gdm-server.c | 21 +++++++++++----------
|
||||
daemon/gdm-x-session.c | 12 ++++++------
|
||||
meson.build | 4 ++--
|
||||
3 files changed, 19 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/daemon/gdm-server.c b/daemon/gdm-server.c
|
||||
index 1ba00d45..e5d23521 100644
|
||||
--- a/daemon/gdm-server.c
|
||||
+++ b/daemon/gdm-server.c
|
||||
@@ -290,72 +290,73 @@ gdm_server_resolve_command_line (GdmServer *server,
|
||||
if (strcmp (arg, "-query") == 0 ||
|
||||
strcmp (arg, "-indirect") == 0)
|
||||
query_in_arglist = TRUE;
|
||||
}
|
||||
|
||||
argv = g_renew (char *, argv, len + 12);
|
||||
/* shift args down one */
|
||||
for (i = len - 1; i >= 1; i--) {
|
||||
argv[i+1] = argv[i];
|
||||
}
|
||||
|
||||
/* server number is the FIRST argument, before any others */
|
||||
argv[1] = g_strdup (server->display_name);
|
||||
len++;
|
||||
|
||||
if (server->auth_file != NULL) {
|
||||
argv[len++] = g_strdup ("-auth");
|
||||
argv[len++] = g_strdup (server->auth_file);
|
||||
}
|
||||
|
||||
if (server->display_seat_id != NULL) {
|
||||
argv[len++] = g_strdup ("-seat");
|
||||
argv[len++] = g_strdup (server->display_seat_id);
|
||||
}
|
||||
|
||||
/* If we were compiled with Xserver >= 1.17 we need to specify
|
||||
* '-listen tcp' as the X server dosen't listen on tcp sockets
|
||||
* by default anymore. In older versions we need to pass
|
||||
* -nolisten tcp to disable listening on tcp sockets.
|
||||
*/
|
||||
-#ifdef HAVE_XSERVER_THAT_DEFAULTS_TO_LOCAL_ONLY
|
||||
- if (!server->disable_tcp && ! query_in_arglist) {
|
||||
- argv[len++] = g_strdup ("-listen");
|
||||
- argv[len++] = g_strdup ("tcp");
|
||||
- }
|
||||
-#else
|
||||
- if (server->disable_tcp && ! query_in_arglist) {
|
||||
- argv[len++] = g_strdup ("-nolisten");
|
||||
- argv[len++] = g_strdup ("tcp");
|
||||
- }
|
||||
+ if (!query_in_arglist) {
|
||||
+ if (server->disable_tcp) {
|
||||
+ argv[len++] = g_strdup ("-nolisten");
|
||||
+ argv[len++] = g_strdup ("tcp");
|
||||
+ }
|
||||
|
||||
+#ifdef HAVE_XSERVER_WITH_LISTEN
|
||||
+ if (!server->disable_tcp) {
|
||||
+ argv[len++] = g_strdup ("-listen");
|
||||
+ argv[len++] = g_strdup ("tcp");
|
||||
+ }
|
||||
#endif
|
||||
+ }
|
||||
|
||||
if (vtarg != NULL && ! gotvtarg) {
|
||||
argv[len++] = g_strdup (vtarg);
|
||||
}
|
||||
|
||||
argv[len++] = NULL;
|
||||
|
||||
*argvp = argv;
|
||||
*argcp = len;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
rotate_logs (const char *path,
|
||||
guint n_copies)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = n_copies - 1; i > 0; i--) {
|
||||
char *name_n;
|
||||
char *name_n1;
|
||||
|
||||
name_n = g_strdup_printf ("%s.%d", path, i);
|
||||
if (i > 1) {
|
||||
name_n1 = g_strdup_printf ("%s.%d", path, i - 1);
|
||||
} else {
|
||||
name_n1 = g_strdup (path);
|
||||
}
|
||||
|
||||
diff --git a/daemon/gdm-x-session.c b/daemon/gdm-x-session.c
|
||||
index b1548361..d2a8aeb3 100644
|
||||
--- a/daemon/gdm-x-session.c
|
||||
+++ b/daemon/gdm-x-session.c
|
||||
@@ -233,70 +233,70 @@ spawn_x_server (State *state,
|
||||
|
||||
if (g_getenv ("XDG_VTNR") != NULL) {
|
||||
int vt;
|
||||
|
||||
vt = atoi (g_getenv ("XDG_VTNR"));
|
||||
|
||||
if (vt > 0 && vt < 64) {
|
||||
vt_string = g_strdup_printf ("vt%d", vt);
|
||||
}
|
||||
}
|
||||
|
||||
display_fd_string = g_strdup_printf ("%d", DISPLAY_FILENO);
|
||||
|
||||
g_ptr_array_add (arguments, X_SERVER);
|
||||
|
||||
if (vt_string != NULL) {
|
||||
g_ptr_array_add (arguments, vt_string);
|
||||
}
|
||||
|
||||
g_ptr_array_add (arguments, "-displayfd");
|
||||
g_ptr_array_add (arguments, display_fd_string);
|
||||
|
||||
g_ptr_array_add (arguments, "-auth");
|
||||
g_ptr_array_add (arguments, auth_file);
|
||||
|
||||
/* If we were compiled with Xserver >= 1.17 we need to specify
|
||||
* '-listen tcp' as the X server doesn't listen on tcp sockets
|
||||
* by default anymore. In older versions we need to pass
|
||||
* -nolisten tcp to disable listening on tcp sockets.
|
||||
*/
|
||||
-#ifdef HAVE_XSERVER_THAT_DEFAULTS_TO_LOCAL_ONLY
|
||||
- if (allow_remote_connections) {
|
||||
- g_ptr_array_add (arguments, "-listen");
|
||||
- g_ptr_array_add (arguments, "tcp");
|
||||
- }
|
||||
-#else
|
||||
if (!allow_remote_connections) {
|
||||
g_ptr_array_add (arguments, "-nolisten");
|
||||
g_ptr_array_add (arguments, "tcp");
|
||||
}
|
||||
+
|
||||
+#ifdef HAVE_XSERVER_WITH_LISTEN
|
||||
+ if (allow_remote_connections) {
|
||||
+ g_ptr_array_add (arguments, "-listen");
|
||||
+ g_ptr_array_add (arguments, "tcp");
|
||||
+ }
|
||||
#endif
|
||||
|
||||
g_ptr_array_add (arguments, "-background");
|
||||
g_ptr_array_add (arguments, "none");
|
||||
|
||||
g_ptr_array_add (arguments, "-noreset");
|
||||
g_ptr_array_add (arguments, "-keeptty");
|
||||
g_ptr_array_add (arguments, "-novtswitch");
|
||||
|
||||
g_ptr_array_add (arguments, "-verbose");
|
||||
if (state->debug_enabled) {
|
||||
g_ptr_array_add (arguments, "7");
|
||||
} else {
|
||||
g_ptr_array_add (arguments, "3");
|
||||
}
|
||||
|
||||
if (state->debug_enabled) {
|
||||
g_ptr_array_add (arguments, "-core");
|
||||
}
|
||||
g_ptr_array_add (arguments, NULL);
|
||||
|
||||
subprocess = g_subprocess_launcher_spawnv (launcher,
|
||||
(const char * const *) arguments->pdata,
|
||||
&error);
|
||||
g_free (display_fd_string);
|
||||
g_clear_object (&launcher);
|
||||
g_ptr_array_free (arguments, TRUE);
|
||||
|
||||
if (subprocess == NULL) {
|
||||
g_debug ("could not start X server: %s", error->message);
|
||||
diff --git a/meson.build b/meson.build
|
||||
index 06d09659..8328dd97 100644
|
||||
--- a/meson.build
|
||||
+++ b/meson.build
|
||||
@@ -44,61 +44,61 @@ glib_min_version = '2.56.0'
|
||||
glib_dep = dependency('glib-2.0', version: '>=' + glib_min_version)
|
||||
gobject_dep = dependency('gobject-2.0', version: '>=' + glib_min_version)
|
||||
gio_dep = dependency('gio-2.0', version: '>=' + glib_min_version)
|
||||
gio_unix_dep = dependency('gio-unix-2.0', version: '>=' + glib_min_version)
|
||||
gtk_dep = dependency('gtk+-3.0', version: '>= 2.91.1')
|
||||
libcanberra_gtk_dep = dependency('libcanberra-gtk3', version: '>= 0.4')
|
||||
accountsservice_dep = dependency('accountsservice', version: '>= 0.6.35')
|
||||
xcb_dep = dependency('xcb')
|
||||
keyutils_dep = dependency('libkeyutils', required: false)
|
||||
libselinux_dep = dependency('libselinux', required: get_option('selinux'))
|
||||
|
||||
# udev
|
||||
if udev_dir == ''
|
||||
if udev_dep.found()
|
||||
udev_prefix = udev_dep.get_pkgconfig_variable('udevdir')
|
||||
else
|
||||
udev_prefix = gdm_prefix / 'lib' / 'udev'
|
||||
endif
|
||||
udev_dir = udev_prefix / 'rules.d'
|
||||
endif
|
||||
|
||||
# X11
|
||||
x_deps = declare_dependency(
|
||||
dependencies: [
|
||||
dependency('x11'),
|
||||
dependency('xau'),
|
||||
],
|
||||
)
|
||||
# Xserver 1.17 & later default to -nolisten and require -listen for remote access
|
||||
xserver_deps = dependency('xorg-server', version : '>=1.17', required : false)
|
||||
-xserver_nolisten_default = xserver_deps.found()
|
||||
+xserver_has_listen = xserver_deps.found()
|
||||
find_x_server_script = find_program('build-aux/find-x-server.sh', native: true)
|
||||
find_x_server_out = run_command(find_x_server_script).stdout().strip()
|
||||
if find_x_server_out != ''
|
||||
x_bin = find_x_server_out
|
||||
x_bin_path_split = x_bin.split('/')
|
||||
i = 0
|
||||
x_path = '/'
|
||||
foreach dir : x_bin_path_split
|
||||
if i < x_bin_path_split.length() - 1
|
||||
x_path = x_path / dir
|
||||
endif
|
||||
i = i + 1
|
||||
endforeach
|
||||
else
|
||||
# what to do, what to do, this is wrong, but this just sets the
|
||||
# defaults, perhaps this user is cross compiling or some such
|
||||
x_path = '/usr/bin/X11:/usr/X11R6/bin:/opt/X11R6/bin'
|
||||
x_bin = '/usr/bin/X'
|
||||
endif
|
||||
xdmcp_dep = cc.find_library('Xdmcp', required: get_option('xdmcp'))
|
||||
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_multiseat_x = find_program('systemd-multi-seat-x',
|
||||
required: false,
|
||||
dirs: [
|
||||
@@ -200,61 +200,61 @@ conf.set_quoted('SYSCONFDIR', gdm_prefix / get_option('sysconfdir'))
|
||||
conf.set_quoted('BINDIR', gdm_prefix / get_option('bindir'))
|
||||
conf.set_quoted('LIBDIR', gdm_prefix / get_option('libdir'))
|
||||
conf.set_quoted('LIBEXECDIR', gdm_prefix / get_option('libexecdir'))
|
||||
conf.set_quoted('LOGDIR', get_option('log-dir'))
|
||||
conf.set_quoted('DMCONFDIR', dmconfdir)
|
||||
conf.set_quoted('GDMCONFDIR', gdmconfdir)
|
||||
conf.set_quoted('GDM_SCREENSHOT_DIR', gdm_screenshot_dir)
|
||||
conf.set_quoted('GDM_XAUTH_DIR', gdm_xauth_dir)
|
||||
conf.set_quoted('GDM_RAN_ONCE_MARKER_DIR', ran_once_marker_dir)
|
||||
conf.set_quoted('GDM_RUN_DIR', gdm_run_dir)
|
||||
conf.set_quoted('GNOMELOCALEDIR', gdm_prefix / get_option('localedir'))
|
||||
conf.set_quoted('AT_SPI_REGISTRYD_DIR', at_spi_registryd_dir)
|
||||
conf.set_quoted('GDM_PID_FILE', gdm_pid_file)
|
||||
conf.set_quoted('GNOME_SETTINGS_DAEMON_DIR', gnome_settings_daemon_dir)
|
||||
conf.set_quoted('LANG_CONFIG_FILE', lang_config_file)
|
||||
conf.set('HAVE_ADT', have_adt)
|
||||
conf.set('HAVE_UTMP_H', have_utmp_header)
|
||||
conf.set('HAVE_UTMPX_H', have_utmpx_header)
|
||||
conf.set('HAVE_POSIX_GETPWNAM_R', have_posix_getpwnam_r)
|
||||
conf.set('UTMP', utmp_struct)
|
||||
conf.set('HAVE_GETUTXENT', cc.has_function('getutxent'))
|
||||
conf.set('HAVE_UPDWTMP', cc.has_function('updwtmp'))
|
||||
conf.set('HAVE_UPDWTMPX', cc.has_function('updwtmpx'))
|
||||
conf.set('HAVE_LOGIN', cc.has_function('login', args: '-lutil'))
|
||||
conf.set('HAVE_LOGOUT', cc.has_function('logout', args: '-lutil'))
|
||||
conf.set('HAVE_LOGWTMP', cc.has_function('logwtmp', args: '-lutil'))
|
||||
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('HAVE_XSERVER_THAT_DEFAULTS_TO_LOCAL_ONLY', xserver_nolisten_default)
|
||||
+conf.set('HAVE_XSERVER_WITH_LISTEN', xserver_has_listen)
|
||||
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'))
|
||||
conf.set('ENABLE_PROFILING', get_option('profiling'))
|
||||
conf.set('GDM_INITIAL_VT', get_option('initial-vt'))
|
||||
conf.set_quoted('GDM_DEFAULTS_CONF', gdm_defaults_conf)
|
||||
conf.set_quoted('GDM_CUSTOM_CONF', gdm_custom_conf)
|
||||
conf.set_quoted('GDM_RUNTIME_CONF', gdm_runtime_conf)
|
||||
conf.set_quoted('GDM_SESSION_DEFAULT_PATH', get_option('default-path'))
|
||||
conf.set_quoted('GDM_USERNAME', get_option('user'))
|
||||
conf.set_quoted('GDM_GROUPNAME', get_option('group'))
|
||||
conf.set('HAVE_LIBXDMCP', xdmcp_dep.found())
|
||||
conf.set_quoted('SYSTEMD_X_SERVER', systemd_x_server)
|
||||
conf.set('WITH_PLYMOUTH', plymouth_dep.found())
|
||||
conf.set_quoted('X_SERVER', x_bin)
|
||||
conf.set_quoted('X_PATH', x_path)
|
||||
conf.set('HAVE_UT_UT_HOST', utmp_has_host_field)
|
||||
conf.set('HAVE_UT_UT_PID', utmp_has_pid_field)
|
||||
conf.set('HAVE_UT_UT_ID', utmp_has_id_field)
|
||||
conf.set('HAVE_UT_UT_NAME', utmp_has_name_field)
|
||||
conf.set('HAVE_UT_UT_TYPE', utmp_has_type_field)
|
||||
conf.set('HAVE_UT_UT_EXIT_E_TERMINATION', utmp_has_exit_e_termination_field)
|
||||
conf.set('HAVE_UT_UT_USER', utmp_has_user_field)
|
||||
conf.set('HAVE_UT_UT_TIME', utmp_has_time_field)
|
||||
conf.set('HAVE_UT_UT_TV', utmp_has_tv_field)
|
||||
conf.set('HAVE_UT_UT_SYSLEN', utmp_has_syslen_field)
|
||||
conf.set('ENABLE_IPV6', get_option('ipv6'))
|
||||
configure_file(output: 'config.h', configuration: conf)
|
||||
|
||||
# Subdirs
|
||||
--
|
||||
2.33.1
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 81efb06506456a260d63b77e3dda1216041b5bb3 Mon Sep 17 00:00:00 2001
|
||||
From 874b26e3674d540df37d7f145df853bcf81e5a26 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Wed, 5 Feb 2020 15:20:48 -0500
|
||||
Subject: [PATCH 2/3] gdm-x-session: run session bus on non-seat0 seats
|
||||
@ -13,10 +13,10 @@ seats get their own session bus.
|
||||
1 file changed, 10 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
|
||||
index 5c5903a49..c891fb577 100644
|
||||
index 418240dc0..77d6b8ff0 100644
|
||||
--- a/daemon/gdm-session.c
|
||||
+++ b/daemon/gdm-session.c
|
||||
@@ -2811,119 +2811,128 @@ on_start_program_cb (GdmDBusWorker *worker,
|
||||
@@ -2822,119 +2822,128 @@ on_start_program_cb (GdmDBusWorker *worker,
|
||||
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CLOSED) ||
|
||||
g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
|
||||
return;
|
||||
@ -78,7 +78,7 @@ index 5c5903a49..c891fb577 100644
|
||||
|
||||
register_session = !gdm_session_session_registers (self);
|
||||
|
||||
+ if (g_strcmp0 (priv->display_seat_id, "seat0") != 0 && !run_launcher) {
|
||||
+ if (g_strcmp0 (self->display_seat_id, "seat0") != 0 && !run_launcher) {
|
||||
+ run_separate_bus = TRUE;
|
||||
+ }
|
||||
+
|
||||
@ -147,5 +147,5 @@ index 5c5903a49..c891fb577 100644
|
||||
self->selected_program);
|
||||
}
|
||||
--
|
||||
2.31.1
|
||||
2.30.1
|
||||
|
||||
|
131
SOURCES/0002-libgdm-Sort-session-list.patch
Normal file
131
SOURCES/0002-libgdm-Sort-session-list.patch
Normal file
@ -0,0 +1,131 @@
|
||||
From c00daca1579c47f3f62894ff2378c37e6cbebfd3 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Tue, 20 Jul 2021 13:36:45 -0400
|
||||
Subject: [PATCH 2/4] libgdm: Sort session list
|
||||
|
||||
Right now the session list comes out in hash table order.
|
||||
|
||||
This commit changes the code to sort by description.
|
||||
---
|
||||
libgdm/gdm-sessions.c | 19 +++++++++++++++++++
|
||||
1 file changed, 19 insertions(+)
|
||||
|
||||
diff --git a/libgdm/gdm-sessions.c b/libgdm/gdm-sessions.c
|
||||
index 97ed5ef3..f078e04b 100644
|
||||
--- a/libgdm/gdm-sessions.c
|
||||
+++ b/libgdm/gdm-sessions.c
|
||||
@@ -311,92 +311,111 @@ collect_sessions (void)
|
||||
g_ptr_array_add (wayland_search_array, g_strdup (wayland_search_dirs[i]));
|
||||
}
|
||||
#endif
|
||||
|
||||
if (gdm_available_sessions_map == NULL) {
|
||||
gdm_available_sessions_map = g_hash_table_new_full (g_str_hash, g_str_equal,
|
||||
g_free, (GDestroyNotify)gdm_session_file_free);
|
||||
}
|
||||
|
||||
if (!supported_session_types || g_strv_contains ((const char * const *) supported_session_types, "x11")) {
|
||||
for (i = 0; i < xorg_search_array->len; i++) {
|
||||
collect_sessions_from_directory (g_ptr_array_index (xorg_search_array, i));
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef ENABLE_WAYLAND_SUPPORT
|
||||
#ifdef ENABLE_USER_DISPLAY_SERVER
|
||||
if (!supported_session_types || g_strv_contains ((const char * const *) supported_session_types, "wayland")) {
|
||||
for (i = 0; i < wayland_search_array->len; i++) {
|
||||
collect_sessions_from_directory (g_ptr_array_index (wayland_search_array, i));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
g_hash_table_foreach_remove (gdm_available_sessions_map,
|
||||
remove_duplicate_sessions,
|
||||
names_seen_before);
|
||||
}
|
||||
|
||||
+static gint
|
||||
+compare_session_ids (gconstpointer a,
|
||||
+ gconstpointer b)
|
||||
+{
|
||||
+ GdmSessionFile *session_a, *session_b;
|
||||
+ session_a = (GdmSessionFile *) g_hash_table_lookup (gdm_available_sessions_map, a);
|
||||
+ session_b = (GdmSessionFile *) g_hash_table_lookup (gdm_available_sessions_map, b);
|
||||
+
|
||||
+ if (session_a == NULL)
|
||||
+ return -1;
|
||||
+
|
||||
+ if (session_b == NULL)
|
||||
+ return 1;
|
||||
+
|
||||
+ return g_strcmp0 (session_a->translated_name, session_b->translated_name);
|
||||
+}
|
||||
+
|
||||
/**
|
||||
* gdm_get_session_ids:
|
||||
*
|
||||
* Reads /usr/share/xsessions and other relevant places for possible sessions
|
||||
* to log into and returns the complete list.
|
||||
*
|
||||
* Returns: (transfer full): a %NULL terminated list of session ids
|
||||
*/
|
||||
char **
|
||||
gdm_get_session_ids (void)
|
||||
{
|
||||
GHashTableIter iter;
|
||||
gpointer key, value;
|
||||
GPtrArray *array;
|
||||
|
||||
if (!gdm_sessions_map_is_initialized) {
|
||||
collect_sessions ();
|
||||
|
||||
gdm_sessions_map_is_initialized = TRUE;
|
||||
}
|
||||
|
||||
array = g_ptr_array_new ();
|
||||
g_hash_table_iter_init (&iter, gdm_available_sessions_map);
|
||||
while (g_hash_table_iter_next (&iter, &key, &value)) {
|
||||
GdmSessionFile *session;
|
||||
|
||||
session = (GdmSessionFile *) value;
|
||||
|
||||
g_ptr_array_add (array, g_strdup (session->id));
|
||||
}
|
||||
g_ptr_array_add (array, NULL);
|
||||
|
||||
+ g_ptr_array_sort (array, compare_session_ids);
|
||||
+
|
||||
return (char **) g_ptr_array_free (array, FALSE);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdm_get_session_name_and_description:
|
||||
* @id: an id from gdm_get_session_ids()
|
||||
* @description: (out): optional returned session description
|
||||
*
|
||||
* Takes an xsession id and returns the name and comment about it.
|
||||
*
|
||||
* Returns: The session name if found, or %NULL otherwise
|
||||
*/
|
||||
char *
|
||||
gdm_get_session_name_and_description (const char *id,
|
||||
char **description)
|
||||
{
|
||||
GdmSessionFile *session;
|
||||
char *name;
|
||||
|
||||
if (!gdm_sessions_map_is_initialized) {
|
||||
collect_sessions ();
|
||||
|
||||
gdm_sessions_map_is_initialized = TRUE;
|
||||
}
|
||||
|
||||
session = (GdmSessionFile *) g_hash_table_lookup (gdm_available_sessions_map,
|
||||
id);
|
||||
|
||||
if (session == NULL) {
|
||||
return NULL;
|
||||
--
|
||||
2.34.1
|
||||
|
227
SOURCES/0002-manager-Fix-btmp-record-accounting.patch
Normal file
227
SOURCES/0002-manager-Fix-btmp-record-accounting.patch
Normal file
@ -0,0 +1,227 @@
|
||||
From 20725e4c65555178ed64a3cb77ee979ec98998f8 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Wed, 19 Oct 2022 14:50:33 -0400
|
||||
Subject: [PATCH 2/2] manager: Fix btmp record accounting
|
||||
|
||||
Before a user logs in they don't have a display.
|
||||
|
||||
btmp records currently need a display though, and they
|
||||
get written when the user can't log in.
|
||||
|
||||
Furthermore, the display from X11 point of view is
|
||||
somewhat archaic. We use wayland by default now.
|
||||
|
||||
In lieu of a display, this commit gives the btmp record
|
||||
the seat id instead.
|
||||
---
|
||||
daemon/gdm-manager.c | 11 +++++++++--
|
||||
daemon/gdm-session-record.c | 8 ++++++--
|
||||
2 files changed, 15 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/daemon/gdm-manager.c b/daemon/gdm-manager.c
|
||||
index 4b62b8b1..c70248f3 100644
|
||||
--- a/daemon/gdm-manager.c
|
||||
+++ b/daemon/gdm-manager.c
|
||||
@@ -641,113 +641,120 @@ switch_to_compatible_user_session (GdmManager *manager,
|
||||
|
||||
ret = TRUE;
|
||||
|
||||
out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static GdmDisplay *
|
||||
get_display_for_user_session (GdmSession *session)
|
||||
{
|
||||
return g_object_get_data (G_OBJECT (session), "gdm-display");
|
||||
}
|
||||
|
||||
static GdmSession *
|
||||
get_user_session_for_display (GdmDisplay *display)
|
||||
{
|
||||
if (display == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return g_object_get_data (G_OBJECT (display), "gdm-user-session");
|
||||
}
|
||||
|
||||
static gboolean
|
||||
add_session_record (GdmManager *manager,
|
||||
GdmSession *session,
|
||||
GPid pid,
|
||||
SessionRecord record)
|
||||
{
|
||||
const char *username;
|
||||
- char *display_name, *hostname, *display_device;
|
||||
+ char *display_name, *hostname, *display_device, *display_seat_id;
|
||||
gboolean recorded = FALSE;
|
||||
|
||||
display_name = NULL;
|
||||
username = NULL;
|
||||
hostname = NULL;
|
||||
display_device = NULL;
|
||||
+ display_seat_id = NULL;
|
||||
|
||||
username = gdm_session_get_username (session);
|
||||
|
||||
if (username == NULL) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
g_object_get (G_OBJECT (session),
|
||||
"display-name", &display_name,
|
||||
"display-hostname", &hostname,
|
||||
"display-device", &display_device,
|
||||
+ "display-seat-id", &display_seat_id,
|
||||
NULL);
|
||||
|
||||
if (display_name == NULL && display_device == NULL) {
|
||||
- goto out;
|
||||
+ if (display_seat_id == NULL)
|
||||
+ goto out;
|
||||
+
|
||||
+ display_name = g_strdup ("login screen");
|
||||
+ display_device = g_strdup (display_seat_id);
|
||||
}
|
||||
|
||||
switch (record) {
|
||||
case SESSION_RECORD_LOGIN:
|
||||
gdm_session_record_login (pid,
|
||||
username,
|
||||
hostname,
|
||||
display_name,
|
||||
display_device);
|
||||
break;
|
||||
case SESSION_RECORD_LOGOUT:
|
||||
gdm_session_record_logout (pid,
|
||||
username,
|
||||
hostname,
|
||||
display_name,
|
||||
display_device);
|
||||
break;
|
||||
case SESSION_RECORD_FAILED:
|
||||
gdm_session_record_failed (pid,
|
||||
username,
|
||||
hostname,
|
||||
display_name,
|
||||
display_device);
|
||||
break;
|
||||
}
|
||||
|
||||
recorded = TRUE;
|
||||
out:
|
||||
g_free (display_name);
|
||||
g_free (hostname);
|
||||
g_free (display_device);
|
||||
+ g_free (display_seat_id);
|
||||
|
||||
return recorded;
|
||||
}
|
||||
|
||||
static GdmSession *
|
||||
find_user_session_for_display (GdmManager *self,
|
||||
GdmDisplay *display)
|
||||
{
|
||||
|
||||
GList *node = self->priv->user_sessions;
|
||||
|
||||
while (node != NULL) {
|
||||
GdmSession *session = node->data;
|
||||
GdmDisplay *candidate_display;
|
||||
GList *next_node = node->next;
|
||||
|
||||
candidate_display = get_display_for_user_session (session);
|
||||
|
||||
if (candidate_display == display)
|
||||
return session;
|
||||
|
||||
node = next_node;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdm_manager_handle_register_display (GdmDBusManager *manager,
|
||||
GDBusMethodInvocation *invocation,
|
||||
diff --git a/daemon/gdm-session-record.c b/daemon/gdm-session-record.c
|
||||
index 7719d0a8..310323b6 100644
|
||||
--- a/daemon/gdm-session-record.c
|
||||
+++ b/daemon/gdm-session-record.c
|
||||
@@ -125,66 +125,70 @@ record_set_host (UTMP *u,
|
||||
*/
|
||||
if (host_name != NULL
|
||||
&& x11_display_name != NULL
|
||||
&& g_str_has_prefix (x11_display_name, ":")) {
|
||||
hostname = g_strdup_printf ("%s%s", host_name, x11_display_name);
|
||||
} else {
|
||||
hostname = g_strdup (x11_display_name);
|
||||
}
|
||||
|
||||
if (hostname != NULL) {
|
||||
memccpy (u->ut_host, hostname, '\0', sizeof (u->ut_host));
|
||||
g_debug ("using ut_host %.*s", (int) sizeof (u->ut_host), u->ut_host);
|
||||
#ifdef HAVE_UT_UT_SYSLEN
|
||||
u->ut_syslen = MIN (strlen (hostname), sizeof (u->ut_host));
|
||||
#endif
|
||||
g_free (hostname);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
record_set_line (UTMP *u,
|
||||
const char *display_device,
|
||||
const char *x11_display_name)
|
||||
{
|
||||
/*
|
||||
* Set ut_line to the device name associated with this display
|
||||
* but remove the "/dev/" prefix. If no device, then use the
|
||||
* $DISPLAY value.
|
||||
*/
|
||||
- if (display_device != NULL
|
||||
- && g_str_has_prefix (display_device, "/dev/")) {
|
||||
+ if (display_device != NULL && g_str_has_prefix (display_device, "/dev/")) {
|
||||
memccpy (u->ut_line,
|
||||
display_device + strlen ("/dev/"),
|
||||
'\0',
|
||||
sizeof (u->ut_line));
|
||||
+ } else if (display_device != NULL && g_str_has_prefix (display_device, "seat")) {
|
||||
+ memccpy (u->ut_line,
|
||||
+ display_device,
|
||||
+ '\0',
|
||||
+ sizeof (u->ut_line));
|
||||
} else if (x11_display_name != NULL) {
|
||||
memccpy (u->ut_line,
|
||||
x11_display_name,
|
||||
'\0',
|
||||
sizeof (u->ut_line));
|
||||
}
|
||||
|
||||
g_debug ("using ut_line %.*s", (int) sizeof (u->ut_line), u->ut_line);
|
||||
}
|
||||
|
||||
void
|
||||
gdm_session_record_login (GPid session_pid,
|
||||
const char *user_name,
|
||||
const char *host_name,
|
||||
const char *x11_display_name,
|
||||
const char *display_device)
|
||||
{
|
||||
UTMP session_record = { 0 };
|
||||
|
||||
if (x11_display_name == NULL)
|
||||
x11_display_name = display_device;
|
||||
|
||||
record_set_username (&session_record, user_name);
|
||||
|
||||
g_debug ("Writing login record");
|
||||
|
||||
#if defined(HAVE_UT_UT_TYPE)
|
||||
session_record.ut_type = USER_PROCESS;
|
||||
g_debug ("using ut_type USER_PROCESS");
|
||||
#endif
|
||||
--
|
||||
2.31.1
|
||||
|
@ -0,0 +1,119 @@
|
||||
From 9f4b4ef1b5e1458ca67cff235b655060b27e357b Mon Sep 17 00:00:00 2001
|
||||
From: Graham Rogers <graham@rogers.me.uk>
|
||||
Date: Sun, 18 Apr 2021 12:22:14 +0100
|
||||
Subject: [PATCH 2/2] pam_gdm: Use the last cryptsetup password instead of the
|
||||
first
|
||||
|
||||
---
|
||||
pam_gdm/pam_gdm.c | 32 ++++++++++++++++++++++++++------
|
||||
1 file changed, 26 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/pam_gdm/pam_gdm.c b/pam_gdm/pam_gdm.c
|
||||
index 767a6c8c..ef77f161 100644
|
||||
--- a/pam_gdm/pam_gdm.c
|
||||
+++ b/pam_gdm/pam_gdm.c
|
||||
@@ -11,75 +11,95 @@
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
*/
|
||||
#include <config.h>
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
#include <security/_pam_macros.h>
|
||||
#include <security/pam_ext.h>
|
||||
#include <security/pam_misc.h>
|
||||
#include <security/pam_modules.h>
|
||||
#include <security/pam_modutil.h>
|
||||
|
||||
#ifdef HAVE_KEYUTILS
|
||||
#include <keyutils.h>
|
||||
#endif
|
||||
|
||||
int
|
||||
pam_sm_authenticate (pam_handle_t *pamh,
|
||||
int flags,
|
||||
int argc,
|
||||
const char **argv)
|
||||
{
|
||||
#ifdef HAVE_KEYUTILS
|
||||
- int r;
|
||||
- void *cached_password = NULL;
|
||||
+ long r;
|
||||
+ size_t cached_passwords_length;
|
||||
+ char *cached_passwords = NULL;
|
||||
+ char *last_cached_password = NULL;
|
||||
key_serial_t serial;
|
||||
+ size_t i;
|
||||
|
||||
serial = find_key_by_type_and_desc ("user", "cryptsetup", 0);
|
||||
if (serial == 0)
|
||||
return PAM_AUTHINFO_UNAVAIL;
|
||||
|
||||
- r = keyctl_read_alloc (serial, &cached_password);
|
||||
- if (r < 0 || r != strlen (cached_password))
|
||||
+ r = keyctl_read_alloc (serial, &cached_passwords);
|
||||
+ if (r < 0)
|
||||
return PAM_AUTHINFO_UNAVAIL;
|
||||
+
|
||||
+ cached_passwords_length = r;
|
||||
+
|
||||
+ /*
|
||||
+ Find the last password in the NUL-separated list of passwords.
|
||||
+ Multiple passwords are returned either when the user enters an
|
||||
+ incorrect password or there are multiple encrypted drives.
|
||||
+ In the case of an incorrect password the last one is correct.
|
||||
+ In the case of multiple drives, choosing the last drive is as
|
||||
+ arbitrary a choice as any other, but choosing the last password at
|
||||
+ least supports multiple attempts on the last drive.
|
||||
+ */
|
||||
+ last_cached_password = cached_passwords;
|
||||
+ for (i = 0; i < cached_passwords_length; i++) {
|
||||
+ last_cached_password = cached_passwords + i;
|
||||
+ i += strlen (last_cached_password);
|
||||
+ }
|
||||
|
||||
- r = pam_set_item (pamh, PAM_AUTHTOK, cached_password);
|
||||
+ r = pam_set_item (pamh, PAM_AUTHTOK, last_cached_password);
|
||||
|
||||
- free (cached_password);
|
||||
+ free (cached_passwords);
|
||||
|
||||
if (r < 0)
|
||||
return PAM_AUTH_ERR;
|
||||
else
|
||||
return PAM_SUCCESS;
|
||||
#endif
|
||||
|
||||
return PAM_AUTHINFO_UNAVAIL;
|
||||
}
|
||||
|
||||
int
|
||||
pam_sm_setcred (pam_handle_t *pamh,
|
||||
int flags,
|
||||
int argc,
|
||||
const char **argv)
|
||||
{
|
||||
return PAM_SUCCESS;
|
||||
}
|
||||
|
||||
int
|
||||
pam_sm_acct_mgmt (pam_handle_t *pamh,
|
||||
int flags,
|
||||
int argc,
|
||||
const char **argv)
|
||||
{
|
||||
return PAM_SUCCESS;
|
||||
}
|
||||
|
||||
int
|
||||
pam_sm_chauthtok (pam_handle_t *pamh,
|
||||
--
|
||||
2.35.1
|
||||
|
@ -1,7 +1,7 @@
|
||||
From 83cdeb662961f8910e79c56f38d9e5e296ac93be Mon Sep 17 00:00:00 2001
|
||||
From 22b08727980cefd665b8805376710e9244523fe3 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Tue, 14 Aug 2018 14:52:41 -0400
|
||||
Subject: [PATCH 2/5] session: support new accountsservice Session and
|
||||
Subject: [PATCH 2/4] session: support new accountsservice Session and
|
||||
SessionType props
|
||||
|
||||
At the moment the user's session is stored in a property called
|
||||
@ -20,7 +20,7 @@ This commit switches GDM over to use the new properties.
|
||||
5 files changed, 153 insertions(+), 29 deletions(-)
|
||||
|
||||
diff --git a/daemon/gdm-session-settings.c b/daemon/gdm-session-settings.c
|
||||
index 484a3b5b4..5b64cb65b 100644
|
||||
index 484a3b5b..f2b1addd 100644
|
||||
--- a/daemon/gdm-session-settings.c
|
||||
+++ b/daemon/gdm-session-settings.c
|
||||
@@ -12,114 +12,121 @@
|
||||
@ -305,14 +305,14 @@ index 484a3b5b4..5b64cb65b 100644
|
||||
|
||||
- session_name = act_user_get_x_session (settings->priv->user);
|
||||
- g_debug ("GdmSessionSettings: saved session is %s", session_name);
|
||||
+ /* if the user doesn't have saved state, they don't have any settings worth reading */
|
||||
+ if (!act_user_get_saved (settings->priv->user))
|
||||
+ goto out;
|
||||
|
||||
- if (session_name != NULL) {
|
||||
+
|
||||
+
|
||||
+
|
||||
+ session_type = act_user_get_session_type (settings->priv->user);
|
||||
+ session_name = act_user_get_session (settings->priv->user);
|
||||
|
||||
- if (session_name != NULL) {
|
||||
+
|
||||
+ g_debug ("GdmSessionSettings: saved session is %s (type %s)", session_name, session_type);
|
||||
+
|
||||
+ if (session_type != NULL && session_type[0] != '\0') {
|
||||
@ -409,7 +409,7 @@ index 484a3b5b4..5b64cb65b 100644
|
||||
return TRUE;
|
||||
}
|
||||
diff --git a/daemon/gdm-session-settings.h b/daemon/gdm-session-settings.h
|
||||
index 20946bff1..db38ffc72 100644
|
||||
index 20946bff..db38ffc7 100644
|
||||
--- a/daemon/gdm-session-settings.h
|
||||
+++ b/daemon/gdm-session-settings.h
|
||||
@@ -33,37 +33,40 @@ G_BEGIN_DECLS
|
||||
@ -454,10 +454,10 @@ index 20946bff1..db38ffc72 100644
|
||||
G_END_DECLS
|
||||
#endif /* GDM_SESSION_SETTINGS_H */
|
||||
diff --git a/daemon/gdm-session-worker.c b/daemon/gdm-session-worker.c
|
||||
index 88fe36c16..c1201b704 100644
|
||||
index 438348df..9cff53a5 100644
|
||||
--- a/daemon/gdm-session-worker.c
|
||||
+++ b/daemon/gdm-session-worker.c
|
||||
@@ -2664,60 +2664,74 @@ gdm_session_worker_handle_set_language_name (GdmDBusWorker *object,
|
||||
@@ -2662,60 +2662,74 @@ gdm_session_worker_handle_set_language_name (GdmDBusWorker *object,
|
||||
gdm_dbus_worker_complete_set_language_name (object, invocation);
|
||||
return TRUE;
|
||||
}
|
||||
@ -532,7 +532,7 @@ index 88fe36c16..c1201b704 100644
|
||||
static void
|
||||
do_authenticate (GdmSessionWorker *worker)
|
||||
{
|
||||
@@ -3127,158 +3141,172 @@ gdm_session_worker_handle_initialize (GdmDBusWorker *object,
|
||||
@@ -3125,158 +3139,172 @@ gdm_session_worker_handle_initialize (GdmDBusWorker *object,
|
||||
} else if (g_strcmp0 (key, "x11-authority-file") == 0) {
|
||||
worker->priv->x11_authority_file = g_variant_dup_string (value, NULL);
|
||||
} else if (g_strcmp0 (key, "console") == 0) {
|
||||
@ -706,7 +706,7 @@ index 88fe36c16..c1201b704 100644
|
||||
const char *log_file)
|
||||
{
|
||||
diff --git a/daemon/gdm-session-worker.xml b/daemon/gdm-session-worker.xml
|
||||
index 4280fe095..a215779c8 100644
|
||||
index 4280fe09..a215779c 100644
|
||||
--- a/daemon/gdm-session-worker.xml
|
||||
+++ b/daemon/gdm-session-worker.xml
|
||||
@@ -51,40 +51,43 @@
|
||||
@ -754,7 +754,7 @@ index 4280fe095..a215779c8 100644
|
||||
</interface>
|
||||
</node>
|
||||
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
|
||||
index d95cef905..2d471ec46 100644
|
||||
index 72afe7b2..f4d0bef9 100644
|
||||
--- a/daemon/gdm-session.c
|
||||
+++ b/daemon/gdm-session.c
|
||||
@@ -61,60 +61,61 @@
|
||||
@ -819,25 +819,14 @@ index d95cef905..2d471ec46 100644
|
||||
char *display_name;
|
||||
char *display_hostname;
|
||||
char *display_device;
|
||||
@@ -319,312 +320,328 @@ on_establish_credentials_cb (GdmDBusWorker *proxy,
|
||||
return;
|
||||
|
||||
self = g_object_ref (conversation->session);
|
||||
service_name = g_strdup (conversation->service_name);
|
||||
|
||||
if (worked) {
|
||||
if (self->user_verifier_interface != NULL) {
|
||||
gdm_dbus_user_verifier_emit_verification_complete (self->user_verifier_interface,
|
||||
service_name);
|
||||
g_signal_emit (self, signals[VERIFICATION_COMPLETE], 0, service_name);
|
||||
}
|
||||
|
||||
switch (self->verification_mode) {
|
||||
case GDM_SESSION_VERIFICATION_MODE_LOGIN:
|
||||
case GDM_SESSION_VERIFICATION_MODE_CHOOSER:
|
||||
gdm_session_open_session (self, service_name);
|
||||
break;
|
||||
@@ -328,309 +329,325 @@ on_establish_credentials_cb (GdmDBusWorker *proxy,
|
||||
case GDM_SESSION_VERIFICATION_MODE_REAUTHENTICATE:
|
||||
if (self->user_verifier_interface != NULL) {
|
||||
gdm_dbus_user_verifier_emit_verification_complete (self->user_verifier_interface,
|
||||
service_name);
|
||||
g_signal_emit (self, signals[VERIFICATION_COMPLETE], 0, service_name);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -849,6 +838,17 @@ index d95cef905..2d471ec46 100644
|
||||
g_object_unref (self);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
supports_session_type (GdmSession *self,
|
||||
const char *session_type)
|
||||
{
|
||||
if (session_type == NULL)
|
||||
return TRUE;
|
||||
|
||||
return g_strv_contains ((const char * const *) self->supported_session_types,
|
||||
session_type);
|
||||
}
|
||||
|
||||
static char **
|
||||
-get_system_session_dirs (GdmSession *self)
|
||||
+get_system_session_dirs (GdmSession *self,
|
||||
@ -856,7 +856,7 @@ index d95cef905..2d471ec46 100644
|
||||
{
|
||||
GArray *search_array = NULL;
|
||||
char **search_dirs;
|
||||
int i;
|
||||
int i, j;
|
||||
const gchar * const *system_data_dirs = g_get_system_data_dirs ();
|
||||
|
||||
static const char *x_search_dirs[] = {
|
||||
@ -870,40 +870,33 @@ index d95cef905..2d471ec46 100644
|
||||
|
||||
search_array = g_array_new (TRUE, TRUE, sizeof (char *));
|
||||
|
||||
- for (i = 0; system_data_dirs[i]; i++) {
|
||||
- gchar *dir = g_build_filename (system_data_dirs[i], "xsessions", NULL);
|
||||
- g_array_append_val (search_array, dir);
|
||||
- }
|
||||
+ if (type == NULL || strcmp (type, "x11") == 0) {
|
||||
+ for (i = 0; system_data_dirs[i]; i++) {
|
||||
+ gchar *dir = g_build_filename (system_data_dirs[i], "xsessions", NULL);
|
||||
+ g_array_append_val (search_array, dir);
|
||||
+ }
|
||||
for (j = 0; self->supported_session_types[j] != NULL; j++) {
|
||||
const char *supported_type = self->supported_session_types[j];
|
||||
|
||||
- g_array_append_vals (search_array, x_search_dirs, G_N_ELEMENTS (x_search_dirs));
|
||||
+ g_array_append_vals (search_array, x_search_dirs, G_N_ELEMENTS (x_search_dirs));
|
||||
+ }
|
||||
- if (g_str_equal (supported_type, "x11")) {
|
||||
+ if (g_str_equal (supported_type, "x11") ||
|
||||
+ (type == NULL || g_str_equal (type, supported_type))) {
|
||||
for (i = 0; system_data_dirs[i]; i++) {
|
||||
gchar *dir = g_build_filename (system_data_dirs[i], "xsessions", NULL);
|
||||
g_array_append_val (search_array, dir);
|
||||
}
|
||||
|
||||
g_array_append_vals (search_array, x_search_dirs, G_N_ELEMENTS (x_search_dirs));
|
||||
}
|
||||
|
||||
#ifdef ENABLE_WAYLAND_SUPPORT
|
||||
- if (!self->ignore_wayland) {
|
||||
+ if ((!self->ignore_wayland && type == NULL) || g_strcmp0 (type, "wayland") == 0) {
|
||||
#ifdef ENABLE_USER_DISPLAY_SERVER
|
||||
g_array_prepend_val (search_array, wayland_search_dir);
|
||||
- if (g_str_equal (supported_type, "wayland")) {
|
||||
+ if (g_str_equal (supported_type, "wayland") ||
|
||||
+ (type == NULL || g_str_equal (type, supported_type))) {
|
||||
for (i = 0; system_data_dirs[i]; i++) {
|
||||
gchar *dir = g_build_filename (system_data_dirs[i], "wayland-sessions", NULL);
|
||||
g_array_append_val (search_array, dir);
|
||||
}
|
||||
|
||||
for (i = 0; system_data_dirs[i]; i++) {
|
||||
gchar *dir = g_build_filename (system_data_dirs[i], "wayland-sessions", NULL);
|
||||
g_array_insert_val (search_array, i, dir);
|
||||
g_array_append_val (search_array, wayland_search_dir);
|
||||
}
|
||||
#else
|
||||
for (i = 0; system_data_dirs[i]; i++) {
|
||||
gchar *dir = g_build_filename (system_data_dirs[i], "wayland-sessions", NULL);
|
||||
g_array_append_val (search_array, dir);
|
||||
}
|
||||
|
||||
g_array_append_val (search_array, wayland_search_dir);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
search_dirs = g_strdupv ((char **) search_array->data);
|
||||
|
||||
@ -983,9 +976,9 @@ index d95cef905..2d471ec46 100644
|
||||
*command = NULL;
|
||||
}
|
||||
|
||||
+ if (self->ignore_wayland && g_strcmp0 (type, "wayland") == 0) {
|
||||
+ g_debug ("GdmSession: ignoring wayland session command request for file '%s'",
|
||||
+ file);
|
||||
+ if (!supports_session_type (self, type)) {
|
||||
+ g_debug ("GdmSession: ignoring %s session command request for file '%s'",
|
||||
+ type, file);
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
@ -1165,7 +1158,7 @@ index d95cef905..2d471ec46 100644
|
||||
|
||||
out:
|
||||
return self->fallback_session_name;
|
||||
@@ -643,60 +660,63 @@ get_default_session_name (GdmSession *self)
|
||||
@@ -649,60 +666,63 @@ get_default_session_name (GdmSession *self)
|
||||
static void
|
||||
gdm_session_defaults_changed (GdmSession *self)
|
||||
{
|
||||
@ -1229,7 +1222,7 @@ index d95cef905..2d471ec46 100644
|
||||
|
||||
static void
|
||||
set_pending_query (GdmSessionConversation *conversation,
|
||||
@@ -963,80 +983,91 @@ worker_on_reauthenticated (GdmDBusWorker *worker,
|
||||
@@ -969,85 +989,96 @@ worker_on_reauthenticated (GdmDBusWorker *worker,
|
||||
GdmSession *self = conversation->session;
|
||||
g_debug ("GdmSession: Emitting 'reauthenticated' signal ");
|
||||
g_signal_emit (self, signals[REAUTHENTICATED], 0, service_name);
|
||||
@ -1266,19 +1259,24 @@ index d95cef905..2d471ec46 100644
|
||||
g_debug ("GdmSession: not using invalid .dmrc session: %s", session_name);
|
||||
g_free (self->saved_session);
|
||||
self->saved_session = NULL;
|
||||
} else if (strcmp (session_name,
|
||||
get_default_session_name (self)) != 0) {
|
||||
g_free (self->saved_session);
|
||||
self->saved_session = g_strdup (session_name);
|
||||
update_session_type (self);
|
||||
} else {
|
||||
if (strcmp (session_name,
|
||||
get_default_session_name (self)) != 0) {
|
||||
g_free (self->saved_session);
|
||||
self->saved_session = g_strdup (session_name);
|
||||
|
||||
if (self->greeter_interface != NULL) {
|
||||
gdm_dbus_greeter_emit_default_session_name_changed (self->greeter_interface,
|
||||
session_name);
|
||||
if (self->greeter_interface != NULL) {
|
||||
gdm_dbus_greeter_emit_default_session_name_changed (self->greeter_interface,
|
||||
session_name);
|
||||
}
|
||||
}
|
||||
if (self->saved_session_type != NULL)
|
||||
set_session_type (self, self->saved_session_type);
|
||||
else
|
||||
update_session_type (self);
|
||||
}
|
||||
|
||||
update_session_type (self);
|
||||
|
||||
}
|
||||
|
||||
+static void
|
||||
@ -1322,7 +1320,7 @@ index d95cef905..2d471ec46 100644
|
||||
uid_t connecting_user;
|
||||
|
||||
connecting_user = g_credentials_get_unix_user (credentials, NULL);
|
||||
@@ -1116,60 +1147,63 @@ register_worker (GdmDBusWorkerManager *worker_manager_interface,
|
||||
@@ -1127,60 +1158,63 @@ register_worker (GdmDBusWorkerManager *worker_manager_interface,
|
||||
g_dbus_method_invocation_return_value (invocation, NULL);
|
||||
|
||||
conversation->worker_proxy = gdm_dbus_worker_proxy_new_sync (connection,
|
||||
@ -1386,7 +1384,7 @@ index d95cef905..2d471ec46 100644
|
||||
g_debug ("GdmSession: Conversation started");
|
||||
|
||||
return TRUE;
|
||||
@@ -1912,60 +1946,63 @@ free_conversation (GdmSessionConversation *conversation)
|
||||
@@ -1923,60 +1957,63 @@ free_conversation (GdmSessionConversation *conversation)
|
||||
close_conversation (conversation);
|
||||
|
||||
if (conversation->job != NULL) {
|
||||
@ -1450,7 +1448,7 @@ index d95cef905..2d471ec46 100644
|
||||
error = NULL;
|
||||
if (!g_file_get_contents (config_file, &contents, &length, &error)) {
|
||||
g_debug ("Failed to parse '%s': %s",
|
||||
@@ -2520,83 +2557,83 @@ gdm_session_send_environment (GdmSession *self,
|
||||
@@ -2535,83 +2572,83 @@ gdm_session_send_environment (GdmSession *self,
|
||||
g_return_if_fail (GDM_IS_SESSION (self));
|
||||
|
||||
conversation = find_conversation_by_name (self, service_name);
|
||||
@ -1536,8 +1534,7 @@ index d95cef905..2d471ec46 100644
|
||||
g_strdup (value));
|
||||
}
|
||||
|
||||
@@ -3165,85 +3202,87 @@ gdm_session_get_conversation_session_id (GdmSession *self,
|
||||
|
||||
@@ -3181,148 +3218,150 @@ gdm_session_get_conversation_session_id (GdmSession *self,
|
||||
conversation = find_conversation_by_name (self, service_name);
|
||||
|
||||
if (conversation == NULL) {
|
||||
@ -1567,11 +1564,16 @@ index d95cef905..2d471ec46 100644
|
||||
|
||||
filename = get_session_filename (self);
|
||||
|
||||
- key_file = load_key_file_for_file (self, filename, &full_path);
|
||||
+ key_file = load_key_file_for_file (self, filename, "wayland", &full_path);
|
||||
if (supports_session_type (self, "wayland")) {
|
||||
- key_file = load_key_file_for_file (self, filename, &full_path);
|
||||
+ key_file = load_key_file_for_file (self, filename, NULL, &full_path);
|
||||
|
||||
if (key_file == NULL) {
|
||||
goto out;
|
||||
- if (key_file == NULL) {
|
||||
- goto out;
|
||||
- }
|
||||
+ if (key_file == NULL) {
|
||||
+ goto out;
|
||||
+ }
|
||||
}
|
||||
|
||||
if (full_path != NULL && strstr (full_path, "/wayland-sessions/") != NULL) {
|
||||
@ -1593,7 +1595,7 @@ index d95cef905..2d471ec46 100644
|
||||
- gboolean is_wayland_session;
|
||||
+ gboolean is_wayland_session = FALSE;
|
||||
+
|
||||
+ if (!self->ignore_wayland)
|
||||
+ if (supports_session_type (self, "wayland"))
|
||||
+ is_wayland_session = gdm_session_is_wayland_session (self);
|
||||
|
||||
- is_wayland_session = gdm_session_is_wayland_session (self);
|
||||
@ -1618,7 +1620,8 @@ index d95cef905..2d471ec46 100644
|
||||
|
||||
filename = get_session_filename (self);
|
||||
|
||||
key_file = load_key_file_for_file (self, filename, NULL);
|
||||
- key_file = load_key_file_for_file (self, filename, NULL);
|
||||
+ key_file = load_key_file_for_file (self, filename, NULL, NULL);
|
||||
|
||||
session_registers = g_key_file_get_boolean (key_file,
|
||||
G_KEY_FILE_DESKTOP_GROUP,
|
||||
@ -1627,7 +1630,7 @@ index d95cef905..2d471ec46 100644
|
||||
if (!session_registers &&
|
||||
error != NULL &&
|
||||
!g_error_matches (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_KEY_NOT_FOUND)) {
|
||||
@@ -3251,61 +3290,61 @@ gdm_session_session_registers (GdmSession *self)
|
||||
g_warning ("GdmSession: Couldn't read session file '%s'", filename);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -1691,5 +1694,5 @@ index d95cef905..2d471ec46 100644
|
||||
self->display_seat_id);
|
||||
|
||||
--
|
||||
2.31.1
|
||||
2.33.1
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
From 35e2d1d298607c3fdb2cbbfb1cf878dc9cbbf546 Mon Sep 17 00:00:00 2001
|
||||
From de95917e0e9d142703a86f94961ef9fd4151739d Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Mon, 20 Aug 2018 14:30:59 -0400
|
||||
Subject: [PATCH 3/5] daemon: save os-release in accountsservice
|
||||
Subject: [PATCH 3/4] daemon: save os-release in accountsservice
|
||||
|
||||
It can be useful to know what OS a user was running
|
||||
when they logged in (to detect upgrades).
|
||||
@ -10,13 +10,14 @@ This commit saves that information in accountsservice.
|
||||
---
|
||||
.../com.redhat.AccountsServiceUser.System.xml | 10 ++
|
||||
daemon/gdm-session-settings.c | 98 +++++++++++++++++++
|
||||
daemon/gdm-session.c | 4 +-
|
||||
daemon/meson.build | 8 ++
|
||||
3 files changed, 116 insertions(+)
|
||||
4 files changed, 118 insertions(+), 2 deletions(-)
|
||||
create mode 100644 daemon/com.redhat.AccountsServiceUser.System.xml
|
||||
|
||||
diff --git a/daemon/com.redhat.AccountsServiceUser.System.xml b/daemon/com.redhat.AccountsServiceUser.System.xml
|
||||
new file mode 100644
|
||||
index 000000000..67f5f302c
|
||||
index 00000000..67f5f302
|
||||
--- /dev/null
|
||||
+++ b/daemon/com.redhat.AccountsServiceUser.System.xml
|
||||
@@ -0,0 +1,10 @@
|
||||
@ -31,7 +32,7 @@ index 000000000..67f5f302c
|
||||
+ </interface>
|
||||
+</node>
|
||||
diff --git a/daemon/gdm-session-settings.c b/daemon/gdm-session-settings.c
|
||||
index 5b64cb65b..5bcfdc14f 100644
|
||||
index f2b1addd..a4b7f1a6 100644
|
||||
--- a/daemon/gdm-session-settings.c
|
||||
+++ b/daemon/gdm-session-settings.c
|
||||
@@ -1,70 +1,77 @@
|
||||
@ -232,9 +233,9 @@ index 5b64cb65b..5bcfdc14f 100644
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
/* if the user doesn't have saved state, they don't have any settings worth reading */
|
||||
if (!act_user_get_saved (settings->priv->user))
|
||||
goto out;
|
||||
|
||||
|
||||
|
||||
|
||||
session_type = act_user_get_session_type (settings->priv->user);
|
||||
session_name = act_user_get_session (settings->priv->user);
|
||||
@ -399,8 +400,87 @@ index 5b64cb65b..5bcfdc14f 100644
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
|
||||
index f4d0bef9..d1e2c301 100644
|
||||
--- a/daemon/gdm-session.c
|
||||
+++ b/daemon/gdm-session.c
|
||||
@@ -351,72 +351,72 @@ supports_session_type (GdmSession *self,
|
||||
if (session_type == NULL)
|
||||
return TRUE;
|
||||
|
||||
return g_strv_contains ((const char * const *) self->supported_session_types,
|
||||
session_type);
|
||||
}
|
||||
|
||||
static char **
|
||||
get_system_session_dirs (GdmSession *self,
|
||||
const char *type)
|
||||
{
|
||||
GArray *search_array = NULL;
|
||||
char **search_dirs;
|
||||
int i, j;
|
||||
const gchar * const *system_data_dirs = g_get_system_data_dirs ();
|
||||
|
||||
static const char *x_search_dirs[] = {
|
||||
"/etc/X11/sessions/",
|
||||
DMCONFDIR "/Sessions/",
|
||||
DATADIR "/gdm/BuiltInSessions/",
|
||||
DATADIR "/xsessions/",
|
||||
};
|
||||
|
||||
static const char *wayland_search_dir = DATADIR "/wayland-sessions/";
|
||||
|
||||
search_array = g_array_new (TRUE, TRUE, sizeof (char *));
|
||||
|
||||
for (j = 0; self->supported_session_types[j] != NULL; j++) {
|
||||
const char *supported_type = self->supported_session_types[j];
|
||||
|
||||
- if (g_str_equal (supported_type, "x11") ||
|
||||
+ if (g_str_equal (supported_type, "x11") &&
|
||||
(type == NULL || g_str_equal (type, supported_type))) {
|
||||
for (i = 0; system_data_dirs[i]; i++) {
|
||||
gchar *dir = g_build_filename (system_data_dirs[i], "xsessions", NULL);
|
||||
g_array_append_val (search_array, dir);
|
||||
}
|
||||
|
||||
g_array_append_vals (search_array, x_search_dirs, G_N_ELEMENTS (x_search_dirs));
|
||||
}
|
||||
|
||||
#ifdef ENABLE_WAYLAND_SUPPORT
|
||||
- if (g_str_equal (supported_type, "wayland") ||
|
||||
+ if (g_str_equal (supported_type, "wayland") &&
|
||||
(type == NULL || g_str_equal (type, supported_type))) {
|
||||
for (i = 0; system_data_dirs[i]; i++) {
|
||||
gchar *dir = g_build_filename (system_data_dirs[i], "wayland-sessions", NULL);
|
||||
g_array_append_val (search_array, dir);
|
||||
}
|
||||
|
||||
g_array_append_val (search_array, wayland_search_dir);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
search_dirs = g_strdupv ((char **) search_array->data);
|
||||
|
||||
g_array_free (search_array, TRUE);
|
||||
|
||||
return search_dirs;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_prog_in_path (const char *prog)
|
||||
{
|
||||
char *f;
|
||||
gboolean ret;
|
||||
|
||||
f = g_find_program_in_path (prog);
|
||||
ret = (f != NULL);
|
||||
g_free (f);
|
||||
return ret;
|
||||
}
|
||||
|
||||
diff --git a/daemon/meson.build b/daemon/meson.build
|
||||
index 2e61b6447..71c650398 100644
|
||||
index 2e61b644..71c65039 100644
|
||||
--- a/daemon/meson.build
|
||||
+++ b/daemon/meson.build
|
||||
@@ -15,114 +15,122 @@ local_display_dbus_gen = gnome.gdbus_codegen('gdm-local-display-glue',
|
||||
@ -527,5 +607,5 @@ index 2e61b6447..71c650398 100644
|
||||
|
||||
gdm_session_worker = executable('gdm-session-worker',
|
||||
--
|
||||
2.31.1
|
||||
2.33.1
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 9a2de416bc13fc40a6d7f2e4e6cb9cf64be2854f Mon Sep 17 00:00:00 2001
|
||||
From 64e8db8432158e5115df18a03bb87ecc1d58ae63 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Mon, 11 Feb 2019 10:32:55 -0500
|
||||
Subject: [PATCH 3/3] session: ensure login screen over XDMCP connects to its
|
||||
@ -17,10 +17,10 @@ the session is X11.
|
||||
1 file changed, 19 insertions(+)
|
||||
|
||||
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
|
||||
index c891fb577..d95cef905 100644
|
||||
index 77d6b8ff0..357e4a297 100644
|
||||
--- a/daemon/gdm-session.c
|
||||
+++ b/daemon/gdm-session.c
|
||||
@@ -2686,60 +2686,79 @@ set_up_session_environment (GdmSession *self)
|
||||
@@ -2697,60 +2697,79 @@ set_up_session_environment (GdmSession *self)
|
||||
}
|
||||
|
||||
static void
|
||||
@ -101,5 +101,5 @@ index c891fb577..d95cef905 100644
|
||||
gpointer key, value;
|
||||
|
||||
--
|
||||
2.31.1
|
||||
2.30.1
|
||||
|
||||
|
@ -0,0 +1,122 @@
|
||||
From b5472a30b1a71aec537ac309e2985cbac61b3136 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Tue, 14 Sep 2021 11:00:33 -0400
|
||||
Subject: [PATCH 3/4] xdmcp-display-factory: Set supported session types for
|
||||
XDMCP displays
|
||||
|
||||
The lower levels of GDM now expect the session types supported by a
|
||||
display to be specified up front.
|
||||
|
||||
This commit makes sure XDMCP displays do that.
|
||||
---
|
||||
daemon/gdm-xdmcp-display-factory.c | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/daemon/gdm-xdmcp-display-factory.c b/daemon/gdm-xdmcp-display-factory.c
|
||||
index ce8f026e..abb58fae 100644
|
||||
--- a/daemon/gdm-xdmcp-display-factory.c
|
||||
+++ b/daemon/gdm-xdmcp-display-factory.c
|
||||
@@ -2104,94 +2104,100 @@ on_display_status_changed (GdmDisplay *display,
|
||||
break;
|
||||
case GDM_DISPLAY_MANAGED:
|
||||
if (session != NULL) {
|
||||
g_signal_connect_object (G_OBJECT (session),
|
||||
"client-disconnected",
|
||||
G_CALLBACK (on_client_disconnected),
|
||||
display, G_CONNECT_SWAPPED);
|
||||
g_signal_connect_object (G_OBJECT (session),
|
||||
"disconnected",
|
||||
G_CALLBACK (on_client_disconnected),
|
||||
display, G_CONNECT_SWAPPED);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
break;
|
||||
}
|
||||
|
||||
g_clear_object (&launch_environment);
|
||||
}
|
||||
|
||||
static GdmDisplay *
|
||||
gdm_xdmcp_display_create (GdmXdmcpDisplayFactory *factory,
|
||||
const char *hostname,
|
||||
GdmAddress *address,
|
||||
int displaynum)
|
||||
{
|
||||
GdmDisplay *display;
|
||||
GdmDisplayStore *store;
|
||||
gboolean use_chooser;
|
||||
+ const char *session_types[] = { "x11", NULL };
|
||||
|
||||
g_debug ("GdmXdmcpDisplayFactory: Creating xdmcp display for %s:%d",
|
||||
hostname ? hostname : "(null)", displaynum);
|
||||
|
||||
use_chooser = FALSE;
|
||||
if (factory->honor_indirect) {
|
||||
IndirectClient *ic;
|
||||
|
||||
ic = indirect_client_lookup (factory, address);
|
||||
|
||||
/* This was an indirect thingie and nothing was yet chosen,
|
||||
* use a chooser */
|
||||
if (ic != NULL && ic->chosen_address == NULL) {
|
||||
use_chooser = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if (use_chooser) {
|
||||
display = gdm_xdmcp_chooser_display_new (hostname,
|
||||
displaynum,
|
||||
address,
|
||||
get_next_session_serial (factory));
|
||||
g_signal_connect (display, "hostname-selected", G_CALLBACK (on_hostname_selected), factory);
|
||||
} else {
|
||||
display = gdm_xdmcp_display_new (hostname,
|
||||
displaynum,
|
||||
address,
|
||||
get_next_session_serial (factory));
|
||||
}
|
||||
|
||||
if (display == NULL) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
+ g_object_set (G_OBJECT (display),
|
||||
+ "session-type", session_types[0],
|
||||
+ "supported-session-types", session_types,
|
||||
+ NULL);
|
||||
+
|
||||
if (! gdm_display_prepare (display)) {
|
||||
gdm_display_unmanage (display);
|
||||
g_object_unref (display);
|
||||
display = NULL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
g_signal_connect_after (display,
|
||||
"notify::status",
|
||||
G_CALLBACK (on_display_status_changed),
|
||||
factory);
|
||||
|
||||
store = gdm_display_factory_get_display_store (GDM_DISPLAY_FACTORY (factory));
|
||||
gdm_display_store_add (store, display);
|
||||
|
||||
factory->num_pending_sessions++;
|
||||
out:
|
||||
|
||||
return display;
|
||||
}
|
||||
|
||||
static void
|
||||
gdm_xdmcp_send_accept (GdmXdmcpDisplayFactory *factory,
|
||||
GdmAddress *address,
|
||||
CARD32 session_id,
|
||||
ARRAY8Ptr authentication_name,
|
||||
ARRAY8Ptr authentication_data,
|
||||
ARRAY8Ptr authorization_name,
|
||||
ARRAY8Ptr authorization_data)
|
||||
{
|
||||
--
|
||||
2.34.1
|
||||
|
@ -1,7 +1,7 @@
|
||||
From 234fdc6e4bd4d4c19fefba27495db5bdc9642217 Mon Sep 17 00:00:00 2001
|
||||
From 738a10ca78e154ad4c3df9a1298eaad01516457e Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Mon, 20 Aug 2018 14:30:59 -0400
|
||||
Subject: [PATCH 4/5] daemon: handle upgrades from RHEL 7
|
||||
Subject: [PATCH 4/4] daemon: handle upgrades from RHEL 7
|
||||
|
||||
RHEL 7 users need to stay on X if they were using X,
|
||||
and they need to stay on gnome-classic if they were using
|
||||
@ -12,10 +12,11 @@ or not they were using RHEL 7 and in the event they were
|
||||
try to get the right settings.
|
||||
---
|
||||
daemon/gdm-session-settings.c | 19 +++++++++++++++++++
|
||||
1 file changed, 19 insertions(+)
|
||||
daemon/gdm-session.c | 19 ++++++++-----------
|
||||
2 files changed, 27 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/daemon/gdm-session-settings.c b/daemon/gdm-session-settings.c
|
||||
index 5bcfdc14f..a7eaa8b2f 100644
|
||||
index a4b7f1a6..a84b2ffa 100644
|
||||
--- a/daemon/gdm-session-settings.c
|
||||
+++ b/daemon/gdm-session-settings.c
|
||||
@@ -270,95 +270,114 @@ gdm_session_settings_get_property (GObject *object,
|
||||
@ -79,9 +80,9 @@ index 5bcfdc14f..a7eaa8b2f 100644
|
||||
}
|
||||
}
|
||||
|
||||
/* if the user doesn't have saved state, they don't have any settings worth reading */
|
||||
if (!act_user_get_saved (settings->priv->user))
|
||||
goto out;
|
||||
|
||||
|
||||
|
||||
|
||||
session_type = act_user_get_session_type (settings->priv->user);
|
||||
session_name = act_user_get_session (settings->priv->user);
|
||||
@ -133,6 +134,117 @@ index 5bcfdc14f..a7eaa8b2f 100644
|
||||
G_CALLBACK (on_user_is_loaded_changed),
|
||||
settings);
|
||||
}
|
||||
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
|
||||
index d1e2c301..d4a46d87 100644
|
||||
--- a/daemon/gdm-session.c
|
||||
+++ b/daemon/gdm-session.c
|
||||
@@ -3207,98 +3207,95 @@ gdm_session_get_session_id (GdmSession *self)
|
||||
return conversation->session_id;
|
||||
}
|
||||
|
||||
const char *
|
||||
gdm_session_get_conversation_session_id (GdmSession *self,
|
||||
const char *service_name)
|
||||
{
|
||||
GdmSessionConversation *conversation;
|
||||
|
||||
g_return_val_if_fail (GDM_IS_SESSION (self), NULL);
|
||||
|
||||
conversation = find_conversation_by_name (self, service_name);
|
||||
|
||||
if (conversation == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return conversation->session_id;
|
||||
}
|
||||
|
||||
static char *
|
||||
get_session_filename (GdmSession *self)
|
||||
{
|
||||
return g_strdup_printf ("%s.desktop", get_session_name (self));
|
||||
}
|
||||
|
||||
#ifdef ENABLE_WAYLAND_SUPPORT
|
||||
static gboolean
|
||||
gdm_session_is_wayland_session (GdmSession *self)
|
||||
{
|
||||
- GKeyFile *key_file;
|
||||
+ g_autoptr (GKeyFile) key_file = NULL;
|
||||
gboolean is_wayland_session = FALSE;
|
||||
- char *filename;
|
||||
- char *full_path = NULL;
|
||||
+ g_autofree char *filename = NULL;
|
||||
+ g_autofree char *full_path = NULL;
|
||||
|
||||
g_return_val_if_fail (self != NULL, FALSE);
|
||||
g_return_val_if_fail (GDM_IS_SESSION (self), FALSE);
|
||||
|
||||
filename = get_session_filename (self);
|
||||
|
||||
if (supports_session_type (self, "wayland")) {
|
||||
key_file = load_key_file_for_file (self, filename, NULL, &full_path);
|
||||
|
||||
if (key_file == NULL) {
|
||||
goto out;
|
||||
}
|
||||
- }
|
||||
|
||||
- if (full_path != NULL && strstr (full_path, "/wayland-sessions/") != NULL) {
|
||||
- is_wayland_session = TRUE;
|
||||
+ if (full_path != NULL && strstr (full_path, "/wayland-sessions/") != NULL) {
|
||||
+ is_wayland_session = TRUE;
|
||||
+ }
|
||||
}
|
||||
- g_debug ("GdmSession: checking if file '%s' is wayland session: %s", filename, is_wayland_session? "yes" : "no");
|
||||
|
||||
out:
|
||||
- g_clear_pointer (&key_file, g_key_file_free);
|
||||
- g_free (filename);
|
||||
+ g_debug ("GdmSession: checking if file '%s' is wayland session: %s", filename, is_wayland_session? "yes" : "no");
|
||||
return is_wayland_session;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
update_session_type (GdmSession *self)
|
||||
{
|
||||
#ifdef ENABLE_WAYLAND_SUPPORT
|
||||
gboolean is_wayland_session = FALSE;
|
||||
|
||||
- if (supports_session_type (self, "wayland"))
|
||||
- is_wayland_session = gdm_session_is_wayland_session (self);
|
||||
+ is_wayland_session = gdm_session_is_wayland_session (self);
|
||||
|
||||
if (is_wayland_session) {
|
||||
set_session_type (self, "wayland");
|
||||
} else {
|
||||
set_session_type (self, NULL);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdm_session_session_registers (GdmSession *self)
|
||||
{
|
||||
g_autoptr(GError) error = NULL;
|
||||
g_autoptr(GKeyFile) key_file = NULL;
|
||||
gboolean session_registers = FALSE;
|
||||
g_autofree char *filename = NULL;
|
||||
|
||||
g_return_val_if_fail (self != NULL, FALSE);
|
||||
g_return_val_if_fail (GDM_IS_SESSION (self), FALSE);
|
||||
|
||||
filename = get_session_filename (self);
|
||||
|
||||
key_file = load_key_file_for_file (self, filename, NULL, NULL);
|
||||
|
||||
session_registers = g_key_file_get_boolean (key_file,
|
||||
G_KEY_FILE_DESKTOP_GROUP,
|
||||
"X-GDM-SessionRegisters",
|
||||
&error);
|
||||
if (!session_registers &&
|
||||
error != NULL &&
|
||||
--
|
||||
2.31.1
|
||||
2.33.1
|
||||
|
||||
|
@ -1,25 +1,39 @@
|
||||
From 89ec6e57e452c04ffc43ae224052c7ddeea66676 Mon Sep 17 00:00:00 2001
|
||||
From dfca67899ea33da08d3aa9e84c1b4487991adad0 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Mon, 29 Oct 2018 06:57:59 -0400
|
||||
Subject: [PATCH] local-display-factory: pause for a few seconds before falling
|
||||
back to X
|
||||
Date: Thu, 7 Oct 2021 15:34:27 -0400
|
||||
Subject: [PATCH 4/4] local-display-factory: Don't crash if Xorg and Wayland
|
||||
are both unavailable
|
||||
|
||||
logind currently gets confused if a session is started immediately as
|
||||
one is shutting down.
|
||||
At the moment if Wayland doesn't work, the login screen will fall back
|
||||
to Xorg, and if Xorg doesn't work the login screen will fall back to
|
||||
Wayland.
|
||||
|
||||
Workaround this problem by adding an artificial delay when falling
|
||||
back to X.
|
||||
But if the fall back choice is disabled explicitly, GDM will just crash.
|
||||
|
||||
http://bugzilla.redhat.com/1643874
|
||||
This commit fixes the crash.
|
||||
|
||||
Closes: https://gitlab.gnome.org/GNOME/gdm/-/issues/739
|
||||
---
|
||||
daemon/gdm-local-display-factory.c | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
daemon/gdm-local-display-factory.c | 9 +++++++--
|
||||
1 file changed, 7 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c
|
||||
index 8a4ef06cd..8554a0442 100644
|
||||
index eba38671..120847f9 100644
|
||||
--- a/daemon/gdm-local-display-factory.c
|
||||
+++ b/daemon/gdm-local-display-factory.c
|
||||
@@ -488,60 +488,65 @@ ensure_display_for_seat (GdmLocalDisplayFactory *factory,
|
||||
@@ -651,62 +651,67 @@ ensure_display_for_seat (GdmLocalDisplayFactory *factory,
|
||||
gdm_settings_direct_get_boolean (GDM_KEY_XORG_ENABLE, &xorg_enabled);
|
||||
|
||||
preferred_display_server = get_preferred_display_server (factory);
|
||||
|
||||
if (g_strcmp0 (preferred_display_server, "none") == 0) {
|
||||
g_debug ("GdmLocalDisplayFactory: Preferred display server is none, so not creating display");
|
||||
return;
|
||||
}
|
||||
|
||||
ret = sd_seat_can_graphical (seat_id);
|
||||
|
||||
if (ret < 0) {
|
||||
g_critical ("Failed to query CanGraphical information for seat %s", seat_id);
|
||||
return;
|
||||
}
|
||||
@ -35,26 +49,25 @@ index 8a4ef06cd..8554a0442 100644
|
||||
if (g_strcmp0 (seat_id, "seat0") == 0) {
|
||||
is_seat0 = TRUE;
|
||||
|
||||
/* If we've failed, or are explicitly told to, fall back to legacy X11 support
|
||||
*/
|
||||
if (factory->num_failures > 0 || !gdm_local_display_factory_use_wayland ()) {
|
||||
session_type = NULL;
|
||||
g_debug ("GdmLocalDisplayFactory: New displays on seat0 will use X11 fallback");
|
||||
+
|
||||
+ /* workaround logind race for now
|
||||
+ * bug 1643874
|
||||
+ */
|
||||
+ g_usleep (2 * G_USEC_PER_SEC);
|
||||
} else {
|
||||
g_debug ("GdmLocalDisplayFactory: New displays on seat0 will use wayland");
|
||||
}
|
||||
falling_back = factory->num_failures > 0;
|
||||
session_types = gdm_local_display_factory_get_session_types (factory, falling_back);
|
||||
|
||||
- g_debug ("GdmLocalDisplayFactory: New displays on seat0 will use %s%s",
|
||||
- session_types[0], falling_back? " fallback" : "");
|
||||
+ if (session_types == NULL) {
|
||||
+ g_debug ("GdmLocalDisplayFactory: Both Wayland and Xorg are unavailable");
|
||||
+ seat_supports_graphics = FALSE;
|
||||
+ } else {
|
||||
+ g_debug ("GdmLocalDisplayFactory: New displays on seat0 will use %s%s",
|
||||
+ session_types[0], falling_back? " fallback" : "");
|
||||
+ }
|
||||
} else {
|
||||
is_seat0 = FALSE;
|
||||
|
||||
g_debug ("GdmLocalDisplayFactory: New displays on seat %s will use X11 fallback", seat_id);
|
||||
/* Force legacy X11 for all auxiliary seats */
|
||||
seat_supports_graphics = TRUE;
|
||||
session_type = NULL;
|
||||
session_types = g_strdupv ((char **) legacy_session_types);
|
||||
}
|
||||
|
||||
/* For seat0, we have a fallback logic to still try starting it after
|
||||
@ -78,13 +91,6 @@ index 8a4ef06cd..8554a0442 100644
|
||||
if (factory->seat0_graphics_check_timeout_id == 0) {
|
||||
g_debug ("GdmLocalDisplayFactory: seat0 doesn't yet support graphics. Waiting %d seconds to try again.", SEAT0_GRAPHICS_CHECK_TIMEOUT);
|
||||
factory->seat0_graphics_check_timeout_id = g_timeout_add_seconds (SEAT0_GRAPHICS_CHECK_TIMEOUT,
|
||||
on_seat0_graphics_check_timeout,
|
||||
factory);
|
||||
|
||||
} else {
|
||||
/* It is not yet time to force X11 fallback. */
|
||||
g_debug ("GdmLocalDisplayFactory: seat0 display requested when there is no graphics support before graphics check timeout.");
|
||||
}
|
||||
--
|
||||
2.31.1
|
||||
2.34.1
|
||||
|
@ -1,221 +0,0 @@
|
||||
From 4862efc8bb38e97a785bd9c368d9b701c2acba68 Mon Sep 17 00:00:00 2001
|
||||
From: Ray Strode <rstrode@redhat.com>
|
||||
Date: Sun, 15 Dec 2019 14:51:44 -0500
|
||||
Subject: [PATCH 5/5] daemon: fix wayland detection when deciding to bypass
|
||||
Xsession
|
||||
|
||||
At the moment if there's a session file with the same name in
|
||||
both /usr/share/xsessions and /usr/share/wayland-sessions, GDM
|
||||
will think the wayland is getting used when deciding whether or
|
||||
not to bypass the /etc/gdm/Xsession script, even if wayland is
|
||||
explicitly being ignored.
|
||||
|
||||
This commit fixes the check.
|
||||
---
|
||||
daemon/gdm-session.c | 31 +++++++++++++++----------------
|
||||
1 file changed, 15 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
|
||||
index 2d471ec46..38a32fdab 100644
|
||||
--- a/daemon/gdm-session.c
|
||||
+++ b/daemon/gdm-session.c
|
||||
@@ -2898,61 +2898,61 @@ gdm_session_start_session (GdmSession *self,
|
||||
char *command;
|
||||
char *program;
|
||||
gboolean register_session;
|
||||
|
||||
g_return_if_fail (GDM_IS_SESSION (self));
|
||||
g_return_if_fail (self->session_conversation == NULL);
|
||||
|
||||
conversation = find_conversation_by_name (self, service_name);
|
||||
|
||||
if (conversation == NULL) {
|
||||
g_warning ("GdmSession: Tried to start session of "
|
||||
"nonexistent conversation %s", service_name);
|
||||
return;
|
||||
}
|
||||
|
||||
stop_all_other_conversations (self, conversation, FALSE);
|
||||
|
||||
display_mode = gdm_session_get_display_mode (self);
|
||||
|
||||
#ifdef ENABLE_WAYLAND_SUPPORT
|
||||
is_x11 = g_strcmp0 (self->session_type, "wayland") != 0;
|
||||
#endif
|
||||
|
||||
if (display_mode == GDM_SESSION_DISPLAY_MODE_LOGIND_MANAGED ||
|
||||
display_mode == GDM_SESSION_DISPLAY_MODE_NEW_VT) {
|
||||
run_launcher = TRUE;
|
||||
}
|
||||
|
||||
register_session = !gdm_session_session_registers (self);
|
||||
|
||||
- if (g_strcmp0 (priv->display_seat_id, "seat0") != 0 && !run_launcher) {
|
||||
+ if (g_strcmp0 (self->display_seat_id, "seat0") != 0 && !run_launcher) {
|
||||
run_separate_bus = TRUE;
|
||||
}
|
||||
|
||||
if (self->selected_program == NULL) {
|
||||
gboolean run_xsession_script;
|
||||
|
||||
command = get_session_command (self);
|
||||
|
||||
run_xsession_script = !gdm_session_bypasses_xsession (self);
|
||||
|
||||
if (self->display_is_local) {
|
||||
gboolean disallow_tcp = TRUE;
|
||||
gdm_settings_direct_get_boolean (GDM_KEY_DISALLOW_TCP, &disallow_tcp);
|
||||
allow_remote_connections = !disallow_tcp;
|
||||
} else {
|
||||
allow_remote_connections = TRUE;
|
||||
}
|
||||
|
||||
if (run_launcher) {
|
||||
if (is_x11) {
|
||||
program = g_strdup_printf (LIBEXECDIR "/gdm-x-session %s%s %s\"%s\"",
|
||||
register_session ? "--register-session " : "",
|
||||
run_xsession_script? "--run-script " : "",
|
||||
allow_remote_connections? "--allow-remote-connections " : "",
|
||||
command);
|
||||
} else {
|
||||
program = g_strdup_printf (LIBEXECDIR "/gdm-wayland-session %s\"%s\"",
|
||||
register_session ? "--register-session " : "",
|
||||
command);
|
||||
}
|
||||
@@ -3192,119 +3192,118 @@ gdm_session_get_session_id (GdmSession *self)
|
||||
return conversation->session_id;
|
||||
}
|
||||
|
||||
const char *
|
||||
gdm_session_get_conversation_session_id (GdmSession *self,
|
||||
const char *service_name)
|
||||
{
|
||||
GdmSessionConversation *conversation;
|
||||
|
||||
g_return_val_if_fail (GDM_IS_SESSION (self), NULL);
|
||||
|
||||
conversation = find_conversation_by_name (self, service_name);
|
||||
|
||||
if (conversation == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return conversation->session_id;
|
||||
}
|
||||
|
||||
static char *
|
||||
get_session_filename (GdmSession *self)
|
||||
{
|
||||
return g_strdup_printf ("%s.desktop", get_session_name (self));
|
||||
}
|
||||
|
||||
#ifdef ENABLE_WAYLAND_SUPPORT
|
||||
static gboolean
|
||||
gdm_session_is_wayland_session (GdmSession *self)
|
||||
{
|
||||
- GKeyFile *key_file;
|
||||
+ g_autoptr (GKeyFile) key_file = NULL;
|
||||
gboolean is_wayland_session = FALSE;
|
||||
- char *filename;
|
||||
- char *full_path = NULL;
|
||||
+ g_autofree char *filename = NULL;
|
||||
+ g_autofree char *full_path = NULL;
|
||||
|
||||
g_return_val_if_fail (self != NULL, FALSE);
|
||||
g_return_val_if_fail (GDM_IS_SESSION (self), FALSE);
|
||||
|
||||
filename = get_session_filename (self);
|
||||
|
||||
- key_file = load_key_file_for_file (self, filename, "wayland", &full_path);
|
||||
+ if (!self->ignore_wayland) {
|
||||
+ key_file = load_key_file_for_file (self, filename, "wayland", &full_path);
|
||||
|
||||
- if (key_file == NULL) {
|
||||
- goto out;
|
||||
- }
|
||||
+ if (key_file == NULL) {
|
||||
+ goto out;
|
||||
+ }
|
||||
|
||||
- if (full_path != NULL && strstr (full_path, "/wayland-sessions/") != NULL) {
|
||||
- is_wayland_session = TRUE;
|
||||
+ if (full_path != NULL && strstr (full_path, "/wayland-sessions/") != NULL) {
|
||||
+ is_wayland_session = TRUE;
|
||||
+ }
|
||||
}
|
||||
- g_debug ("GdmSession: checking if file '%s' is wayland session: %s", filename, is_wayland_session? "yes" : "no");
|
||||
|
||||
out:
|
||||
- g_clear_pointer (&key_file, g_key_file_free);
|
||||
- g_free (filename);
|
||||
+ g_debug ("GdmSession: checking if file '%s' is wayland session: %s", filename, is_wayland_session? "yes" : "no");
|
||||
return is_wayland_session;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
update_session_type (GdmSession *self)
|
||||
{
|
||||
#ifdef ENABLE_WAYLAND_SUPPORT
|
||||
gboolean is_wayland_session = FALSE;
|
||||
|
||||
- if (!self->ignore_wayland)
|
||||
- is_wayland_session = gdm_session_is_wayland_session (self);
|
||||
+ is_wayland_session = gdm_session_is_wayland_session (self);
|
||||
|
||||
if (is_wayland_session) {
|
||||
set_session_type (self, "wayland");
|
||||
} else {
|
||||
set_session_type (self, NULL);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdm_session_session_registers (GdmSession *self)
|
||||
{
|
||||
g_autoptr(GError) error = NULL;
|
||||
g_autoptr(GKeyFile) key_file = NULL;
|
||||
gboolean session_registers = FALSE;
|
||||
g_autofree char *filename = NULL;
|
||||
|
||||
g_return_val_if_fail (self != NULL, FALSE);
|
||||
g_return_val_if_fail (GDM_IS_SESSION (self), FALSE);
|
||||
|
||||
filename = get_session_filename (self);
|
||||
|
||||
- key_file = load_key_file_for_file (self, filename, NULL);
|
||||
+ key_file = load_key_file_for_file (self, filename, NULL, NULL);
|
||||
|
||||
session_registers = g_key_file_get_boolean (key_file,
|
||||
G_KEY_FILE_DESKTOP_GROUP,
|
||||
"X-GDM-SessionRegisters",
|
||||
&error);
|
||||
if (!session_registers &&
|
||||
error != NULL &&
|
||||
!g_error_matches (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_KEY_NOT_FOUND)) {
|
||||
g_warning ("GdmSession: Couldn't read session file '%s'", filename);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
g_debug ("GdmSession: '%s' %s self", filename,
|
||||
session_registers ? "registers" : "does not register");
|
||||
|
||||
return session_registers;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdm_session_bypasses_xsession (GdmSession *self)
|
||||
{
|
||||
GError *error;
|
||||
GKeyFile *key_file;
|
||||
gboolean res;
|
||||
gboolean bypasses_xsession = FALSE;
|
||||
char *filename = NULL;
|
||||
|
||||
g_return_val_if_fail (self != NULL, FALSE);
|
||||
g_return_val_if_fail (GDM_IS_SESSION (self), FALSE);
|
||||
|
||||
--
|
||||
2.31.1
|
||||
|
@ -3,7 +3,6 @@ load-module module-card-restore
|
||||
load-module module-udev-detect
|
||||
load-module module-native-protocol-unix
|
||||
load-module module-default-device-restore
|
||||
load-module module-rescue-streams
|
||||
load-module module-always-sink
|
||||
load-module module-intended-roles
|
||||
load-module module-suspend-on-idle
|
||||
|
118
SPECS/gdm.spec
118
SPECS/gdm.spec
@ -12,7 +12,7 @@
|
||||
Name: gdm
|
||||
Epoch: 1
|
||||
Version: 40.0
|
||||
Release: 2%{?dist}
|
||||
Release: 27%{?dist}
|
||||
Summary: The GNOME Display Manager
|
||||
|
||||
License: GPLv2+
|
||||
@ -20,6 +20,12 @@ URL: https://wiki.gnome.org/Projects/GDM
|
||||
Source0: http://download.gnome.org/sources/gdm/40/gdm-%{version}.tar.xz
|
||||
Source1: org.gnome.login-screen.gschema.override
|
||||
|
||||
# Lets customers using vendor nvidia driver pick wayland sessions from the login screen
|
||||
Patch10001: 0001-local-display-factory-Provide-more-flexibility-for-c.patch
|
||||
Patch10002: 0002-libgdm-Sort-session-list.patch
|
||||
Patch10003: 0003-xdmcp-display-factory-Set-supported-session-types-fo.patch
|
||||
Patch10004: 0004-local-display-factory-Don-t-crash-if-Xorg-and-Waylan.patch
|
||||
|
||||
# Race fix
|
||||
Patch40001: 0001-display-Handle-failure-before-display-registration.patch
|
||||
|
||||
@ -34,8 +40,31 @@ Patch60003: 0003-session-ensure-login-screen-over-XDMCP-connects-to-i.patch
|
||||
# Upstream change that's moderately risky so revert it
|
||||
Patch70001: 0001-Revert-gdm-wayland-x-session-don-t-overwrite-user-en.patch
|
||||
|
||||
# Crash fix
|
||||
Patch80001: 0001-local-display-factory-Don-t-try-to-respawn-displays-.patch
|
||||
|
||||
# VT handling fix from upstream
|
||||
Patch90001: 0001-session-worker-Set-session_vt-0-out-of-pam-uninitial.patch
|
||||
|
||||
# Wayland fix from upstream
|
||||
Patch100001: 0001-daemon-Infer-session-type-from-desktop-file-if-user-.patch
|
||||
|
||||
# Fix DisallowTcp=false from upstream
|
||||
Patch110001: 0001-meson-Fix-detection-of-Xorg-versions-that-need-liste.patch
|
||||
Patch110002: 0002-daemon-Support-X-servers-built-with-Dlisten_tcp-true.patch
|
||||
|
||||
# Fix btmp accounting
|
||||
Patch120001: 0001-meson-set-D_GNU_SOURCE-for-updwtmpx.patch
|
||||
Patch120002: 0002-manager-Fix-btmp-record-accounting.patch
|
||||
|
||||
# Fix status error when stoppping gdm quickly after starting it
|
||||
Patch130001: 0001-daemon-Don-t-error-on-shutdown.patch
|
||||
|
||||
# Fix LUKS password propagation
|
||||
Patch140001: 0001-build-Support-keyutils-1.5.11-and-older.patch
|
||||
Patch140002: 0002-pam_gdm-Use-the-last-cryptsetup-password-instead-of-.patch
|
||||
|
||||
# Non-upstreamable workarounds
|
||||
Patch66610001: 0001-local-display-factory-pause-for-a-few-seconds-before.patch
|
||||
Patch66620001: 0001-data-reap-gdm-sessions-on-shutdown.patch
|
||||
|
||||
# Non-upstreamable integration patches
|
||||
@ -45,12 +74,14 @@ Patch99920001: 0001-worker-don-t-load-user-settings-for-program-sessions.patch
|
||||
Patch99920002: 0002-session-support-new-accountsservice-Session-and-Sess.patch
|
||||
Patch99920003: 0003-daemon-save-os-release-in-accountsservice.patch
|
||||
Patch99920004: 0004-daemon-handle-upgrades-from-RHEL-7.patch
|
||||
Patch99920005: 0005-daemon-fix-wayland-detection-when-deciding-to-bypass.patch
|
||||
|
||||
Patch99920006: 0001-data-Disable-network-configuration-on-login-screen.patch
|
||||
|
||||
Patch99930001: 0001-data-add-system-dconf-databases-to-gdm-profile.patch
|
||||
|
||||
Patch99940001: 0001-data-disable-wayland-on-certain-hardware.patch
|
||||
|
||||
|
||||
BuildRequires: accountsservice-devel
|
||||
BuildRequires: audit-libs-devel >= %{libauditver}
|
||||
BuildRequires: dconf
|
||||
@ -108,7 +139,7 @@ Requires: libXau >= 1.0.4-4
|
||||
Requires: pam >= 0:%{pam_version}
|
||||
Requires: /sbin/nologin
|
||||
Requires: setxkbmap
|
||||
Requires: systemd >= 186
|
||||
Requires: systemd >= 239-50
|
||||
Requires: system-logos
|
||||
Requires: xorg-x11-server-utils
|
||||
Requires: xorg-x11-xinit
|
||||
@ -325,10 +356,11 @@ fi
|
||||
%{_datadir}/gdm/locale.alias
|
||||
%{_datadir}/gdm/gdb-cmd
|
||||
%{_datadir}/gnome-session/sessions/gnome-login.session
|
||||
%{_datadir}/polkit-1/rules.d/org.gnome.gdm.rules
|
||||
%{_libdir}/girepository-1.0/Gdm-1.0.typelib
|
||||
%{_libdir}/security/pam_gdm.so
|
||||
%{_libdir}/libgdm*.so*
|
||||
%dir %{_localstatedir}/log/gdm
|
||||
%attr(0711, root, gdm) %dir %{_localstatedir}/log/gdm
|
||||
%attr(1770, gdm, gdm) %dir %{_localstatedir}/lib/gdm
|
||||
%attr(0700, gdm, gdm) %dir %{_localstatedir}/lib/gdm/.config
|
||||
%attr(0700, gdm, gdm) %dir %{_localstatedir}/lib/gdm/.config/pulse
|
||||
@ -354,6 +386,82 @@ fi
|
||||
%{_libdir}/pkgconfig/gdm-pam-extensions.pc
|
||||
|
||||
%changelog
|
||||
* Mon Dec 12 2022 Ray Strode <rstrode@redhat.com> - 40.0-27
|
||||
- Fix LUKs password handling
|
||||
Resolves: #2150649
|
||||
|
||||
* Mon Dec 12 2022 Ray Strode <rstrode@redhat.com> - 40.0-26
|
||||
- Fix error in service status log
|
||||
Resolves: #1924079
|
||||
|
||||
* Wed Oct 19 2022 Ray Strode <rstrode@redhat.com> - 40.0-25
|
||||
- Fix btmp accounting
|
||||
Resolves: #2030043
|
||||
|
||||
* Mon May 16 2022 Ray Strode <rstrode@redhat.com> - 40.0-24
|
||||
- Fix typo that prevents the correct session type from being
|
||||
used when user switching.
|
||||
Resolves: #2034092
|
||||
|
||||
* Thu Jan 27 2022 Ray Strode <rstrode@redhat.com> - 40.0-23
|
||||
- Fix crash when neither Xorg nor wayland is working great
|
||||
Resolves: #2032180
|
||||
|
||||
* Wed Dec 22 2021 Ray Strode <rstrode@redhat.com> - 40.1-22
|
||||
- Fix DisallowTCP
|
||||
Resolves: #2025768
|
||||
|
||||
* Tue Dec 21 2021 Ray Strode <rstrode@redhat.com> - 40.1-21
|
||||
- Fix Xorg/Wayland selection in some cases
|
||||
Resolves: #2009045
|
||||
|
||||
* Mon Oct 25 2021 Ray Strode <rstrode@redhat.com> - 40.1-20
|
||||
- Remove module-rescue-stream from default.pa
|
||||
Resolves: #1969846
|
||||
|
||||
* Mon Oct 25 2021 Ray Strode <rstrode@redhat.com> - 40.0-19
|
||||
- Synchronize permission and group ownership for log dir between
|
||||
rpm file manifest and daemon expectations.
|
||||
Resolves: #1878119
|
||||
|
||||
* Mon Oct 25 2021 Ray Strode <rstrode@redhat.com> - 40.0-18
|
||||
- Drop usleep workaround for problem that's now fixed properly in systemd
|
||||
Resolves: #1921732
|
||||
|
||||
* Wed Oct 13 2021 Ray Strode <rstrode@redhat.com> - 40.0-17
|
||||
- Properly switch VTs when jumping to multi-user target
|
||||
Related: #1988958
|
||||
|
||||
* Wed Sep 15 2021 Ray Strode <rstrode@redhat.com> - 40.0-16
|
||||
- Fix XDMCP
|
||||
Resolves: #2005011
|
||||
- Fix crash at shutdown
|
||||
Related: #2005011
|
||||
|
||||
* Wed Sep 01 2021 Ray Strode <rstrode@redhat.com> - 40.0-14
|
||||
- Disable Wayland on HyperV
|
||||
- Fix Xorg fallback
|
||||
Related: #2000904
|
||||
|
||||
* Thu Aug 19 2021 Ray Strode <rstrode@redhat.com> - 40.0-12
|
||||
- Redisable on server chips since rebase
|
||||
Related: #1909300
|
||||
|
||||
* Wed Aug 04 2021 Ray Strode <rstrode@redhat.com> - 40.0-11
|
||||
- Read session settings from users even if they've never saved
|
||||
before. Needed to support accountsservice templated user
|
||||
defaults.
|
||||
Related: #1812788
|
||||
|
||||
* Tue Jul 27 2021 Ray Strode <rstrode@redhat.com> - 40.0-10
|
||||
- Let customers using vendor nvidia driver choose wayland sessions
|
||||
Resolves: #1962211
|
||||
- Drop unused patches
|
||||
|
||||
* Tue Jun 08 2021 Florian Müllner <fmuellner@redhat.com> - 40.0-3
|
||||
- Disable network items on login screen
|
||||
Resolves: #1935261
|
||||
|
||||
* Wed May 19 2021 Ray Strode <rstrode@redhat.com> - 40.0-2
|
||||
- Fix workaround for systemd bug that's breaking X11 fallback
|
||||
Resolves: #1962049
|
||||
|
Loading…
Reference in New Issue
Block a user