adblock: bugfix 3.8.14
authorDirk Brenken <dev@brenken.org>
Wed, 11 Dec 2019 09:39:10 +0000 (10:39 +0100)
committerDirk Brenken <dev@brenken.org>
Wed, 11 Dec 2019 15:32:53 +0000 (16:32 +0100)
* fix some whitelist issues (see
https://forum.openwrt.org/t/adblock-support-thread/507/1101)

Signed-off-by: Dirk Brenken <dev@brenken.org>
(cherry picked from commit 5369d0dbbfc5233ac1f630b93273f40899342cc8)

net/adblock/Makefile
net/adblock/files/adblock.sh

index 1c11afab1dfdf383a500ed1e708245c0bec78c1c..ec64901968e70174c3b15c8324698ac155c90428 100644 (file)
@@ -6,7 +6,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=adblock
-PKG_VERSION:=3.8.13
+PKG_VERSION:=3.8.14
 PKG_RELEASE:=1
 PKG_LICENSE:=GPL-3.0-or-later
 PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
index 0d9a2bb23037b0fb1d3355e202373c11f418843a..5da153a9c75dc173e553ffab9de9b291089c9dee 100755 (executable)
@@ -13,7 +13,7 @@
 #
 LC_ALL=C
 PATH="/usr/sbin:/usr/bin:/sbin:/bin"
-adb_ver="3.8.13"
+adb_ver="3.8.14"
 adb_basever=""
 adb_enabled=0
 adb_debug=0
@@ -604,7 +604,7 @@ f_list()
                                out_rc="${?}"
                                if [ "${out_rc}" -eq 0 ]
                                then
-                                       adb_whitelist_rset="/^([[:alnum:]_-]+\\.)+[[:alpha:]]+([[:space:]]|$)/{gsub(\"\\\\.\",\"\\\\.\",\$1);print tolower(\"^\"\$1\"\\\\|\\\\.\"\$1)}"
+                                       adb_whitelist_rset="/^([[:alnum:]_-]+\\.)+[[:alpha:]]+([[:space:]]|$)/{gsub(\"\\\\.\",\"\\\\.\",\$1);print tolower(\"^(|.*\\\\.)\"\$1\"$\")}"
                                        awk "${adb_whitelist_rset}" "${adb_tmpdir}/tmp.raw.${mode}" > "${adb_tmpdir}/tmp.rem.${mode}"
                                        out_rc="${?}"
                                        if [ "${out_rc}" -eq 0 ] && [ -n "${adb_dnsallow}" ]
@@ -613,6 +613,7 @@ f_list()
                                                out_rc="${?}"
                                        fi
                                fi
+                               rm -f "${adb_tmpdir}/tmp.raw.${mode}"
                        fi
                ;;
                "backup")
@@ -670,7 +671,7 @@ f_list()
                        fi
                        if [ -s "${adb_tmpdir}/tmp.rem.whitelist" ]
                        then
-                               grep -vf "${adb_tmpdir}/tmp.rem.whitelist" "${adb_tmpdir}/${adb_dnsfile}" | eval "${adb_dnsdeny}" >> "${adb_dnsdir}/${adb_dnsfile}"
+                               egrep -vf "${adb_tmpdir}/tmp.rem.whitelist" "${adb_tmpdir}/${adb_dnsfile}" | eval "${adb_dnsdeny}" >> "${adb_dnsdir}/${adb_dnsfile}"
                        else
                                eval "${adb_dnsdeny}" "${adb_tmpdir}/${adb_dnsfile}" >> "${adb_dnsdir}/${adb_dnsfile}"
                        fi