01cbfb3
From 1580f05a56b671950a23d267c815a977cd56655b Mon Sep 17 00:00:00 2001
01cbfb3
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
01cbfb3
Date: Wed, 28 Jun 2023 13:55:01 +0200
01cbfb3
Subject: [PATCH] daemon: Specify DCONF_PROFILE for initial-setup
01cbfb3
01cbfb3
Since commit edc1815175, the initial-setup session no longer uses
01cbfb3
the locked down "gdm" profile, but the regular user profile.
01cbfb3
01cbfb3
On the one hand this seems justified, given that the initial-setup
01cbfb3
session is different enough from the login screen, however it is
01cbfb3
also different from a regular user session:
01cbfb3
01cbfb3
 - screen locking isn't useful for a system user
01cbfb3
 - during setup, log out / user switching are pointless at best
01cbfb3
 - accessibility features should be readily available in case
01cbfb3
   the user needs them
01cbfb3
01cbfb3
For this reason, return to specify DCONF_PROFILE for the initial-setup
01cbfb3
user, but use a distince profile from "gdm" to allow initial-setup
01cbfb3
to provide its own presets.
01cbfb3
---
01cbfb3
 daemon/gdm-launch-environment.c | 6 +-----
01cbfb3
 1 file changed, 1 insertion(+), 5 deletions(-)
01cbfb3
01cbfb3
diff --git a/daemon/gdm-launch-environment.c b/daemon/gdm-launch-environment.c
01cbfb3
index 507d6de74..5e379bf85 100644
01cbfb3
--- a/daemon/gdm-launch-environment.c
01cbfb3
+++ b/daemon/gdm-launch-environment.c
01cbfb3
@@ -155,71 +155,67 @@ build_launch_environment (GdmLaunchEnvironment *launch_environment,
01cbfb3
                 "LC_TIME",
01cbfb3
                 "LD_LIBRARY_PATH",
01cbfb3
                 "PATH",
01cbfb3
                 "WINDOWPATH",
01cbfb3
                 "XCURSOR_PATH",
01cbfb3
                 "XDG_CONFIG_DIRS",
01cbfb3
                 NULL
01cbfb3
         };
01cbfb3
         char *system_data_dirs;
01cbfb3
         g_auto (GStrv) supported_session_types = NULL;
01cbfb3
         int i;
01cbfb3
 
01cbfb3
         /* create a hash table of current environment, then update keys has necessary */
01cbfb3
         hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
01cbfb3
 
01cbfb3
         for (i = 0; optional_environment[i] != NULL; i++) {
01cbfb3
                 if (g_getenv (optional_environment[i]) == NULL) {
01cbfb3
                         continue;
01cbfb3
                 }
01cbfb3
 
01cbfb3
                 g_hash_table_insert (hash,
01cbfb3
                                      g_strdup (optional_environment[i]),
01cbfb3
                                      g_strdup (g_getenv (optional_environment[i])));
01cbfb3
         }
01cbfb3
 
01cbfb3
         if (launch_environment->x11_authority_file != NULL)
01cbfb3
                 g_hash_table_insert (hash, g_strdup ("XAUTHORITY"), g_strdup (launch_environment->x11_authority_file));
01cbfb3
 
01cbfb3
         if (launch_environment->session_mode != NULL) {
01cbfb3
                 g_hash_table_insert (hash, g_strdup ("GNOME_SHELL_SESSION_MODE"), g_strdup (launch_environment->session_mode));
01cbfb3
+                g_hash_table_insert (hash, g_strdup ("DCONF_PROFILE"), g_strdup (launch_environment->user_name));
01cbfb3
 
01cbfb3
 		if (strcmp (launch_environment->session_mode, INITIAL_SETUP_SESSION_MODE) != 0) {
01cbfb3
 			/* gvfs is needed for fetching remote avatars in the initial setup. Disable it otherwise. */
01cbfb3
 			g_hash_table_insert (hash, g_strdup ("GVFS_DISABLE_FUSE"), g_strdup ("1"));
01cbfb3
 			g_hash_table_insert (hash, g_strdup ("GIO_USE_VFS"), g_strdup ("local"));
01cbfb3
 			g_hash_table_insert (hash, g_strdup ("GVFS_REMOTE_VOLUME_MONITOR_IGNORE"), g_strdup ("1"));
01cbfb3
-
01cbfb3
-			/* The locked down dconf profile should not be used for the initial setup session.
01cbfb3
-			 * This allows overridden values from the user profile to take effect.
01cbfb3
-			 */
01cbfb3
-			g_hash_table_insert (hash, g_strdup ("DCONF_PROFILE"), g_strdup ("gdm"));
01cbfb3
 		}
01cbfb3
         }
01cbfb3
 
01cbfb3
         g_hash_table_insert (hash, g_strdup ("LOGNAME"), g_strdup (launch_environment->user_name));
01cbfb3
         g_hash_table_insert (hash, g_strdup ("USER"), g_strdup (launch_environment->user_name));
01cbfb3
         g_hash_table_insert (hash, g_strdup ("USERNAME"), g_strdup (launch_environment->user_name));
01cbfb3
 
01cbfb3
         g_hash_table_insert (hash, g_strdup ("GDM_VERSION"), g_strdup (VERSION));
01cbfb3
         g_hash_table_remove (hash, "MAIL");
01cbfb3
 
01cbfb3
         g_hash_table_insert (hash, g_strdup ("HOME"), g_strdup ("/"));
01cbfb3
         g_hash_table_insert (hash, g_strdup ("PWD"), g_strdup ("/"));
01cbfb3
         g_hash_table_insert (hash, g_strdup ("SHELL"), g_strdup ("/bin/sh"));
01cbfb3
 
01cbfb3
         gdm_get_pwent_for_name (launch_environment->user_name, &pwent);
01cbfb3
         if (pwent != NULL) {
01cbfb3
                 if (pwent->pw_dir != NULL && pwent->pw_dir[0] != '\0') {
01cbfb3
                         g_hash_table_insert (hash, g_strdup ("HOME"), g_strdup (pwent->pw_dir));
01cbfb3
                         g_hash_table_insert (hash, g_strdup ("PWD"), g_strdup (pwent->pw_dir));
01cbfb3
                 }
01cbfb3
 
01cbfb3
                 g_hash_table_insert (hash, g_strdup ("SHELL"), g_strdup (pwent->pw_shell));
01cbfb3
         }
01cbfb3
 
01cbfb3
         if (start_session && launch_environment->x11_display_seat_id != NULL) {
01cbfb3
                 char *seat_id;
01cbfb3
 
01cbfb3
                 seat_id = launch_environment->x11_display_seat_id;
01cbfb3
 
01cbfb3
                 g_hash_table_insert (hash, g_strdup ("GDM_SEAT_ID"), g_strdup (seat_id));
01cbfb3
-- 
01cbfb3
2.41.0.rc2
01cbfb3