diff options
author | Eric Andersen <andersen@codepoet.org> | 2003-07-29 07:05:40 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2003-07-29 07:05:40 +0000 |
commit | 2a186890ee664be41b8f9ea572a9ae3498f06eca (patch) | |
tree | 13ec20ed6ec7dd51ab4ffe84530d9dd37b77b091 /include | |
parent | 81fe123040b53490b239b3d2abc8cc93d6d462ae (diff) | |
download | busybox-w32-2a186890ee664be41b8f9ea572a9ae3498f06eca.tar.gz busybox-w32-2a186890ee664be41b8f9ea572a9ae3498f06eca.tar.bz2 busybox-w32-2a186890ee664be41b8f9ea572a9ae3498f06eca.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
Diffstat (limited to 'include')
-rw-r--r-- | include/libbb.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/libbb.h b/include/libbb.h index 6b75b8a89..ddc93c183 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -405,7 +405,7 @@ extern void run_shell ( const char *shell, int loginshell, const char *command, | |||
405 | , security_id_t sid | 405 | , security_id_t sid |
406 | #endif | 406 | #endif |
407 | ); | 407 | ); |
408 | extern int run_parts(char **args, const unsigned char test_mode); | 408 | extern int run_parts(char **args, const unsigned char test_mode, char **env); |
409 | extern int restricted_shell ( const char *shell ); | 409 | extern int restricted_shell ( const char *shell ); |
410 | extern void setup_environment ( const char *shell, int loginshell, int changeenv, const struct passwd *pw ); | 410 | extern void setup_environment ( const char *shell, int loginshell, int changeenv, const struct passwd *pw ); |
411 | extern int correct_password ( const struct passwd *pw ); | 411 | extern int correct_password ( const struct passwd *pw ); |