On Wed, Nov 30, 2005 at 12:55:43PM +0100, matteo brancaleoni wrote:

> Hi,
> I think I've found out the bug
> 
> On 11/30/05, matteo brancaleoni <[EMAIL PROTECTED]> wrote:
> > with latest amavisd-new (amavisd-new-2.3.3) seems that if the ldap
> > connection to the server drops (ie after being idle for sometime)
> > amavisd is not able to reconnect, or to explain it better, it
> > reconnects for for some reasons the query fails.
> > The only way to solve that is to restart amavisd.
> 
> Seems that here's a typo into
> do_search (which leads to be always in error, even if the
> recconection is ok) and a missing return if the retry result
> is available.

You're right, here's the patch as submitted, its slightly different
as the 'else' clause isn't needed:

+++ amavisd     2005-11-30 07:28:32.000000000 -0800
@@ -10603,11 +10603,12 @@
                                         );
         if ($result->code) { die $result->error_name, "\n"; }
       };
-      if (@_ ne '') {
+      if ($@ ne '') {
         my($err) = $@; chomp $err;
         $self->disconnect_from_ldap;
         die "do_search: failed again, $err";
       }
+      return $result;
     }
     die "do_search: $err";
   }

A copy of the patch is also attached.

<snip>

--
Your lucky number is 3552664958674928. Watch for it everywhere.

Mike Hall,
System Admin - Rock Island Communications           <[EMAIL PROTECTED]>
System Admin - riverside.org, ssdd.org              <[EMAIL PROTECTED]>
--- amavisd.orig        2005-11-30 07:26:25.000000000 -0800
+++ amavisd     2005-11-30 07:28:32.000000000 -0800
@@ -10603,11 +10603,12 @@
                                         );
         if ($result->code) { die $result->error_name, "\n"; }
       };
-      if (@_ ne '') {
+      if ($@ ne '') {
         my($err) = $@; chomp $err;
         $self->disconnect_from_ldap;
         die "do_search: failed again, $err";
       }
+      return $result;
     }
     die "do_search: $err";
   }

Reply via email to