Sophos Wrapper a suggestion
Anthony Peacock
a.peacock at CHIME.UCL.AC.UK
Thu Nov 10 09:55:47 GMT 2005
Hi,
Following on from the discussion yesterday about the SAV_IDE
directory setting for the sophos-wrapper script, I have been giving
this some more thought, and have a proposed modification.
Summary of the problem
The sophos-wrapper script is designed to work hand in hand with the
sophos-autoupdate script supplied with MailScanner. Which makes a
lot of sense seeing as up until recently Sophos did not come with a
default way of keeping it up to date automatically. This mechanism
uses a non-Sophos directory for storing the virus identity files.
This setup means that on systems that have Sophos installed into its
standard locations the sophos-wrapper script does not work without
either modifying the script, moving Sophos, or creating a link in the
file system. In my case I had Sophos installed in its default
location and had already created a script to update its identities.
I had to do some furkling around under the bonnet to work out why the
wrapper wasn't working and then put in place a workaround. Now that
Sophos is able to auto-update itself (even the Unix versions) it is
likely that more people may already have it installed in the default
locations.
Yesterday there was a suggestion of creating a new wrapper for
standard Sophos installs. But this is only a case of setting one
directory or another. I have attached a modified version of sophos-
wrapper that sets the SAV_IDE environment variable depending on the
existence or otherwise of the ide/sav directories. Hopefully this
will work for both cases without anyone else having to check under
the bonnet.
The change is basically:
SAV_IDE=$PackageDir/ide
# Check to see if Sophos is using the Sophos install directory,
# rather than the MailScanner Sophos
# update directory
if [ ! -x ${PackageDir}/ide ] && [ -x ${PackageDir}/sav ]; then
SAV_IDE=$PackageDir/sav
fi
So the wrapper defaults to the current situation, and if the ide
directory does now exist and the sav directory does, it uses that one
instead.
Any comments?
Can this be included in the MailScanner distribution?
--
Anthony Peacock
CHIME, Royal Free & University College Medical School
WWW: http://www.chime.ucl.ac.uk/~rmhiajp/
I'm in shape. - ROUND is a shape.
------------------------ MailScanner list ------------------------
To unsubscribe, email jiscmail at jiscmail.ac.uk with the words:
'leave mailscanner' in the body of the email.
Before posting, read the Wiki (http://wiki.mailscanner.info/) and
the archives (http://www.jiscmail.ac.uk/lists/mailscanner.html).
Support MailScanner development - buy the book off the website!
[ Part 2: "Text from file 'sophos-wrapper'" ]
#!/bin/sh
# MailScanner - SMTP E-Mail Virus Scanner
# Copyright (C) 2001 Julian Field
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# The author, Julian Field, can be contacted by email at
# Jules at JulianField.net
# or by paper mail at
# Julian Field
# Dept of Electronics & Computer Science
# University of Southampton
# Southampton
# SO17 1BJ
# United Kingdom
#
# JKF Wrapper Sophos programs with the correct LD_LIBRARY_PATH
# Modified for solaris by CJG
# Then tweaked for heron by JKF again
# Modified to check for the existence of the Sophos standard install directory, if the MailScanner ide dir
# does not exist. AJP 10 Nov 2005
PackageDir=$1
shift
prog=sweep # `basename $0`
SAV_IDE=$PackageDir/ide
# Check to see if Sophos is using the Sophos install directory, rather than the MailScanner Sophos
# update directory
if [ ! -x ${PackageDir}/ide ] && [ -x ${PackageDir}/sav ]; then
SAV_IDE=$PackageDir/sav
fi
LD_LIBRARY_PATH=$PackageDir/lib
LANG=C
export SAV_IDE
export LD_LIBRARY_PATH
export LANG
if [ "x$1" = "x-IsItInstalled" ]; then
[ -x ${PackageDir}/bin/$prog ] && exit 0
exit 1
fi
exec ${PackageDir}/bin/$prog "$@"
------------------------ MailScanner list ------------------------
To unsubscribe, email jiscmail at jiscmail.ac.uk with the words:
'leave mailscanner' in the body of the email.
Before posting, read the Wiki (http://wiki.mailscanner.info/) and
the archives (http://www.jiscmail.ac.uk/lists/mailscanner.html).
Support MailScanner development - buy the book off the website!
More information about the MailScanner
mailing list