[Mimedefang] Problem in mimedefang.pl 2.34

Tony L. Cratz tcratz at exchange.jcis.net
Fri Jun 27 13:13:00 EDT 2003


Hello,

	I tried to installed Mimedefang 2.34 last night on my Solaris 8
	X86 box. The build went file but when I try to start it I was
	Given some errors in mimedefang.pl and that 'sock' might be a
	Reserve word. When I looked at mimedefang.pl at the line number
	In the syslog, I found:

		sock->close;

	Looking at the code in other places I saw that it really should
	have been:

		$sock->close;


	Below is a diff -c of what I changed. Once I made the changes
	everything worked fine.


								Tony



----------------------------------------------------------------------

*** mimedefang.pl.old   Thu Jun 26 18:44:28 2003
--- mimedefang.pl       Thu Jun 26 18:45:37 2003
***************
*** 2255,2261 ****
      # Cool; send our stuff!
      if ($local) {
        if (!$sock->print("Version 2\nAVSCANLOCAL\n$fname\n")) {
!           sock->close;
            return (999, 'swerr', 'tempfail');
        }
      } else {
--- 2255,2261 ----
      # Cool; send our stuff!
      if ($local) {
        if (!$sock->print("Version 2\nAVSCANLOCAL\n$fname\n")) {
!           $sock->close;
            return (999, 'swerr', 'tempfail');
        }
      } else {
***************
*** 2269,2275 ****
            return(999, 'swerr', 'tempfail');
        }
        if (!$sock->print("Version 2\nAVSCAN\n$fname\n$size\n")) {
!           sock->close;
            return (999, 'swerr', 'tempfail');
        }
        unless(open(IN, "<$fname")) {
--- 2269,2275 ----
            return(999, 'swerr', 'tempfail');
        }
        if (!$sock->print("Version 2\nAVSCAN\n$fname\n$size\n")) {
!           $sock->close;
            return (999, 'swerr', 'tempfail');
        }
        unless(open(IN, "<$fname")) {
***************
*** 2291,2297 ****
            }
            last if ($nread == 0);
            if (!$sock->print($chunk)) {
!               sock->close;
                return (999, 'swerr', 'tempfail');
            }
            $size -= $nread;
--- 2291,2297 ----
            }
            last if ($nread == 0);
            if (!$sock->print($chunk)) {
!               $sock->close;
                return (999, 'swerr', 'tempfail');
            }
            $size -= $nread;
***************
*** 2303,2309 ****
        }
      }
      if (!$sock->flush) {
!       sock->close;
        return (999, 'swerr', 'tempfail');
      }
  
--- 2303,2309 ----
        }
      }
      if (!$sock->flush) {
!       $sock->close;
        return (999, 'swerr', 'tempfail');
      }
  
***************
*** 2445,2455 ****
        # are the same as for the command line F-Prot, the additional
        # -remote-dtd suppresses the unuseful XML DTD prefix
        if (!$sock->print("GET
$item?-dumb%20-archive%20-packed%20-remote-dtd HTTP/1.0\n\n")) {
!           sock->close;
            return (wantarray ? (999, 'swerr', 'tempfail') : 999);
        }
        if (!$sock->flush) {
!           sock->close;
            return (wantarray ? (999, 'swerr', 'tempfail') : 999);
        }
  
--- 2445,2455 ----
        # are the same as for the command line F-Prot, the additional
        # -remote-dtd suppresses the unuseful XML DTD prefix
        if (!$sock->print("GET
$item?-dumb%20-archive%20-packed%20-remote-dtd HTTP/1.0\n\n")) {
!           $sock->close;
            return (wantarray ? (999, 'swerr', 'tempfail') : 999);
        }
        if (!$sock->flush) {
!           $sock->close;
            return (wantarray ? (999, 'swerr', 'tempfail') : 999);
        }
  
***************
*** 2652,2662 ****
            $path = $CWD . "/" . $path;
        }
        if (!$sock->print("SCAN $path\n")) {
!           sock->close;
            return (wantarray ? (999, 'swerr', 'tempfail') : 1);
        }
        if (!$sock->flush) {
!           sock->close;
            return (wantarray ? (999, 'swerr', 'tempfail') : 1);
        }
        my($output);
--- 2652,2662 ----
            $path = $CWD . "/" . $path;
        }
        if (!$sock->print("SCAN $path\n")) {
!           $sock->close;
            return (wantarray ? (999, 'swerr', 'tempfail') : 1);
        }
        if (!$sock->flush) {
!           $sock->close;
            return (wantarray ? (999, 'swerr', 'tempfail') : 1);
        }
        my($output);
***************
*** 2692,2702 ****
      my $sock = IO::Socket::INET->new($host);
      if (defined $sock) {
        if (!$sock->print("SCAN $CWD/Work\n")) {
!           sock->close;
            return (wantarray ? (999, 'swerr', 'tempfail') : 1);
        }
        if (!$sock->flush) {
!           sock->close;
            return (wantarray ? (999, 'swerr', 'tempfail') : 1);
        }
        my($output);
--- 2692,2702 ----
      my $sock = IO::Socket::INET->new($host);
      if (defined $sock) {
        if (!$sock->print("SCAN $CWD/Work\n")) {
!           $sock->close;
            return (wantarray ? (999, 'swerr', 'tempfail') : 1);
        }
        if (!$sock->flush) {
!           $sock->close;
            return (wantarray ? (999, 'swerr', 'tempfail') : 1);
        }
        my($output);
***************
*** 3463,3478 ****
            $path = $CWD . "/" . $path;
        }
        if (!$sock->print("$path\n")) {
!           sock->close;
            return (wantarray ? (999, 'swerr', 'tempfail') : 1);
        }
        if (!$sock->flush) {
!           sock->close;
            return (wantarray ? (999, 'swerr', 'tempfail') : 1);
        }
        my($output);
        if (!$sock->sysread($output,256)) {
!           sock->close;
            return (wantarray ? (999, 'swerr', 'tempfail') : 1);
        }
        if (!$sock->close) {
--- 3463,3478 ----
            $path = $CWD . "/" . $path;
        }
        if (!$sock->print("$path\n")) {
!           $sock->close;
            return (wantarray ? (999, 'swerr', 'tempfail') : 1);
        }
        if (!$sock->flush) {
!           $sock->close;
            return (wantarray ? (999, 'swerr', 'tempfail') : 1);
        }
        my($output);
        if (!$sock->sysread($output,256)) {
!           $sock->close;
            return (wantarray ? (999, 'swerr', 'tempfail') : 1);
        }
        if (!$sock->close) {
***************
*** 3520,3536 ****
      my $sock = IO::Socket::UNIX->new(Peer => $sophie_sock);
      if (defined $sock) {
        if (!$sock->print("$CWD/Work\n")) {
!           sock->close;
            return (wantarray ? (999, 'swerr', 'tempfail') : 1);
        }
        if (!$sock->flush) {
!           sock->close;
            return (wantarray ? (999, 'swerr', 'tempfail') : 1);
        }
        my($output, $ans);
        $ans = $sock->sysread($output, 256);
        if (!defined($ans)) {
!           sock->close;
            return (wantarray ? (999, 'swerr', 'tempfail') : 1);
        }
        if (!$sock->close) {
--- 3520,3536 ----
      my $sock = IO::Socket::UNIX->new(Peer => $sophie_sock);
      if (defined $sock) {
        if (!$sock->print("$CWD/Work\n")) {
!           $sock->close;
            return (wantarray ? (999, 'swerr', 'tempfail') : 1);
        }
        if (!$sock->flush) {
!           $sock->close;
            return (wantarray ? (999, 'swerr', 'tempfail') : 1);
        }
        my($output, $ans);
        $ans = $sock->sysread($output, 256);
        if (!defined($ans)) {
!           $sock->close;
            return (wantarray ? (999, 'swerr', 'tempfail') : 1);
        }
        if (!$sock->close) {
***************
*** 3591,3601 ****
            $path = $CWD . "/" . $path;
        }
        if (!$sock->print("SCAN $path\n")) {
!           sock->close;
            return (wantarray ? (999, 'swerr', 'tempfail') : 1);
        }
        if (!$sock->flush) {
!           sock->close;
            return (wantarray ? (999, 'swerr', 'tempfail') : 1);
        }
        my($output, $ans);
--- 3591,3601 ----
            $path = $CWD . "/" . $path;
        }
        if (!$sock->print("SCAN $path\n")) {
!           $sock->close;
            return (wantarray ? (999, 'swerr', 'tempfail') : 1);
        }
        if (!$sock->flush) {
!           $sock->close;
            return (wantarray ? (999, 'swerr', 'tempfail') : 1);
        }
        my($output, $ans);
***************
*** 3654,3664 ****
      $sock = IO::Socket::UNIX->new(Peer => $clamd_sock);
      if (defined $sock) {
        if (!$sock->print("SCAN $CWD/Work\n")) {
!           sock->close;
            return (wantarray ? (999, 'swerr', 'tempfail') : 999);
        }
        if (!$sock->flush) {
!           sock->close;
            return (wantarray ? (999, 'swerr', 'tempfail') : 999);
        }
        my $ans;
--- 3654,3664 ----
      $sock = IO::Socket::UNIX->new(Peer => $clamd_sock);
      if (defined $sock) {
        if (!$sock->print("SCAN $CWD/Work\n")) {
!           $sock->close;
            return (wantarray ? (999, 'swerr', 'tempfail') : 999);
        }
        if (!$sock->flush) {
!           $sock->close;
            return (wantarray ? (999, 'swerr', 'tempfail') : 999);
        }
        my $ans;
***************
*** 3712,3722 ****
            $path = $CWD . "/" . $path;
        }
        if (!$sock->print("$path\n")) {
!           sock->close;
            return (wantarray ? (999, 'swerr', 'tempfail') : 999);
        }
        if (!$sock->flush) {
!           sock->close;
            return (wantarray ? (999, 'swerr', 'tempfail') : 999);
        }
        my($output);
--- 3712,3722 ----
            $path = $CWD . "/" . $path;
        }
        if (!$sock->print("$path\n")) {
!           $sock->close;
            return (wantarray ? (999, 'swerr', 'tempfail') : 999);
        }
        if (!$sock->flush) {
!           $sock->close;
            return (wantarray ? (999, 'swerr', 'tempfail') : 999);
        }
        my($output);
***************
*** 3751,3761 ****
      my $sock = IO::Socket::UNIX->new(Peer => $trophie_sock);
      if (defined $sock) {
        if (!$sock->print("$CWD/Work\n")) {
!           sock->close;
            return (wantarray ? (999, 'swerr', 'tempfail') : 999);
        }
        if (!$sock->flush) {
!           sock->close;
            return (wantarray ? (999, 'swerr', 'tempfail') : 999);
        }
        my($output);
--- 3751,3761 ----
      my $sock = IO::Socket::UNIX->new(Peer => $trophie_sock);
      if (defined $sock) {
        if (!$sock->print("$CWD/Work\n")) {
!           $sock->close;
            return (wantarray ? (999, 'swerr', 'tempfail') : 999);
        }
        if (!$sock->flush) {
!           $sock->close;
            return (wantarray ? (999, 'swerr', 'tempfail') : 999);
        }
        my($output);




More information about the MIMEDefang mailing list