aboutsummaryrefslogtreecommitdiff
path: root/security/drweb
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>2001-10-19 10:55:38 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>2001-10-19 10:55:38 +0000
commit3279aeae0f3de1c23ab53f90b53ae64d912cb401 (patch)
treee060ed87acf5c07dc29c2c6a78e01dc6d555bf3b /security/drweb
parent61b690d4e1f015e34d4fb7b572618b750fb3b6aa (diff)
downloadports-3279aeae0f3de1c23ab53f90b53ae64d912cb401.tar.gz
ports-3279aeae0f3de1c23ab53f90b53ae64d912cb401.zip
Notes
Diffstat (limited to 'security/drweb')
-rw-r--r--security/drweb/Makefile7
-rw-r--r--security/drweb/pkg-deinstall22
-rw-r--r--security/drweb/pkg-install (renamed from security/drweb/scripts/post-install)27
3 files changed, 44 insertions, 12 deletions
diff --git a/security/drweb/Makefile b/security/drweb/Makefile
index 104fd55e2109..f5b3dc96fc48 100644
--- a/security/drweb/Makefile
+++ b/security/drweb/Makefile
@@ -7,7 +7,7 @@
PORTNAME= drweb
PORTVERSION= 4.26
-PORTREVISION= 5
+PORTREVISION= 6
CATEGORIES= security
MASTER_SITES= http://www.drweb.ru/ftp/web_pub/
DISTNAME= ${PORTNAME}d-${PORTVERSION}-freebsd4
@@ -20,8 +20,6 @@ NO_BUILD= YES
# Needed for update.pl
RUN_DEPENDS= ${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/${PERL_ARCH}/String/CRC32.pm:${PORTSDIR}/devel/p5-String-CRC32
-SCRIPTS_ENV+= BINOWN=${BINOWN} BINGRP=${BINGRP}
-
DRWEB_PREFIX= ${PREFIX}/${PORTNAME}
do-install:
@@ -57,4 +55,7 @@ do-install:
cd ${DRWEB_PREFIX}/update; \
${PATCH} -s < ${FILESDIR}/update-patch && ${RM} update.pl.orig
+post-install:
+ PKG_PREFIX=${PREFIX} ./pkg-install ${PKGNAME} POST-INSTALL
+
.include <bsd.port.mk>
diff --git a/security/drweb/pkg-deinstall b/security/drweb/pkg-deinstall
new file mode 100644
index 000000000000..fe71e9e62b5e
--- /dev/null
+++ b/security/drweb/pkg-deinstall
@@ -0,0 +1,22 @@
+#!/bin/sh
+# $FreeBSD$
+#
+
+if [ "$2" != "POST-DEINSTALL" ]; then
+ exit 0
+fi
+
+USER=drweb
+ex=0
+
+if pw usershow "${USER}" 2>/dev/null 1>&2; then
+ if pw userdel ${USER}; then
+ echo "Delete user/group \"${USER}\"."
+ else
+ echo "Deleting user/group \"${USER}\" failed..."
+ ex=1
+ fi
+fi
+
+[ "$ex" = "1" ] && exit 1
+exit 0
diff --git a/security/drweb/scripts/post-install b/security/drweb/pkg-install
index eef1258c189b..a9788a54cf32 100644
--- a/security/drweb/scripts/post-install
+++ b/security/drweb/pkg-install
@@ -1,11 +1,20 @@
#!/bin/sh
-ex=0
+# $FreeBSD$
+#
+
+if [ "$2" != "POST-INSTALL" ]; then
+ exit 0
+fi
+
USER=drweb
GROUP=${USER}
UID=426
GID=${UID}
+BINOWN=root
+BINGRP=wheel
+ex=0
-if ! pw group show "${GROUP}" 2>/dev/null 1>&2; then
+if ! pw groupshow "${GROUP}" 2>/dev/null 1>&2; then
if pw groupadd ${GROUP} -g ${GID}; then
echo "Added group \"${GROUP}\"."
else
@@ -14,7 +23,7 @@ if ! pw group show "${GROUP}" 2>/dev/null 1>&2; then
fi
fi
-if ! pw user show "${USER}" 2>/dev/null 1>&2; then
+if ! pw usershow "${USER}" 2>/dev/null 1>&2; then
if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \
-s "/sbin/nologin" -d "/nonexistent" -c "Dr. Web Scanner"
then
@@ -25,19 +34,19 @@ if ! pw user show "${USER}" 2>/dev/null 1>&2; then
fi
fi
-if ! grep -q "^!drweb" /etc/syslog.conf; then
+if ! grep -q "^!${USER}" /etc/syslog.conf; then
echo "You may also add this lines to your /etc/syslog.conf:"
echo "*.* /var/log/drwebd.log"
echo ""
fi
-if ! grep -q drweb /etc/crontab; then
- if ! crontab -l -u root | grep -q drweb; then
+if ! grep -q ${USER} /etc/crontab; then
+ if ! crontab -l -u ${BINOWN} | grep -q ${USER}; then
echo "You may also add this crontab entry to /etc/crontab"
- echo "0 12 * * * ${BINOWN} ${PREFIX}/drweb/update/update.pl ${PREFIX}/drweb"
+ echo "0 12 * * * ${BINOWN} ${PKG_PREFIX}/drweb/update/update.pl ${PKG_PREFIX}/drweb"
echo ""
fi
fi
[ "$ex" = "1" ] && exit 1
-install -dv -m 0755 -o drweb -g ${BINGRP} ${PREFIX}/drweb/run
-install -dv -m 0700 -o drweb -g ${BINGRP} ${PREFIX}/drweb/infected.!!!
+install -dv -m 0755 -o ${USER} -g ${BINGRP} ${PKG_PREFIX}/drweb/run
+install -dv -m 0700 -o ${USER} -g ${BINGRP} ${PKG_PREFIX}/drweb/infected.!!!
exit 0