View | Details | Raw Unified | Return to bug 243556 | Differences between
and this patch

Collapse All | Expand All

(-)clamav-unofficial-sigs/Makefile (-3 / +3 lines)
Lines 2-8 Link Here
2
# $FreeBSD: head/security/clamav-unofficial-sigs/Makefile 511592 2019-09-08 19:37:27Z pi $
2
# $FreeBSD: head/security/clamav-unofficial-sigs/Makefile 511592 2019-09-08 19:37:27Z pi $
3
3
4
PORTNAME=	clamav-unofficial-sigs
4
PORTNAME=	clamav-unofficial-sigs
5
PORTVERSION=	6.1.1
5
PORTVERSION=	7.0.1
6
CATEGORIES=	security
6
CATEGORIES=	security
7
7
8
MAINTAINER=	ports@FreeBSD.org
8
MAINTAINER=	ports@FreeBSD.org
Lines 43-50 Link Here
43
	${INSTALL_MAN} ${WRKSRC}/clamav-unofficial-sigs.8 ${STAGEDIR}${MANPREFIX}/man/man8
43
	${INSTALL_MAN} ${WRKSRC}/clamav-unofficial-sigs.8 ${STAGEDIR}${MANPREFIX}/man/man8
44
44
45
	@${MKDIR} ${STAGEDIR}${ETCDIR}
45
	@${MKDIR} ${STAGEDIR}${ETCDIR}
46
	${INSTALL_DATA} ${WRKSRC}/config/master.conf ${STAGEDIR}${ETCDIR}/master.conf.sample
46
	${INSTALL_DATA} ${WRKSRC}/config/master.conf ${STAGEDIR}${ETCDIR}/master.conf
47
	${INSTALL_DATA} ${WRKSRC}/config/os/os.freebsd.conf ${STAGEDIR}${ETCDIR}/os.conf.sample
47
	${INSTALL_DATA} ${WRKSRC}/config/os/os.freebsd.conf ${STAGEDIR}${ETCDIR}/os.conf
48
	${INSTALL_DATA} ${WRKSRC}/config/user.conf ${STAGEDIR}${ETCDIR}/user.conf.sample
48
	${INSTALL_DATA} ${WRKSRC}/config/user.conf ${STAGEDIR}${ETCDIR}/user.conf.sample
49
49
50
	@${MKDIR} ${STAGEDIR}${DOCSDIR}
50
	@${MKDIR} ${STAGEDIR}${DOCSDIR}
(-)clamav-unofficial-sigs/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1567631464
1
TIMESTAMP = 1580043997
2
SHA256 (extremeshok-clamav-unofficial-sigs-6.1.1_GH0.tar.gz) = bac14809c8106ebae6c13f4db1c330a75f0a284924b3ab3668c49e30619b299f
2
SHA256 (extremeshok-clamav-unofficial-sigs-7.0.1_GH0.tar.gz) = 20e1bd6da863513ec1dc42c3f498ca1dfe1c1845110442c2e4595df6ab8341ed
3
SIZE (extremeshok-clamav-unofficial-sigs-6.1.1_GH0.tar.gz) = 55340
3
SIZE (extremeshok-clamav-unofficial-sigs-7.0.1_GH0.tar.gz) = 59517
(-)clamav-unofficial-sigs/files/patch-clamav-unofficial-sigs.sh (-28 / +151 lines)
Lines 1-50 Link Here
1
--- clamav-unofficial-sigs.sh.orig	2019-09-02 22:41:48 UTC
1
--- clamav-unofficial-sigs.sh.orig	2020-02-09 13:20:31.127412000 +0100
2
+++ clamav-unofficial-sigs.sh
2
+++ clamav-unofficial-sigs.sh	2020-02-09 13:21:05.127877000 +0100
3
@@ -1422,25 +1422,14 @@ force_wget="no"
3
@@ -744,8 +744,8 @@
4
 				 xshok_pretty_echo_and_log "ERROR: ${config_dir}/master.conf is not a file or is not writable"
5
 				 exit 1
6
 		  fi
7
-		fi
8
 	fi
9
+fi
10
 
11
 	if [ "$latest_version" ] ; then
12
 		# shellcheck disable=SC2183,SC2086
13
@@ -1541,49 +1541,78 @@
4
 enable_log="no"
14
 enable_log="no"
5
 custom_config="no"
15
 custom_config="no"
6
 we_have_a_config="0"
16
 we_have_a_config="0"
7
+pkg_mgr="FreeBSD ports"
17
+pkg_mgr="FreeBSD ports"
8
+pkg_rm="pkg delete"
18
+pkg_rm="pkg delete"
9
 
19
 
10
-
20
 
11
-# Attempt to scan for a valid config dir
21
-# Attempt to scan for a valid config dir
12
-if [ -f "/etc/clamav-unofficial-sigs/master.conf" ] ; then
22
-if [ -f "/etc/clamav-unofficial-sigs/master.conf" ] ; then
13
-  config_dir="/etc/clamav-unofficial-sigs"
23
-  config_dir="/etc/clamav-unofficial-sigs"
14
-elif [ -f "/usr/local/etc/clamav-unofficial-sigs/master.conf" ] ; then
24
-elif [ -f "/usr/local/etc/clamav-unofficial-sigs/master.conf" ] ; then
15
-  config_dir="/usr/local/etc/clamav-unofficial-sigs/"
25
-  config_dir="/usr/local/etc/clamav-unofficial-sigs/"
16
-elif [ -f "/opt/zimbra/config/clamav-unofficial-sigs/master.conf" ] ; then
26
-elif [ -f "/opt/zimbra/conf/clamav-unofficial-sigs/master.conf" ] ; then
17
-  config_dir="/opt/zimbra/config/clamav-unofficial-sigs/"
27
-  config_dir="/opt/zimbra/conf/clamav-unofficial-sigs/"
18
-else
28
-else
19
-  xshok_pretty_echo_and_log "ERROR: config_dir (/etc/clamav-unofficial-sigs/master.conf) could not be found"
29
-  xshok_pretty_echo_and_log "ERROR: config_dir (/etc/clamav-unofficial-sigs/master.conf) could not be found"
20
-  exit 1
30
-  exit 1
21
-fi
31
-fi
22
 # Default config files
32
-# Default config files
23
+config_dir="%%PREFIX%%/etc/clamav-unofficial-sigs"
33
-if [ -r "${config_dir}/master.conf" ] ; then
24
 config_files=("${config_dir}/master.conf")
34
-	config_files+=( "${config_dir}/master.conf" )
25
-#find the a suitable os.conf or os.*.conf file
35
-else
26
-config_file="$(find "$config_dir" -type f -iname "os.conf" -o -iname "os.*.conf" | tail -n1)"
36
-	xshok_pretty_echo_and_log "ERROR: ${config_dir}/master.conf is not readable"
27
-if [ -r "${config_file}" ]; then
37
-	exit 1
28
-	config_files+=( "${config_file}" )
38
-fi
29
+if [ -r "${config_dir}/os.conf" ] ; then
39
-if [ -r "${config_dir}/os.conf" ] ; then
30
+	config_files+=( "${config_dir}/os.conf" )
40
-	config_files+=( "${config_dir}/os.conf" )
31
 fi
41
-else
32
 if [ -r "${config_dir}/user.conf" ] ; then
42
-	#find the a suitable os.*.conf file
33
 	config_files+=( "${config_dir}/user.conf" )
43
-	os_config_number=$(find "$config_dir" -type f -iname "os.*.conf" | wc -l)
34
@@ -1576,10 +1565,8 @@ if [ "$custom_config" != "no" ] ; then
44
-	if [ "$os_config_number" == "0" ] ; then
45
-		xshok_pretty_echo_and_log "WARNING: no os.conf or os.*.conf found"
46
-	elif [ "$os_config_number" == "1" ] ; then
47
-		config_file="$(find "$config_dir" -type f -iname "os.*.conf" | head -n1)"
48
-		if [ -r "${config_file}" ]; then
49
+# Check command line options for custom configuration
50
+while true ; do
51
+  case "${1}" in
52
+    -c|--config) xshok_check_s2 "${2}"; custom_config="${2}"; shift 2; break ;;
53
+    *) break ;;
54
+  esac
55
+done
56
+
57
+# Custom config files take precedence
58
+if [ "$custom_config" != "no" ] ; then
59
+	if [ -d "$custom_config" ] ; then
60
+		# Assign the custom config dir and remove trailing / (removes / and //)
61
+		shopt -s extglob; config_dir="${custom_config%%+(/)}"
62
+		config_files=()
63
+		if [ -r "${config_dir}/master.conf" ] ; then
64
+			config_files+=( "${config_dir}/master.conf" )
65
+		else
66
+			xshok_pretty_echo_and_log "WARNING: ${config_dir}/master.conf not found"
67
+		fi
68
+		# find the a suitable os.conf or os.*.conf file
69
+		config_file="$(find "$config_dir" -type f -iname "os.conf" -o -iname "os.*.conf" | tail -n1)"
70
+        	if [ -r "${config_file}" ] ; then
71
 			config_files+=( "${config_file}" )
35
 		else
72
 		else
36
 			xshok_pretty_echo_and_log "WARNING: ${config_dir}/master.conf not found"
73
-			xshok_pretty_echo_and_log "WARNING: ${config_file} is not readable"
74
+			xshok_pretty_echo_and_log "WARNING: ${config_dir}/os.conf not found"
37
 		fi
75
 		fi
76
+		if [ -r "${config_dir}/user.conf" ] ; then
77
+			config_files+=( "${config_dir}/user.conf" )
78
+		else
79
+			xshok_pretty_echo_and_log "WARNING: ${config_dir}/user.conf not found"
80
+		fi
81
 	else
82
-		xshok_pretty_echo_and_log "WARNING: Too many os.*.conf configs found"
83
+		config_files=( "$custom_config" )
84
+ 	fi
85
+else
86
+        # Default config files
87
+	config_dir="/usr/local/etc/clamav-unofficial-sigs"
88
+
89
+	if [ -r "${config_dir}/master.conf" ] ; then
90
+		config_files+=( "${config_dir}/master.conf" )
91
+	else
92
+		xshok_pretty_echo_and_log "ERROR: ${config_dir}/master.conf is not readable"
93
+		exit 1
94
 	fi
95
+	if [ -r "${config_dir}/os.conf" ] ; then
96
+		config_files+=( "${config_dir}/os.conf" )
97
+	else
98
+		# find the a suitable os.*.conf file
99
+		os_config_number=$(find "$config_dir" -type f -iname "os.*.conf" | wc -l)
100
+		if [ "$os_config_number" == "0" ] ; then
101
+			xshok_pretty_echo_and_log "WARNING: no os.conf or os.*.conf found"
102
+		elif [ "$os_config_number" == "1" ] ; then
103
+			config_file="$(find "$config_dir" -type f -iname "os.*.conf" | head -n1)"
104
+			if [ -r "${config_file}" ]; then
105
+				config_files+=( "${config_file}" )
106
+			else
107
+				xshok_pretty_echo_and_log "WARNING: ${config_file} is not readable"
108
+			fi
109
+		else
110
+			xshok_pretty_echo_and_log "WARNING: Too many os.*.conf configs found"
111
+		fi
112
+	fi
113
+	if [ -r "${config_dir}/user.conf" ] ; then
114
+		config_files+=( "${config_dir}/user.conf" )
115
+	else
116
+		xshok_pretty_echo_and_log "WARNING: ${config_dir}/user.conf is not readable"
117
+	fi
118
 fi
119
-if [ -r "${config_dir}/user.conf" ] ; then
120
-	config_files+=( "${config_dir}/user.conf" )
121
-else
122
-	xshok_pretty_echo_and_log "WARNING: ${config_dir}/user.conf is not readable"
123
-fi
124
 
125
 # Solaris command -v function returns garbage when the program is not found
126
 # only define the new command -v function if running under Solaris
127
@@ -1708,33 +1737,6 @@
128
 done
129
 
130
 # CONFIG LOADING AND ERROR CHECKING ##############################################
131
-if [ "$custom_config" != "no" ] ; then
132
-  if [ -d "$custom_config" ] ; then
133
-    # Assign the custom config dir and remove trailing / (removes / and //)
134
-    shopt -s extglob; config_dir="${custom_config%%+(/)}"
135
-		config_files=()
136
-		if [ -r "${config_dir}/master.conf" ] ; then
137
-			config_files+=( "${config_dir}/master.conf" )
138
-		else
139
-			xshok_pretty_echo_and_log "WARNING: ${config_dir}/master.conf not found"
140
-		fi
38
-		#find the a suitable os.conf or os.*.conf file
141
-		#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)"
142
-		config_file="$(find "$config_dir" -type f -iname "os.conf" -o -iname "os.*.conf" | tail -n1)"
40
-		if [ -r "${config_file}" ] ; then
143
-		if [ -r "${config_file}" ] ; then
41
-			config_files+=( "${config_file}" )
144
-			config_files+=( "${config_file}" )
42
+		if [ -r "${config_dir}/os.conf" ] ; then
145
-		else
43
+			config_files+=( "${config_dir}/os.conf" )
146
-			xshok_pretty_echo_and_log "WARNING: ${config_dir}/os.conf not found"
44
 		else
147
-		fi
45
 			xshok_pretty_echo_and_log "WARNING: ${config_dir}/os.conf not found"
148
-		if [ -r "${config_dir}/user.conf" ] ; then
46
 		fi
149
-			config_files+=( "${config_dir}/user.conf" )
47
@@ -1625,7 +1612,7 @@ for config_file in "${config_files[@]}" ; do
150
-		else
151
-			xshok_pretty_echo_and_log "WARNING: ${config_dir}/user.conf not found"
152
-		fi
153
-  else
154
-    config_files=( "$custom_config" )
155
-  fi
156
-fi
157
-
158
 for config_file in "${config_files[@]}" ; do
159
   if [ -r "$config_file" ] ; then # Exists and readable
160
     we_have_a_config="1"
161
@@ -1767,7 +1769,7 @@
48
       # Delete both trailing and leading whitespace
162
       # Delete both trailing and leading whitespace
49
       # Delete all trailing whitespace
163
       # Delete all trailing whitespace
50
       # Delete all empty lines
164
       # Delete all empty lines
Lines 53-59 Link Here
53
     fi
167
     fi
54
 
168
 
55
     #fix eval of |
169
     #fix eval of |
56
@@ -1640,7 +1627,7 @@ for config_file in "${config_files[@]}" ; do
170
@@ -1782,7 +1784,7 @@
57
     fi
171
     fi
58
 
172
 
59
     # Check there is an = for every set of "" optional whitespace \s* between = and "
173
     # Check there is an = for every set of "" optional whitespace \s* between = and "
Lines 62-68 Link Here
62
 
176
 
63
     if [ $(( ${#config_check} / 2 )) -ne "$config_check_vars" ] ; then
177
     if [ $(( ${#config_check} / 2 )) -ne "$config_check_vars" ] ; then
64
       xshok_pretty_echo_and_log "ERROR: Your configuration has errors, every = requires a pair of \"\""
178
       xshok_pretty_echo_and_log "ERROR: Your configuration has errors, every = requires a pair of \"\""
65
@@ -2316,24 +2303,12 @@ if [ "$sanesecurity_enabled" == "yes" ] ; then
179
@@ -2504,24 +2506,12 @@
66
         echo "$current_time" > "${work_dir_work_configs}/last-ss-update.txt"
180
         echo "$current_time" > "${work_dir_work_configs}/last-ss-update.txt"
67
         xshok_pretty_echo_and_log "Sanesecurity Database & GPG Signature File Updates" "="
181
         xshok_pretty_echo_and_log "Sanesecurity Database & GPG Signature File Updates" "="
68
         xshok_pretty_echo_and_log "Checking for Sanesecurity updates..."
182
         xshok_pretty_echo_and_log "Checking for Sanesecurity updates..."
Lines 90-92 Link Here
90
             sanesecurity_mirror_site_info="$sanesecurity_mirror_name $sanesecurity_mirror_ip"
204
             sanesecurity_mirror_site_info="$sanesecurity_mirror_name $sanesecurity_mirror_ip"
91
             xshok_pretty_echo_and_log "Sanesecurity mirror site used: ${sanesecurity_mirror_site_info}"
205
             xshok_pretty_echo_and_log "Sanesecurity mirror site used: ${sanesecurity_mirror_site_info}"
92
             # shellcheck disable=SC2086
206
             # shellcheck disable=SC2086
207
@@ -2834,7 +2824,7 @@
208
           ret="$?"
209
           if [ "$ret" -eq 0 ] ; then
210
 						# shellcheck disable=SC2035
211
-            $tar_bin --strip-components=1 --wildcards --overwrite -xzf "${work_dir_linuxmalwaredetect}/sigpack.tgz" --directory "${work_dir_linuxmalwaredetect}" */rfxn.*
212
+            $tar_bin --strip-components=1 -xzf "${work_dir_linuxmalwaredetect}/sigpack.tgz" --directory "${work_dir_linuxmalwaredetect}" "*/rfxn.*"
213
             for db_file in "${linuxmalwaredetect_dbs[@]}" ; do
214
               if [ "$loop" == "1" ] ; then
215
                 xshok_pretty_echo_and_log "---"
(-)clamav-unofficial-sigs/files/patch-config_user.conf (-6 / +5 lines)
Lines 1-6 Link Here
1
--- config/user.conf.orig	2019-09-02 22:41:48 UTC
1
--- config/user.conf.orig	2020-01-26 14:32:25.762181000 +0100
2
+++ config/user.conf
2
+++ config/user.conf	2020-01-26 14:32:41.921181000 +0100
3
@@ -49,14 +49,12 @@
3
@@ -54,13 +54,11 @@
4
 #) #END ADDITIONAL DATABASES
4
 #) #END ADDITIONAL DATABASES
5
 
5
 
6
 # Uncomment the following line to enable the script
6
 # Uncomment the following line to enable the script
Lines 9-18 Link Here
9
 
9
 
10
 # Proxy Support
10
 # Proxy Support
11
 # If necessary to proxy database downloads, define the rsync, curl, wget, dig, hosr proxy settings here.
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"
12
 #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"
13
-#dig_proxy="@proxy_host -p proxy_host:proxy_port"
16
-#host_proxy="@proxy_host" #does not support port
14
-#host_proxy="@proxy_host" #does not support port
15
 #rsync_proxy="username:password@proxy_host:proxy_port"
16
 #wget_proxy="-e http_proxy=http://username:password@proxy_host:proxy_port -e https_proxy=https://username:password@proxy_host:proxy_port"
17
 
17
 
18
 # https://eXtremeSHOK.com ######################################################
(-)clamav-unofficial-sigs/pkg-plist (-2 / +2 lines)
Lines 1-6 Link Here
1
bin/clamav-unofficial-sigs.sh
1
bin/clamav-unofficial-sigs.sh
2
@sample %%ETCDIR%%/master.conf.sample
2
%%ETCDIR%%/master.conf
3
@sample %%ETCDIR%%/os.conf.sample
3
%%ETCDIR%%/os.conf
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.md
6
%%PORTDOCS%%%%DOCSDIR%%/INSTALL.md

Return to bug 243556