From 6cf5495c3465b00d11dcd6be15606544a1f55249 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 15 Jan 2018 15:26:33 +0000 Subject: [PATCH 1/4] bus: Don't pass systemd environment variables to activated services Signed-off-by: Simon McVittie --- bus/activation.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bus/activation.c b/bus/activation.c index edf96a2c..3669d4fb 100644 --- a/bus/activation.c +++ b/bus/activation.c @@ -848,6 +848,14 @@ populate_environment (BusActivation *activation) retval = _dbus_hash_table_from_array (activation->environment, environment, '='); dbus_free_string_array (environment); + /* These environment variables are set by systemd for the dbus-daemon + * itself, and are not applicable to our child processes. */ + _dbus_hash_table_remove_string (activation->environment, "JOURNAL_STREAM"); + _dbus_hash_table_remove_string (activation->environment, "LISTEN_FDNAMES"); + _dbus_hash_table_remove_string (activation->environment, "LISTEN_FDS"); + _dbus_hash_table_remove_string (activation->environment, "LISTEN_PID"); + _dbus_hash_table_remove_string (activation->environment, "NOTIFY_SOCKET"); + return retval; } -- 2.15.1