diff --git a/blockcheck2.d/custom/10-list.sh b/blockcheck2.d/custom/10-list.sh index 8531bdf..dc119ab 100644 --- a/blockcheck2.d/custom/10-list.sh +++ b/blockcheck2.d/custom/10-list.sh @@ -3,6 +3,11 @@ LIST_HTTPS_TLS12="${LIST_HTTPS_TLS12:-$TESTDIR/list_https_tls12.txt}" LIST_HTTPS_TLS13="${LIST_HTTPS_TLS13:-$TESTDIR/list_https_tls13.txt}" LIST_QUIC="${LIST_QUIC:-$TESTDIR/list_quic.txt}" +emptyf() +{ + : +} + check_list() { # $1 - test function @@ -19,7 +24,14 @@ check_list() ""|\#*) continue ;; esac line=$(echo "$line" | tr -d "\r\n") - eval pktws_curl_test_update "$1" "$2" $line && ok=1 + # dry run eval in subshell. can fail because of unescaped chars or something else + if (eval emptyf $line); then + # real run in the current shell. can modify vars + eval pktws_curl_test_update "$1" "$2" $line && ok=1 + else + echo >&2 BAD STRATEGY: $line + echo >&2 "THIS LINE IS PASSED TO eval SHELL FUNCTION. IT'S INTERPRETED AS A SHELL STATEMENT. SPECIAL CHARS MUST BE ESCAPED" + fi done < "$3" [ "$ok" = 1 ] diff --git a/docs/changes.txt b/docs/changes.txt index beb90ba..873e36f 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -330,3 +330,4 @@ v0.9.4.3 * nfqws2: negate SSID/NLM filters * nfqws2: desync function can explicitly return nil as a synonym of VERDICT_PASS * zapret-lub: luaexec now passes returned verdict code +* blockcheck2: fix script crash on bad strategies from the file in custom/10-list.sh