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)
This commit is contained in:
Tobias Kortkamp 2019-01-28 19:37:02 +00:00
parent ba678193d5
commit fed3d4266c
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=491514
2 changed files with 20 additions and 1 deletions

View File

@ -3,6 +3,7 @@
PORTNAME= clamav-unofficial-sigs
PORTVERSION= 5.6.2
PORTREVISION= 1
CATEGORIES= security
MAINTAINER= sf@maxempire.com

View File

@ -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..."