3 @@ -39,7 +39,7 @@ static void action_dumb(const struct set
4 * Returns: Newly allocated string in "key=value" form
7 -static char* alloc_env(const char *key, const char *value) {
8 +char* alloc_env(const char *key, const char *value) {
17 void action_perform(struct settings_t *, struct uevent_t *);
18 +char* alloc_env(const char *, const char *);
19 #endif /* ifndef ACTION_H */
21 --- a/workers/worker_fork.c
22 +++ b/workers/worker_fork.c
23 @@ -380,6 +380,7 @@ static void worker_fork_deinit(void *in_
26 static int worker_fork_process(void *in_ctx, struct uevent_t *uevent) {
29 struct worker_fork_child_t *child;
30 struct worker_fork_ctx_t *ctx = in_ctx;
31 @@ -406,6 +407,12 @@ static int worker_fork_process(void *in_
32 * No child process is currently available.
35 + env = xmalloc(sizeof(char *) * uevent->env_vars_c);
36 + for (i = 0; i < uevent->env_vars_c; i++) {
37 + env[i] = alloc_env(uevent->env_vars[i].key, uevent->env_vars[i].value);
42 * Are the matching rules trivial enough that we
43 * can execute them in the main process?
44 @@ -421,6 +428,12 @@ static int worker_fork_process(void *in_
46 if (ctx->children_count < ctx->max_children)
47 child = worker_fork_spawn(ctx);
49 + for (i = 0; i < uevent->env_vars_c; i++) {
50 + unsetenv(uevent->env_vars[i].key);