mirror of
https://github.com/openwrt/packages.git
synced 2026-04-15 10:51:55 +00:00
adblock: update 4.5.4-2
* refine the DNS reporting filter (stricter), to filter out false positives Signed-off-by: Dirk Brenken <dev@brenken.org>
This commit is contained in:
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=adblock
|
||||
PKG_VERSION:=4.5.4
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
PKG_LICENSE:=GPL-3.0-or-later
|
||||
PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
|
||||
|
||||
|
||||
@@ -177,7 +177,7 @@ function stopRefresh() {
|
||||
if [ "${nft_remote}" != "1" ] || [ -z "${nft_macremote}" ]; then
|
||||
printf '%s\n' "
|
||||
<div class=\"msg err\">
|
||||
Remote allow is not enabled or no MAC addresses configured
|
||||
Adblock Remote Allow is not enabled or no MAC addresses configured
|
||||
</div>
|
||||
</div></body></html>"
|
||||
exit 0
|
||||
@@ -185,7 +185,7 @@ fi
|
||||
if [ -z "${query_mac}" ]; then
|
||||
printf '%s\n' "
|
||||
<div class=\"msg err\">
|
||||
Could not determine MAC address
|
||||
MAC address could not be determined
|
||||
</div>
|
||||
</div></body></html>"
|
||||
exit 0
|
||||
|
||||
@@ -1421,6 +1421,9 @@ f_search() {
|
||||
: >"${tmp_result}"
|
||||
read -r search_start _ < "/proc/uptime"
|
||||
search_start="${search_start%.*}"
|
||||
|
||||
# search recursively for domain and its parent domains until tld is reached
|
||||
#
|
||||
while :; do
|
||||
search="${domain//./\\.}"
|
||||
res="$("${adb_awkcmd}" -F '/|\"|\t| ' "/^(${prefix}${search}${suffix})$/{i++;if(i<=9){printf \" + %s\n\",\$${field}}else if(i==10){printf \" + %s\n\",\"[...]\";exit}}" "${adb_finaldir}/${adb_dnsfile}")"
|
||||
@@ -1430,6 +1433,9 @@ f_search() {
|
||||
domain="${tld}"
|
||||
tld="${domain#*.}"
|
||||
done
|
||||
|
||||
# search exactly for domain in backup files and local block-/allowlist
|
||||
#
|
||||
if [ -d "${adb_backupdir}" ]; then
|
||||
search="${1//./\\.}"
|
||||
printf '%s\n%s\n%s\n' ":::" "::: domain '${1}' in backups and in local block-/allowlist" ":::" >>"${tmp_result}"
|
||||
@@ -1857,7 +1863,7 @@ f_report() {
|
||||
# ignore Reverse DNS
|
||||
/\.in-addr\.arpa/ || /\.ip6\.arpa/ { next }
|
||||
# domain request parser (with optional EDNS marker support)
|
||||
/\+[[:space:]]+(\[.*\][[:space:]]+)?(A\?|AAAA\?)/ {
|
||||
/\+[[:space:]]+(\[[0-9a-z]*\][[:space:]]+)?(A\?|AAAA\?)/ {
|
||||
# drop unresolved previous query
|
||||
if (pending)
|
||||
pending = 0
|
||||
@@ -1875,6 +1881,7 @@ f_report() {
|
||||
sub(/[,\.]+$/, "", domain)
|
||||
if (domain ~ /\.lan$/) next
|
||||
if (domain !~ /\./) next
|
||||
if (domain ~ /[\/:]/) next
|
||||
qtype = $(NF-2)
|
||||
sub(/\?$/, "", qtype)
|
||||
last_date = date
|
||||
|
||||
Reference in New Issue
Block a user