View | Details | Raw Unified | Return to bug 240357
Collapse All | Expand All

(-)Makefile (-5 / +4 lines)
Lines 2-12 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	clamav-unofficial-sigs
4
PORTNAME=	clamav-unofficial-sigs
5
PORTVERSION=	5.6.2
5
PORTVERSION=	6.1.1
6
PORTREVISION=	1
7
CATEGORIES=	security
6
CATEGORIES=	security
8
7
9
MAINTAINER=	sf@maxempire.com
8
MAINTAINER=	ports@FreeBSD.org
10
COMMENT=	Update script for third-party ClamAV databases
9
COMMENT=	Update script for third-party ClamAV databases
11
10
12
LICENSE=	BSD3CLAUSE
11
LICENSE=	BSD3CLAUSE
Lines 45-54 Link Here
45
44
46
	@${MKDIR} ${STAGEDIR}${ETCDIR}
45
	@${MKDIR} ${STAGEDIR}${ETCDIR}
47
	${INSTALL_DATA} ${WRKSRC}/config/master.conf ${STAGEDIR}${ETCDIR}/master.conf.sample
46
	${INSTALL_DATA} ${WRKSRC}/config/master.conf ${STAGEDIR}${ETCDIR}/master.conf.sample
48
	${INSTALL_DATA} ${WRKSRC}/config/os.freebsd.conf ${STAGEDIR}${ETCDIR}/os.conf.sample
47
	${INSTALL_DATA} ${WRKSRC}/config/os/os.freebsd.conf ${STAGEDIR}${ETCDIR}/os.conf.sample
49
	${INSTALL_DATA} ${WRKSRC}/config/user.conf ${STAGEDIR}${ETCDIR}/user.conf.sample
48
	${INSTALL_DATA} ${WRKSRC}/config/user.conf ${STAGEDIR}${ETCDIR}/user.conf.sample
50
49
51
	@${MKDIR} ${STAGEDIR}${DOCSDIR}
50
	@${MKDIR} ${STAGEDIR}${DOCSDIR}
52
	(cd ${WRKSRC} && ${INSTALL_DATA} INSTALL LICENSE README.md ${STAGEDIR}${DOCSDIR})
51
	(cd ${WRKSRC} && ${INSTALL_DATA} INSTALL.md LICENSE README.md ${STAGEDIR}${DOCSDIR})
53
52
54
.include <bsd.port.mk>
53
.include <bsd.port.mk>
(-)distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1522164679
1
TIMESTAMP = 1567631464
2
SHA256 (extremeshok-clamav-unofficial-sigs-5.6.2_GH0.tar.gz) = 233404d767fcb7d2b82defef831d584cbbcc7105f6bbc586d69a0a960bc0d4df
2
SHA256 (extremeshok-clamav-unofficial-sigs-6.1.1_GH0.tar.gz) = bac14809c8106ebae6c13f4db1c330a75f0a284924b3ab3668c49e30619b299f
3
SIZE (extremeshok-clamav-unofficial-sigs-5.6.2_GH0.tar.gz) = 50931
3
SIZE (extremeshok-clamav-unofficial-sigs-6.1.1_GH0.tar.gz) = 55340
(-)files/patch-clamav-unofficial-sigs.sh (-24 / +55 lines)
Lines 1-15 Link Here
1
--- clamav-unofficial-sigs.sh.orig	2018-11-24 16:35:07 UTC
1
--- clamav-unofficial-sigs.sh.orig	2019-09-02 22:41:48 UTC
2
+++ clamav-unofficial-sigs.sh
2
+++ clamav-unofficial-sigs.sh
3
@@ -1290,7 +1290,7 @@ minimum_required_config_version="72"
3
@@ -1422,25 +1422,14 @@ force_wget="no"
4
 minimum_yara_clamav_version="0.99"
5
 
6
 # Default config files
7
-config_dir="/etc/clamav-unofficial-sigs"
8
+config_dir="%%PREFIX%%/etc/clamav-unofficial-sigs"
9
 config_files=( "$config_dir/master.conf" "$config_dir/os.conf" "$config_dir/user.conf" )
10
 
11
 # Initialise
12
@@ -1302,6 +1302,8 @@ force_updates="no"
13
 enable_log="no"
4
 enable_log="no"
14
 custom_config="no"
5
 custom_config="no"
15
 we_have_a_config="0"
6
 we_have_a_config="0"
Lines 16-24 Link Here
16
+pkg_mgr="FreeBSD ports"
7
+pkg_mgr="FreeBSD ports"
17
+pkg_rm="pkg delete"
8
+pkg_rm="pkg delete"
18
 
9
 
19
 # Solaris which function returns garbage when the program is not found
10
-
20
 # only define the new which function if running under Solaris
11
-# Attempt to scan for a valid config dir
21
@@ -1455,7 +1457,7 @@ for config_file in "${config_files[@]}" 
12
-if [ -f "/etc/clamav-unofficial-sigs/master.conf" ] ; then
13
-  config_dir="/etc/clamav-unofficial-sigs"
14
-elif [ -f "/usr/local/etc/clamav-unofficial-sigs/master.conf" ] ; then
15
-  config_dir="/usr/local/etc/clamav-unofficial-sigs/"
16
-elif [ -f "/opt/zimbra/config/clamav-unofficial-sigs/master.conf" ] ; then
17
-  config_dir="/opt/zimbra/config/clamav-unofficial-sigs/"
18
-else
19
-  xshok_pretty_echo_and_log "ERROR: config_dir (/etc/clamav-unofficial-sigs/master.conf) could not be found"
20
-  exit 1
21
-fi
22
 # Default config files
23
+config_dir="%%PREFIX%%/etc/clamav-unofficial-sigs"
24
 config_files=("${config_dir}/master.conf")
25
-#find the a suitable os.conf or os.*.conf file
26
-config_file="$(find "$config_dir" -type f -iname "os.conf" -o -iname "os.*.conf" | tail -n1)"
27
-if [ -r "${config_file}" ]; then
28
-	config_files+=( "${config_file}" )
29
+if [ -r "${config_dir}/os.conf" ] ; then
30
+	config_files+=( "${config_dir}/os.conf" )
31
 fi
32
 if [ -r "${config_dir}/user.conf" ] ; then
33
 	config_files+=( "${config_dir}/user.conf" )
34
@@ -1576,10 +1565,8 @@ if [ "$custom_config" != "no" ] ; then
35
 		else
36
 			xshok_pretty_echo_and_log "WARNING: ${config_dir}/master.conf not found"
37
 		fi
38
-		#find the a suitable os.conf or os.*.conf file
39
-		config_file="$(find "$config_dir" -type f -iname "os.conf" -o -iname "os.*.conf" | tail -n1)"
40
-		if [ -r "${config_file}" ] ; then
41
-			config_files+=( "${config_file}" )
42
+		if [ -r "${config_dir}/os.conf" ] ; then
43
+			config_files+=( "${config_dir}/os.conf" )
44
 		else
45
 			xshok_pretty_echo_and_log "WARNING: ${config_dir}/os.conf not found"
46
 		fi
47
@@ -1625,7 +1612,7 @@ for config_file in "${config_files[@]}" ; do
22
       # Delete both trailing and leading whitespace
48
       # Delete both trailing and leading whitespace
23
       # Delete all trailing whitespace
49
       # Delete all trailing whitespace
24
       # Delete all empty lines
50
       # Delete all empty lines
Lines 27-33 Link Here
27
     fi
53
     fi
28
 
54
 
29
     #fix eval of |
55
     #fix eval of |
30
@@ -1470,7 +1472,7 @@ for config_file in "${config_files[@]}" 
56
@@ -1640,7 +1627,7 @@ for config_file in "${config_files[@]}" ; do
31
     fi
57
     fi
32
 
58
 
33
     # Check there is an = for every set of "" optional whitespace \s* between = and "
59
     # Check there is an = for every set of "" optional whitespace \s* between = and "
Lines 35-61 Link Here
35
+    config_check_vars="$(echo "$clean_config" | $grep_bin -c '=[[:space:]]*\"' )"
61
+    config_check_vars="$(echo "$clean_config" | $grep_bin -c '=[[:space:]]*\"' )"
36
 
62
 
37
     if [ $(( ${#config_check} / 2 )) -ne "$config_check_vars" ] ; then
63
     if [ $(( ${#config_check} / 2 )) -ne "$config_check_vars" ] ; then
38
       xshok_pretty_echo_and_log "ERROR: Your configuration has errors, every = requires a pair of \"\"" "="
64
       xshok_pretty_echo_and_log "ERROR: Your configuration has errors, every = requires a pair of \"\""
39
@@ -2131,20 +2133,11 @@ if [ "$sanesecurity_enabled" == "yes" ] 
65
@@ -2316,24 +2303,12 @@ if [ "$sanesecurity_enabled" == "yes" ] ; then
66
         echo "$current_time" > "${work_dir_work_configs}/last-ss-update.txt"
40
         xshok_pretty_echo_and_log "Sanesecurity Database & GPG Signature File Updates" "="
67
         xshok_pretty_echo_and_log "Sanesecurity Database & GPG Signature File Updates" "="
41
         xshok_pretty_echo_and_log "Checking for Sanesecurity updates..."
68
         xshok_pretty_echo_and_log "Checking for Sanesecurity updates..."
42
 
69
-				# shellcheck disable=SC2086
43
-        sanesecurity_mirror_ips="$(dig +ignore +short "$sanesecurity_url")"
70
-        sanesecurity_mirror_ips="$(dig $dig_proxy +ignore +short "$sanesecurity_url")"
44
-        # Add fallback to host if dig returns no records
71
-        # Add fallback to host if dig returns no records
45
-        if [ ${#sanesecurity_mirror_ips} -lt 1 ] ; then
72
-        if [ ${#sanesecurity_mirror_ips} -lt 1 ] ; then
46
-          sanesecurity_mirror_ips="$(host -t A "$sanesecurity_url" | sed -n '/has address/{s/.*address \([^ ]*\).*/\1/;p;}')"
73
-					# shellcheck disable=SC2086
74
-          sanesecurity_mirror_ips="$(host $host_proxy -t A "$sanesecurity_url" | sed -n '/has address/{s/.*address \([^ ]*\).*/\1/;p;}')"
47
-        fi
75
-        fi
76
 
48
+        sanesecurity_mirror_ips=$(host "$sanesecurity_url" | sed 's/.*[[:space:]]//')
77
+        sanesecurity_mirror_ips=$(host "$sanesecurity_url" | sed 's/.*[[:space:]]//')
49
 
78
+
50
         if [ ${#sanesecurity_mirror_ips} -ge 1 ] ; then
79
         if [ ${#sanesecurity_mirror_ips} -ge 1 ] ; then
51
           for sanesecurity_mirror_ip in $sanesecurity_mirror_ips ; do
80
           for sanesecurity_mirror_ip in $sanesecurity_mirror_ips ; do
52
-            sanesecurity_mirror_name=""
81
-            sanesecurity_mirror_name=""
53
-            sanesecurity_mirror_name="$(dig +short -x "$sanesecurity_mirror_ip" | command sed 's/\.$//')"
82
-						# shellcheck disable=SC2086
83
-            sanesecurity_mirror_name="$(dig $dig_proxy +short -x "$sanesecurity_mirror_ip" | command sed 's/\.$//')"
54
-            # Add fallback to host if dig returns no records
84
-            # Add fallback to host if dig returns no records
55
-            if [ -z "$sanesecurity_mirror_name" ] ; then
85
-            if [ -z "$sanesecurity_mirror_name" ] ; then
56
-              sanesecurity_mirror_name="$(host "$sanesecurity_mirror_ip" | sed -n '/name pointer/{s/.*pointer \([^ ]*\).*\.$/\1/;p;}')"
86
-							# shellcheck disable=SC2086
87
-              sanesecurity_mirror_name="$(host $host_proxy "$sanesecurity_mirror_ip" | sed -n '/name pointer/{s/.*pointer \([^ ]*\).*\.$/\1/;p;}')"
57
-            fi
88
-            fi
58
+            sanesecurity_mirror_name=$(host "$sanesecurity_mirror_ip" | sed 's/.*[[:space:]]//' | sed 's/\.$//')
89
+            sanesecurity_mirror_name=$(host "$sanesecurity_mirror_ip" | sed 's/.*[[:space:]]//' | sed 's/\.$//')
59
             sanesecurity_mirror_site_info="$sanesecurity_mirror_name $sanesecurity_mirror_ip"
90
             sanesecurity_mirror_site_info="$sanesecurity_mirror_name $sanesecurity_mirror_ip"
60
             xshok_pretty_echo_and_log "Sanesecurity mirror site used: $sanesecurity_mirror_site_info"
91
             xshok_pretty_echo_and_log "Sanesecurity mirror site used: ${sanesecurity_mirror_site_info}"
61
             # shellcheck disable=SC2086
92
             # shellcheck disable=SC2086
(-)files/patch-config_master.conf (-11 / +11 lines)
Lines 1-4 Link Here
1
--- config/master.conf.orig	2017-03-18 11:57:29 UTC
1
--- config/master.conf.orig	2019-09-02 22:41:48 UTC
2
+++ config/master.conf
2
+++ config/master.conf
3
@@ -63,8 +63,8 @@ clamd_reload_opt="clamdscan --reload"
3
@@ -63,8 +63,8 @@ clamd_reload_opt="clamdscan --reload"
4
 work_dir="/var/lib/clamav-unofficial-sigs"   #Top level working directory
4
 work_dir="/var/lib/clamav-unofficial-sigs"   #Top level working directory
Lines 9-22 Link Here
9
+logging_enabled="no"
9
+logging_enabled="no"
10
+log_file_path="/var/log"
10
+log_file_path="/var/log"
11
 log_file_name="clamav-unofficial-sigs.log"
11
 log_file_name="clamav-unofficial-sigs.log"
12
 ## Use a program to log messages
13
 #log_pipe_cmd="/usr/bin/logger -it 'clamav-unofficial-sigs'"
14
@@ -487,8 +487,6 @@ selinux_fixes="no" # Default is "no" ignore ssl errors
15
 #rsync_proxy="username:password@proxy_host:proxy_port"
16
 #curl_proxy="--proxy http://username:password@proxy_host:proxy_port"
17
 #wget_proxy="-e http_proxy=http://username:password@proxy_host:proxy_port -e https_proxy=https://username:password@proxy_host:proxy_port"
18
-#dig_proxy="@proxy_host -p proxy_host:proxy_port"
19
-#host_proxy="@proxy_host" #does not support port
12
 
20
 
13
 
21
 # Custom Cron install settings, these are detected and only used if you want to override
14
@@ -125,7 +125,7 @@ yararulesproject_enabled="yes"   # Yara-
22
 # the automatic detection and generation of the values when not set, this is mainly to aid package maintainers
15
 additional_enabled="yes"   # Additional Databases
16
 
17
 ## Disabling this will also cause the yararulesproject to be disabled.
18
-enable_yararules="yes"   #Enables yararules in the various databases, automatically disabled if clamav is older than 0.99
19
+enable_yararules="no"   #Enables yararules in the various databases, automatically disabled if clamav is older than 0.99
20
 
21
 # ========================
22
 # eXtremeSHOK Database format
(-)files/patch-config_os.freebsd.conf (-11 lines)
Lines 1-11 Link Here
1
--- config/os.freebsd.conf.orig	2017-03-18 11:57:29 UTC
2
+++ config/os.freebsd.conf
3
@@ -29,8 +29,6 @@ clamd_pid="/var/run/clamav/clamd.pid"
4
 
5
 work_dir="/var/db/clamav-unofficial-sigs"
6
 
7
-log_file_path="/var/log/clamav"
8
-
9
 clamd_restart_opt="service clamav-clamd reload"
10
 
11
 #clamd_socket="/var/run/clamav/clamd.sock"
(-)files/patch-config_os_os.freebsd.conf (+11 lines)
Line 0 Link Here
1
--- config/os/os.freebsd.conf.orig	2019-09-02 22:41:48 UTC
2
+++ config/os/os.freebsd.conf
3
@@ -29,8 +29,6 @@ clamd_pid="/var/run/clamav/clamd.pid"
4
 
5
 work_dir="/var/db/clamav-unofficial-sigs"
6
 
7
-log_file_path="/var/log/clamav"
8
-
9
 clamd_restart_opt="service clamav-clamd reload"
10
 
11
 #clamd_socket="/var/run/clamav/clamd.sock"
(-)files/patch-config_user.conf (+18 lines)
Line 0 Link Here
1
--- config/user.conf.orig	2019-09-02 22:41:48 UTC
2
+++ config/user.conf
3
@@ -49,14 +49,12 @@
4
 #) #END ADDITIONAL DATABASES
5
 
6
 # Uncomment the following line to enable the script
7
-user_configuration_complete="yes"
8
+#user_configuration_complete="yes"
9
 
10
 # Proxy Support
11
 # If necessary to proxy database downloads, define the rsync, curl, wget, dig, hosr proxy settings here.
12
 #rsync_proxy="username:password@proxy_host:proxy_port"
13
 #curl_proxy="--proxy http://username:password@proxy_host:proxy_port"
14
 #wget_proxy="-e http_proxy=http://username:password@proxy_host:proxy_port -e https_proxy=https://username:password@proxy_host:proxy_port"
15
-#dig_proxy="@proxy_host -p proxy_host:proxy_port"
16
-#host_proxy="@proxy_host" #does not support port
17
 
18
 # https://eXtremeSHOK.com ######################################################
(-)pkg-plist (-1 / +1 lines)
Lines 3-8 Link Here
3
@sample %%ETCDIR%%/os.conf.sample
3
@sample %%ETCDIR%%/os.conf.sample
4
@sample %%ETCDIR%%/user.conf.sample
4
@sample %%ETCDIR%%/user.conf.sample
5
man/man8/clamav-unofficial-sigs.8.gz
5
man/man8/clamav-unofficial-sigs.8.gz
6
%%PORTDOCS%%%%DOCSDIR%%/INSTALL
6
%%PORTDOCS%%%%DOCSDIR%%/INSTALL.md
7
%%PORTDOCS%%%%DOCSDIR%%/LICENSE
7
%%PORTDOCS%%%%DOCSDIR%%/LICENSE
8
%%PORTDOCS%%%%DOCSDIR%%/README.md
8
%%PORTDOCS%%%%DOCSDIR%%/README.md

Return to bug 240357