From c4136810a85fba3b8eba0b1000879a2086ac320e Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Jul 29 2019 12:52:06 +0000 Subject: import gdm-3.28.2-12.el7_6.2 --- diff --git a/SOURCES/0001-local-display-factory-don-t-spawn-login-screen-if-ba.patch b/SOURCES/0001-local-display-factory-don-t-spawn-login-screen-if-ba.patch new file mode 100644 index 0000000..eef37ae --- /dev/null +++ b/SOURCES/0001-local-display-factory-don-t-spawn-login-screen-if-ba.patch @@ -0,0 +1,187 @@ +From 02429cabcddd3a12e0cddd975820b37e8440f1c7 Mon Sep 17 00:00:00 2001 +From: Ray Strode +Date: Wed, 22 May 2019 10:53:12 -0400 +Subject: [PATCH] local-display-factory: don't spawn login screen if background + session dies + +At the moment gdm conjures up a login screen any time a user session +exits. + +This is the right behavior if the user explicitly logs out, but if an +admin is killing a session on a background VT, then going to the login +screen is wrong. + +This commit changes the code to detect when the killed session is in +the foreground, and only then bring up a login screen. +--- + daemon/gdm-local-display-factory.c | 24 +++++++++++++++++++++++- + 1 file changed, 23 insertions(+), 1 deletion(-) + +diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c +index cf4f5095c..6856d30d0 100644 +--- a/daemon/gdm-local-display-factory.c ++++ b/daemon/gdm-local-display-factory.c +@@ -227,137 +227,159 @@ gdm_local_display_factory_create_transient_display (GdmLocalDisplayFactory *fact + + store_display (factory, display); + + if (! gdm_display_manage (display)) { + display = NULL; + goto out; + } + + if (! gdm_display_get_id (display, id, NULL)) { + display = NULL; + goto out; + } + + ret = TRUE; + out: + /* ref either held by store or not at all */ + g_object_unref (display); + + return ret; + } + + static void + on_display_status_changed (GdmDisplay *display, + GParamSpec *arg1, + GdmLocalDisplayFactory *factory) + { + int status; + GdmDisplayStore *store; + int num; + char *seat_id = NULL; ++ char *session_id = NULL; + char *session_type = NULL; + char *session_class = NULL; + gboolean is_initial = TRUE; + gboolean is_local = TRUE; ++ int ret; + + num = -1; + gdm_display_get_x11_display_number (display, &num, NULL); + + store = gdm_display_factory_get_display_store (GDM_DISPLAY_FACTORY (factory)); + + g_object_get (display, + "seat-id", &seat_id, ++ "session-id", &session_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->priv->used_display_numbers + so that it may be reused */ + if (num != -1) { + g_hash_table_remove (factory->priv->used_display_numbers, GUINT_TO_POINTER (num)); + } + gdm_display_store_remove (store, display); + + /* if this is a local display, recreate the display so + * a new login screen comes up if one is missing. + */ + if (is_local && g_strcmp0 (session_class, "greeter") != 0) { ++ g_autofree char *active_session = NULL; ++ + /* reset num failures */ + factory->priv->num_failures = 0; + +- create_display (factory, seat_id, session_type, is_initial); ++ ret = sd_seat_get_active (seat_id, &active_session, NULL); ++ ++ if (ret == 0) { ++ g_autofree char *state = NULL; ++ ret = sd_session_get_state (active_session, &state); ++ if (ret != 0 || ++ g_strcmp0 (state, "closing") == 0 || ++ g_strcmp0 (active_session, session_id) == 0) { ++ g_clear_pointer (&active_session, free); ++ } ++ } ++ ++ /* If this died in the foreground leaving us on a blank vt, ++ start a new login screen */ ++ if (!sd_seat_can_multi_session (seat_id) || active_session == NULL) { ++ create_display (factory, seat_id, session_type, is_initial); ++ } + } + break; + case GDM_DISPLAY_FAILED: + /* leave the display number in factory->priv->used_display_numbers + so that it doesn't get reused */ + gdm_display_store_remove (store, display); + + /* Create a new equivalent display if it was static */ + if (is_local) { + + factory->priv->num_failures++; + + if (factory->priv->num_failures > MAX_DISPLAY_FAILURES) { + /* oh shit */ + g_warning ("GdmLocalDisplayFactory: maximum number of X display failures reached: check X server log for errors"); + } else { + #ifdef ENABLE_WAYLAND_SUPPORT + if (g_strcmp0 (session_type, "wayland") == 0) { + g_free (session_type); + session_type = NULL; + } + + #endif + create_display (factory, seat_id, session_type, is_initial); + } + } + break; + case GDM_DISPLAY_UNMANAGED: + break; + case GDM_DISPLAY_PREPARED: + break; + case GDM_DISPLAY_MANAGED: + break; + default: + g_assert_not_reached (); + break; + } + + g_free (seat_id); ++ g_free (session_id); + g_free (session_type); + g_free (session_class); + } + + static gboolean + lookup_by_seat_id (const char *id, + GdmDisplay *display, + gpointer user_data) + { + const char *looking_for = user_data; + char *current; + gboolean res; + + g_object_get (G_OBJECT (display), "seat-id", ¤t, NULL); + + res = g_strcmp0 (current, looking_for) == 0; + + g_free(current); + + return res; + } + + static gboolean + activate_session_id (GdmLocalDisplayFactory *self, + const char *seat_id, + const char *session_id) + { + GError *error = NULL; + GVariant *reply; + +-- +2.21.0 + diff --git a/SPECS/gdm.spec b/SPECS/gdm.spec index 29dba12..1a103d2 100644 --- a/SPECS/gdm.spec +++ b/SPECS/gdm.spec @@ -10,7 +10,7 @@ Name: gdm Epoch: 1 Version: 3.28.2 -Release: 12%{?dist}.1 +Release: 12%{?dist}.2 Summary: The GNOME Display Manager License: GPLv2+ @@ -21,35 +21,37 @@ Source2: ja.po Patch0: 0001-Honor-initial-setup-being-disabled-by-distro-install.patch -Patch20: 0001-Revert-session-forward-is-initial-from-display-to-wo.patch -Patch21: 0001-worker-add-compat-patch-to-make-new-worker-work-with.patch +Patch10001: 0001-Revert-session-forward-is-initial-from-display-to-wo.patch +Patch20001: 0001-worker-add-compat-patch-to-make-new-worker-work-with.patch # breaks upgrades -Patch40: 0001-Revert-data-Add-gnome-login.session.patch +Patch40001: 0001-Revert-data-Add-gnome-login.session.patch # we don't have new enough dbus for this and don't need it with our old dbus -Patch41: 0001-Revert-gdm-sessions-force-a-session-bus-for-non-seat.patch +Patch50001: 0001-Revert-gdm-sessions-force-a-session-bus-for-non-seat.patch -Patch50: 0001-data-change-cirrus-blacklist-to-use-gdm-disable-wayl.patch +Patch60001: 0001-data-change-cirrus-blacklist-to-use-gdm-disable-wayl.patch -Patch60: 0001-manager-plug-leak-in-maybe_activate_other_session.patch -Patch61: 0002-manager-start-login-screen-if-old-one-is-finished.patch -Patch62: 0003-manager-don-t-bail-if-session-disappears-out-from-un.patch -Patch63: 0004-manager-make-get_login_window_session_id-fail-if-no-.patch -Patch64: 0005-daemon-try-harder-to-get-to-a-login-screen-at-logout.patch -Patch65: 0006-daemon-ensure-is-initial-bit-is-transferred-to-new-l.patch -Patch66: 0007-local-display-factory-try-even-harder-to-get-to-a-lo.patch +Patch70001: 0001-manager-plug-leak-in-maybe_activate_other_session.patch +Patch70002: 0002-manager-start-login-screen-if-old-one-is-finished.patch +Patch70003: 0003-manager-don-t-bail-if-session-disappears-out-from-un.patch +Patch70004: 0004-manager-make-get_login_window_session_id-fail-if-no-.patch +Patch70005: 0005-daemon-try-harder-to-get-to-a-login-screen-at-logout.patch +Patch70006: 0006-daemon-ensure-is-initial-bit-is-transferred-to-new-l.patch +Patch70007: 0007-local-display-factory-try-even-harder-to-get-to-a-lo.patch -Patch70: 0001-daemon-gdm-session-record.c-open-close-the-utmp-data.patch +Patch80001: 0001-daemon-gdm-session-record.c-open-close-the-utmp-data.patch -Patch81: 0001-manager-allow-multiple-xdmcp-logins-for-the-same-use.patch +Patch90001: 0001-manager-allow-multiple-xdmcp-logins-for-the-same-use.patch -Patch90: audit-4.patch -Patch91: clear-screen.patch -Patch92: 0001-gdm.conf-custom.in-strip-out-reference-to-wayland.patch -Patch93: system-dconf.patch -Patch94: classic-session.patch -Patch95: 0001-data-drop-pam_gdm-reintroduce-pam_env-postlogin.patch -Patch96: 0001-configure-don-t-assume-x-server-defaults-to-local-on.patch +Patch100001: 0001-local-display-factory-don-t-spawn-login-screen-if-ba.patch + +Patch900000: audit-4.patch +Patch900001: clear-screen.patch +Patch900002: 0001-gdm.conf-custom.in-strip-out-reference-to-wayland.patch +Patch900003: system-dconf.patch +Patch900004: classic-session.patch +Patch900005: 0001-data-drop-pam_gdm-reintroduce-pam_env-postlogin.patch +Patch900006: 0001-configure-don-t-assume-x-server-defaults-to-local-on.patch BuildRequires: pam-devel >= 0:%{pam_version} BuildRequires: desktop-file-utils >= %{desktop_file_utils_version} @@ -110,6 +112,8 @@ Requires: system-logos Requires: xorg-x11-server-utils Requires: xorg-x11-xinit +Conflicts: xorg-x11-server-Xorg < 1.20.1-5.4 + Obsoletes: gdm-libs < 1:3.12.0-3 Provides: gdm-libs%{?_isa} = %{epoch}:%{version}-%{release} @@ -361,6 +365,10 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor >&/dev/null || : %{_libdir}/pkgconfig/gdm-pam-extensions.pc %changelog +* Wed Jun 12 2019 Ray Strode - 3.28.2-12.2 +- Don't bring up login screen if background session gets killed + Related: #1719361 + * Thu Mar 28 2019 Ray Strode - 3.28.2-12.1 - Fix unlock on XDMCP sessions Resolves: #1693967