aboutsummaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authortobik <tobik@FreeBSD.org>2019-01-29 03:37:02 +0800
committertobik <tobik@FreeBSD.org>2019-01-29 03:37:02 +0800
commit6ffa819be4cea4c8ccd194cf046f9424fe8a9b32 (patch)
treee9b62338b162b8d8cf0f2a316db859af7cf0dc48 /security
parentf02184df4eb7f18f1e172fa25aadfaf67cc2fc31 (diff)
downloadfreebsd-ports-gnome-6ffa819be4cea4c8ccd194cf046f9424fe8a9b32.tar.gz
freebsd-ports-gnome-6ffa819be4cea4c8ccd194cf046f9424fe8a9b32.tar.zst
freebsd-ports-gnome-6ffa819be4cea4c8ccd194cf046f9424fe8a9b32.zip
security/clamav-unofficial-sigs: Patch out GNU extended regex
There are a couple of cases of GNU extensions being used in clamav-unofficial-sigs.sh; all being \s, or [[:space:]]. Patch these over to [[:space:]] since this script is already otherwise patched until our base sed becomes GNU-compatible in this respect. This worked up until this point because \s is being interpreted as an escaped 's', which is an ordinary character. Future versions of regex(3) will disallowed escaped ordinary characters, so this will become an error if left unpatched. PR: 233461 Submitted by: kevans, Marko Njezic <sf@maxempire.com> (maintainer, final patch)
Diffstat (limited to 'security')
-rw-r--r--security/clamav-unofficial-sigs/Makefile1
-rw-r--r--security/clamav-unofficial-sigs/files/patch-clamav-unofficial-sigs.sh20
2 files changed, 20 insertions, 1 deletions
diff --git a/security/clamav-unofficial-sigs/Makefile b/security/clamav-unofficial-sigs/Makefile
index e8f2b0d47fea..cae84ba97d99 100644
--- a/security/clamav-unofficial-sigs/Makefile
+++ b/security/clamav-unofficial-sigs/Makefile
@@ -3,6 +3,7 @@
PORTNAME= clamav-unofficial-sigs
PORTVERSION= 5.6.2
+PORTREVISION= 1
CATEGORIES= security
MAINTAINER= sf@maxempire.com
diff --git a/security/clamav-unofficial-sigs/files/patch-clamav-unofficial-sigs.sh b/security/clamav-unofficial-sigs/files/patch-clamav-unofficial-sigs.sh
index a646c8623439..d83a38beb033 100644
--- a/security/clamav-unofficial-sigs/files/patch-clamav-unofficial-sigs.sh
+++ b/security/clamav-unofficial-sigs/files/patch-clamav-unofficial-sigs.sh
@@ -1,4 +1,4 @@
---- clamav-unofficial-sigs.sh.orig 2018-03-27 15:43:43 UTC
+--- clamav-unofficial-sigs.sh.orig 2018-11-24 16:35:07 UTC
+++ clamav-unofficial-sigs.sh
@@ -1290,7 +1290,7 @@ minimum_required_config_version="72"
minimum_yara_clamav_version="0.99"
@@ -18,6 +18,24 @@
# Solaris which function returns garbage when the program is not found
# only define the new which function if running under Solaris
+@@ -1455,7 +1457,7 @@ for config_file in "${config_files[@]}"
+ # Delete both trailing and leading whitespace
+ # Delete all trailing whitespace
+ # Delete all empty lines
+- clean_config="$(command sed -e '/^#.*/d' -e 's/[[:space:]]#.*//' -e 's/#[[:space:]].*//' -e 's/^[ \t]*//;s/[ \t]*$//' -e '/^\s*$/d' "$config_file")"
++ clean_config="$(command sed -e '/^#.*/d' -e 's/[[:space:]]#.*//' -e 's/#[[:space:]].*//' -e 's/^[[:blank:]]*//;s/[[:blank:]]*$//' -e '/^[[:space:]]*$/d' "$config_file")"
+ fi
+
+ #fix eval of |
+@@ -1470,7 +1472,7 @@ for config_file in "${config_files[@]}"
+ fi
+
+ # Check there is an = for every set of "" optional whitespace \s* between = and "
+- config_check_vars="$(echo "$clean_config" | $grep_bin -c '=\s*\"' )"
++ config_check_vars="$(echo "$clean_config" | $grep_bin -c '=[[:space:]]*\"' )"
+
+ if [ $(( ${#config_check} / 2 )) -ne "$config_check_vars" ] ; then
+ xshok_pretty_echo_and_log "ERROR: Your configuration has errors, every = requires a pair of \"\"" "="
@@ -2131,20 +2133,11 @@ if [ "$sanesecurity_enabled" == "yes" ]
xshok_pretty_echo_and_log "Sanesecurity Database & GPG Signature File Updates" "="
xshok_pretty_echo_and_log "Checking for Sanesecurity updates..."