(Fix): spawnSession now calls SetBasicVariables, SetDisplay, SetSessionParams, SetSeatVars, SetSessionVars, and SetXDGCommonPaths before spawning the desktop. fixes setupX failing immediately with missing DISPLAY/XDG_VTNR/HOME env vars because none were set

This commit is contained in:
2026-07-18 22:40:32 +05:30
parent c646c7a18b
commit 1eb900c27c
2 changed files with 11 additions and 0 deletions

View File

@@ -156,6 +156,16 @@ func spawnSession(res *login.Result) error {
return fmt.Errorf("pam session: %w", err)
}
session.SetBasicVariables(creds.Username, creds.HomeDir, creds.Shell, res.Config.InitialPath)
if res.Env.Kind == "x11" {
session.SetDisplay(res.Config.X11.Display)
}
session.RemoveXDG()
session.SetSessionParams(res.Env.Kind)
session.SetSeatVars(res.Config.TTY)
session.SetSessionVars(creds.UID)
session.SetXDGCommonPaths(creds.HomeDir)
sess, err := session.Spawn(&res.Env, creds.UID, creds.PrimaryGID, creds.AllGIDs, &res.Config)
if err != nil {
return fmt.Errorf("spawn: %w", err)