File test.patch of Package gdm

commit 417db995c13393405696ed75d4b202fc5f8e8c55
Author: Eugenio Paolantonio <eugenio.paolantonio@suse.com>
Date:   Mon Sep 29 23:12:16 2025 +0200

    daemon: display: do not try to obtain a GdmSession on launch environment failure
    
    Signed-off-by: Eugenio Paolantonio <eugenio.paolantonio@suse.com>

diff --git a/daemon/gdm-display.c b/daemon/gdm-display.c
index 54e054808..09eb9a744 100644
--- a/daemon/gdm-display.c
+++ b/daemon/gdm-display.c
@@ -1759,7 +1759,10 @@ gdm_display_start_greeter_session (GdmDisplay *self)
                               NULL);
         }
 
-        gdm_launch_environment_start (priv->launch_environment);
+        if (!gdm_launch_environment_start (priv->launch_environment)) {
+                g_critical ("Unable to start launch environment");
+                return;
+        }
 
         session = gdm_launch_environment_get_session (priv->launch_environment);
         g_object_set (G_OBJECT (session),

commit c28ec42095f8dbf5c60fad39fc2a6da085e4eb15
Author: Eugenio Paolantonio <eugenio.paolantonio@suse.com>
Date:   Mon Sep 29 22:18:18 2025 +0200

    daemon: manager: ensure the newly created dynamic user can queried
    
    Although the distribution itself might support dynamic users, the system
    might not be configured to look at the systemd nss database.
    
    Try to query the newly created dynamic user before creating the
    session. On failure, abort.
    
    Signed-off-by: Eugenio Paolantonio <eugenio.paolantonio@suse.com>

diff --git a/daemon/gdm-launch-environment.c b/daemon/gdm-launch-environment.c
index 1b2fcd6f1..388e98da9 100644
--- a/daemon/gdm-launch-environment.c
+++ b/daemon/gdm-launch-environment.c
@@ -538,6 +538,19 @@ gdm_launch_environment_start (GdmLaunchEnvironment *launch_environment)
 
         g_debug ("GdmLaunchEnvironment: Starting...");
 
+        /* Even if we have a dynamic user, the system might be
+         * configured in such a way that might not allow querying the
+         * systemd nss database. Ensure we can retrieve the newly
+         * created user, and fail if not. */
+        if (!gdm_get_pwent_for_uid (launch_environment->dyn_uid, NULL)) {
+                gdm_dynamic_user_store_remove (launch_environment->dyn_user_store,
+                                               launch_environment->dyn_uid);
+                launch_environment->dyn_uid = 0;
+                g_critical ("Unable to query for the newly-created dynamic user. "
+                            "Misconfigured Name Service Switch configuration?");
+                return FALSE;
+        }
+
         launch_environment->session = gdm_session_new (launch_environment->verification_mode,
                                                        launch_environment->dyn_uid,
                                                        launch_environment->x11_display_name,
openSUSE Build Service is sponsored by