mirror of
https://github.com/bol-van/zapret2.git
synced 2026-08-27 20:46:10 +04:00
blockcheck2: fix script crash on bad strategies from the file in custom/10-list.sh
This commit is contained in:
@@ -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 ]
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user