<<< Date Index >>>     <<< Thread Index >>>

Re: Recommended patches



On Tue, Dec 21, 2004 at 10:10:36PM +0900, TAKAHASHI Tamotsu wrote:
> On Tue, Dec 21, 2004 at 10:41:33AM +0100, Thomas Roessler wrote:
> > On 2004-12-21 18:19:49 +0900, TAKAHASHI Tamotsu wrote:
> > > ==============================================
> > >  1. Security patches
> > > ==============================================
> > >      1. "decrypt-save" loses messages (bug1919, deb275188 - patch by tamo)
> > 
> > I think the real bug is in pgp.c:832:

Hmm, Have you confirmed that it really fixed the bug?
While testing, I saw the same problem as ever.

You were looked at the line 607 of copy.c?
:   else if (WithCrypto
:            && (flags & M_CM_DECODE_CRYPT) && (hdr->security & ENCRYPT))
:   {
:     BODY *cur;
:     FILE *fp;
: 
:     if ((WithCrypto & APPLICATION_PGP)
:         && (flags & M_CM_DECODE_PGP) && (hdr->security & APPLICATION_PGP) &&
:       hdr->content->type == TYPEMULTIPART)
:     {
:       if (crypt_pgp_decrypt_mime (fpin, &fp, hdr->content, &cur))
:       return (-1);
:       fputs ("Mime-Version: 1.0\n", fpout);
:     }

But, decrypt-save goes into the line 573:
:   if (flags & M_CM_DECODE)
:   {
:     /* now make a text/plain version of the message */
:     memset (&s, 0, sizeof (STATE));
:     s.fpin = fpin;
:     s.fpout = fpout;
:     if (flags & M_CM_PREFIX)
:       s.prefix = prefix;
:     if (flags & M_CM_DISPLAY)
:       s.flags |= M_DISPLAY;
:     if (flags & M_CM_PRINTING)
:       s.flags |= M_PRINTING;
:     if (flags & M_CM_WEED)
:       s.flags |= M_WEED;
:     if (flags & M_CM_CHARCONV)
:       s.flags |= M_CHARCONV;
:     if (flags & M_CM_REPLYING)
:       s.flags |= M_REPLYING;
:     
:     if (WithCrypto && flags & M_CM_VERIFY)
:       s.flags |= M_VERIFY;
: 
:     mutt_body_handler (body, &s);
:   }

So, you have to make mutt_body_handler() be non-void
(or, make it return some error status in body or &s).
My patch was sent to debian's BTS. See it, please.

-- 
tamo