From: Mike Yuan Date: Wed, 5 Nov 2025 16:27:56 +0000 (+0100) Subject: core/service: do not pass $MANAGERPID and friends if pidns is employed X-Git-Tag: v259-rc1~136^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=675a4841cc9a6d6ebed7e616647566fae4b41a54;p=thirdparty%2Fsystemd.git core/service: do not pass $MANAGERPID and friends if pidns is employed --- diff --git a/src/core/service.c b/src/core/service.c index 5c1e6189f58..7b446351943 100644 --- a/src/core/service.c +++ b/src/core/service.c @@ -1810,7 +1810,9 @@ static int service_spawn_internal( return -ENOMEM; } - if (MANAGER_IS_USER(UNIT(s)->manager)) { + if (MANAGER_IS_USER(UNIT(s)->manager) && + !exec_needs_pid_namespace(&s->exec_context, /* params = */ NULL)) { + if (asprintf(our_env + n_env++, "MANAGERPID="PID_FMT, getpid_cached()) < 0) return -ENOMEM;