From bac40f22aa614b1caf2c049d7245ca6d69d5fe83 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Wed, 28 Jul 2021 11:22:55 -0400 Subject: [PATCH] Clean up the initial-setup disabling patch that somehow got bits from another patch in it Related: #1985099 --- ...tup-being-disabled-by-distro-install.patch | 268 +----------------- gdm.spec | 7 +- 2 files changed, 13 insertions(+), 262 deletions(-) diff --git a/0001-Honor-initial-setup-being-disabled-by-distro-install.patch b/0001-Honor-initial-setup-being-disabled-by-distro-install.patch index bc787b1..b46e5e4 100644 --- a/0001-Honor-initial-setup-being-disabled-by-distro-install.patch +++ b/0001-Honor-initial-setup-being-disabled-by-distro-install.patch @@ -1,4 +1,4 @@ -From 7a39e99348a3ca8988c8542126f82012f81135af Mon Sep 17 00:00:00 2001 +From 42b18e4c84d470f33cdec5fc1f481cb25c25cf0d Mon Sep 17 00:00:00 2001 From: Rui Matos Date: Mon, 23 Jan 2017 20:19:51 +0100 Subject: [PATCH] Honor initial setup being disabled by distro installer @@ -14,43 +14,15 @@ that but more might be added in the future. https://bugzilla.gnome.org/show_bug.cgi?id=777708 --- + daemon/Makefile.am | 1 + daemon/gdm-display.c | 29 +++++++++++++++++++++++++++++ - daemon/gdm-manager.c | 11 +++++------ - daemon/gdm-session.c | 2 +- - 3 files changed, 35 insertions(+), 7 deletions(-) + 2 files changed, 30 insertions(+) diff --git a/daemon/gdm-display.c b/daemon/gdm-display.c -index 46d5a773..c7a8028b 100644 +index 5e193f2..878be88 100644 --- a/daemon/gdm-display.c +++ b/daemon/gdm-display.c -@@ -1621,103 +1621,132 @@ kernel_cmdline_initial_setup_force_state (gboolean *force_state) - GError *error = NULL; - gchar *contents = NULL; - gchar *setup_argument = NULL; - - g_return_val_if_fail (force_state != NULL, FALSE); - - if (!g_file_get_contents ("/proc/cmdline", &contents, NULL, &error)) { - g_debug ("GdmDisplay: Could not check kernel parameters, not forcing initial setup: %s", - error->message); - g_clear_error (&error); - return FALSE; - } - - g_debug ("GdmDisplay: Checking kernel command buffer %s", contents); - - if (!kernel_cmdline_initial_setup_argument (contents, &setup_argument, &error)) { - g_debug ("GdmDisplay: Failed to read kernel commandline: %s", error->message); - g_clear_pointer (&contents, g_free); - return FALSE; - } - - g_clear_pointer (&contents, g_free); - - /* Poor-man's check for truthy or falsey values */ - *force_state = setup_argument[0] == '1'; - - g_free (setup_argument); +@@ -1547,6 +1547,31 @@ kernel_cmdline_initial_setup_force_state (gboolean *force_state) return TRUE; } @@ -82,43 +54,7 @@ index 46d5a773..c7a8028b 100644 static gboolean wants_initial_setup (GdmDisplay *self) { - GdmDisplayPrivate *priv; - gboolean enabled = FALSE; - gboolean forced = FALSE; - - priv = gdm_display_get_instance_private (self); - - if (already_done_initial_setup_on_this_boot ()) { - return FALSE; - } - - if (kernel_cmdline_initial_setup_force_state (&forced)) { - if (forced) { - g_debug ("GdmDisplay: Forcing gnome-initial-setup"); - return TRUE; - } - - g_debug ("GdmDisplay: Forcing no gnome-initial-setup"); - return FALSE; - } - - /* don't run initial-setup on remote displays - */ - if (!priv->is_local) { - return FALSE; - } - - /* don't run if the system has existing users */ - if (priv->have_existing_user_accounts) { - return FALSE; - } - - /* don't run if initial-setup is unavailable */ - if (!can_create_environment ("gnome-initial-setup")) { - return FALSE; - } - - if (!gdm_settings_direct_get_boolean (GDM_KEY_INITIAL_SETUP_ENABLE, &enabled)) { +@@ -1587,6 +1612,10 @@ wants_initial_setup (GdmDisplay *self) return FALSE; } @@ -129,196 +65,6 @@ index 46d5a773..c7a8028b 100644 return enabled; } - void - gdm_display_start_greeter_session (GdmDisplay *self) - { - GdmDisplayPrivate *priv; - GdmSession *session; - char *display_name; - char *seat_id; - char *hostname; - char *auth_file = NULL; - - priv = gdm_display_get_instance_private (self); - g_return_if_fail (g_strcmp0 (priv->session_class, "greeter") == 0); - - g_debug ("GdmDisplay: Running greeter"); - - display_name = NULL; - seat_id = NULL; - hostname = NULL; - - g_object_get (self, - "x11-display-name", &display_name, - "seat-id", &seat_id, - "remote-hostname", &hostname, - NULL); - if (priv->access_file != NULL) { - auth_file = gdm_display_access_file_get_path (priv->access_file); - } -diff --git a/daemon/gdm-manager.c b/daemon/gdm-manager.c -index e433acf3..f8dce936 100644 ---- a/daemon/gdm-manager.c -+++ b/daemon/gdm-manager.c -@@ -2278,86 +2278,85 @@ on_session_reauthentication_started (GdmSession *session, - - if (invocation != NULL) { - g_hash_table_steal (manager->priv->open_reauthentication_requests, - source_tag); - gdm_dbus_manager_complete_open_reauthentication_channel (GDM_DBUS_MANAGER (manager), - invocation, - address); - } - } - - static void - clean_user_session (GdmSession *session) - { - g_object_set_data (G_OBJECT (session), "gdm-display", NULL); - g_object_unref (session); - } - - static void - create_user_session_for_display (GdmManager *manager, - GdmDisplay *display, - uid_t allowed_user) - { - GdmSession *session; - gboolean display_is_local = FALSE; - char *display_name = NULL; - char *display_device = NULL; - char *remote_hostname = NULL; - char *display_auth_file = NULL; - char *display_seat_id = NULL; - char *display_id = NULL; --#if defined(ENABLE_WAYLAND_SUPPORT) && defined(ENABLE_USER_DISPLAY_SERVER) -- g_autofree char *display_session_type = NULL; --#endif -+ g_auto (GStrv) supported_session_types = NULL; - - g_object_get (G_OBJECT (display), - "id", &display_id, - "x11-display-name", &display_name, - "is-local", &display_is_local, - "remote-hostname", &remote_hostname, - "x11-authority-file", &display_auth_file, - "seat-id", &display_seat_id, --#if defined(ENABLE_WAYLAND_SUPPORT) && defined(ENABLE_USER_DISPLAY_SERVER) -- "session-type", &display_session_type, --#endif -+ "supported-session-types", &supported_session_types, - NULL); - display_device = get_display_device (manager, display); - - session = gdm_session_new (GDM_SESSION_VERIFICATION_MODE_LOGIN, - allowed_user, - display_name, - remote_hostname, - display_device, - display_seat_id, - display_auth_file, - display_is_local, - NULL); -+ g_object_set (G_OBJECT (session), -+ "supported-session-types", supported_session_types, -+ NULL); - - g_debug ("GdmSession: Created user session for user %d on display %s (seat %s)", - (int) allowed_user, - display_id, - display_seat_id); - - g_free (display_name); - g_free (remote_hostname); - g_free (display_auth_file); - g_free (display_seat_id); - - g_signal_connect (session, - "reauthentication-started", - G_CALLBACK (on_session_reauthentication_started), - manager); - g_signal_connect (session, - "reauthenticated", - G_CALLBACK (on_session_reauthenticated), - manager); - g_signal_connect (session, - "client-ready-for-session-to-start", - G_CALLBACK (on_session_client_ready_for_session_to_start), - manager); - g_signal_connect (session, - "client-connected", - G_CALLBACK (on_session_client_connected), - manager); - g_signal_connect (session, - "client-disconnected", - G_CALLBACK (on_session_client_disconnected), -diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c -index 2cd9c323..5c225445 100644 ---- a/daemon/gdm-session.c -+++ b/daemon/gdm-session.c -@@ -2562,61 +2562,61 @@ gdm_session_send_environment (GdmSession *self, - g_return_if_fail (GDM_IS_SESSION (self)); - - conversation = find_conversation_by_name (self, service_name); - if (conversation != NULL) { - send_environment (self, conversation); - } - } - - static const char * - get_session_name (GdmSession *self) - { - /* FIXME: test the session names before we use them? */ - - if (self->selected_session != NULL) { - return self->selected_session; - } - - return get_default_session_name (self); - } - - static char * - get_session_command (GdmSession *self) - { - gboolean res; - char *command; - const char *session_name; - - session_name = get_session_name (self); - - command = NULL; -- res = get_session_command_for_name (self, session_name, NULL, &command); -+ res = get_session_command_for_name (self, session_name, self->session_type, &command); - if (! res) { - g_critical ("Cannot find a command for specified session: %s", session_name); - exit (EXIT_FAILURE); - } - - return command; - } - - static gchar * - get_session_desktop_names (GdmSession *self) - { - gchar *filename; - GKeyFile *keyfile; - gchar *desktop_names = NULL; - - if (self->selected_program != NULL) { - return g_strdup ("GNOME-Greeter:GNOME"); - } - - filename = g_strdup_printf ("%s.desktop", get_session_name (self)); - g_debug ("GdmSession: getting desktop names for file '%s'", filename); - keyfile = load_key_file_for_file (self, filename, NULL, NULL); - if (keyfile != NULL) { - gchar **names; - - names = g_key_file_get_string_list (keyfile, G_KEY_FILE_DESKTOP_GROUP, - "DesktopNames", NULL, NULL); - if (names != NULL) { - desktop_names = g_strjoinv (":", names); - -- -2.32.0 +2.19.0 diff --git a/gdm.spec b/gdm.spec index c5c420a..06a45f6 100644 --- a/gdm.spec +++ b/gdm.spec @@ -11,7 +11,7 @@ Name: gdm Epoch: 1 Version: 40.1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: The GNOME Display Manager License: GPLv2+ @@ -311,6 +311,11 @@ dconf update || : %{_libdir}/pkgconfig/gdm-pam-extensions.pc %changelog +* Wed Jul 28 2021 Ray Strode - 40.1-3 +- Clean up the initial-setup disabling patch that somehow + got bits from another patch in it. + Related: #1985099 + * Wed Jul 28 2021 Ray Strode - 40.1-2 - A few clean ups and fixes in session selection patch Related: #1985099