From 58533bbdf7aa0548de8e2abd3cb2de0593fa9fdc Mon Sep 17 00:00:00 2001 From: "jca@openbsd.org" Date: Mon, 17 Nov 2025 12:59:29 +0000 Subject: [PATCH] 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 --- session.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/session.c b/session.c index f265fdc3e..34b049a0f 100644 --- a/session.c +++ b/session.c @@ -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 , 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)