ssh/tailssh: set DBUS_SESSION_BUS_ADDRESS and SSH_TTY variables

Updates #3802

Signed-off-by: Maisem Ali <maisem@tailscale.com>
This commit is contained in:
Maisem Ali
2022-03-11 12:34:36 -08:00
committed by Maisem Ali
parent 6d61b7906e
commit bf3559171f
2 changed files with 6 additions and 0 deletions

View File

@@ -165,6 +165,7 @@ func maybeStartLoginSessionLinux(logf logger.Logf, uid uint32, localUser, remote
logf("ssh: failed to CreateSession for user %q (%d) %v", localUser, uid, err)
return nil, nil
}
os.Setenv("DBUS_SESSION_BUS_ADDRESS", fmt.Sprintf("unix:path=%v/bus", resp.runtimePath))
if !resp.existing {
return func() error {
return releaseSession(resp.sessionID)