upstream: Export XDG_RUNTIME_DIR to child ssh sessions

Currently setusercontext(LOGIN_SETALL) does create the directory in
/tmp/run/user, since LOGIN_SETXDGENV is part of LOGIN_SETALL, but the
env variable wasn't exported.

ok djm@

OpenBSD-Commit-ID: 02b8433f72759b3a07b55cbc5a7cdb84391b0017
This commit is contained in:
jca@openbsd.org
2025-11-17 12:59:29 +00:00
committed by Damien Miller
parent e4cc5ab0ef
commit 58533bbdf7

View File

@@ -1,4 +1,4 @@
/* $OpenBSD: session.c,v 1.344 2025/09/25 02:15:39 jsg Exp $ */
/* $OpenBSD: session.c,v 1.345 2025/11/17 12:59:29 jca Exp $ */
/*
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
* All rights reserved
@@ -1012,6 +1012,12 @@ do_setup_env(struct ssh *ssh, Session *s, const char *shell)
if (getenv("TZ"))
child_set_env(&env, &envsize, "TZ", getenv("TZ"));
#ifdef HAVE_LOGIN_CAP
if (getenv("XDG_RUNTIME_DIR")) {
child_set_env(&env, &envsize, "XDG_RUNTIME_DIR",
getenv("XDG_RUNTIME_DIR"));
}
#endif /* HAVE_LOGIN_CAP */
if (s->term)
child_set_env(&env, &envsize, "TERM", s->term);
if (s->display)