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>
This commit is contained in:
Denys Vlasenko
2017-11-03 14:16:25 +01:00
parent f5e8b42788
commit a5060b8364
5 changed files with 88 additions and 5 deletions

View File

@@ -0,0 +1,9 @@
ZVAR=1
ZVAR=2
ZVAR=3
ZVAR=4
ZVAR=5
ZVAR=6
ZVAR=7
ZVAR=8
Ok:0

View File

@@ -0,0 +1,15 @@
# ash had a bug where NOFORKed applet (env/printenv) was not seeing new exported variables
(export ZVAR=1; printenv) | grep ^ZVAR=
(ZVAR=2 printenv) | grep ^ZVAR=
(export ZVAR=3; env) | grep ^ZVAR=
(ZVAR=4 env) | grep ^ZVAR=
export ZVAR=5; printenv | grep ^ZVAR=
ZVAR=6 printenv | grep ^ZVAR=
export ZVAR=7; env | grep ^ZVAR=
ZVAR=8 env | grep ^ZVAR=
echo Ok:$?