diff options
Diffstat (limited to 'networking/ifupdown.c')
-rw-r--r-- | networking/ifupdown.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/networking/ifupdown.c b/networking/ifupdown.c index 818bec2d6..f91eddae8 100644 --- a/networking/ifupdown.c +++ b/networking/ifupdown.c | |||
@@ -1019,7 +1019,7 @@ static int doit(char *str) | |||
1019 | static int execute_all(struct interface_defn_t *ifd, execfn *exec, const char *opt) | 1019 | static int execute_all(struct interface_defn_t *ifd, execfn *exec, const char *opt) |
1020 | { | 1020 | { |
1021 | int i; | 1021 | int i; |
1022 | char *buf; | 1022 | char *buf[2]; |
1023 | 1023 | ||
1024 | for (i = 0; i < ifd->n_options; i++) { | 1024 | for (i = 0; i < ifd->n_options; i++) { |
1025 | if (strcmp(ifd->option[i].name, opt) == 0) { | 1025 | if (strcmp(ifd->option[i].name, opt) == 0) { |
@@ -1029,10 +1029,11 @@ static int execute_all(struct interface_defn_t *ifd, execfn *exec, const char *o | |||
1029 | } | 1029 | } |
1030 | } | 1030 | } |
1031 | 1031 | ||
1032 | buf = xmalloc(bb_strlen(opt) + 19); | 1032 | bb_xasprintf(&buf[0], "/etc/network/if-%s.d", opt); |
1033 | sprintf(buf, "/etc/network/if-%s.d", opt); | 1033 | buf[1] = NULL; |
1034 | run_parts(&buf, 2); | 1034 | |
1035 | free(buf); | 1035 | run_parts(&buf, 2, environ); |
1036 | free(buf[0]); | ||
1036 | return (1); | 1037 | return (1); |
1037 | } | 1038 | } |
1038 | 1039 | ||