← Commit list

51b4a9e2f

Denys Vlasenko
Denys Vlasenko
2010-05-18
FAILED Duration: 28s

Subject

ash: fix var_leak testcase

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

shell/ash_test/ash-vars/var_leak.right+2 -1
@@ -1,2 +1,3 @@
should be empty: ''
-should be empty: ''
+should be not empty: 'val2'
+should be not empty: 'val3'
shell/ash_test/ash-vars/var_leak.tests+14 -5
@@ -1,9 +1,18 @@
-# This currently fails with CONFIG_FEATURE_SH_NOFORK=y
+# true is a regular builtin, varibale should not leak out of it
+# this currently fails with CONFIG_FEATURE_SH_NOFORK=y
VAR=''
-VAR=qwe true
+VAR=val1 true
echo "should be empty: '$VAR'"
-# This fails (always)
+# ash follows the "special builtin leaks variables" rule here:
+# exec is a special builtin. (bash does not do it)
VAR=''
-VAR=qwe exec 2>&1
-echo "should be empty: '$VAR'"
+VAR=val2 exec 2>&1
+echo "should be not empty: '$VAR'"
+
+# ash follows the "function call is a special builtin" rule here
+# (bash does not do it)
+f() { true; }
+VAR=''
+VAR=val3 f
+echo "should be not empty: '$VAR'"