diff options
| author | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2003-07-29 07:05:40 +0000 |
|---|---|---|
| committer | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2003-07-29 07:05:40 +0000 |
| commit | 0a44eed81409e05f62e5cb195ed2d72972d3ee22 (patch) | |
| tree | 13ec20ed6ec7dd51ab4ffe84530d9dd37b77b091 /debianutils | |
| parent | 9d760860836c9f87ac48ca5488333f69cd5b7698 (diff) | |
| download | busybox-w32-0a44eed81409e05f62e5cb195ed2d72972d3ee22.tar.gz busybox-w32-0a44eed81409e05f62e5cb195ed2d72972d3ee22.tar.bz2 busybox-w32-0a44eed81409e05f62e5cb195ed2d72972d3ee22.zip | |
Bruno Randolf writes:
this patch fixes run_parts when it's called by ifupdown. 1) argv has to be a
NULL terminated char* array, not just a string. 2) run_parts now explicitly
sets the environment. this environment is populated from the
/etc/network/interfaces config file and is needed by the scripts in
/etc/network/if-pre-up.d/. when run-parts is called from the command line the
environment is taken from the current process.
Vladimir Oleynik then wrote:
You can simplify this if use:
+ bb_xasprintf(&buf[0], "/etc/network/if-%s.d", opt);
+ buf[1] = NULL;
+
+ run_parts(&buf, 2, environ);
+ free(buf[0]);
--w
vodz
git-svn-id: svn://busybox.net/trunk/busybox@7130 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'debianutils')
| -rw-r--r-- | debianutils/run_parts.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/debianutils/run_parts.c b/debianutils/run_parts.c index 98fd58887..53d33cec5 100644 --- a/debianutils/run_parts.c +++ b/debianutils/run_parts.c | |||
| @@ -61,6 +61,8 @@ static const struct option runparts_long_options[] = { | |||
| 61 | { 0, 0, 0, 0 } | 61 | { 0, 0, 0, 0 } |
| 62 | }; | 62 | }; |
| 63 | 63 | ||
| 64 | extern char **environ; | ||
| 65 | |||
| 64 | /* run_parts_main */ | 66 | /* run_parts_main */ |
| 65 | /* Process options */ | 67 | /* Process options */ |
| 66 | int run_parts_main(int argc, char **argv) | 68 | int run_parts_main(int argc, char **argv) |
| @@ -108,5 +110,5 @@ int run_parts_main(int argc, char **argv) | |||
| 108 | args[0] = argv[optind]; | 110 | args[0] = argv[optind]; |
| 109 | args[argcount] = 0; | 111 | args[argcount] = 0; |
| 110 | 112 | ||
| 111 | return(run_parts(args, test_mode)); | 113 | return(run_parts(args, test_mode, environ)); |
| 112 | } | 114 | } |
