aboutsummaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorgarga <garga@FreeBSD.org>2007-04-14 01:49:09 +0800
committergarga <garga@FreeBSD.org>2007-04-14 01:49:09 +0800
commit82cfecbdea2ab176197bcf3216e2b32353d848d1 (patch)
treef3fd3cc599f5f7f6f9c9f00503756e5e10af6da9 /security
parent6eb79a4b383b73eecdcb7cc232db929fbe4a1d8d (diff)
downloadfreebsd-ports-gnome-82cfecbdea2ab176197bcf3216e2b32353d848d1.tar.gz
freebsd-ports-gnome-82cfecbdea2ab176197bcf3216e2b32353d848d1.tar.zst
freebsd-ports-gnome-82cfecbdea2ab176197bcf3216e2b32353d848d1.zip
- Update to 0.90.2
- Add a patch to increase performance of clamd in threaded systems [1] - Change clamav-milter rc.d script to use a var to determine seconds of timeout to wait clamd socket be started [2] - Add support to gethostbyname_r() on FreeBSD 6 and above [3] - Install clamav-config.h [3] - Fix all dependencies for klamav work fine [3] PR: ports/111130 [2], ports/111478 [3] Submitted by: Anton Yuzhaninov <citrin@rambler-co.ru> [1] Denis Eremenko <moonshade@pnhz.kz> [2] Anderson S. Ferreira <anderson@cnpm.embrapa.br> [3] Obtained from: https://wwws.clamav.net/bugzilla/show_bug.cgi?id=434 [1]
Diffstat (limited to 'security')
-rw-r--r--security/clamav/Makefile11
-rw-r--r--security/clamav/distinfo6
-rw-r--r--security/clamav/files/clamav-milter.in15
-rw-r--r--security/clamav/files/patch-libclamav__matcher-ac.c65
-rw-r--r--security/clamav/pkg-plist1
5 files changed, 91 insertions, 7 deletions
diff --git a/security/clamav/Makefile b/security/clamav/Makefile
index 8324ae0f8895..56653a5af6f6 100644
--- a/security/clamav/Makefile
+++ b/security/clamav/Makefile
@@ -6,8 +6,7 @@
#
PORTNAME= clamav
-PORTVERSION= 0.90.1
-PORTREVISION= 1
+PORTVERSION= 0.90.2
CATEGORIES= security
MASTER_SITES= SF
@@ -47,7 +46,6 @@ CONFIGURE_ARGS= --with-dbdir=${DBDIR} \
--disable-clamuko \
--disable-clamav \
--enable-bigstack \
- --disable-gethostbyname_r \
--enable-readdir_r \
--disable-dependency-tracking
CPPFLAGS+= -I${LOCALBASE}/include \
@@ -99,6 +97,12 @@ PLIST_SUB+= CLAMAVUSER=${CLAMAVUSER} \
.include <bsd.port.pre.mk>
+.if ${OSVERSION} < 600000
+CONFIGURE_ARGS+= --disable-gethostbyname_r
+.else
+CONFIGURE_ARGS+= --enable-gethostbyname_r
+.endif
+
# This port has a problem with -pthread,
# force to use -lthr until it's not fixed.
.if ${OSVERSION} >= 601000
@@ -159,6 +163,7 @@ pre-install:
@${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
post-install:
+ @${INSTALL_DATA} ${WRKSRC}/clamav-config.h ${PREFIX}/include
.for c in clamd freshclam
@[ -f ${PREFIX}/etc/${c}.conf ] || \
${CP} ${PREFIX}/etc/${c}.conf.default ${PREFIX}/etc/${c}.conf
diff --git a/security/clamav/distinfo b/security/clamav/distinfo
index 51ca3c2bd23c..7bc2b9b40d64 100644
--- a/security/clamav/distinfo
+++ b/security/clamav/distinfo
@@ -1,3 +1,3 @@
-MD5 (clamav-0.90.1.tar.gz) = cd11c05b5476262eaea4fa3bd7dc25bf
-SHA256 (clamav-0.90.1.tar.gz) = 08a0255b4f6bdc4312eea6c118e79ecf684aed10640b45037d9dc5890c7687be
-SIZE (clamav-0.90.1.tar.gz) = 11643310
+MD5 (clamav-0.90.2.tar.gz) = 39d1f07a399b551b55096b6ec7325c33
+SHA256 (clamav-0.90.2.tar.gz) = 30df6a5d4a591dcd4acd7d4cce54dcfd260280fce6bbc9d19d240967bcdabbfa
+SIZE (clamav-0.90.2.tar.gz) = 12062886
diff --git a/security/clamav/files/clamav-milter.in b/security/clamav/files/clamav-milter.in
index cc455890f817..c43201c3549a 100644
--- a/security/clamav/files/clamav-milter.in
+++ b/security/clamav/files/clamav-milter.in
@@ -35,11 +35,23 @@ start_precmd()
rm "$clamav_milter_socket"
fi
rc_flags="--pidfile ${pidfile} ${flags:-$clamav_milter_flags} $clamav_milter_socket"
- for a in 1 2 3 4 5 6 7 8 9 10
+
+ echo -n "Waiting for clamd socket.. "
+ i=${clamav_milter_socktimeout}
+ while [ $i -ne 0 ]
do
[ -S "$clamav_clamd_socket" ] && break
+ if [ `expr $i % 10` -eq 0 ]; then
+ echo -n "${i}.. "
+ fi
sleep 1
+ i=$(($i-1))
done
+ echo
+ if [ $i -eq 0 ]; then
+ echo "There is no clamd socket (${clamav_clamd_socket})!"
+ exit 1
+ fi
}
# read settings, set default values
@@ -48,5 +60,6 @@ load_rc_config $name
: ${clamav_milter_socket="%%CLAMAV_MILTER_SOCKET%%"}
: ${clamav_clamd_socket="%%CLAMAV_CLAMD_SOCKET%%"}
: ${clamav_milter_flags="--postmaster-only --local --outgoing --timeout=0 --max-children=50"}
+: ${clamav_milter_socktimeout="60"}
run_rc_command "$1"
diff --git a/security/clamav/files/patch-libclamav__matcher-ac.c b/security/clamav/files/patch-libclamav__matcher-ac.c
new file mode 100644
index 000000000000..ad517cf5fcda
--- /dev/null
+++ b/security/clamav/files/patch-libclamav__matcher-ac.c
@@ -0,0 +1,65 @@
+--- libclamav/matcher-ac.c.orig Mon Apr 9 19:16:01 2007
++++ libclamav/matcher-ac.c Mon Apr 9 19:25:18 2007
+@@ -301,7 +301,7 @@
+
+ int cli_ac_initdata(struct cli_ac_data *data, unsigned int partsigs, unsigned int tracklen)
+ {
+- unsigned int i, j;
++ unsigned int i;
+
+
+ if(!data) {
+@@ -366,30 +366,26 @@
+ * allocation in cli_ac_scanbuff()
+ */
+
+- for(i = 0; i < partsigs; i++) {
+- data->partoff[i] = (unsigned int *) cli_calloc(tracklen, sizeof(unsigned int));
++ data->partoff[0] = (unsigned int *) cli_calloc(partsigs * tracklen, sizeof(unsigned int));
+
+- if(!data->partoff[i]) {
+- for(j = 0; j < i; j++)
+- free(data->partoff[j]);
+-
+- free(data->partoff);
+- free(data->partcnt);
+- free(data->offcnt);
+- free(data->offidx);
+- free(data->maxshift);
+- cli_errmsg("cli_ac_init(): unable to cli_calloc(%u, %u)\n", tracklen, sizeof(unsigned int));
+- return CL_EMEM;
+- }
++ if(!data->partoff[0]) {
++ free(data->partoff);
++ free(data->partcnt);
++ free(data->offcnt);
++ free(data->offidx);
++ free(data->maxshift);
++ cli_errmsg("cli_ac_init(): unable to cli_calloc(%u, %u)\n", partsigs * tracklen, sizeof(unsigned int));
++ return CL_EMEM;
+ }
+
++ for(i = 0; i < partsigs; i++)
++ data->partoff[i] = data->partoff[0] + tracklen * i;
++
+ return CL_SUCCESS;
+ }
+
+ void cli_ac_freedata(struct cli_ac_data *data)
+ {
+- unsigned int i;
+-
+
+ if(data && data->partsigs) {
+ free(data->partcnt);
+@@ -397,9 +393,7 @@
+ free(data->offidx);
+ free(data->maxshift);
+
+- for(i = 0; i < data->partsigs; i++)
+- free(data->partoff[i]);
+-
++ free(data->partoff[0]);
+ free(data->partoff);
+ }
+ }
diff --git a/security/clamav/pkg-plist b/security/clamav/pkg-plist
index 48776a7c6793..cce136a30848 100644
--- a/security/clamav/pkg-plist
+++ b/security/clamav/pkg-plist
@@ -8,6 +8,7 @@ bin/sigtool
%%CLAMAV-MILTER%%sbin/clamav-milter
sbin/clamd
include/clamav.h
+include/clamav-config.h
lib/libclamav.so.2
lib/libclamav.so
lib/libclamav.a