From: Lennart Poettering Date: Tue, 12 Sep 2017 18:07:30 +0000 (+0200) Subject: core: rework how we treat specifiers in Environment= of transient units X-Git-Tag: v235~108^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1c68232ee2584e20eda31e5ddce91c30ef6ab86c;p=platform%2Fupstream%2Fsystemd.git core: rework how we treat specifiers in Environment= of transient units Let's validate the data passed in after resolving specifiers, but let's write out to the unit snippet the list without specifiers applied. This way the pre-existing comment actually starts matching what is actually implemented. --- diff --git a/src/core/dbus-execute.c b/src/core/dbus-execute.c index 9515224..2c01242 100644 --- a/src/core/dbus-execute.c +++ b/src/core/dbus-execute.c @@ -1817,13 +1817,13 @@ int bus_exec_context_set_transient_property( if (r < 0) return r; - if (!strv_env_is_valid(l)) - return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid environment block."); - r = unit_full_printf_strv(u, l, &q); if (r < 0) return r; + if (!strv_env_is_valid(q)) + return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid environment block."); + if (mode != UNIT_CHECK) { if (strv_length(q) == 0) { c->environment = strv_free(c->environment); @@ -1840,7 +1840,7 @@ int bus_exec_context_set_transient_property( c->environment = e; /* We write just the new settings out to file, with unresolved specifiers */ - joined = strv_join_quoted(q); + joined = strv_join_quoted(l); if (!joined) return -ENOMEM;