--- clamav-unofficial-sigs/Makefile 2019-09-08 21:37:27.000000000 +0200 +++ clamav-unofficial-sigs/Makefile 2020-02-09 13:23:46.478088000 +0100 @@ -2,7 +2,7 @@ # $FreeBSD: head/security/clamav-unofficial-sigs/Makefile 511592 2019-09-08 19:37:27Z pi $ PORTNAME= clamav-unofficial-sigs -PORTVERSION= 6.1.1 +PORTVERSION= 7.0.1 CATEGORIES= security MAINTAINER= ports@FreeBSD.org @@ -43,8 +43,8 @@ ${INSTALL_MAN} ${WRKSRC}/clamav-unofficial-sigs.8 ${STAGEDIR}${MANPREFIX}/man/man8 @${MKDIR} ${STAGEDIR}${ETCDIR} - ${INSTALL_DATA} ${WRKSRC}/config/master.conf ${STAGEDIR}${ETCDIR}/master.conf.sample - ${INSTALL_DATA} ${WRKSRC}/config/os/os.freebsd.conf ${STAGEDIR}${ETCDIR}/os.conf.sample + ${INSTALL_DATA} ${WRKSRC}/config/master.conf ${STAGEDIR}${ETCDIR}/master.conf + ${INSTALL_DATA} ${WRKSRC}/config/os/os.freebsd.conf ${STAGEDIR}${ETCDIR}/os.conf ${INSTALL_DATA} ${WRKSRC}/config/user.conf ${STAGEDIR}${ETCDIR}/user.conf.sample @${MKDIR} ${STAGEDIR}${DOCSDIR} --- clamav-unofficial-sigs/distinfo 2019-09-08 21:37:27.000000000 +0200 +++ clamav-unofficial-sigs/distinfo 2020-01-26 14:06:37.344629000 +0100 @@ -1,3 +1,3 @@ -TIMESTAMP = 1567631464 -SHA256 (extremeshok-clamav-unofficial-sigs-6.1.1_GH0.tar.gz) = bac14809c8106ebae6c13f4db1c330a75f0a284924b3ab3668c49e30619b299f -SIZE (extremeshok-clamav-unofficial-sigs-6.1.1_GH0.tar.gz) = 55340 +TIMESTAMP = 1580043997 +SHA256 (extremeshok-clamav-unofficial-sigs-7.0.1_GH0.tar.gz) = 20e1bd6da863513ec1dc42c3f498ca1dfe1c1845110442c2e4595df6ab8341ed +SIZE (extremeshok-clamav-unofficial-sigs-7.0.1_GH0.tar.gz) = 59517 --- clamav-unofficial-sigs/files/patch-clamav-unofficial-sigs.sh 2019-09-08 21:37:27.000000000 +0200 +++ clamav-unofficial-sigs/files/patch-clamav-unofficial-sigs.sh 2020-02-09 13:21:47.406536000 +0100 @@ -1,50 +1,164 @@ ---- clamav-unofficial-sigs.sh.orig 2019-09-02 22:41:48 UTC -+++ clamav-unofficial-sigs.sh -@@ -1422,25 +1422,14 @@ force_wget="no" +--- clamav-unofficial-sigs.sh.orig 2020-02-09 13:20:31.127412000 +0100 ++++ clamav-unofficial-sigs.sh 2020-02-09 13:21:05.127877000 +0100 +@@ -744,8 +744,8 @@ + xshok_pretty_echo_and_log "ERROR: ${config_dir}/master.conf is not a file or is not writable" + exit 1 + fi +- fi + fi ++fi + + if [ "$latest_version" ] ; then + # shellcheck disable=SC2183,SC2086 +@@ -1541,49 +1541,78 @@ enable_log="no" custom_config="no" we_have_a_config="0" +pkg_mgr="FreeBSD ports" +pkg_rm="pkg delete" -- + -# Attempt to scan for a valid config dir -if [ -f "/etc/clamav-unofficial-sigs/master.conf" ] ; then - config_dir="/etc/clamav-unofficial-sigs" -elif [ -f "/usr/local/etc/clamav-unofficial-sigs/master.conf" ] ; then - config_dir="/usr/local/etc/clamav-unofficial-sigs/" --elif [ -f "/opt/zimbra/config/clamav-unofficial-sigs/master.conf" ] ; then -- config_dir="/opt/zimbra/config/clamav-unofficial-sigs/" +-elif [ -f "/opt/zimbra/conf/clamav-unofficial-sigs/master.conf" ] ; then +- config_dir="/opt/zimbra/conf/clamav-unofficial-sigs/" -else - xshok_pretty_echo_and_log "ERROR: config_dir (/etc/clamav-unofficial-sigs/master.conf) could not be found" - exit 1 -fi - # Default config files -+config_dir="%%PREFIX%%/etc/clamav-unofficial-sigs" - config_files=("${config_dir}/master.conf") --#find the a suitable os.conf or os.*.conf file --config_file="$(find "$config_dir" -type f -iname "os.conf" -o -iname "os.*.conf" | tail -n1)" --if [ -r "${config_file}" ]; then -- config_files+=( "${config_file}" ) -+if [ -r "${config_dir}/os.conf" ] ; then -+ config_files+=( "${config_dir}/os.conf" ) - fi - if [ -r "${config_dir}/user.conf" ] ; then - config_files+=( "${config_dir}/user.conf" ) -@@ -1576,10 +1565,8 @@ if [ "$custom_config" != "no" ] ; then +-# Default config files +-if [ -r "${config_dir}/master.conf" ] ; then +- config_files+=( "${config_dir}/master.conf" ) +-else +- xshok_pretty_echo_and_log "ERROR: ${config_dir}/master.conf is not readable" +- exit 1 +-fi +-if [ -r "${config_dir}/os.conf" ] ; then +- config_files+=( "${config_dir}/os.conf" ) +-else +- #find the a suitable os.*.conf file +- os_config_number=$(find "$config_dir" -type f -iname "os.*.conf" | wc -l) +- if [ "$os_config_number" == "0" ] ; then +- xshok_pretty_echo_and_log "WARNING: no os.conf or os.*.conf found" +- elif [ "$os_config_number" == "1" ] ; then +- config_file="$(find "$config_dir" -type f -iname "os.*.conf" | head -n1)" +- if [ -r "${config_file}" ]; then ++# Check command line options for custom configuration ++while true ; do ++ case "${1}" in ++ -c|--config) xshok_check_s2 "${2}"; custom_config="${2}"; shift 2; break ;; ++ *) break ;; ++ esac ++done ++ ++# Custom config files take precedence ++if [ "$custom_config" != "no" ] ; then ++ if [ -d "$custom_config" ] ; then ++ # Assign the custom config dir and remove trailing / (removes / and //) ++ shopt -s extglob; config_dir="${custom_config%%+(/)}" ++ config_files=() ++ if [ -r "${config_dir}/master.conf" ] ; then ++ config_files+=( "${config_dir}/master.conf" ) ++ else ++ xshok_pretty_echo_and_log "WARNING: ${config_dir}/master.conf not found" ++ fi ++ # find the a suitable os.conf or os.*.conf file ++ config_file="$(find "$config_dir" -type f -iname "os.conf" -o -iname "os.*.conf" | tail -n1)" ++ if [ -r "${config_file}" ] ; then + config_files+=( "${config_file}" ) else - xshok_pretty_echo_and_log "WARNING: ${config_dir}/master.conf not found" +- xshok_pretty_echo_and_log "WARNING: ${config_file} is not readable" ++ xshok_pretty_echo_and_log "WARNING: ${config_dir}/os.conf not found" fi ++ if [ -r "${config_dir}/user.conf" ] ; then ++ config_files+=( "${config_dir}/user.conf" ) ++ else ++ xshok_pretty_echo_and_log "WARNING: ${config_dir}/user.conf not found" ++ fi + else +- xshok_pretty_echo_and_log "WARNING: Too many os.*.conf configs found" ++ config_files=( "$custom_config" ) ++ fi ++else ++ # Default config files ++ config_dir="/usr/local/etc/clamav-unofficial-sigs" ++ ++ if [ -r "${config_dir}/master.conf" ] ; then ++ config_files+=( "${config_dir}/master.conf" ) ++ else ++ xshok_pretty_echo_and_log "ERROR: ${config_dir}/master.conf is not readable" ++ exit 1 + fi ++ if [ -r "${config_dir}/os.conf" ] ; then ++ config_files+=( "${config_dir}/os.conf" ) ++ else ++ # find the a suitable os.*.conf file ++ os_config_number=$(find "$config_dir" -type f -iname "os.*.conf" | wc -l) ++ if [ "$os_config_number" == "0" ] ; then ++ xshok_pretty_echo_and_log "WARNING: no os.conf or os.*.conf found" ++ elif [ "$os_config_number" == "1" ] ; then ++ config_file="$(find "$config_dir" -type f -iname "os.*.conf" | head -n1)" ++ if [ -r "${config_file}" ]; then ++ config_files+=( "${config_file}" ) ++ else ++ xshok_pretty_echo_and_log "WARNING: ${config_file} is not readable" ++ fi ++ else ++ xshok_pretty_echo_and_log "WARNING: Too many os.*.conf configs found" ++ fi ++ fi ++ if [ -r "${config_dir}/user.conf" ] ; then ++ config_files+=( "${config_dir}/user.conf" ) ++ else ++ xshok_pretty_echo_and_log "WARNING: ${config_dir}/user.conf is not readable" ++ fi + fi +-if [ -r "${config_dir}/user.conf" ] ; then +- config_files+=( "${config_dir}/user.conf" ) +-else +- xshok_pretty_echo_and_log "WARNING: ${config_dir}/user.conf is not readable" +-fi + + # Solaris command -v function returns garbage when the program is not found + # only define the new command -v function if running under Solaris +@@ -1708,33 +1737,6 @@ + done + + # CONFIG LOADING AND ERROR CHECKING ############################################## +-if [ "$custom_config" != "no" ] ; then +- if [ -d "$custom_config" ] ; then +- # Assign the custom config dir and remove trailing / (removes / and //) +- shopt -s extglob; config_dir="${custom_config%%+(/)}" +- config_files=() +- if [ -r "${config_dir}/master.conf" ] ; then +- config_files+=( "${config_dir}/master.conf" ) +- else +- xshok_pretty_echo_and_log "WARNING: ${config_dir}/master.conf not found" +- fi - #find the a suitable os.conf or os.*.conf file - config_file="$(find "$config_dir" -type f -iname "os.conf" -o -iname "os.*.conf" | tail -n1)" - if [ -r "${config_file}" ] ; then - config_files+=( "${config_file}" ) -+ if [ -r "${config_dir}/os.conf" ] ; then -+ config_files+=( "${config_dir}/os.conf" ) - else - xshok_pretty_echo_and_log "WARNING: ${config_dir}/os.conf not found" - fi -@@ -1625,7 +1612,7 @@ for config_file in "${config_files[@]}" ; do +- else +- xshok_pretty_echo_and_log "WARNING: ${config_dir}/os.conf not found" +- fi +- if [ -r "${config_dir}/user.conf" ] ; then +- config_files+=( "${config_dir}/user.conf" ) +- else +- xshok_pretty_echo_and_log "WARNING: ${config_dir}/user.conf not found" +- fi +- else +- config_files=( "$custom_config" ) +- fi +-fi +- + for config_file in "${config_files[@]}" ; do + if [ -r "$config_file" ] ; then # Exists and readable + we_have_a_config="1" +@@ -1767,7 +1769,7 @@ # Delete both trailing and leading whitespace # Delete all trailing whitespace # Delete all empty lines @@ -53,7 +167,7 @@ fi #fix eval of | -@@ -1640,7 +1627,7 @@ for config_file in "${config_files[@]}" ; do +@@ -1782,7 +1784,7 @@ fi # Check there is an = for every set of "" optional whitespace \s* between = and " @@ -62,7 +176,7 @@ if [ $(( ${#config_check} / 2 )) -ne "$config_check_vars" ] ; then xshok_pretty_echo_and_log "ERROR: Your configuration has errors, every = requires a pair of \"\"" -@@ -2316,24 +2303,12 @@ if [ "$sanesecurity_enabled" == "yes" ] ; then +@@ -2504,24 +2506,12 @@ echo "$current_time" > "${work_dir_work_configs}/last-ss-update.txt" xshok_pretty_echo_and_log "Sanesecurity Database & GPG Signature File Updates" "=" xshok_pretty_echo_and_log "Checking for Sanesecurity updates..." @@ -90,3 +204,12 @@ sanesecurity_mirror_site_info="$sanesecurity_mirror_name $sanesecurity_mirror_ip" xshok_pretty_echo_and_log "Sanesecurity mirror site used: ${sanesecurity_mirror_site_info}" # shellcheck disable=SC2086 +@@ -2834,7 +2824,7 @@ + ret="$?" + if [ "$ret" -eq 0 ] ; then + # shellcheck disable=SC2035 +- $tar_bin --strip-components=1 --wildcards --overwrite -xzf "${work_dir_linuxmalwaredetect}/sigpack.tgz" --directory "${work_dir_linuxmalwaredetect}" */rfxn.* ++ $tar_bin --strip-components=1 -xzf "${work_dir_linuxmalwaredetect}/sigpack.tgz" --directory "${work_dir_linuxmalwaredetect}" "*/rfxn.*" + for db_file in "${linuxmalwaredetect_dbs[@]}" ; do + if [ "$loop" == "1" ] ; then + xshok_pretty_echo_and_log "---" --- clamav-unofficial-sigs/files/patch-config_user.conf 2019-09-08 21:37:27.000000000 +0200 +++ clamav-unofficial-sigs/files/patch-config_user.conf 2020-01-26 14:32:45.760970000 +0100 @@ -1,6 +1,6 @@ ---- config/user.conf.orig 2019-09-02 22:41:48 UTC -+++ config/user.conf -@@ -49,14 +49,12 @@ +--- config/user.conf.orig 2020-01-26 14:32:25.762181000 +0100 ++++ config/user.conf 2020-01-26 14:32:41.921181000 +0100 +@@ -54,13 +54,11 @@ #) #END ADDITIONAL DATABASES # Uncomment the following line to enable the script @@ -9,10 +9,9 @@ # Proxy Support # If necessary to proxy database downloads, define the rsync, curl, wget, dig, hosr proxy settings here. - #rsync_proxy="username:password@proxy_host:proxy_port" #curl_proxy="--proxy http://username:password@proxy_host:proxy_port" - #wget_proxy="-e http_proxy=http://username:password@proxy_host:proxy_port -e https_proxy=https://username:password@proxy_host:proxy_port" -#dig_proxy="@proxy_host -p proxy_host:proxy_port" -#host_proxy="@proxy_host" #does not support port + #rsync_proxy="username:password@proxy_host:proxy_port" + #wget_proxy="-e http_proxy=http://username:password@proxy_host:proxy_port -e https_proxy=https://username:password@proxy_host:proxy_port" - # https://eXtremeSHOK.com ###################################################### --- clamav-unofficial-sigs/pkg-plist 2019-09-08 21:37:27.000000000 +0200 +++ clamav-unofficial-sigs/pkg-plist 2020-02-09 13:37:39.192979000 +0100 @@ -1,6 +1,6 @@ bin/clamav-unofficial-sigs.sh -@sample %%ETCDIR%%/master.conf.sample -@sample %%ETCDIR%%/os.conf.sample +%%ETCDIR%%/master.conf +%%ETCDIR%%/os.conf @sample %%ETCDIR%%/user.conf.sample man/man8/clamav-unofficial-sigs.8.gz %%PORTDOCS%%%%DOCSDIR%%/INSTALL.md