Clam Antivirus is a free virus scanner with a command line scanner, a

scanning daemon (clamd), signature update from the net (freshclam), and
a sendmail-milter (clamav-milter).

ok alek@
This commit is contained in:
mbalmer 2005-01-09 17:07:52 +00:00
parent 3ea44f7fd4
commit 866d37d97f
16 changed files with 521 additions and 0 deletions

63
security/clamav/Makefile Normal file
View File

@ -0,0 +1,63 @@
# $OpenBSD: Makefile,v 1.1.1.1 2005/01/09 17:07:52 mbalmer Exp $
COMMENT= "free virus scanner"
DISTNAME= clamav-0.80
CATEGORIES= security
HOMEPAGE= http://www.clamav.net/
MAINTAINER= Marc Balmer <mbalmer@openbsd.org>
#GPL
PERMIT_PACKAGE_CDROM= Yes
PERMIT_PACKAGE_FTP= Yes
PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes
WANTLIB= c crypto pthread ssl wrap z
LIB_DEPENDS= gmp.6::devel/gmp \
curl.2::net/curl \
bz2.10::archivers/bzip2
RUN_DEPENDS= :lha-*:archivers/lha \
:unarj-*:archivers/unarj \
:unrar-*:archivers/unrar \
:zoo-*:archivers/zoo \
:arc-*:archivers/arc \
:unzip-*:archivers/unzip
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=clamav/}
CONFIGURE_STYLE= gnu
CONFIGURE_ARGS+= ${CONFIGURE_SHARED}
CONFIGURE_ARGS+= --disable-clamav \
--enable-dependency-tracking \
--disable-clamuko \
--enable-bigstack \
--enable-milter \
--with-user=_clamav \
--with-group=_clamav \
--disable-cr \
--with-dbdir=/var/db/clamav
NO_REGRESS= Yes
CONFIGURE_ENV+= LDFLAGS=" -L${LOCALBASE}/lib" \
CPPFLAGS="-I${LOCALBASE}/include"
DOCS= clamav-mirror-howto.pdf clamdoc.pdf signatures.pdf
post-install:
${INSTALL_DATA_DIR} ${PREFIX}/share/doc/clamav \
${PREFIX}/share/examples/clamav
${INSTALL_DATA_DIR} ${PREFIX}/share/doc/clamav/html
cd ${WRKSRC}/docs; ${INSTALL_DATA} html/* \
${PREFIX}/share/doc/clamav/html
cd ${WRKSRC}/docs; ${INSTALL_DATA} ${DOCS} ${PREFIX}/share/doc/clamav
cd ${WRKSRC}/etc; ${INSTALL_DATA} clamd.conf \
freshclam.conf ${PREFIX}/share/examples/clamav
cd ${WRKSRC}/examples; ${INSTALL_DATA} ex1.c \
${PREFIX}/share/examples/clamav
.include <bsd.port.mk>

4
security/clamav/distinfo Normal file
View File

@ -0,0 +1,4 @@
MD5 (clamav-0.80.tar.gz) = 59bf21e169a35d7e9c27a34435f9b870
RMD160 (clamav-0.80.tar.gz) = 488a1f96adf8aa3fa6511ff91cd15de900841844
SHA1 (clamav-0.80.tar.gz) = 0f050a19c514d2bab6063c983f155fb891c7155f
SIZE (clamav-0.80.tar.gz) = 2679434

View File

@ -0,0 +1,11 @@
--- Makefile.am.orig Thu Oct 7 01:57:15 2004
+++ Makefile.am Thu Oct 7 01:57:23 2004
@@ -15,7 +15,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-SUBDIRS = libclamav clamscan clamd clamdscan freshclam sigtool database docs etc clamav-milter
+SUBDIRS = libclamav clamscan clamd clamdscan freshclam sigtool database docs clamav-milter
EXTRA_DIST = FAQ contrib test examples BUGS shared libclamav.pc.in
bin_SCRIPTS=clamav-config

View File

@ -0,0 +1,11 @@
--- Makefile.in.orig Sun Oct 17 18:37:37 2004
+++ Makefile.in Tue Dec 21 16:37:12 2004
@@ -207,7 +207,7 @@ target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
-SUBDIRS = libclamav clamscan clamd clamdscan freshclam sigtool database docs etc clamav-milter
+SUBDIRS = libclamav clamscan clamd clamdscan freshclam sigtool database docs clamav-milter
EXTRA_DIST = FAQ contrib test examples BUGS shared libclamav.pc.in
bin_SCRIPTS = clamav-config
pkgconfigdir = $(libdir)/pkgconfig

View File

@ -0,0 +1,20 @@
--- clamav-milter/clamav-milter.c.orig Mon Oct 11 02:59:12 2004
+++ clamav-milter/clamav-milter.c Tue Dec 21 16:37:12 2004
@@ -1138,7 +1138,7 @@ main(int argc, char **argv)
* uid == 0 for that
*/
on = 1;
- if(setsockopt(broadcastSock, SOL_SOCKET, SO_BROADCAST, (int *)&on, sizeof(on)) < 0) {
+ if(setsockopt(broadcastSock, SOL_SOCKET, 0, (int *)&on, sizeof(on)) < 0) {
perror("setsockopt");
return EX_UNAVAILABLE;
}
@@ -1155,7 +1155,7 @@ main(int argc, char **argv)
memset(&ifr, '\0', sizeof(struct ifreq));
strncpy(ifr.ifr_name, iface, sizeof(ifr.ifr_name) - 1);
- if(setsockopt(broadcastSock, SOL_SOCKET, SO_BINDTODEVICE, &ifr, sizeof(ifr)) < 0) {
+ if(setsockopt(broadcastSock, SOL_SOCKET, 0, &ifr, sizeof(ifr)) < 0) {
perror(iface);
return EX_CONFIG;
}

View File

@ -0,0 +1,33 @@
$OpenBSD: patch-clamdscan_client_c,v 1.1.1.1 2005/01/09 17:07:52 mbalmer Exp $
--- clamdscan/client.c.orig Sun Jan 9 12:24:58 2005
+++ clamdscan/client.c Sun Jan 9 12:27:44 2005
@@ -25,6 +25,7 @@
#include <sys/stat.h>
#include <unistd.h>
#include <sys/socket.h>
+#include <sys/param.h>
#include <sys/un.h>
#include <netinet/in.h>
#include <arpa/inet.h>
@@ -186,18 +187,18 @@ int dsstream(int sockd)
char *abpath(const char *filename)
{
struct stat foo;
- char *fullpath, cwd[200];
+ char *fullpath, cwd[MAXPATHLEN];
if(stat(filename, &foo) == -1) {
mprintf("@Can't access file %s\n", filename);
perror(filename);
return NULL;
} else {
- fullpath = mcalloc(200 + strlen(filename) + 10, sizeof(char));
+ fullpath = mcalloc(sizeof(cwd) + strlen(filename) + 10, sizeof(char));
#ifdef C_CYGWIN
sprintf(fullpath, "%s", filename);
#else
- if(!getcwd(cwd, 200)) {
+ if(!getcwd(cwd, sizeof(cwd))) {
mprintf("@Can't get absolute pathname of current working directory.\n");
return NULL;
}

View File

@ -0,0 +1,49 @@
--- configure.orig Sun Oct 17 18:37:47 2004
+++ configure Sun Jan 9 12:24:10 2005
@@ -10339,11 +10339,11 @@ extern "C"
#endif
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
-char bzReadOpen ();
+char BZ2_bzReadOpen ();
int
main ()
{
-bzReadOpen ();
+BZ2_bzReadOpen ();
;
return 0;
}
@@ -10704,6 +10704,8 @@ cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
+#include <sys/types.h>
+#include <netinet/in.h>
#include <resolv.h>
_ACEOF
rm -f conftest.$ac_objext
@@ -11527,6 +11529,7 @@ _ACEOF
openbsd*)
if test "$have_pthreads" = "yes"; then
LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -pthread"
+ ADDITIONAL_LIBS="-pthread"
if test "$disable_cr" = "yes"; then
CLAMD_LIBS="$CLAMD_LIBS -pthread"
CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -pthread"
@@ -12405,6 +12408,7 @@ cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+#include <sys/types.h>
#include <tcpd.h>
int allow_severity = 0;
int deny_severity = 0;
@@ -12460,6 +12464,7 @@ cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+#include <sys/types.h>
#include <tcpd.h>
int allow_severity = 0;
int deny_severity = 0;

View File

@ -0,0 +1,20 @@
--- etc/clamd.conf.orig Mon Oct 11 03:14:30 2004
+++ etc/clamd.conf Tue Dec 21 16:37:52 2004
@@ -11,7 +11,7 @@ Example
# LogFile must be writable for the user running daemon.
# A full path is required.
# Default: disabled
-#LogFile /tmp/clamd.log
+#LogFile /var/log/clamd.log
# By default the log file is locked for writing - the lock protects against
# running clamd multiple times (if want to run another clamd, please
@@ -62,7 +62,7 @@ Example
# Path to the database directory.
# Default: hardcoded (depends on installation options)
-#DatabaseDirectory /var/lib/clamav
+#DatabaseDirectory /var/db/clamav
# The daemon works in a local OR a network mode. Due to security reasons we
# recommend the local mode.

View File

@ -0,0 +1,20 @@
--- etc/freshclam.conf.orig Mon Sep 27 22:35:01 2004
+++ etc/freshclam.conf Tue Dec 21 16:40:33 2004
@@ -11,7 +11,7 @@ Example
# Path to the database directory.
# WARNING: It must match clamd.conf's directive!
# Default: hardcoded (depends on installation options)
-#DatabaseDirectory /var/lib/clamav
+#DatabaseDirectory /var/db/clamav
# Path to the log file (make sure it has proper permissions)
# Default: disabled
@@ -37,7 +37,7 @@ Example
# By default when started freshclam drops privileges and switches to the
# "clamav" user. This directive allows you to change the database owner.
# Default: clamav (may depend on installation options)
-#DatabaseOwner clamav
+#DatabaseOwner _clamav
# Use DNS to verify virus database version. Freshclam uses DNS TXT records
# to verify database and software versions. We highly recommend enabling

View File

@ -0,0 +1,14 @@
--- libclamav/mbox.c.orig Sun Oct 17 15:25:31 2004
+++ libclamav/mbox.c Tue Dec 21 16:37:12 2004
@@ -472,11 +472,6 @@ static char const rcsid[] = "$Id: mbox.c
#define NDEBUG /* map CLAMAV debug onto standard */
#endif
-#ifdef CL_THREAD_SAFE
-#ifndef _REENTRANT
-#define _REENTRANT /* for Solaris 2.8 */
-#endif
-#endif
#include <stdio.h>
#include <stdlib.h>

View File

@ -0,0 +1,23 @@
--- libclamav/scanners.c.orig Sun Oct 17 01:24:48 2004
+++ libclamav/scanners.c Tue Dec 21 16:37:12 2004
@@ -494,11 +494,6 @@ static int cli_scangzip(int desc, const
#ifdef HAVE_BZLIB_H
-#ifdef NOBZ2PREFIX
-#define BZ2_bzReadOpen bzReadOpen
-#define BZ2_bzReadClose bzReadClose
-#define BZ2_bzRead bzRead
-#endif
static int cli_scanbzip(int desc, const char **virname, long int *scanned, const struct cl_node *root, const struct cl_limits *limits, unsigned int options, int *arec, int *mrec)
{
@@ -519,7 +514,7 @@ static int cli_scanbzip(int desc, const
if(limits->archivememlim)
memlim = 1;
- if((bfd = BZ2_bzReadOpen(&bzerror, fs, 0, memlim, NULL, 0)) == NULL) {
+ if((bfd = (BZFILE *)BZ2_bzReadOpen(&bzerror, fs, 0, memlim, NULL, 0)) == NULL) {
cli_dbgmsg("Bzip: Can't initialize bzip2 library (descriptor: %d).\n", desc);
fclose(fs);
return CL_EBZIP;

View File

@ -0,0 +1,80 @@
$OpenBSD: patch-ltmain_sh,v 1.1.1.1 2005/01/09 17:07:52 mbalmer Exp $
--- ltmain.sh.orig Tue Jun 24 00:48:14 2003
+++ ltmain.sh Tue Jun 24 00:50:20 2003
@@ -1035,39 +1035,45 @@ compiler."
;;
-l*)
- if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
- case $host in
- *-*-cygwin* | *-*-pw32* | *-*-beos*)
- # These systems don't actually have a C or math library (as such)
- continue
- ;;
- *-*-mingw* | *-*-os2*)
- # These systems don't actually have a C library (as such)
- test "X$arg" = "X-lc" && continue
- ;;
- *-*-openbsd* | *-*-freebsd*)
- # Do not include libc due to us having libc/libc_r.
- test "X$arg" = "X-lc" && continue
- ;;
- esac
- # This change is required for -lc_r under FreeBSD / Tomasz Kojm
- #elif test "X$arg" = "X-lc_r"; then
- # case $host in
- #*-*-openbsd* | *-*-freebsd*)
- # # Do not include libc_r directly, use -pthread flag.
- # continue
- # ;;
- # esac
- fi
- deplibs="$deplibs $arg"
- continue
- ;;
+ if test "$arg" = "-lc"; then
+ case "$host" in
+ *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
+ # These systems don't actually have c library (as such)
+ continue
+ ;;
+ *-*-openbsd*)
+ # Do not include libc due to us having libc/libc_r.
+ continue
+ ;;
+ esac
+ elif test "$arg" = "-lc_r"; then
+ case "$host" in
+ *-*-openbsd*)
+ # Do not include libc_r directly, use -pthread flag.
+ continue
+ ;;
+ esac
+ elif test "$arg" = "-lm"; then
+ case "$host" in
+ *-*-cygwin* | *-*-beos*)
+ # These systems don't actually have math library (as such)
+ continue
+ ;;
+ esac
+ fi
+ deplibs="$deplibs $arg"
+ ;;
- # We need this change for old -pthread *BSD style / Tomasz Kojm
-pthread)
- deplibs="$deplibs -pthread"
- continue
- ;;
+ case $host in
+ *-*-openbsd*)
+ deplibs="$deplibs $arg"
+ ;;
+ *)
+ continue
+ ;;
+ esac
+ ;;
-module)
module=yes

View File

@ -0,0 +1,4 @@
Clam Antivirus is an anti-virus scanner written from scratch. It is licensed
under GNU GPL2 and uses the virus database from OpenAntiVirus, which is an
another free anti-virus project. In contrast to the OpenAntiVirus (which is
written in Java), Clam Antivirus is written entirely in C and POSIX compliant.

4
security/clamav/pkg/MESSAGE Executable file
View File

@ -0,0 +1,4 @@
Edit ${SYSCONFDIR}/clamd.conf and ${SYSCONFDIR}/freshclam.conf
to use Clam AV.
Use freshclam to install an up-to-date virus signature database.

View File

@ -0,0 +1,2 @@
@comment $OpenBSD: PFRAG.shared,v 1.1.1.1 2005/01/09 17:07:52 mbalmer Exp $
@lib lib/libclamav.so.1.4

163
security/clamav/pkg/PLIST Normal file
View File

@ -0,0 +1,163 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2005/01/09 17:07:53 mbalmer Exp $
@newgroup _clamav:539
@newuser _clamav:539:539:daemon:Clam AntiVirus:/nonexistent:/sbin/nologin
bin/clamav-config
bin/clamdscan
bin/clamscan
bin/freshclam
bin/sigtool
include/clamav.h
lib/libclamav.a
lib/libclamav.la
lib/pkgconfig/
lib/pkgconfig/libclamav.pc
@man man/man1/clamdscan.1
@man man/man1/clamscan.1
@man man/man1/freshclam.1
@man man/man1/sigtool.1
@man man/man5/clamd.conf.5
@man man/man5/freshclam.conf.5
@man man/man8/clamav-milter.8
@man man/man8/clamd.8
sbin/clamav-milter
sbin/clamd
share/doc/clamav/
share/doc/clamav/clamav-mirror-howto.pdf
share/doc/clamav/clamdoc.pdf
share/doc/clamav/html/
share/doc/clamav/html/clamdoc.css
share/doc/clamav/html/footnode.html
share/doc/clamav/html/img1.png
share/doc/clamav/html/img2.png
share/doc/clamav/html/img3.png
share/doc/clamav/html/img4.png
share/doc/clamav/html/img5.png
share/doc/clamav/html/index.html
share/doc/clamav/html/node1.html
share/doc/clamav/html/node10.html
share/doc/clamav/html/node100.html
share/doc/clamav/html/node101.html
share/doc/clamav/html/node102.html
share/doc/clamav/html/node103.html
share/doc/clamav/html/node104.html
share/doc/clamav/html/node105.html
share/doc/clamav/html/node106.html
share/doc/clamav/html/node107.html
share/doc/clamav/html/node108.html
share/doc/clamav/html/node109.html
share/doc/clamav/html/node11.html
share/doc/clamav/html/node110.html
share/doc/clamav/html/node111.html
share/doc/clamav/html/node112.html
share/doc/clamav/html/node12.html
share/doc/clamav/html/node13.html
share/doc/clamav/html/node14.html
share/doc/clamav/html/node15.html
share/doc/clamav/html/node16.html
share/doc/clamav/html/node17.html
share/doc/clamav/html/node18.html
share/doc/clamav/html/node19.html
share/doc/clamav/html/node2.html
share/doc/clamav/html/node20.html
share/doc/clamav/html/node21.html
share/doc/clamav/html/node22.html
share/doc/clamav/html/node23.html
share/doc/clamav/html/node24.html
share/doc/clamav/html/node25.html
share/doc/clamav/html/node26.html
share/doc/clamav/html/node27.html
share/doc/clamav/html/node28.html
share/doc/clamav/html/node29.html
share/doc/clamav/html/node3.html
share/doc/clamav/html/node30.html
share/doc/clamav/html/node31.html
share/doc/clamav/html/node32.html
share/doc/clamav/html/node33.html
share/doc/clamav/html/node34.html
share/doc/clamav/html/node35.html
share/doc/clamav/html/node36.html
share/doc/clamav/html/node37.html
share/doc/clamav/html/node38.html
share/doc/clamav/html/node39.html
share/doc/clamav/html/node4.html
share/doc/clamav/html/node40.html
share/doc/clamav/html/node41.html
share/doc/clamav/html/node42.html
share/doc/clamav/html/node43.html
share/doc/clamav/html/node44.html
share/doc/clamav/html/node45.html
share/doc/clamav/html/node46.html
share/doc/clamav/html/node47.html
share/doc/clamav/html/node48.html
share/doc/clamav/html/node49.html
share/doc/clamav/html/node5.html
share/doc/clamav/html/node50.html
share/doc/clamav/html/node51.html
share/doc/clamav/html/node52.html
share/doc/clamav/html/node53.html
share/doc/clamav/html/node54.html
share/doc/clamav/html/node55.html
share/doc/clamav/html/node56.html
share/doc/clamav/html/node57.html
share/doc/clamav/html/node58.html
share/doc/clamav/html/node59.html
share/doc/clamav/html/node6.html
share/doc/clamav/html/node60.html
share/doc/clamav/html/node61.html
share/doc/clamav/html/node62.html
share/doc/clamav/html/node63.html
share/doc/clamav/html/node64.html
share/doc/clamav/html/node65.html
share/doc/clamav/html/node66.html
share/doc/clamav/html/node67.html
share/doc/clamav/html/node68.html
share/doc/clamav/html/node69.html
share/doc/clamav/html/node7.html
share/doc/clamav/html/node70.html
share/doc/clamav/html/node71.html
share/doc/clamav/html/node72.html
share/doc/clamav/html/node73.html
share/doc/clamav/html/node74.html
share/doc/clamav/html/node75.html
share/doc/clamav/html/node76.html
share/doc/clamav/html/node77.html
share/doc/clamav/html/node78.html
share/doc/clamav/html/node79.html
share/doc/clamav/html/node8.html
share/doc/clamav/html/node80.html
share/doc/clamav/html/node81.html
share/doc/clamav/html/node82.html
share/doc/clamav/html/node83.html
share/doc/clamav/html/node84.html
share/doc/clamav/html/node85.html
share/doc/clamav/html/node86.html
share/doc/clamav/html/node87.html
share/doc/clamav/html/node88.html
share/doc/clamav/html/node89.html
share/doc/clamav/html/node9.html
share/doc/clamav/html/node90.html
share/doc/clamav/html/node91.html
share/doc/clamav/html/node92.html
share/doc/clamav/html/node93.html
share/doc/clamav/html/node94.html
share/doc/clamav/html/node95.html
share/doc/clamav/html/node96.html
share/doc/clamav/html/node97.html
share/doc/clamav/html/node98.html
share/doc/clamav/html/node99.html
share/doc/clamav/signatures.pdf
share/examples/clamav/
share/examples/clamav/clamd.conf
@sample ${SYSCONFDIR}/clamd.conf
share/examples/clamav/ex1.c
share/examples/clamav/freshclam.conf
@sample ${SYSCONFDIR}/freshclam.conf
%%SHARED%%
@owner _clamav
@group _clamav
@sample /var/db/clamav/
@mode 0700
@sample /var/clamav/
@sample /var/clamav/quarantine/
@extraunexec rm -fr /var/db/clamav/*
@extraunexec rm -fr /var/clamav/quarantine/*