diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2017-11-03 14:16:25 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2017-11-03 14:16:25 +0100 |
commit | a5060b8364faa7c677c8950f1315c451403b0660 (patch) | |
tree | f62638268fb4edd79cd1a062d63092df1a5b4513 /shell/ash_test | |
parent | f5e8b4278822f2413bf7e47466f55cc1a0fcca9a (diff) | |
download | busybox-w32-a5060b8364faa7c677c8950f1315c451403b0660.tar.gz busybox-w32-a5060b8364faa7c677c8950f1315c451403b0660.tar.bz2 busybox-w32-a5060b8364faa7c677c8950f1315c451403b0660.zip |
ash: fix nofork bug where environment is not properly passed to a command
function old new delta
listvars 144 252 +108
evalcommand 1500 1546 +46
showvars 142 147 +5
shellexec 242 245 +3
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 4/0 up/down: 162/0) Total: 162 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/ash_test')
-rw-r--r-- | shell/ash_test/ash-standalone/nofork_env.right | 9 | ||||
-rwxr-xr-x | shell/ash_test/ash-standalone/nofork_env.tests | 15 |
2 files changed, 24 insertions, 0 deletions
diff --git a/shell/ash_test/ash-standalone/nofork_env.right b/shell/ash_test/ash-standalone/nofork_env.right new file mode 100644 index 000000000..3f16ff458 --- /dev/null +++ b/shell/ash_test/ash-standalone/nofork_env.right | |||
@@ -0,0 +1,9 @@ | |||
1 | ZVAR=1 | ||
2 | ZVAR=2 | ||
3 | ZVAR=3 | ||
4 | ZVAR=4 | ||
5 | ZVAR=5 | ||
6 | ZVAR=6 | ||
7 | ZVAR=7 | ||
8 | ZVAR=8 | ||
9 | Ok:0 | ||
diff --git a/shell/ash_test/ash-standalone/nofork_env.tests b/shell/ash_test/ash-standalone/nofork_env.tests new file mode 100755 index 000000000..111e564d2 --- /dev/null +++ b/shell/ash_test/ash-standalone/nofork_env.tests | |||
@@ -0,0 +1,15 @@ | |||
1 | # ash had a bug where NOFORKed applet (env/printenv) was not seeing new exported variables | ||
2 | |||
3 | (export ZVAR=1; printenv) | grep ^ZVAR= | ||
4 | (ZVAR=2 printenv) | grep ^ZVAR= | ||
5 | |||
6 | (export ZVAR=3; env) | grep ^ZVAR= | ||
7 | (ZVAR=4 env) | grep ^ZVAR= | ||
8 | |||
9 | export ZVAR=5; printenv | grep ^ZVAR= | ||
10 | ZVAR=6 printenv | grep ^ZVAR= | ||
11 | |||
12 | export ZVAR=7; env | grep ^ZVAR= | ||
13 | ZVAR=8 env | grep ^ZVAR= | ||
14 | |||
15 | echo Ok:$? | ||