Re: [Exim] exim 4.32: possible bug: rewrite broken

Pàgina inicial
Delete this message
Reply to this message
Autor: Philip Hazel
Data:  
A: Ronny Vaningh
CC: exim-users
Assumptes nous: [Exim] Race condition in MBX locking
Assumpte: Re: [Exim] exim 4.32: possible bug: rewrite broken
On Thu, 22 Apr 2004, Ronny Vaningh wrote:

> I have a difference in behavior between 4.30 and 4.32 that breaks my
> rewrite setup.
> I have looked around and cannot find a solution but maybe it's just a
> bug ?


A rewrite-influenced bug was introduced in 4.31. The patch is below. The
ChangeLog entry reads:

 5. Change 4.31/55 was buggy, and broke when there was a rewriting rule that
    operated on the sender address. After changing the $sender_address to <>
    for the sender address verify, Exim was re-instated it as the original
    (before rewriting) address, but remembering that it had rewritten it, so it
    wasn't rewriting it again. This bug also had the effect of breaking the
    sender address verification caching when the sender address was rewritten.


I shall be bringing out 4.33 quite soon because of this bug.

--
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.
Get the Exim 4 book:    http://www.uit.co.uk/exim-book



*** exim-4.32/src/verify.c  Thu Apr 15 09:27:01 2004
--- verify.c    Wed Apr 21 16:28:18 2004
***************
*** 758,764 ****
  address_item *addr_succeed = NULL;
  uschar *ko_prefix, *cr;
  uschar *address = vaddr->address;
! uschar *save_sender = sender_address;
  uschar null_sender[] = { 0 };             /* Ensure writeable memory */


  /* Set up a prefix and suffix for error message which allow us to use the same
--- 758,764 ----
  address_item *addr_succeed = NULL;
  uschar *ko_prefix, *cr;
  uschar *address = vaddr->address;
! uschar *save_sender;
  uschar null_sender[] = { 0 };             /* Ensure writeable memory */


/* Set up a prefix and suffix for error message which allow us to use the same
***************
*** 816,825 ****

/* If the address was rewritten to <> no verification can be done, and we have
to return OK. This rewriting is permitted only for sender addresses; for other
! addresses, such rewriting faile. */

if (address[0] == 0) return OK;

/* Update the address structure with the possibly qualified and rewritten
address. Set it up as the starting address on the chain of new addresses. */

--- 816,830 ----

/* If the address was rewritten to <> no verification can be done, and we have
to return OK. This rewriting is permitted only for sender addresses; for other
! addresses, such rewriting fails. */

if (address[0] == 0) return OK;

+ /* Save a copy of the sender address for re-instating if we change it to <>
+ while verifying a sender address (a nice bit of self-reference there). */
+
+ save_sender = sender_address;
+
/* Update the address structure with the possibly qualified and rewritten
address. Set it up as the starting address on the chain of new addresses. */

***************
*** 898,904 ****
      if (!is_recipient) sender_address = null_sender;
      rc = route_address(addr, &addr_local, &addr_remote, &addr_new,
        &addr_succeed, verify_type);
!     sender_address = save_sender;
      }


    /* If routing an address succeeded, set the flag that remembers, for use when
--- 903,909 ----
      if (!is_recipient) sender_address = null_sender;
      rc = route_address(addr, &addr_local, &addr_remote, &addr_new,
        &addr_succeed, verify_type);
!     sender_address = save_sender;     /* Put back the real sender */
      }


    /* If routing an address succeeded, set the flag that remembers, for use when