2021-08-23 08:35:34 +00:00
|
|
|
Index: gdm-40.1/common/gdm-common.c
|
2020-05-06 16:21:38 +00:00
|
|
|
===================================================================
|
2021-08-23 08:35:34 +00:00
|
|
|
--- gdm-40.1.orig/common/gdm-common.c
|
|
|
|
+++ gdm-40.1/common/gdm-common.c
|
|
|
|
@@ -613,6 +613,8 @@ gdm_get_script_environment (const char *
|
2016-09-08 21:23:45 +00:00
|
|
|
|
|
|
|
if (display_hostname) {
|
|
|
|
g_hash_table_insert (hash, g_strdup ("REMOTE_HOST"), g_strdup (display_hostname));
|
|
|
|
+ } else {
|
|
|
|
+ g_hash_table_insert (hash, g_strdup ("XAUTHLOCALHOSTNAME"), gdm_gethostname ());
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Runs as root */
|
2021-08-23 08:35:34 +00:00
|
|
|
@@ -1079,3 +1081,14 @@ gdm_load_env_d (GdmLoadEnvVarFunc load_e
|
|
|
|
gdm_load_env_dir (dir, load_env_func, expand_func, user_data);
|
|
|
|
g_object_unref (dir);
|
2016-09-08 21:23:45 +00:00
|
|
|
}
|
|
|
|
+
|
|
|
|
+char *
|
|
|
|
+gdm_gethostname (void)
|
|
|
|
+{
|
|
|
|
+ char localhost[HOST_NAME_MAX + 1] = "";
|
|
|
|
+ if (gethostname (localhost, HOST_NAME_MAX) == 0) {
|
|
|
|
+ return g_strdup (localhost);
|
|
|
|
+ } else {
|
|
|
|
+ return g_strdup ("localhost");
|
|
|
|
+ }
|
|
|
|
+}
|
2021-08-23 08:35:34 +00:00
|
|
|
Index: gdm-40.1/common/gdm-common.h
|
2020-05-06 16:21:38 +00:00
|
|
|
===================================================================
|
2021-08-23 08:35:34 +00:00
|
|
|
--- gdm-40.1.orig/common/gdm-common.h
|
|
|
|
+++ gdm-40.1/common/gdm-common.h
|
|
|
|
@@ -70,6 +70,7 @@ char *gdm_generate_random_bytes
|
2019-06-07 11:16:29 +00:00
|
|
|
gboolean gdm_get_login_window_session_id (const char *seat_id,
|
|
|
|
char **session_id);
|
2016-09-08 21:23:45 +00:00
|
|
|
gboolean gdm_goto_login_session (GError **error);
|
|
|
|
+char *gdm_gethostname (void);
|
|
|
|
|
|
|
|
GPtrArray *gdm_get_script_environment (const char *username,
|
|
|
|
const char *display_name,
|
2021-08-23 08:35:34 +00:00
|
|
|
Index: gdm-40.1/daemon/gdm-display-access-file.c
|
2020-05-06 16:21:38 +00:00
|
|
|
===================================================================
|
2021-08-23 08:35:34 +00:00
|
|
|
--- gdm-40.1.orig/daemon/gdm-display-access-file.c
|
|
|
|
+++ gdm-40.1/daemon/gdm-display-access-file.c
|
2019-06-07 11:16:29 +00:00
|
|
|
@@ -441,13 +441,10 @@ _get_auth_info_for_display (GdmDisplayAc
|
2013-03-13 22:59:19 +00:00
|
|
|
*
|
|
|
|
* https://bugs.freedesktop.org/show_bug.cgi?id=43425
|
|
|
|
*/
|
2013-01-18 20:04:32 +00:00
|
|
|
- char localhost[HOST_NAME_MAX + 1] = "";
|
2009-09-28 16:08:57 +00:00
|
|
|
*family = FamilyLocal;
|
2013-01-18 20:04:32 +00:00
|
|
|
- if (gethostname (localhost, HOST_NAME_MAX) == 0) {
|
|
|
|
- *address = g_strdup (localhost);
|
|
|
|
- } else {
|
|
|
|
- *address = g_strdup ("localhost");
|
|
|
|
- }
|
2013-03-13 22:59:19 +00:00
|
|
|
+ /* using the new function we create in the patch, to detect
|
|
|
|
+ * changes here, in the original code */
|
2013-01-18 20:04:32 +00:00
|
|
|
+ *address = gdm_gethostname ();
|
2009-09-28 16:08:57 +00:00
|
|
|
} else {
|
|
|
|
*family = FamilyWild;
|
|
|
|
gdm_display_get_remote_hostname (display, address, NULL);
|
2021-08-23 08:35:34 +00:00
|
|
|
Index: gdm-40.1/daemon/gdm-launch-environment.c
|
2020-05-06 16:21:38 +00:00
|
|
|
===================================================================
|
2021-08-23 08:35:34 +00:00
|
|
|
--- gdm-40.1.orig/daemon/gdm-launch-environment.c
|
|
|
|
+++ gdm-40.1/daemon/gdm-launch-environment.c
|
|
|
|
@@ -224,6 +224,11 @@ build_launch_environment (GdmLaunchEnvir
|
2012-09-12 09:18:56 +00:00
|
|
|
g_hash_table_insert (hash, g_strdup ("GDM_SEAT_ID"), g_strdup (seat_id));
|
2010-08-09 21:51:59 +00:00
|
|
|
}
|
2010-05-13 22:43:13 +00:00
|
|
|
|
2012-09-12 09:18:56 +00:00
|
|
|
+ if (launch_environment->priv->x11_display_is_local) {
|
|
|
|
+ g_hash_table_remove (hash, "XAUTHLOCALHOSTNAME");
|
2013-01-18 20:04:32 +00:00
|
|
|
+ g_hash_table_insert (hash, g_strdup ("XAUTHLOCALHOSTNAME"), gdm_gethostname ());
|
2012-09-12 09:18:56 +00:00
|
|
|
+ }
|
|
|
|
+
|
2019-04-15 08:19:53 +00:00
|
|
|
g_hash_table_insert (hash, g_strdup ("RUNNING_UNDER_GDM"), g_strdup ("true"));
|
2019-06-07 11:16:29 +00:00
|
|
|
|
2021-08-23 08:35:34 +00:00
|
|
|
/* Now populate XDG_DATA_DIRS from env.d if we're running initial setup; this allows
|
|
|
|
Index: gdm-40.1/daemon/gdm-session.c
|
2020-05-06 16:21:38 +00:00
|
|
|
===================================================================
|
2021-08-23 08:35:34 +00:00
|
|
|
--- gdm-40.1.orig/daemon/gdm-session.c
|
|
|
|
+++ gdm-40.1/daemon/gdm-session.c
|
|
|
|
@@ -2709,6 +2709,14 @@ set_up_session_environment (GdmSession *
|
2016-09-08 21:23:45 +00:00
|
|
|
}
|
2012-09-12 09:18:56 +00:00
|
|
|
}
|
2009-09-28 16:08:57 +00:00
|
|
|
|
2019-06-07 11:16:29 +00:00
|
|
|
+ if (self->display_is_local) {
|
2013-01-18 20:04:32 +00:00
|
|
|
+ char *hostname = gdm_gethostname ();
|
2012-09-12 09:18:56 +00:00
|
|
|
+ gdm_session_set_environment_variable (self,
|
|
|
|
+ "XAUTHLOCALHOSTNAME",
|
2013-01-18 20:04:32 +00:00
|
|
|
+ hostname);
|
|
|
|
+ g_free (hostname);
|
2009-09-28 16:08:57 +00:00
|
|
|
+ }
|
|
|
|
+
|
2012-09-12 09:18:56 +00:00
|
|
|
if (g_getenv ("WINDOWPATH") != NULL) {
|
|
|
|
gdm_session_set_environment_variable (self,
|
|
|
|
"WINDOWPATH",
|