unexpunge segfaults with -l on some mailboxes

Bron Gondwana brong at fastmail.fm
Wed Mar 25 20:14:40 EDT 2009


On Wed, Mar 25, 2009 at 08:43:10PM -0300, Patrick Boutilier wrote:
> Bron Gondwana wrote:
> > On Mon, Mar 23, 2009 at 04:08:47PM -0700, David R Bosso wrote:
> >> I'd love to see a fix for this.
> > 
> > Here's one:
> > 
> >>From 8448c2f304bd61fe073b1d98a0d614b69b0ee184
> > Subject: [PATCH] Don't immediate expunge in ipurge
> > 
> > This has two benefits.
> > 
> > 1) you can unexpunge
> > 2) it won't corrupt the cache pointers in the expunge file
> > 
> > NOTE: this only applies if you have delayed expunge enabled
> > in your configuration, otherwise the behaviour is unchanged.
> > ---
> >  imap/ipurge.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> > 
> > diff --git a/imap/ipurge.c b/imap/ipurge.c
> > index a8c6228..1a76ede 100644
> > --- a/imap/ipurge.c
> > +++ b/imap/ipurge.c
> > @@ -268,7 +268,7 @@ int purge_me(char *name, int matchlen __attribute__((unused)),
> >    (void) mailbox_lock_index(&the_box);
> >    the_box.index_lock_count = 1;
> >  
> > -  mailbox_expunge(&the_box, purge_check, &stats, EXPUNGE_FORCE);
> > +  mailbox_expunge(&the_box, purge_check, &stats, 0);
> >  
> >    sync_log_mailbox(the_box.name);
> >    mailbox_close(&the_box);
> 
> Looks good. Passes my earlier test. And you are correct. You can 
> unexpunge messages that ipurge purges. Slick :-)

Committed to CVS.  Trivially correct :)  I still want to go fix up
mailbox_expunge.  It should NEVER be possible to pass a combination
of flags that causes mailbox corruption.... but that's a different
kettle of fish :)

Bron ( nntp will still break at the moment, but I don't know if any
       sites run nntp and delayed expunge.  Anyway, it's not forgotten
       yet... )


More information about the Info-cyrus mailing list