summaryrefslogtreecommitdiff
path: root/shell/ash.c
diff options
context:
space:
mode:
authorDenis Vlasenko2008-10-20 08:15:51 +0000
committerDenis Vlasenko2008-10-20 08:15:51 +0000
commitb730474bda4a964930e8013301ace7b49a0c5726 (patch)
tree67a8c0ebd37a6231017e8e8dc3598b63a8c4402c /shell/ash.c
parentd1660cb9ad3adb4b99c098de88f79cbeb74c3a5d (diff)
downloadbusybox-b730474bda4a964930e8013301ace7b49a0c5726.zip
busybox-b730474bda4a964930e8013301ace7b49a0c5726.tar.gz
ash: fix NOEXEC mode - we were forgetting to pass environment!
env: promote to NOEXEC hd: promote to NOEXEC, as hexdump is NOEXEC already
Diffstat (limited to 'shell/ash.c')
-rw-r--r--shell/ash.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 70b7ae3..81ac563 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -7008,8 +7008,11 @@ tryexec(USE_FEATURE_SH_STANDALONE(int applet_no,) char *cmd, char **argv, char *
#if ENABLE_FEATURE_SH_STANDALONE
if (applet_no >= 0) {
- if (APPLET_IS_NOEXEC(applet_no))
+ if (APPLET_IS_NOEXEC(applet_no)) {
+ while (*envp)
+ putenv(*envp++);
run_applet_no_and_exit(applet_no, argv);
+ }
/* re-exec ourselves with the new arguments */
execve(bb_busybox_exec_path, argv, envp);
/* If they called chroot or otherwise made the binary no longer
@@ -12094,7 +12097,7 @@ exportcmd(int argc UNUSED_PARAM, char **argv)
char *name;
const char *p;
char **aptr;
- int flag = argv[0][0] == 'r'? VREADONLY : VEXPORT;
+ int flag = argv[0][0] == 'r' ? VREADONLY : VEXPORT;
if (nextopt("p") != 'p') {
aptr = argptr;