1 diff -x '*~' -Naur hotplug2-201/action.c hotplug2-201.patched/action.c
2 --- hotplug2-201/action.c 2010-04-01 04:48:10.000000000 +0300
3 +++ hotplug2-201.patched/action.c 2010-04-01 04:53:49.000000000 +0300
5 * Returns: Newly allocated string in "key=value" form
8 -static char* alloc_env(const char *key, const char *value) {
9 +char* alloc_env(const char *key, const char *value) {
10 size_t keylen, vallen;
13 diff -x '*~' -Naur hotplug2-201/action.h hotplug2-201.patched/action.h
14 --- hotplug2-201/action.h 2009-12-09 20:44:14.000000000 +0200
15 +++ hotplug2-201.patched/action.h 2010-04-01 04:54:14.000000000 +0300
19 void action_perform(struct settings_t *, struct uevent_t *);
20 +char* alloc_env(const char *, const char *);
21 #endif /* ifndef ACTION_H */
23 diff -x '*~' -Naur hotplug2-201/workers/worker_fork.c hotplug2-201.patched/workers/worker_fork.c
24 --- hotplug2-201/workers/worker_fork.c 2010-04-01 04:52:26.000000000 +0300
25 +++ hotplug2-201.patched/workers/worker_fork.c 2010-04-01 04:51:49.000000000 +0300
29 static int worker_fork_process(void *in_ctx, struct uevent_t *uevent) {
32 struct worker_fork_child_t *child;
33 struct worker_fork_ctx_t *ctx = in_ctx;
35 * No child process is currently available.
38 + env = xmalloc(sizeof(char *) * uevent->env_vars_c);
39 + for (i = 0; i < uevent->env_vars_c; i++) {
40 + env[i] = alloc_env(uevent->env_vars[i].key, uevent->env_vars[i].value);
45 * Are the matching rules trivial enough that we
46 * can execute them in the main process?
49 if (ctx->children_count < ctx->max_children)
50 child = worker_fork_spawn(ctx);
52 + for (i = 0; i < uevent->env_vars_c; i++) {
53 + unsetenv(uevent->env_vars[i].key);