summaryrefslogtreecommitdiff
path: root/src/core/execute.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-12-23 19:04:56 +0100
committerLennart Poettering <lennart@poettering.net>2014-12-23 19:15:27 +0100
commit039f0e70a0fcd71dcf7cc2f3ba2cea2e3b186a60 (patch)
tree33cec7bc03e0dbc2d4c69117cf383f3d4d7d5c60 /src/core/execute.c
parent3c70e3bb022f0de3317f3600c9366a2f4597339e (diff)
env-util: don't include files from src/core/
Diffstat (limited to 'src/core/execute.c')
-rw-r--r--src/core/execute.c21
1 files changed, 19 insertions, 2 deletions
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;