(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:
10
src/main.go
10
src/main.go
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user