2013-01-18 20:04:32 +00:00
|
|
|
Index: gdm-3.7.3.1/daemon/gdm-display-access-file.c
|
2009-09-28 16:08:57 +00:00
|
|
|
===================================================================
|
2013-01-18 20:04:32 +00:00
|
|
|
--- gdm-3.7.3.1.orig/daemon/gdm-display-access-file.c
|
|
|
|
+++ gdm-3.7.3.1/daemon/gdm-display-access-file.c
|
|
|
|
@@ -443,13 +443,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);
|
2013-01-18 20:04:32 +00:00
|
|
|
Index: gdm-3.7.3.1/daemon/gdm-launch-environment.c
|
2009-09-28 16:08:57 +00:00
|
|
|
===================================================================
|
2013-01-18 20:04:32 +00:00
|
|
|
--- gdm-3.7.3.1.orig/daemon/gdm-launch-environment.c
|
|
|
|
+++ gdm-3.7.3.1/daemon/gdm-launch-environment.c
|
|
|
|
@@ -284,6 +284,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
|
|
|
+ }
|
|
|
|
+
|
|
|
|
g_hash_table_insert (hash, g_strdup ("PATH"), g_strdup (g_getenv ("PATH")));
|
|
|
|
|
|
|
|
g_hash_table_insert (hash, g_strdup ("RUNNING_UNDER_GDM"), g_strdup ("true"));
|
2013-01-18 20:04:32 +00:00
|
|
|
Index: gdm-3.7.3.1/daemon/gdm-session.c
|
2012-09-12 09:18:56 +00:00
|
|
|
===================================================================
|
2013-01-18 20:04:32 +00:00
|
|
|
--- gdm-3.7.3.1.orig/daemon/gdm-session.c
|
|
|
|
+++ gdm-3.7.3.1/daemon/gdm-session.c
|
|
|
|
@@ -2374,6 +2374,14 @@ setup_session_environment (GdmSession *s
|
2012-09-12 09:18:56 +00:00
|
|
|
self->priv->user_x11_authority_file);
|
|
|
|
}
|
2009-09-28 16:08:57 +00:00
|
|
|
|
2012-09-12 09:18:56 +00:00
|
|
|
+ if (self->priv->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",
|
2013-01-18 20:04:32 +00:00
|
|
|
Index: gdm-3.7.3.1/daemon/gdm-slave.c
|
2009-09-28 16:08:57 +00:00
|
|
|
===================================================================
|
2013-01-18 20:04:32 +00:00
|
|
|
--- gdm-3.7.3.1.orig/daemon/gdm-slave.c
|
|
|
|
+++ gdm-3.7.3.1/daemon/gdm-slave.c
|
2012-09-12 09:18:56 +00:00
|
|
|
@@ -255,6 +255,10 @@ get_script_environment (GdmSlave *slav
|
2009-09-28 16:08:57 +00:00
|
|
|
g_hash_table_insert (hash, g_strdup ("REMOTE_HOST"), g_strdup (slave->priv->display_hostname));
|
|
|
|
}
|
|
|
|
|
|
|
|
+ if (slave->priv->display_is_local) {
|
2013-01-18 20:04:32 +00:00
|
|
|
+ g_hash_table_insert (hash, g_strdup ("XAUTHLOCALHOSTNAME"), gdm_gethostname ());
|
2009-09-28 16:08:57 +00:00
|
|
|
+ }
|
|
|
|
+
|
|
|
|
/* Runs as root */
|
|
|
|
g_hash_table_insert (hash, g_strdup ("XAUTHORITY"), g_strdup (slave->priv->display_x11_authority_file));
|
|
|
|
g_hash_table_insert (hash, g_strdup ("DISPLAY"), g_strdup (slave->priv->display_name));
|
2013-01-18 20:04:32 +00:00
|
|
|
@@ -644,6 +648,11 @@ gdm_slave_connect_to_x11_display (GdmSla
|
2009-09-28 16:08:57 +00:00
|
|
|
|
|
|
|
g_setenv ("DISPLAY", slave->priv->display_name, TRUE);
|
|
|
|
g_setenv ("XAUTHORITY", slave->priv->display_x11_authority_file, TRUE);
|
2013-01-18 20:04:32 +00:00
|
|
|
+ do {
|
|
|
|
+ char *hostname = gdm_gethostname ();
|
|
|
|
+ g_setenv ("XAUTHLOCALHOSTNAME", hostname, TRUE);
|
|
|
|
+ g_free (hostname);
|
|
|
|
+ } while (0);
|
2009-09-28 16:08:57 +00:00
|
|
|
|
|
|
|
sigemptyset (&mask);
|
|
|
|
sigaddset (&mask, SIGCHLD);
|
2013-01-18 20:04:32 +00:00
|
|
|
Index: gdm-3.7.3.1/common/gdm-common.c
|
|
|
|
===================================================================
|
|
|
|
--- gdm-3.7.3.1.orig/common/gdm-common.c
|
|
|
|
+++ gdm-3.7.3.1/common/gdm-common.c
|
|
|
|
@@ -509,3 +509,14 @@ gdm_generate_random_bytes (gsize size
|
|
|
|
close (fd);
|
|
|
|
return bytes;
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+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");
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
Index: gdm-3.7.3.1/common/gdm-common.h
|
|
|
|
===================================================================
|
|
|
|
--- gdm-3.7.3.1.orig/common/gdm-common.h
|
|
|
|
+++ gdm-3.7.3.1/common/gdm-common.h
|
|
|
|
@@ -58,6 +58,7 @@ gboolean gdm_string_hex_decode
|
|
|
|
int insert_at);
|
|
|
|
char *gdm_generate_random_bytes (gsize size,
|
|
|
|
GError **error);
|
|
|
|
+char *gdm_gethostname (void);
|
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|