1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-23 00:43:28 +00:00
freebsd-ports/security/clamav/pkg-install
Oliver Eikemeier 70ec1e0cb9 - update to 0.80rc4
+ JPEG comment exploit (MS04-028) detection

  *** IMPORTANT ***
  The configruration file for the clamd daemon has changed from
  /usr/local/etc/clamav.conf to /usr/local/etc/clamd.conf.

PR:		72203
Approved by:	Rob Evers <revers@infraqon.nl> (maintainer)
2004-10-14 09:30:47 +00:00

72 lines
1.6 KiB
Bash

#!/bin/sh
# $FreeBSD$
PREFIX=${PKG_PREFIX:-%%PREFIX%%}
DESTDIR=${PKG_DESTDIR:-}
CLAMAVUSER=%%CLAMAVUSER%%
CLAMAVGROUP=%%CLAMAVGROUP%%
UID=106
GID=$UID
CLAMRUN=$DESTDIR/var/run/clamav
CLAMLOG=$DESTDIR/var/log/clamav
DATADIR=$DESTDIR%%DATADIR%%
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 "$CLAMRUN" ]; then
mkdir -p "$CLAMRUN" || exit 1
chown "$CLAMAVUSER:$CLAMAVGROUP" "$CLAMRUN" || exit 1
fi
if [ ! -d "$CLAMLOG" ]; then
mkdir -p "$CLAMLOG" || exit 1
chown "$CLAMAVUSER:$CLAMAVGROUP" "$CLAMLOG" || exit 1
fi
if [ ! -d "$DATADIR" ]; then
mkdir -p "$DATADIR" || exit 1
chown "$CLAMAVUSER:$CLAMAVGROUP" "$DATADIR" || 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