head	1.6;
access;
symbols
	RELEASE_6_1_0:1.5
	RELEASE_5_5_0:1.5
	RELEASE_6_0_0:1.5
	RELEASE_5_4_0:1.5
	RELEASE_4_11_0:1.5
	RELEASE_5_3_0:1.3
	RELEASE_4_10_0:1.3
	RELEASE_5_2_1:1.1
	RELEASE_5_2_0:1.1;
locks; strict;
comment	@# @;


1.6
date	2006.09.02.21.52.20;	author kris;	state dead;
branches;
next	1.5;

1.5
date	2004.12.11.21.28.36;	author marius;	state Exp;
branches;
next	1.4;

1.4
date	2004.10.20.18.22.23;	author marius;	state Exp;
branches;
next	1.3;

1.3
date	2004.03.08.08.03.50;	author netchild;	state Exp;
branches;
next	1.2;

1.2
date	2003.12.10.17.57.57;	author netchild;	state Exp;
branches;
next	1.1;

1.1
date	2003.10.14.16.04.48;	author netchild;	state Exp;
branches;
next	;


desc
@@


1.6
log
@Remove expired ports.
@
text
@--- script/avq.orig	Sat Oct 11 13:26:02 2003
+++ script/avq	Sat Oct 11 13:31:54 2003
@@@@ -39,7 +39,7 @@@@
 #   59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 #******************************************************************************
 
-configuration=/etc/avmilter.conf
+configuration=%%PREFIX%%/etc/avmilter/avmilter.conf
 
 for arg ;
 do
@@@@ -68,6 +68,15 @@@@
 systeme="`uname`"
 date_param="-d"
 
+# Make sure the user running this program is root or the avmilter user.
+procowner=${procowner:-`/usr/bin/id -u`}
+user="`egrep -i '^user' $configuration | awk '{print $2;}'`"
+uid="`/usr/bin/id -u "$user"`"
+if [ "$procowner" != "0" -a "$procowner" != "$uid" ]; then
+	echo "${pname}: you must be root (uid 0) or the avmilter user to run this utility."
+	exit 2
+fi
+
 usage() {
     echo "${pname} usage:"
     echo "    ${pname} [--conf=.conf] "
@@@@ -149,7 +158,7 @@@@
         data=`/bin/ls "${queue}"/*/[Dd]f-"${id}"`
        echo "ctor: ${ctrl} ${data}" 
         if [ ! -f "${data}" ] ; then
-            echo "${pname}: there is no data  file id '${id}'"\
+            echo "${pname}: there is no data file id '${id}'"\
                  "in queue '$queue'."
             exit 3            
         fi
@@@@ -161,9 +170,13 @@@@
         bnam="`basename ${ctrl}`"
         case $newstate in
         R)
-            ( /bin/rm "${ctrl}" && /bin/rm "${data}" ) \
-            && echo "${pname}: message id '${id}' removed." \
-            || echo "${pname}: could not remove message id '${id}'."
+            if ( /bin/rm "${ctrl}" && /bin/rm "${data}" ) > /dev/null 2>&1 ; then
+                    echo "${pname}: message id '${id}' removed."
+                    exit 0
+                else
+                    echo "${pname}: could not remove message id '${id}'."
+                    exit 3
+                fi
             ;;
         *)
             Qtrl="`echo $bnam|sed -e 's/^.\(.*\)$/'${newstate}'\1/'`"
@@@@ -204,7 +217,7 @@@@
             group=`egrep -i '^group' "$configuration"|awk '{print $2;}'`
             if [ -f "${data}" ] ; then
                 if /bin/ls "${queue}"/*/??-"${id}" > /dev/null 2>&1 ; then
-                    echo "${pname}: there is already files with id '${id}'"
+                    echo "${pname}: there are already files with id '${id}'"
                     echo "${pblan}  in queue '${queue}'."
                     exit 3
                 else
@


1.5
log
@Update to 1.1.0-3 which amongst several fixes and some minor new features
brings native binaries for FreeBSD/i386 5-STABLE. For a complete list of
changes since 1.1 please see the installed ChangeLog.

Approved by:	netchild
@
text
@@


1.4
log
@- Update to 1.1 (final). For changes since 1.1-beta see the ChangeLog
  in the DOCSDIR.
- Rename the start script from antivir-milter.sh to avmilter.sh to be
  consistent with naming of the rest of the installed AntiVir Milter
  files and directories.
- Now that AntiVir Milter supports using a different location from
  /etc for the ignore, scan and warn config files no longer install
  them in the EXAMPLESDIR but in PREFIX/etc/avmilter (i.e. install
  as sample files, copy over when not already existent, etc.).
- Change the location of the AntiVir Milter config file (avmilter.conf)
  but not that of the scan engine (antivir.conf; shared between different
  AntiVir products) from PREFIX/etc to PREFIX/etc/avmilter in order to
  have all AntiVir Milter config files in one place but don't directly
  populate PREFIX/etc with them.

If you had previously changed PREFIX/etc/avmilter.conf you have to
bring over your changes to PREFIX/etc/avmilter/avmilter.conf but note
that some variables have been renamed. If you used ignore, scan and/or
warn files in /etc you can now move them to PREFIX/etc/avmilter.

Approved by:	netchild
@
text
@d3 1
a3 1
@@@@ -38,7 +38,7 @@@@
d9 4
a12 4
 queue="`egrep -i '^[Ss][Pp][Oo][Oo][Ll][Dd][Ii][Rr]' ${configuration} | awk '{print $2;}'`"
 queue_set=0
 pname="`basename $0`"
@@@@ -49,6 +49,15 @@@@
d27 2
a28 2
     echo "    ${pname} [--queue=DIR] "
@@@@ -124,7 +133,7 @@@@
d37 1
a37 1
@@@@ -136,9 +145,13 @@@@
d54 1
a54 1
@@@@ -179,7 +192,7 @@@@
@


1.3
log
@- Use daemon(8) for launching avmilter in order to detach it from the
  controlling terminal. [1]
- Make the avq script check if it's ran by the avmilter user in addition
  to uid == 0. This enables `avq --remove` to be run via a script and the
  ExternalProgram option in order to automatically delete the rejected
  messages. [2]
- Install a script avqrm which serves this purpose, i.e. executes
  `avq --remove` and can be run via ExternalProgram.
- Make the avq script not print the contents of the queue when option
  '--remove' is given, this greatly improves speed and otherwise it's not
  really suitable to be called on every rejected message. Fix some typos.
- Fix pkg-plist by adding antivirupdater.

Requested by:	ache [1], [2]
Submitted by:	maintainer
@
text
@d8 1
a8 1
+configuration=%%PREFIX%%/etc/avmilter.conf
@


1.2
log
@- H+BEDV GmbH released a new tarball shipping an updated anti-virus engine
  (6.22.0.1 -> 6.23.0.1), a current virus definition file (6.23.0.1) and
  and updated antivir.conf adding new options for the new features in the
  current AV engine.
  If you are using the auto-update facility you should already have the
  updated AV engine and VDF. The new options available in antivir.conf are
  only relevant if you are using the update daemon mechanism (i.e. you are
  using `antivir --update-daemon` instead of running antivirupdater via
  cron(8)) or you own a true commercial license (i.e. no private license)
  and want to catch "unwanted files" e.g. dialers in addition to worms and
  viruses.
- Be consistent in how PREFIX gets inserted in the avq script compared to
  the other patched files. The old way previously saved a patch which is
  no longer true. No change in the installed script.

Submitted by:	Marius Strobl <marius@@alchemy.franken.de>
@
text
@d12 1
a12 2
@@@@ -48,6 +48,13 @@@@
 data=
d15 2
a16 2
+
+# Make sure the user running this program is root.
d18 4
a21 2
+if [ "$procowner" != "0" ]; then
+	echo "${pname}: you must be the super-user (uid 0) to use this utility."
d24 1
a24 1
 
d27 36
@


1.1
log
@- H+BEDV GmbH released a new tarball shipping an updated anti-virus engine
  (6.21.0.1 -> 6.22.0.1) and a current virus definition file (6.22.0.0).
  If you are using the auto-update functionality you should already have
  these updated versions.
- Mention the AntiVir Bulletin Board (support) in the DESCR.
- Make the antivirupdater script behave like described in the documentation
  (pass command line arguments to antivir).
- Make the avq script check for uid == 0, the avmilter spool directory can't
  be read without sufficient permissions.

Submitted by:	maintainer
@
text
@d3 11
a13 1
@@@@ -49,6 +49,13 @@@@
d16 1
a16 1
 
d23 1
a23 1
+
a25 1
     echo "    ${pname} [--queue=DIR] "
@

