From 21de6b6edd2c4784b3a8b7cc3a5e274da4f36c93 Mon Sep 17 00:00:00 2001 From: lotherk Date: Wed, 18 Nov 2026 05:04:33 +0000 Subject: [PATCH] dtlogin: the session keeps the user's Xauthority SetUserAuthorization() writes ~/.Xauthority for the user (and sets XAUTHORITY itself when it has to use the fallback file), but the session environment then named the server's auth file -- 0600 root, unreadable for the user. dtsession could not open the display and dtlogin went back to the greeter (measured 2026-11-18; dtsession runs fine when XAUTHORITY names ~/.Xauthority). --- programs/dtlogin/session.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/programs/dtlogin/session.c b/programs/dtlogin/session.c index 4dc3b7da..af7f7086 100644 --- a/programs/dtlogin/session.c +++ b/programs/dtlogin/session.c @@ -1911,8 +1911,14 @@ RunGreeter( struct display *d, struct greet_info *greet, if (errorLogFile && errorLogFile[0]) env = setEnv(env, ERRORLOG, errorLogFile); - if (d->authFile) - env = setEnv(env, "XAUTHORITY", d->authFile); + /* + * MCDE: no XAUTHORITY here. The session runs as the user and its + * cookie is in ~/.Xauthority, which SetUserAuthorization() wrote + * (auth.c). Pointing the session at the server's file -- 0600 root + * -- made every client of the session fail to read a cookie: dtsession + * exited and dtlogin showed the greeter again (measured 2026-11-18). + * The fallback path of SetUserAuthorization sets XAUTHORITY itself. + */ if (d->dtlite) env = setEnv(env, DTLITE, "True");