blockcheck2: fix script crash on bad strategies from the file in custom/10-list.sh

This commit is contained in:
bol-van
2026-08-23 19:50:13 +03:00
parent 2080981cea
commit 07c69bf132
2 changed files with 14 additions and 1 deletions
+13 -1
View File
@@ -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 ]
+1
View File
@@ -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