useless use of private variable in void context at CustomConf ig.p m line 475...?

Furnish, Trever G TGFurnish at HERFF-JONES.COM
Mon Aug 11 22:13:38 IST 2003


Ah, thanks.  Fixed.

It is with real trepidation that I'll go ahead and offer up the attached
modified version of CustomConfig.pm with the changes I made to get it
writing to a flat log file instead of to a SQL server.  Trepidation because
I won't be all that surprised when someone points out something like
"There's already flat-file logging in the XYZ function at the top of that
file" or "That's dumb, why'd you do it that way."  It's also really just a
slightly modified version of the SQLLogging functions.

I re-used functions from the MailScanner modules without a deep
understanding of them - just made them look similar to how I saw them used
in other functions.  It seems to work, but if anyone looks at the code to
get a good laugh and spots a problem, I'd be most grateful to be informed.

There's no sorting of the log messages here so the log file will end up out
of order - I thought I'd just put re-sorting functionality into the
logrotate stanza used to rotate the log file.  Haven't done that bit yet.

-t.


> -----Original Message-----
> From: Julian Field [mailto:mailscanner at ECS.SOTON.AC.UK]
> Sent: Monday, August 11, 2003 3:40 PM
> To: MAILSCANNER at JISCMAIL.AC.UK
> Subject: Re: useless use of private variable in void context at
> CustomConfig.p m line 475...?
>
>
> Well spotted. It should be "||" and not "or".
>
> At 21:23 11/08/2003, you wrote:
> >If I do:
> >
> >perl -cw CustomConfig.pm
> >
> >...then I get:
> >private variable in void context at CustomConfig.pm2 line 475.
> >
> >The line numbers may have changed a little bit, but here's
> the tidbit of
> >code in question:
> >     # Use the sanitised filename to avoid problems caused
> by people forcing
> >     # logging of attachment filenames which contain nasty
> SQL instructions.
> >     $file = $message->{file2safefile}{$file} or $file;
> >
> >Looking at that though I'm not sure whether it's really a
> problem or not.
> >So... any MS+Perl guru care to say whether that is something
> that needs
> >fixing?  I just adapted the SQLLogging code to work with
> flat files instead
> >(not enough spare mem on the test system to run mysqld :-( )
> and inherited
> >this line in the process.
> >
> >--
> >Trever
>
> --
> Julian Field
> www.MailScanner.info
> Professional Support Services at www.MailScanner.biz
> MailScanner thanks transtec Computers for their support
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: CustomConfig.pm2
Type: application/octet-stream
Size: 25229 bytes
Desc: not available
Url : http://lists.mailscanner.info/pipermail/mailscanner/attachments/20030811/745d7ac1/CustomConfig-0001.obj


More information about the MailScanner mailing list