aboutsummaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2011-03-08 21:00:36 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2011-03-08 21:00:36 +0100
commit681efe20d327e9e6774b174a617d66bbb9d21f48 (patch)
tree4331e443ee303c24364b1655651c8584db8b51c1 /networking
parent86cf0364bd58e07646a23a1128e4a9ea79189579 (diff)
downloadbusybox-w32-681efe20d327e9e6774b174a617d66bbb9d21f48.tar.gz
busybox-w32-681efe20d327e9e6774b174a617d66bbb9d21f48.tar.bz2
busybox-w32-681efe20d327e9e6774b174a617d66bbb9d21f48.zip
use user's shell instead of hardwired "/bin/sh" (android needs this)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking')
-rw-r--r--networking/ifupdown.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/networking/ifupdown.c b/networking/ifupdown.c
index c7b560bf8..7706a84b7 100644
--- a/networking/ifupdown.c
+++ b/networking/ifupdown.c
@@ -106,6 +106,7 @@ enum {
106struct globals { 106struct globals {
107 char **my_environ; 107 char **my_environ;
108 const char *startup_PATH; 108 const char *startup_PATH;
109 char *shell;
109} FIX_ALIASING; 110} FIX_ALIASING;
110#define G (*(struct globals*)&bb_common_bufsiz1) 111#define G (*(struct globals*)&bb_common_bufsiz1)
111#define INIT_G() do { } while (0) 112#define INIT_G() do { } while (0)
@@ -986,11 +987,10 @@ static int doit(char *str)
986 987
987 fflush_all(); 988 fflush_all();
988 child = vfork(); 989 child = vfork();
989 switch (child) { 990 if (child < 0) /* failure */
990 case -1: /* failure */
991 return 0; 991 return 0;
992 case 0: /* child */ 992 if (child == 0) { /* child */
993 execle(DEFAULT_SHELL, DEFAULT_SHELL, "-c", str, (char *) NULL, G.my_environ); 993 execle(G.shell, G.shell, "-c", str, (char *) NULL, G.my_environ);
994 _exit(127); 994 _exit(127);
995 } 995 }
996 safe_waitpid(child, &status, 0); 996 safe_waitpid(child, &status, 0);
@@ -1165,6 +1165,7 @@ int ifupdown_main(int argc UNUSED_PARAM, char **argv)
1165 INIT_G(); 1165 INIT_G();
1166 1166
1167 G.startup_PATH = getenv("PATH"); 1167 G.startup_PATH = getenv("PATH");
1168 G.shell = xstrdup(get_shell_name());
1168 1169
1169 cmds = iface_down; 1170 cmds = iface_down;
1170 if (applet_name[2] == 'u') { 1171 if (applet_name[2] == 'u') {