freebsd-ports/security/antivir-milter/files/patch-script::avq
Marius Strobl 727bab0fbf 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
2004-12-11 21:28:36 +00:00

62 lines
2.3 KiB
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