Files
lightdm/lightdm-xauthlocalhostname-support.patch
Alexei Sorokin 3cf4015f34 Accepting request 731591 from home:iznogood:branches:X11:Utilities
- Update to version 1.30.0:
  * Add lightdm_user_get_is_locked ().
  * Hide users with shell /bin/false.
  * Remove unity-system-compositor support (dead upstream).
  * Fix dm-tool crash.
  * Update documentation.
- Refresh patches with quilt.
- Use modern macros.

OBS-URL: https://build.opensuse.org/request/show/731591
OBS-URL: https://build.opensuse.org/package/show/X11:Utilities/lightdm?expand=0&rev=120
2019-09-18 09:04:31 +00:00

52 lines
2.1 KiB
Diff

Set XAUTHLOCALHOSTNAME to the hostname for local logins to avoid issues in the
session in case the hostname changes.
Index: lightdm-1.30.0/src/seat-local.c
===================================================================
--- lightdm-1.30.0.orig/src/seat-local.c
+++ lightdm-1.30.0/src/seat-local.c
@@ -289,6 +289,7 @@ seat_local_run_script (Seat *seat, Displ
const gchar *path = x_server_local_get_authority_file_path (X_SERVER_LOCAL (display_server));
process_set_env (script, "DISPLAY", x_server_get_address (X_SERVER (display_server)));
process_set_env (script, "XAUTHORITY", path);
+ process_set_env (script, "XAUTHLOCALHOSTNAME", g_get_host_name ());
}
SEAT_CLASS (seat_local_parent_class)->run_script (seat, display_server, script);
Index: lightdm-1.30.0/src/x-authority.c
===================================================================
--- lightdm-1.30.0.orig/src/x-authority.c
+++ lightdm-1.30.0/src/x-authority.c
@@ -68,8 +68,8 @@ x_authority_new_cookie (guint16 family,
XAuthority *
x_authority_new_local_cookie (const gchar *number)
{
- gchar hostname[1024];
- gethostname (hostname, 1024);
+ const gchar *hostname;
+ hostname = g_get_host_name ();
return x_authority_new_cookie (XAUTH_FAMILY_LOCAL, (guint8 *) hostname, strlen (hostname), number);
}
Index: lightdm-1.30.0/src/x-server.c
===================================================================
--- lightdm-1.30.0.orig/src/x-server.c
+++ lightdm-1.30.0/src/x-server.c
@@ -15,6 +15,7 @@
#include "x-server.h"
#include "configuration.h"
+#include "x-server-local.h"
typedef struct
{
@@ -161,6 +162,8 @@ x_server_connect_session (DisplayServer
else
l_debug (session, "Not setting XDG_VTNR");
+ if (IS_X_SERVER_LOCAL (display_server))
+ session_set_env (session, "XAUTHLOCALHOSTNAME", g_get_host_name ());
session_set_env (session, "DISPLAY", x_server_get_address (X_SERVER (display_server)));
session_set_xdisplay (session, x_server_get_address (X_SERVER (display_server)));
session_set_remote_host_name (session, x_server_get_hostname (X_SERVER (display_server)));