chiark / gitweb /
core: loopback - correctly fail the loopback_check if somehow the rtnl calls fail
[elogind.git] / src / core / execute.c
index bc925cd80cfd3bf188ea078badd58f0c6df1a19a..a806d42827a8afa5389bc52948e6498b7cfee884 100644 (file)
@@ -84,7 +84,7 @@
 #include "mkdir.h"
 #include "apparmor-util.h"
 #include "smack-util.h"
-#include "bus-kernel.h"
+#include "bus-endpoint.h"
 #include "label.h"
 #include "cap-list.h"
 
@@ -1984,7 +1984,7 @@ int exec_context_destroy_runtime_directory(ExecContext *c, const char *runtime_p
                 /* We execute this synchronously, since we need to be
                  * sure this is gone when we start the service
                  * next. */
-                rm_rf_dangerous(p, false, true, false);
+                rm_rf(p, false, true, false);
         }
 
         return 0;
@@ -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;