On Tue, Apr 30, 2002 at 01:42:26AM +0100, Sean Rima wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On Tue, 30 Apr 2002, Sean Rima said:
> 
> 
> >>> SR> Use of uninitialized value at
> >>> SR> /usr/lib/perl5/site_perl/5.005/Mail/SpamAssassin/Dns.pm line
> >>> SR> 270. DCC check skipped: Undefined subroutine
> >>> SR> &Mail::SpamAssassin::PerMsgStatus::open2 called at
> >>> SR> /usr/lib/perl5/site_perl/5.005/Mail/SpamAssassin/Dns.pm line
> >>> SR> 270.
> >>> 
> >>> Weird again.  Given that we've just required IPC::Open2 a few lines
> >>> above, I don't see how it can now be failing to find open2() -- I
> >>> suppose it might need to be IPC::Open2::open2() or something.
> >>> Again, I'll see what I can do after installing DCC.
> >> 
> >> I changed line 270 to:
> >> $pid = IPC::Open2::open2(....) and the result was:
> >> Use of uninitialized value at
> >> /usr/lib/perl5/site_perl/5.005/Mail/SpamAssassin/Dns.pm line 270.
> >> DCC check skipped:  open2: wtr should not be null at
> >> /usr/lib/perl5/site_perl/5.005/Mail/SpamAssassin/Dns.pm line 270
> >> 
> > 
> > Okay I did:
> >     use IPC::Open2;
> >  instead of require IPC::Open2; and changed line 270 back to what you
> >     had it, that gets rid of the Use of uninitialized value line but
> >     not the wtr error
> 
> I did this:
>     $pid = open2(\*Dccout, \*Dccin, '......

Hrm.  Typeglobs have always scared me for somereason.  Then again, so has
open2.  It's always seemed so kludgy.

Here's my fix from the latest CVS code which fixes both the warnings.

$  cvs -d:pserver:[EMAIL PROTECTED]:/cvsroot/spamassassin 
diff -u spamassassin/lib/Mail/SpamAssassin/Dns.pm
Index: spamassassin/lib/Mail/SpamAssassin/Dns.pm
===================================================================
RCS file: /cvsroot/spamassassin/spamassassin/lib/Mail/SpamAssassin/Dns.pm,v
retrieving revision 1.34
diff -u -r1.34 Dns.pm
--- spamassassin/lib/Mail/SpamAssassin/Dns.pm   29 Apr 2002 22:56:22 -0000      1.34
+++ spamassassin/lib/Mail/SpamAssassin/Dns.pm   30 Apr 2002 06:42:21 -0000
@@ -247,7 +247,7 @@
 sub dcc_lookup {
   my ($self, $fulltext) = @_;
   my $response = undef;
-  my %count = { };
+  my %count;
 
   $count{body} = 0;
   $count{fuz1} = 0;
@@ -259,8 +259,13 @@
   }
 
   eval {
-    require IPC::Open2;
+    use IPC::Open2;
+    use Symbol;
+
     my ($dccin, $dccout, $pid);
+
+    $dccin = gensym();
+    $dccout = gensym();
 
     local $SIG{ALRM} = sub { die "alarm\n" };
     local $SIG{PIPE} = sub { die "brokenpipe\n" };





-- 
Kelsey Cummings - [EMAIL PROTECTED]         sonic.net
System Administrator                    300 B Street, Ste 101
707.522.1000 (Voice)                    Santa Rosa, CA 95404
707.547.2199 (Fax)                      http://www.sonic.net/
Fingerprint = 7F 59 43 1B 44 8A 0D 57  91 08 73 73 7A 48 90 C5

_______________________________________________
Spamassassin-talk mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/spamassassin-talk

Reply via email to