head	1.21;
access;
symbols
	RELEASE_6_1_0:1.20
	RELEASE_5_5_0:1.20
	RELEASE_6_0_0:1.20
	RELEASE_5_4_0:1.20
	RELEASE_4_11_0:1.18
	RELEASE_5_3_0:1.16
	RELEASE_4_10_0:1.12
	RELEASE_5_2_1:1.8
	RELEASE_5_2_0:1.8
	RELEASE_4_9_0:1.4
	old_RELEASE_5_1_0:1.1
	old_RELEASE_4_8_0:1.1;
locks; strict;
comment	@# @;


1.21
date	2006.04.07.10.10.20;	author garga;	state dead;
branches;
next	1.20;

1.20
date	2005.01.27.12.15.27;	author yar;	state Exp;
branches;
next	1.19;

1.19
date	2005.01.12.18.22.56;	author yar;	state Exp;
branches;
next	1.18;

1.18
date	2004.12.22.02.10.12;	author edwin;	state Exp;
branches;
next	1.17;

1.17
date	2004.11.04.22.49.52;	author pav;	state Exp;
branches;
next	1.16;

1.16
date	2004.05.30.08.03.49;	author pav;	state Exp;
branches;
next	1.15;

1.15
date	2004.05.25.12.49.28;	author eik;	state Exp;
branches;
next	1.14;

1.14
date	2004.05.25.09.36.35;	author pav;	state Exp;
branches;
next	1.13;

1.13
date	2004.05.24.23.02.23;	author pav;	state Exp;
branches;
next	1.12;

1.12
date	2004.02.18.20.24.40;	author dinoex;	state Exp;
branches;
next	1.11;

1.11
date	2004.02.11.10.39.34;	author dinoex;	state Exp;
branches;
next	1.10;

1.10
date	2004.01.30.18.45.04;	author dinoex;	state Exp;
branches;
next	1.9;

1.9
date	2003.12.11.15.32.29;	author dinoex;	state Exp;
branches;
next	1.8;

1.8
date	2003.11.12.21.14.57;	author dinoex;	state Exp;
branches;
next	1.7;

1.7
date	2003.10.03.13.31.25;	author dinoex;	state Exp;
branches;
next	1.6;

1.6
date	2003.09.30.03.39.11;	author dinoex;	state Exp;
branches;
next	1.5;

1.5
date	2003.09.26.17.34.19;	author dinoex;	state Exp;
branches;
next	1.4;

1.4
date	2003.06.25.12.33.31;	author nork;	state Exp;
branches;
next	1.3;

1.3
date	2003.06.18.09.43.05;	author nork;	state Exp;
branches;
next	1.2;

1.2
date	2003.06.08.16.16.49;	author leeym;	state Exp;
branches;
next	1.1;

1.1
date	2003.01.20.03.41.52;	author edwin;	state Exp;
branches;
next	;


desc
@@


1.21
log
@- Update to 20060406 snapshot -- fix multiple vulnerabilities
   * CVE-2006-1614
      Damian Put discovered an integer overflow in the PE header parser.
      This is only exploitable if the ArchiveMaxFileSize option is disabled.
   * CVE-2006-1615
      Format string vulnerabilities in the logging code have been discovered,
      which might lead to the execution of arbitrary code.
   * CVE-2006-1630
      David Luyer discovered, that ClamAV can be tricked into an invalid
      memory access in the cli_bitset_set() function, which may lead to
      a denial of service.

- Synchronize with clamav port using SUB_FILES, USE_RC_SUBR

PR:		ports/95425
Submitted by:	garga
Security:	VuXML 6a5174bd-c580-11da-9110-00123ffe8333
@
text
@#!/bin/sh
# $FreeBSD: ports/security/clamav-devel/pkg-install,v 1.20 2005/01/27 12:15:27 yar Exp $

PREFIX=${PKG_PREFIX:-%%PREFIX%%}
DESTDIR=${PKG_DESTDIR:-}

CLAMAVUSER=%%CLAMAVUSER%%
CLAMAVGROUP=%%CLAMAVGROUP%%
UID=106
GID=$UID

DBDIR=$DESTDIR%%DBDIR%%
LOGDIR=$DESTDIR%%LOGDIR%%
RUNDIR=$DESTDIR%%RUNDIR%%

if [ "$2" = "PRE-INSTALL" ]; then

	if ! pw groupshow "$CLAMAVGROUP" 2>/dev/null 1>&2; then
		if pw groupadd $CLAMAVGROUP -g $GID; then
			echo "=> Added group \"$CLAMAVGROUP\"."
		else
			echo "=> Adding group \"$CLAMAVGROUP\" failed..."
			exit 1
		fi
	fi

	if ! pw usershow "$CLAMAVUSER" 2>/dev/null 1>&2; then
		if pw useradd $CLAMAVUSER -u $UID -g $CLAMAVGROUP -h - \
			-s "/sbin/nologin" -d "/nonexistent" \
			-c "Clam Antivirus"; \
		then
			pw groupmod mail -m $CLAMAVUSER
			echo "=> Added user \"$CLAMAVUSER\"."
		else
			echo "=> Adding user \"$CLAMAVUSER\" failed..."
			exit 1
		fi
	fi

elif [ "$2" = "POST-INSTALL" ]; then

	if [ ! -d "$DBDIR" ]; then
		mkdir -p "$DBDIR" || exit 1
		chown "$CLAMAVUSER:$CLAMAVGROUP" "$DBDIR" || exit 1
	fi

	if [ ! -d "$LOGDIR" ]; then
		mkdir -p "$LOGDIR" || exit 1
		chown "$CLAMAVUSER:$CLAMAVGROUP" "$LOGDIR" || exit 1
	fi

	if [ ! -d "$RUNDIR" ]; then
		mkdir -p "$RUNDIR" || exit 1
		chown "$CLAMAVUSER:$CLAMAVGROUP" "$RUNDIR" || exit 1
	fi

	if [ -f "$DESTDIR$PREFIX/etc/clamav.conf" ]; then
		echo
		echo "**************** WARNING ****************"
		echo "*                                       *"
		echo "*  The configuration file has changed:  *"
		echo "* Please edit $PREFIX/etc/clamd.conf *"
		echo "* and remove $PREFIX/etc/clamav.conf *"
		echo "*                                       *"
		echo "**************** WARNING ****************"
		echo
	fi

fi

exit 0
@


1.20
log
@Introduce a variable LOGDIR instead of using a literal log directory
pathname everywhere.

Approved by:	Rob Evers (maintainer)
@
text
@d2 1
a2 1
# $FreeBSD: ports/security/clamav-devel/pkg-install,v 1.19 2005/01/12 18:22:56 yar Exp $
@


1.19
log
@Finish incorporating the changes proposed in
ports/75607 into clamav-devel.

In particular, the last change to this port makes
use of the clamav-milter pidfile, which wouldn't be
recorded without the present change.

PR:		ports/75607
Approved by:	maintainer
@
text
@d2 1
a2 1
# $FreeBSD: ports/security/clamav-devel/pkg-install,v 1.18 2004/12/22 02:10:12 edwin Exp $
a11 1
CLAMLOG=$DESTDIR/var/log/clamav
d13 1
a41 5
	if [ ! -d "$CLAMLOG" ]; then
		mkdir -p "$CLAMLOG" || exit 1
		chown "$CLAMAVUSER:$CLAMAVGROUP" "$CLAMLOG" || exit 1
	fi

d47 5
@


1.18
log
@Fix ports: security/clamav and security/clamav-devel (change db
directory to /var/db/clamav and fix removal of db on deinstall)

	For the sake of coherence, the ClamAV database should be
	installed in /var/db/clamav, not /usr/local/share/clamav.
	Also fixes the database removal on package deinstallation.

PR:		ports/74172
Submitted by:	Jean-Yves Lefort <jylefort@@brutele.be>
Approved by:	Rob Evers <rob@@debank.tv>
@
text
@d2 1
a2 1
# $FreeBSD: ports/security/clamav-devel/pkg-install,v 1.17 2004/11/04 22:49:52 pav Exp $
a11 1
CLAMRUN=$DESTDIR/var/run/clamav
d14 1
a41 5
	if [ ! -d "$CLAMRUN" ]; then
		mkdir -p "$CLAMRUN" || exit 1
		chown "$CLAMAVUSER:$CLAMAVGROUP" "$CLAMRUN" || exit 1
	fi

d52 5
@


1.17
log
@- Update to 20041101
- Configuration file was renamed to clamd.conf!

PR:		ports/73491
Submitted by:	Rob Evers <rob@@debank.tv> (maintainer)
@
text
@d2 1
a2 1
# $FreeBSD: ports/security/clamav/pkg-install,v 1.8 2004/10/14 09:30:47 eik Exp $
d14 1
a14 1
DATADIR=$DESTDIR%%DATADIR%%
d52 3
a54 3
	if [ ! -d "$DATADIR" ]; then
		mkdir -p "$DATADIR" || exit 1
		chown "$CLAMAVUSER:$CLAMAVGROUP" "$DATADIR" || exit 1
@


1.16
log
@- Use fixed UID/GID (same as security/clamav)
@
text
@d2 13
d18 28
a45 7
if [ -z "${CLAMAVUSER}" ]; then
	CLAMAVUSER=clamav
fi

if [ -z "${CLAMAVGROUP}" ]; then
	CLAMAVGROUP=clamav
fi
d47 4
a50 2
UID=106
GID=${UID}
d52 4
a55 2
CLAMRUN=/var/run/clamav
CLAMLOG=/var/log/clamav
d57 11
a67 26
echo "===> Adding user \"${CLAMAVUSER}\" if necessary."
if ! pw groupshow "${CLAMAVGROUP}" 2>/dev/null 1>&2; then
	if pw groupadd ${CLAMAVGROUP} -g ${GID}; then
		echo "===> Added group \"${CLAMAVGROUP}\"."
	else
                echo "===> Adding group \"${CLAMAVGROUP}\" failed..."
                exit 1
	fi
fi

if ! pw usershow "${CLAMAVUSER}" 2>/dev/null 1>&2; then
	if pw useradd ${CLAMAVUSER} -u ${UID} -g ${CLAMAVGROUP} -h - \
		-s "/usr/sbin/nologin" -d "/nonexistent" \
		-c "Clam Antivirus"; \
        then
                echo "===> Added user \"${CLAMAVUSER}\"."
		pw groupmod mail -m ${CLAMAVUSER}
        else
                echo "===> Adding user \"${CLAMAVUSER}\" failed..."
                exit 1
        fi
fi

echo "===> Setting permissions..."
mkdir -p "${CLAMRUN}"
chown "${CLAMAVUSER}:${CLAMAVGROUP}" "${CLAMRUN}"
a68 2
mkdir -p "${CLAMLOG}"
chown "${CLAMAVUSER}:${CLAMAVGROUP}" "${CLAMLOG}"
@


1.15
log
@undo chmod on socket directory

Approved by:	Rob Evers <rob@@debank.tv> (maintainer)
@
text
@d13 3
d21 1
a21 1
	if pw groupadd ${CLAMAVGROUP}; then
d30 1
a30 1
	if pw useradd ${CLAMAVUSER} -g ${CLAMAVGROUP} -h - \
@


1.14
log
@- Change permissions on socket directory to 750.
  This unbreaks sendmail.

Submitted by:	ume
Approved by:	maintainer
@
text
@a40 1
chmod 750 "${CLAMRUN}"
@


1.13
log
@- Update to 20040524
- Rename rc script freshclam.sh -> clamav-freshclam.sh for consistency
  BEWARE if you're using freshclam daemon you must update your rc.conf!
- Chmod 770 socket directory
- Diff reduction against security/clamav port

PR:		ports/67125
Submitted by:	Rob Evers <rob@@debank.tv> (maintainer)
@
text
@d41 1
a41 1
chmod 770 "${CLAMRUN}"
@


1.12
log
@- Unbreak threading issue
PR:		63022
Submitted by:	rob@@debank.tv

- Use fixStaleSocket by default
- Add clamav user to mail group (for exim users)
- clean up DOCSDIR variable
PR:		63022
Submitted by:	rob@@debank.tv
Suggested by:	eik
@
text
@d41 1
@


1.11
log
@- update to 20040210
- The install doesn't delete the database anymore
- Don't remove the database on deinstall
- Use OPTIONS target
- handle all config install via the port

You have to run freshclam manually once after upgrade to restore the database.

PR:		62653
Submitted by:	rob@@debank.tv

- Fix deinstall when no database was installed.
Submitted by:	dinoex
@
text
@d32 1
@


1.10
log
@- udpate to 20040129 (Various OLE2/VBA fixes)
Get default config files from BUILD_WRKSRC to fix upgrade when config files are untouched
Really use the POST-INSTALL target

PR:		62112
Submitted by:	rob@@debank.tv
@
text
@a45 5
if [ "$2" = "POST-INSTALL" ]; then
	echo "===> Updating virus definitions..."
	freshclam
fi

@


1.9
log
@- fix path for freshclam
@
text
@d48 1
a48 1
	freshclam -u $3 --datadir=$4
@


1.8
log
@- update to 20031112
PR:		59219
Submitted by:	rob@@debank.tv
@
text
@d48 1
a48 1
	$1/bin/freshclam -u $3 --datadir=$4
@


1.7
log
@- Upgrade to 20031001
- added RC-ng scripts
- Fix build on CURENT
PR:		57451
Submitted by:	rob@@debank.tv, eikemeier@@fillmore-labs.com, dinoex
@
text
@d3 1
a3 3
if [ ! "$2" = "PRE-INSTALL" ]; then
	exit 0
fi
d44 6
@


1.6
log
@Update to 20030928
- use included libtool (seems heavily patched)
- make packageable and include a working configure file
- don't install useless .la files
- use DATADIR
- 510001 is FreeBSD 5.10, 5.1-CURRENT is 501100
- Change log and pid file location to more universal one
- RC-ng scripts for clamd and clamav-milter are planned

- Thanks to Oliver Eikemeier from whom I stole most (clamav-port)

PR:		57371
Submitted by:	rob@@debank.tv
@
text
@d3 4
@


1.5
log
@- Udpate to 20030926
add a few switches for spooldir and user
The clamav-user doesn't get deinstalled by default (easy when upgrading),
after deinstall a message is presented to remove the clamav-user if neccesary.

PR:		57254
Submitted by:	rob@@debank.tv
@
text
@d7 2
a8 2
if [ -z "${SPOOLDIR}" ]; then
	SPOOLDIR=/var/clamd
d11 2
a12 1
CLAMAVGROUP=${CLAMAVUSER}
d26 1
a26 1
		-s "/usr/sbin/nologin" -d "${SPOOLDIR}" \
d37 5
a41 2
mkdir ${SPOOLDIR}
chown -R ${CLAMAVUSER}:${CLAMAVGROUP} ${PKG_PREFIX}/share/clamav ${SPOOLDIR}
@


1.4
log
@Add new port of clamav-devel after repo copy.
Update to snapshot(20030625).

PR:		ports/53306
Submitted by:	Rob Evers <rob@@debank.tv>
Approved by:	portmgr (marcus)
Repo copyed by:	cvs (joe)
@
text
@d3 3
d7 2
a8 2
if [ "$2" != "PRE-INSTALL" ]; then
    chown -R clamav:clamav ${PKG_PREFIX}/share/clamav
d11 1
a11 2
USER=clamav
GROUP=clamav
d13 4
a16 3
if ! pw groupshow "$GROUP" 2>/dev/null 1>&2; then
	if pw groupadd $GROUP; then
		echo "===> Added group \"$GROUP\"."
d18 1
a18 1
                echo "===> Adding group \"$GROUP\" failed..."
d20 1
a20 1
        fi
d23 4
a26 4
if ! pw usershow "$USER" 2>/dev/null 1>&2; then
        if pw useradd $USER -g $GROUP -h - \
                -s "/sbin/nologin" -d "/nonexistent" \
                -c "Clam Antivirus"; \
d28 1
a28 1
                echo "===> Added user \"$USER\"."
d30 1
a30 1
                echo "===> Adding user \"$USER\" failed..."
d34 5
@


1.3
log
@o Add mirror site.
o Remove unnecsesary patches for current.
o Add/remove users when installing/removing.
o Set permissions on virus database dir.

PR:		ports/53305
Submitted by:	Rob Evers<rob@@debank.tv>
Approved by:	TERAMOTO Masahiro <markun@@onohara.to> (maintainer)
@
text
@d3 4
a6 1
if [ "$2" = "PRE-INSTALL" ]; then
d13 1
a13 1
		echo "=> Added group \"$GROUP\"."
d15 1
a15 1
                echo "=> Adding group \"$GROUP\" failed..."
d25 1
a25 1
                echo "=> Added user \"$USER\"."
d27 1
a27 1
                echo "=> Adding user \"$USER\" failed..."
a30 10
fi

if [ "$2" = "POST-INSTALL" ]; then
        chown -R clamav:clamav ${PKG_PREFIX}/share/clamav
fi

if [ "$2" != "POST-INSTALL" ] && [ "$2" != "PRE-INSTALL" ]; then
	exit 0
fi

@


1.2
log
@Enable pthread support using devel/pth.
Turn on building clamd and clamdscan.

PR:		53056
Pointed out by:	Olivier Tharan <olive@@oban.frmug.org>
Submitted by:	TERAMOTO Masahiro <markun@@onohara.to>
@
text
@d3 1
a3 3
if [ "$2" != "PRE-INSTALL" ]; then
    exit 0
fi
d5 2
a6 2
USER?=clamav
GROUP?=clamav
d28 10
@


1.1
log
@new port: security/clamav

	Clam Antivirus is command line virus scanner using database
	from OpenAntiVirus.

PR:		ports/40602
Submitted by:	TERAMOTO Masahiro <markun@@onohara.to>
@
text
@d7 2
a8 2
USER=clamav
GROUP=clamav
@

