From 039f0e70a0fcd71dcf7cc2f3ba2cea2e3b186a60 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 23 Dec 2014 19:04:56 +0100 Subject: env-util: don't include files from src/core/ --- src/core/execute.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'src/core') diff --git a/src/core/execute.c b/src/core/execute.c index c472dadfed..a806d42827 100644 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -2026,6 +2026,17 @@ void exec_command_free_array(ExecCommand **c, unsigned n) { c[i] = exec_command_free_list(c[i]); } +typedef struct InvalidEnvInfo { + const char *unit_id; + const char *path; +} InvalidEnvInfo; + +static void invalid_env(const char *p, void *userdata) { + InvalidEnvInfo *info = userdata; + + log_unit_error(info->unit_id, "Ignoring invalid environment assignment '%s': %s", p, info->path); +} + int exec_context_load_environment(const ExecContext *c, const char *unit_id, char ***l) { char **i, **r = NULL; @@ -2082,8 +2093,14 @@ int exec_context_load_environment(const ExecContext *c, const char *unit_id, cha return k; } /* Log invalid environment variables with filename */ - if (p) - p = strv_env_clean_log(p, unit_id, pglob.gl_pathv[n]); + if (p) { + InvalidEnvInfo info = { + .unit_id = unit_id, + .path = pglob.gl_pathv[n] + }; + + p = strv_env_clean_with_callback(p, invalid_env, &info); + } if (r == NULL) r = p; -- cgit v1.2.3-54-g00ecf