From 2ac0faf119525ef6d2c4f8f1875c3f51ec224d33 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Sun, 4 Aug 2024 09:58:13 +0100 Subject: [PATCH] If built with systemd, remove some environment variables it uses. From Ciprian Dorin Craciun, GitHub issue 4035. --- environ.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/environ.c b/environ.c index 5abf383c..b57c19b5 100644 --- a/environ.c +++ b/environ.c @@ -264,6 +264,12 @@ environ_for_session(struct session *s, int no_TERM) environ_set(env, "TERM_PROGRAM_VERSION", 0, "%s", getversion()); } +#ifdef HAVE_SYSTEMD + environ_clear(env, "LISTEN_PID"); + environ_clear(env, "LISTEN_FDS"); + environ_clear(env, "LISTEN_FDNAMES"); +#endif + if (s != NULL) idx = s->id; else