summaryrefslogtreecommitdiffstats
path: root/tools/sed/Makefile
Commit message (Expand)AuthorAgeFilesLines
* tools: remove static linking supportJo-Philipp Wich2015-02-061-1/+1
* sed: upgrade to version 4.2.2Luka Perkov2013-02-281-3/+3
* build: add the + token to any commands that can pass through the jobserver, f...Felix Fietkau2012-09-231-1/+1
* tools/sed: enable parallel buildsFelix Fietkau2012-09-151-1/+3
* convert remaining tools to $(HOST_STATIC_LINKING) (#12012)Jo-Philipp Wich2012-08-121-1/+1
* sed: disable further SELinux featuresJo-Philipp Wich2012-08-101-0/+2
* sed: unconditionally disable SELinux, NLS and ACL support (#12007)Jo-Philipp Wich2012-08-101-0/+7
* sed: link staticallyJo-Philipp Wich2012-08-101-1/+1
* tools/sed: update to sed-4.2.1 (also tested on FreeBSD/AMD64)Alexandros C. Couloumbis2010-10-051-5/+5
* revert r17022, this is not the way to do thisFlorian Fainelli2009-07-261-8/+0
* override sed configuration to work with FreeBSD (#4531)Florian Fainelli2009-07-261-0/+8
* fix download urlRalph Hempel2009-05-311-1/+1
* build system refactoring in preparation for allowing packages to do host-buil...Felix Fietkau2009-02-221-5/+5
* build system cleanup/restructuring as described in http://lists.openwrt.org/p...Felix Fietkau2007-08-071-21/+6
* more shell related fixesFelix Fietkau2006-11-121-3/+2
* finally move buildroot-ng to trunkFelix Fietkau2016-03-201-0/+48
ight: bold } /* Literal.Number.Integer.Long */
--- a/action.c
+++ b/action.c
@@ -39,7 +39,7 @@ static void action_dumb(const struct set
  * Returns: Newly allocated string in "key=value" form
  *
  */
-static char* alloc_env(const char *key, const char *value) {
+char* alloc_env(const char *key, const char *value) {
 	size_t keylen, vallen;
 	char *combined;
 
--- a/action.h
+++ b/action.h
@@ -12,5 +12,6 @@
 #include "settings.h"
 
 void action_perform(struct settings_t *, struct uevent_t *);
+char* alloc_env(const char *, const char *);
 #endif /* ifndef ACTION_H */
 
--- a/workers/worker_fork.c
+++ b/workers/worker_fork.c
@@ -380,6 +380,7 @@ static void worker_fork_deinit(void *in_
 
 
 static int worker_fork_process(void *in_ctx, struct uevent_t *uevent) {
+	char **env;
 	int i;
 	struct worker_fork_child_t *child;
 	struct worker_fork_ctx_t *ctx = in_ctx;
@@ -406,6 +407,12 @@ static int worker_fork_process(void *in_
 		 * No child process is currently available.
 		 */
 		if (child == NULL) {
+			env = xmalloc(sizeof(char *) * uevent->env_vars_c);
+			for (i = 0; i < uevent->env_vars_c; i++) {
+				env[i] = alloc_env(uevent->env_vars[i].key, uevent->env_vars[i].value);
+				putenv(env[i]);
+			}
+
 			/*
 			 * Are the matching rules trivial enough that we
 			 * can execute them in the main process?
@@ -421,6 +428,12 @@ static int worker_fork_process(void *in_
 			 */
 			if (ctx->children_count < ctx->max_children)
 				child = worker_fork_spawn(ctx);
+
+			for (i = 0; i < uevent->env_vars_c; i++) {
+				unsetenv(uevent->env_vars[i].key);
+				free(env[i]);
+			}
+			free(env);
 		}
 
 		/*