From a5060b8364faa7c677c8950f1315c451403b0660 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Fri, 3 Nov 2017 14:16:25 +0100 Subject: 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 --- shell/hush_test/hush-standalone/nofork_env.tests | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 shell/hush_test/hush-standalone/nofork_env.tests (limited to 'shell/hush_test/hush-standalone/nofork_env.tests') diff --git a/shell/hush_test/hush-standalone/nofork_env.tests b/shell/hush_test/hush-standalone/nofork_env.tests new file mode 100755 index 000000000..111e564d2 --- /dev/null +++ b/shell/hush_test/hush-standalone/nofork_env.tests @@ -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:$? -- cgit v1.2.3