diff --git a/tests/bigip/class.tcl b/tests/bigip/class.irule similarity index 100% rename from tests/bigip/class.tcl rename to tests/bigip/class.irule diff --git a/tests/bigip/class.tcl.expected b/tests/bigip/class.irule.expected similarity index 100% rename from tests/bigip/class.tcl.expected rename to tests/bigip/class.irule.expected diff --git a/tests/bigip/conditionals.tcl b/tests/bigip/conditionals.irule similarity index 100% rename from tests/bigip/conditionals.tcl rename to tests/bigip/conditionals.irule diff --git a/tests/bigip/conditionals.tcl.expected b/tests/bigip/conditionals.irule.expected similarity index 100% rename from tests/bigip/conditionals.tcl.expected rename to tests/bigip/conditionals.irule.expected diff --git a/tests/bigip/deprecated.tcl b/tests/bigip/deprecated.irule similarity index 100% rename from tests/bigip/deprecated.tcl rename to tests/bigip/deprecated.irule diff --git a/tests/bigip/deprecated.tcl.expected b/tests/bigip/deprecated.irule.expected similarity index 100% rename from tests/bigip/deprecated.tcl.expected rename to tests/bigip/deprecated.irule.expected diff --git a/tests/bigip/syntax/test1.irule b/tests/bigip/syntax/test1.irule new file mode 100644 index 0000000..78892d5 --- /dev/null +++ b/tests/bigip/syntax/test1.irule @@ -0,0 +1,7 @@ +when RULE_INIT priority 500 { + set n 1; +while {$n < 30} +{ + log local0. [set n [expr $n + 30]] +} +} \ No newline at end of file diff --git a/tests/bigip/syntax/test1.irule.expected b/tests/bigip/syntax/test1.irule.expected new file mode 100644 index 0000000..e0c4f85 --- /dev/null +++ b/tests/bigip/syntax/test1.irule.expected @@ -0,0 +1,4 @@ +DANGEROUS: Dangerous unquoted expr at `$n` in `expr $n + 30` +WARNING: Unquoted expr at `+` in `expr $n + 30` +WARNING: Unquoted expr at `30` in `expr $n + 30` + diff --git a/tests/bigip/syntax/test2.irule b/tests/bigip/syntax/test2.irule new file mode 100644 index 0000000..40d5477 --- /dev/null +++ b/tests/bigip/syntax/test2.irule @@ -0,0 +1,7 @@ +when RULE_INIT priority 500 { + set n 1; +while {$n < 30} \ +{ + log local0. [set n [expr $n + 30]] +} +} \ No newline at end of file diff --git a/tests/bigip/syntax/test2.irule.expected b/tests/bigip/syntax/test2.irule.expected new file mode 100644 index 0000000..e0c4f85 --- /dev/null +++ b/tests/bigip/syntax/test2.irule.expected @@ -0,0 +1,4 @@ +DANGEROUS: Dangerous unquoted expr at `$n` in `expr $n + 30` +WARNING: Unquoted expr at `+` in `expr $n + 30` +WARNING: Unquoted expr at `30` in `expr $n + 30` + diff --git a/tests/bigip/syntax/test3.irule b/tests/bigip/syntax/test3.irule new file mode 100644 index 0000000..57a7d10 --- /dev/null +++ b/tests/bigip/syntax/test3.irule @@ -0,0 +1,8 @@ +when RULE_INIT priority 500 { + set n 1; + # space after line continouation is not allowed, not even in iRules +while {$n < 30} \ +{ + log local0. [set n [expr $n + 30]] +} +} \ No newline at end of file diff --git a/tests/bigip/syntax/test3.irule.expected b/tests/bigip/syntax/test3.irule.expected new file mode 100644 index 0000000..1207018 --- /dev/null +++ b/tests/bigip/syntax/test3.irule.expected @@ -0,0 +1,2 @@ +DANGEROUS: badly formed command, cannot scan code at `while` in `while {$n < 30} \ { log local0. [set n [expr $n + 30]]}` + diff --git a/tests/bigip/syntax/test4.irule b/tests/bigip/syntax/test4.irule new file mode 100644 index 0000000..97ae5c9 --- /dev/null +++ b/tests/bigip/syntax/test4.irule @@ -0,0 +1,8 @@ +when RULE_INIT priority 500 { + for + {set x 0} + {$x<10} +{incr x} { + log local0. "for x is [expr $x]" +} +} \ No newline at end of file diff --git a/tests/bigip/syntax/test4.irule.expected b/tests/bigip/syntax/test4.irule.expected new file mode 100644 index 0000000..101664f --- /dev/null +++ b/tests/bigip/syntax/test4.irule.expected @@ -0,0 +1,2 @@ +DANGEROUS: Dangerous unquoted expr at `$x` in `expr $x` + diff --git a/tests/bigip/syntax/test5.irule b/tests/bigip/syntax/test5.irule new file mode 100644 index 0000000..198d226 --- /dev/null +++ b/tests/bigip/syntax/test5.irule @@ -0,0 +1,4 @@ +when RULE_INIT priority 500 { +switch {4}{ + {4}{log local0. [expr 4]} } +} \ No newline at end of file diff --git a/tests/bigip/syntax/test5.irule.expected b/tests/bigip/syntax/test5.irule.expected new file mode 100644 index 0000000..a2c8aa8 --- /dev/null +++ b/tests/bigip/syntax/test5.irule.expected @@ -0,0 +1,3 @@ +DANGEROUS: missing options terminator `--` permits argument injection at `{4}` in `switch {4} { {4} {log local0. [expr 4]} } ` +WARNING: Unquoted expr at `4` in `expr 4` + diff --git a/tests/bigip/table.irule b/tests/bigip/table.irule new file mode 100644 index 0000000..bf17821 --- /dev/null +++ b/tests/bigip/table.irule @@ -0,0 +1,36 @@ +when CLIENT_ACCEPTED priority 500 { + log local0. "table set -- foo1 bar1> [table set -- foo1 bar1]" + log local0. "table set -subtable foo3 -- abc def> [table set -subtable foo3 -- abc def]" + log local0. "table set -georedundancy -- abc def> [table set -georedundancy -- abc def]" + log local0. "table set -notouch -subtable foo4 -- abc def> [table set -notouch -subtable foo4 -- abc def]" + log local0. "table add -- foo2 bar2> [table add -- foo2 bar2]" + log local0. "table replace -- foo1 1> [table replace -- foo1 1]" + log local0. "\[table lookup -- foo1\]> [table lookup -- foo1]" + log local0. "\[table incr -- foo1 1\]> [table incr -- foo1 1]" + log local0. "\[table lookup -georedundancy -- abc\]> [table lookup -georedundancy -- abc]" + log local0. "table append -- foo2 bar3> [table append -- foo2 bar3]" + log local0. "table delete -- foo2> [table delete -- foo2]" + log local0. "table timeout -- foo1 60> [table timeout -- foo1 60]" + log local0. "table lifetime -- foo1 60> [table lifetime -- foo1 60]" + log local0. "\[table timeout -remaining -- foo1\]> [table timeout -remaining -- foo1]" + log local0. "\[table lifetime -remaining -- foo1\]> [table lifetime -remaining -- foo1]" + log local0. "\[table keys -subtable foo3 -count\]> [table keys -subtable foo3 -count]" +} +when CLIENT_ACCEPTED priority 501 { + log local0. "table set FOO1 bar1> [table set FOO1 bar1]" + log local0. "table set -subtable FOO3 ABC DEF> [table set -subtable FOO3 ABC DEF]" + log local0. "table set -georedundancy ABC DEF> [table set -georedundancy ABC DEF]" + log local0. "table set -notouch -subtable FOO4 ABC DEF> [table set -notouch -subtable FOO4 ABC DEF]" + log local0. "table add FOO2 bar2> [table add FOO2 bar2]" + log local0. "table replace FOO1 1> [table replace FOO1 1]" + log local0. "\[table lookup FOO1\]> [table lookup FOO1]" + log local0. "\[table incr FOO1 1\]> [table incr FOO1 1]" + log local0. "\[table lookup -georedundancy ABC\]> [table lookup -georedundancy ABC]" + log local0. "table append FOO2 bar3> [table append FOO2 bar3]" + log local0. "table delete FOO2> [table delete FOO2]" + log local0. "table timeout FOO1 60> [table timeout FOO1 60]" + log local0. "table lifetime FOO1 60> [table lifetime FOO1 60]" + log local0. "\[table timeout -remaining FOO1\]> [table timeout -remaining FOO1]" + log local0. "\[table lifetime -remaining FOO1\]> [table lifetime -remaining FOO1]" + log local0. "\[table keys -subtable FOO3 -count\]> [table keys -subtable FOO3 -count]" +} \ No newline at end of file diff --git a/tests/bigip/tmconf.tcl b/tests/bigip/tmconf.irule similarity index 100% rename from tests/bigip/tmconf.tcl rename to tests/bigip/tmconf.irule diff --git a/tests/bigip/tmconf.tcl.expected b/tests/bigip/tmconf.irule.expected similarity index 100% rename from tests/bigip/tmconf.tcl.expected rename to tests/bigip/tmconf.irule.expected diff --git a/tests/bigip/unsafe.tcl b/tests/bigip/unsafe.irule similarity index 100% rename from tests/bigip/unsafe.tcl rename to tests/bigip/unsafe.irule diff --git a/tests/bigip/unsafe.tcl.expected b/tests/bigip/unsafe.irule.expected similarity index 100% rename from tests/bigip/unsafe.tcl.expected rename to tests/bigip/unsafe.irule.expected diff --git a/tests/bigip/unsupported.tcl b/tests/bigip/unsupported.irule similarity index 100% rename from tests/bigip/unsupported.tcl rename to tests/bigip/unsupported.irule diff --git a/tests/bigip/unsupported.tcl.expected b/tests/bigip/unsupported.irule.expected similarity index 100% rename from tests/bigip/unsupported.tcl.expected rename to tests/bigip/unsupported.irule.expected diff --git a/tests/bigip/when.tcl b/tests/bigip/when.irule similarity index 100% rename from tests/bigip/when.tcl rename to tests/bigip/when.irule diff --git a/tests/bigip/when.tcl.expected b/tests/bigip/when.irule.expected similarity index 100% rename from tests/bigip/when.tcl.expected rename to tests/bigip/when.irule.expected diff --git a/tests/tcl/all.tcl b/tests/tcl/all.tcl new file mode 100644 index 0000000..efa1548 --- /dev/null +++ b/tests/tcl/all.tcl @@ -0,0 +1,208 @@ +# after +after 100 +after 100 { + expr 1 +} +after cancel -current +after cancel 100 +after cancel [expr 2] +after cancel {100 200 300} +after info 100 +after info [expr 3] +after info {100 200 300} + +set cncl cancel +set curr {-current} +set inf info + +after $cncl $curr +after $cncl 123 +after $cncl [expr 4] +after $cncl {100 200 300} +after $inf 123 +after $inf [expr 5] +after $inf {100 200 300} + +set id 123 +set ids [list 123 456 789] +after cancel $ids + +set ms 100 +after $ms { + expr 6 +} +after $ms -periodic { + expr 7 +} +after 100 { + expr 8 +} +after 100 -periodic { + expr 9 +} + +# catch +catch { + expr 1 +} result + +catch { + expr 2 +} + +# foreach +foreach i {d e f g} { + expr 1 +} + +foreach i {a b c} j {d e f g} { + expr 2 +} + +foreach {i j} {a b c d} k {d e f g} {l m} {h i j k} { + expr 3 +} + +# if +if {1} { + expr 1 +} elseif {2} { + expr 2 +} else { + expr 3 +} + +# test .. then .. support + +if {10} then { + expr 10 +} +elseif {20} then { + expr 20 +} +else { + expr 30 +} + +if {100} { + expr 100 +} elseif {200} { + expr 200 +} +elseif {300} { + expr 300 +} +else { + expr 400 +} + +if {1000} +{ + expr 1000 +} +elseif {2000} +{ + expr 2000 +} +else +{ + expr 3000 +} + +# regexp_regsub +regexp -- exp string ?matchVar? ?subMatchVar subMatchVar ...? +regsub -- exp string subSpec ?varName? + +regexp -about -expanded -indices -line -linestop -lineanchor -nocase -all -inline -start -- exp string ?matchVar? ?subMatchVar subMatchVar ...? +regsub -all -expanded -line -linestop -lineanchor -nocase -start -- exp string subSpec ?varName? + +regexp -about -expanded -indices -line -linestop -lineanchor -nocase -all -inline -start exp_fail_100 string ?matchVar? ?subMatchVar subMatchVar ...? +regsub -all -expanded -line -linestop -lineanchor -nocase -start exp_fail_200 string subSpec ?varName? + +regexp -about -expanded -indices -line -linestop -lineanchor -nocase -all -inline exp_fail_300 string ?matchVar? ?subMatchVar subMatchVar ...? +regsub -all -expanded -line -linestop -lineanchor -nocase exp_fail_400 string subSpec ?varName? + +regexp -about -expanded -indices -line -linestop -lineanchor -nocase -all -inline exp_fail_500 string ?matchVar? ?subMatchVar subMatchVar ...? +regsub -all -expanded -line -linestop -lineanchor -nocase exp_fail_600 string subSpec ?varName? + +regexp exp_fail_700 string ?matchVar? ?subMatchVar subMatchVar ...? +regsub exp_fail_800 string subSpec ?varName? + +# switch +set foo "bar" +set DANGEROUS "1" + + +switch "abc" { + abc {} + default {expr 2} + +} + +switch abc { + a - + b {expr 10} + $foo {expr 20} + default {expr 30} +} + +switch abc a {expr 100} +switch abc a - b {expr 1000} $foo {expr 2000} default {expr 3000} +switch -- abc a - b {expr 10000} $foo {expr 20000} default {expr 30000} +switch -- abc { a - b {expr 1*1} $foo {expr 2*2} default {expr 3*3} } + +switch -- $foo { + "BAR" - + "bar" { expr $DANGEROUS } + "baz" { + expr 111 + } + default {set baz "fizz"} +} + +switch -exact -- $foo { + {bar} { + expr $DANGEROUS + } + {fiz} - + "faz" - + "[expr 222]" - + default {} +} + +set var 1 +switch -exact -- $var \ + {bar} { + expr $DANGEROUS + } \ + {fiz} - \ + "faz" - \ + "[expr 333]" - \ + default {} + + +set switch { + a*b - + b {expr 1} + a* {expr 2} + default {expr 3} +} + +switch -glob aaab $switch + +set switch [linsert $switch end-2 c {expr 4}] + +switch -glob c $switch + +# unset +unset -nocomplain -- var_x var_y var_z +unset -- var_x var_y var_z + +unset fail_100 var_y var_z + +unset -nocomplain fail_200 var_y var_z + +# while +while [expr 1] { + expr 2 +} diff --git a/tests/tcl/all.tcl.expected b/tests/tcl/all.tcl.expected new file mode 100644 index 0000000..72ed685 --- /dev/null +++ b/tests/tcl/all.tcl.expected @@ -0,0 +1,76 @@ +WARNING: Unquoted expr at `1` in `expr 1` +WARNING: Unquoted expr at `2` in `expr 2` +WARNING: Unquoted expr at `3` in `expr 3` +DANGEROUS: Dangerous unquoted block at `$curr` in `after $cncl $curr` +WARNING: Unquoted block at `123` in `after $cncl 123` +WARNING: Unquoted expr at `4` in `expr 4` +DANGEROUS: Dangerous unquoted block at `[expr 4]` in `after $cncl [expr 4]` +WARNING: Unquoted block at `123` in `after $inf 123` +WARNING: Unquoted expr at `5` in `expr 5` +DANGEROUS: Dangerous unquoted block at `[expr 5]` in `after $inf [expr 5]` +WARNING: Unquoted expr at `6` in `expr 6` +WARNING: Unquoted expr at `7` in `expr 7` +WARNING: Unquoted expr at `8` in `expr 8` +WARNING: Unquoted expr at `9` in `expr 9` +WARNING: Unquoted expr at `1` in `expr 1` +WARNING: Unquoted expr at `2` in `expr 2` +WARNING: Unquoted expr at `1` in `expr 1` +WARNING: Unquoted expr at `2` in `expr 2` +WARNING: Unquoted expr at `3` in `expr 3` +WARNING: Unquoted expr at `1` in `expr 1` +WARNING: Unquoted expr at `2` in `expr 2` +WARNING: Unquoted expr at `3` in `expr 3` +WARNING: Unquoted expr at `10` in `expr 10` +WARNING: Unquoted expr at `20` in `expr 20` +WARNING: Unquoted expr at `30` in `expr 30` +WARNING: Unquoted expr at `100` in `expr 100` +WARNING: Unquoted expr at `200` in `expr 200` +WARNING: Unquoted expr at `300` in `expr 300` +WARNING: Unquoted expr at `400` in `expr 400` +WARNING: Unquoted expr at `1000` in `expr 1000` +WARNING: Unquoted expr at `2000` in `expr 2000` +WARNING: Unquoted expr at `3000` in `expr 3000` +DANGEROUS: missing options terminator `--` permits argument injection at `exp_fail_100` in `regexp -about -expanded -indices -line -linestop -lineanchor -nocase -all -inline -start exp_fail_100 string ?matchVar? ?subMatchVar subMatchVar ...?` +DANGEROUS: missing options terminator `--` permits argument injection at `exp_fail_200` in `regsub -all -expanded -line -linestop -lineanchor -nocase -start exp_fail_200 string subSpec ?varName?` +DANGEROUS: missing options terminator `--` permits argument injection at `exp_fail_300` in `regexp -about -expanded -indices -line -linestop -lineanchor -nocase -all -inline exp_fail_300 string ?matchVar? ?subMatchVar subMatchVar ...?` +DANGEROUS: missing options terminator `--` permits argument injection at `exp_fail_400` in `regsub -all -expanded -line -linestop -lineanchor -nocase exp_fail_400 string subSpec ?varName?` +DANGEROUS: missing options terminator `--` permits argument injection at `exp_fail_500` in `regexp -about -expanded -indices -line -linestop -lineanchor -nocase -all -inline exp_fail_500 string ?matchVar? ?subMatchVar subMatchVar ...?` +DANGEROUS: missing options terminator `--` permits argument injection at `exp_fail_600` in `regsub -all -expanded -line -linestop -lineanchor -nocase exp_fail_600 string subSpec ?varName?` +DANGEROUS: missing options terminator `--` permits argument injection at `exp_fail_700` in `regexp exp_fail_700 string ?matchVar? ?subMatchVar subMatchVar ...?` +DANGEROUS: missing options terminator `--` permits argument injection at `exp_fail_800` in `regsub exp_fail_800 string subSpec ?varName?` +DANGEROUS: missing options terminator `--` permits argument injection at `"abc"` in `switch "abc" { abc {} default {expr 2}}` +WARNING: Unquoted expr at `2` in `expr 2` +DANGEROUS: missing options terminator `--` permits argument injection at `abc` in `switch abc { a - b {expr 10} $foo {expr 20} default {expr 30}}` +WARNING: Unquoted expr at `10` in `expr 10` +DANGEROUS: Expected literal, found $ at `$foo` in `switch abc { a - b {expr 10} $foo {expr 20} default {expr 30}}` +WARNING: Unquoted expr at `20` in `expr 20` +WARNING: Unquoted expr at `30` in `expr 30` +DANGEROUS: missing options terminator `--` permits argument injection at `abc` in `switch abc a {expr 100}` +DANGEROUS: Dangerous unquoted switch body at `abc` in `switch abc a {expr 100}` +DANGEROUS: badly formed command, cannot scan code at `switch` in `switch abc a {expr 100}` +DANGEROUS: missing options terminator `--` permits argument injection at `abc` in `switch abc a - b {expr 1000} $foo {expr 2000} default {expr 3000}` +DANGEROUS: Dangerous unquoted switch body at `abc` in `switch abc a - b {expr 1000} $foo {expr 2000} default {expr 3000}` +DANGEROUS: badly formed command, cannot scan code at `switch` in `switch abc a - b {expr 1000} $foo {expr 2000} default {expr 3000}` +DANGEROUS: Dangerous unquoted switch body at `abc` in `switch -- abc a - b {expr 10000} $foo {expr 20000} default {expr 30000}` +DANGEROUS: badly formed command, cannot scan code at `switch` in `switch -- abc a - b {expr 10000} $foo {expr 20000} default {expr 30000}` +WARNING: Unquoted expr at `1*1` in `expr 1*1` +DANGEROUS: Expected literal, found $ at `$foo` in `switch -- abc { a - b {expr 1*1} $foo {expr 2*2} default {expr 3*3} }` +WARNING: Unquoted expr at `2*2` in `expr 2*2` +WARNING: Unquoted expr at `3*3` in `expr 3*3` +DANGEROUS: Dangerous unquoted expr at `$DANGEROUS` in `expr $DANGEROUS ` +WARNING: Unquoted expr at `111` in `expr 111` +DANGEROUS: Dangerous unquoted expr at `$DANGEROUS` in `expr $DANGEROUS` +DANGEROUS: Expected literal, found [ at `"[expr 222]"` in `switch -exact -- $foo { {bar} { expr $DANGEROUS } {fiz} - "faz" - "[expr 222]" - default {}}` +WARNING: Unquoted expr at `333` in `expr 333` +DANGEROUS: Dangerous unquoted switch body at `$var` in `switch -exact -- $var \ {bar} { expr $DANGEROUS } \ {fiz} - \ "faz" - \ "[expr 333]" - \ default {}` +DANGEROUS: badly formed command, cannot scan code at `switch` in `switch -exact -- $var \ {bar} { expr $DANGEROUS } \ {fiz} - \ "faz" - \ "[expr 333]" - \ default {}` +DANGEROUS: missing options terminator `--` permits argument injection at `aaab` in `switch -glob aaab $switch` +DANGEROUS: Dangerous quoted `"` switch body at `$switch` in `switch -glob aaab $switch` +DANGEROUS: missing options terminator `--` permits argument injection at `c` in `switch -glob c $switch` +DANGEROUS: Dangerous quoted `"` switch body at `$switch` in `switch -glob c $switch` +DANGEROUS: missing options terminator `--` permits argument injection at `fail_100` in `unset fail_100 var_y var_z` +DANGEROUS: missing options terminator `--` permits argument injection at `fail_200` in `unset -nocomplain fail_200 var_y var_z` +WARNING: Unquoted expr at `1` in `expr 1` +DANGEROUS: Dangerous unquoted expr at `[expr 1]` in `while [expr 1] { expr 2}` +WARNING: Unquoted expr at `2` in `expr 2` + diff --git a/tests/tcl/if.tcl.expected b/tests/tcl/if.tcl.expected index b19c7c4..8fa5e6b 100644 --- a/tests/tcl/if.tcl.expected +++ b/tests/tcl/if.tcl.expected @@ -8,5 +8,7 @@ WARNING: Unquoted expr at `100` in `expr 100` WARNING: Unquoted expr at `200` in `expr 200` WARNING: Unquoted expr at `300` in `expr 300` WARNING: Unquoted expr at `400` in `expr 400` -WARNING: badly formed command at `else` in `else` +WARNING: Unquoted expr at `1000` in `expr 1000` +WARNING: Unquoted expr at `2000` in `expr 2000` +WARNING: Unquoted expr at `3000` in `expr 3000` diff --git a/tests/tcl/switch.tcl.expected b/tests/tcl/switch.tcl.expected index e46a6b4..885c267 100644 --- a/tests/tcl/switch.tcl.expected +++ b/tests/tcl/switch.tcl.expected @@ -6,13 +6,13 @@ DANGEROUS: Expected literal, found $ at `$foo` in `switch abc { a - b {exp WARNING: Unquoted expr at `20` in `expr 20` WARNING: Unquoted expr at `30` in `expr 30` DANGEROUS: missing options terminator `--` permits argument injection at `abc` in `switch abc a {expr 100}` -DANGEROUS: Dangerous unqoted switch body at `abc` in `switch abc a {expr 100}` -WARNING: badly formed command at `switch` in `switch abc a {expr 100}` +DANGEROUS: Dangerous unquoted switch body at `abc` in `switch abc a {expr 100}` +DANGEROUS: badly formed command, cannot scan code at `switch` in `switch abc a {expr 100}` DANGEROUS: missing options terminator `--` permits argument injection at `abc` in `switch abc a - b {expr 1000} $foo {expr 2000} default {expr 3000}` -DANGEROUS: Dangerous unqoted switch body at `abc` in `switch abc a - b {expr 1000} $foo {expr 2000} default {expr 3000}` -WARNING: badly formed command at `switch` in `switch abc a - b {expr 1000} $foo {expr 2000} default {expr 3000}` -DANGEROUS: Dangerous unqoted switch body at `abc` in `switch -- abc a - b {expr 10000} $foo {expr 20000} default {expr 30000}` -WARNING: badly formed command at `switch` in `switch -- abc a - b {expr 10000} $foo {expr 20000} default {expr 30000}` +DANGEROUS: Dangerous unquoted switch body at `abc` in `switch abc a - b {expr 1000} $foo {expr 2000} default {expr 3000}` +DANGEROUS: badly formed command, cannot scan code at `switch` in `switch abc a - b {expr 1000} $foo {expr 2000} default {expr 3000}` +DANGEROUS: Dangerous unquoted switch body at `abc` in `switch -- abc a - b {expr 10000} $foo {expr 20000} default {expr 30000}` +DANGEROUS: badly formed command, cannot scan code at `switch` in `switch -- abc a - b {expr 10000} $foo {expr 20000} default {expr 30000}` WARNING: Unquoted expr at `1*1` in `expr 1*1` DANGEROUS: Expected literal, found $ at `$foo` in `switch -- abc { a - b {expr 1*1} $foo {expr 2*2} default {expr 3*3} }` WARNING: Unquoted expr at `2*2` in `expr 2*2` @@ -20,10 +20,10 @@ WARNING: Unquoted expr at `3*3` in `expr 3*3` DANGEROUS: Dangerous unquoted expr at `$DANGEROUS` in `expr $DANGEROUS ` WARNING: Unquoted expr at `111` in `expr 111` DANGEROUS: Dangerous unquoted expr at `$DANGEROUS` in `expr $DANGEROUS` -DANGEROUS: Expected literal, found [ at `"[expr 222]"` in `switch -exact -- $foo { {bar} { expr $DANGEROUS } {fiz} - "faz" - "[expr 222]" - default {}}` +DANGEROUS: Expected literal, found [ at `"[expr 222]"` in `switch -exact -- $foo { {bar} { expr $DANGEROUS } {fiz} - "faz" - "[expr 222]" - default {}}` WARNING: Unquoted expr at `333` in `expr 333` -DANGEROUS: Dangerous unqoted switch body at `$var` in `switch -exact -- $var \ {bar} { expr $DANGEROUS } \ {fiz} - \ "faz" - \ "[expr 333]" - \ default {}` -WARNING: badly formed command at `switch` in `switch -exact -- $var \ {bar} { expr $DANGEROUS } \ {fiz} - \ "faz" - \ "[expr 333]" - \ default {}` +DANGEROUS: Dangerous unquoted switch body at `$var` in `switch -exact -- $var \ {bar} { expr $DANGEROUS } \ {fiz} - \ "faz" - \ "[expr 333]" - \ default {}` +DANGEROUS: badly formed command, cannot scan code at `switch` in `switch -exact -- $var \ {bar} { expr $DANGEROUS } \ {fiz} - \ "faz" - \ "[expr 333]" - \ default {}` DANGEROUS: missing options terminator `--` permits argument injection at `aaab` in `switch -glob aaab $switch` DANGEROUS: Dangerous quoted `"` switch body at `$switch` in `switch -glob aaab $switch` DANGEROUS: missing options terminator `--` permits argument injection at `c` in `switch -glob c $switch`