View | Details | Raw Unified | Return to bug 275989
Collapse All | Expand All

(-)b/x11/lightdm/files/patch-x_authority_filename (+27 lines)
Added Link Here
1
--- data/lightdm.conf
2
+++ data/lightdm.conf
3
@@ -6,7 +6,7 @@
4
 # minimum-display-number = Minimum display number to use for X servers
5
 # minimum-vt = First VT to run displays on
6
 # lock-memory = True to prevent memory from being paged to disk
7
-# user-authority-in-system-dir = True if session authority should be in the system location
8
+# user-authority-in-system-dir = True if session authority should be in the system location, else XDG_RUNTIME_DIR or home dir will be used
9
 # guest-account-script = Script to be run to setup guest account
10
 # logind-check-graphical = True to on start seats that are marked as graphical by logind
11
 # log-directory = Directory to log information to
12
--- src/session-child.c
13
+++ src/session-child.c
14
@@ -602,6 +581,13 @@
15
     /* Write X authority */
16
     if (x_authority)
17
     {
18
+        /* If XDG_RUNTIME_DIR is set and user-authority-in-system-dir=false than use
19
+         * XDG_RUNTIME_DIR to store .Xauthority file. */
20
+        const gchar *runtime_dir = pam_getenv (pam_handle, "XDG_RUNTIME_DIR");
21
+        if (runtime_dir && x_authority_filename && g_str_has_suffix (x_authority_filename, ".Xauthority")) {
22
+            x_authority_filename = g_build_filename (runtime_dir, ".Xauthority", NULL);
23
+        }
24
+
25
         gboolean drop_privileges = geteuid () == 0;
26
         if (drop_privileges)
27
             privileges_drop (user_get_uid (user), user_get_gid (user));

Return to bug 275989