Changeset 3646:2b649fd03f1e

Show
Ignore:
Timestamp:
2004-04-12 13:33:33 (5 years ago)
Author:
Thomas Roessler <roessler@…>
Branch:
HEAD
Message:

A belated fix for #1808 (Debian #233106): Make sure
check-traditional-pgp doesn't leave the pager context unnecessarily.
This makes message-hooks like this one safe:

message-hook '!(~g|~G) ~b"-----BEGIN\ PGP\ (SIGNED\ )?MESSAGE"' \

"exec check-traditional-pgp"

Files:
6 modified

Legend:

Unmodified
Added
Removed
  • commands.c

    r3549 r3646  
    942942  int rv = 0; 
    943943   
     944  h->security |= PGP_TRADITIONAL_CHECKED; 
     945   
    944946  mutt_parse_mime_message (Context, h); 
    945947  if ((msg = mx_open_message (Context, h->msgno)) == NULL) 
     
    960962  int i; 
    961963  int rv = 0; 
    962   if (h) 
     964  if (h && !(h->security & PGP_TRADITIONAL_CHECKED)) 
    963965    rv = _mutt_check_traditional_pgp (h, redraw); 
    964966  else 
    965967  { 
    966968    for (i = 0; i < Context->vcount; i++) 
    967       if (Context->hdrs[Context->v2r[i]]->tagged) 
     969      if (Context->hdrs[Context->v2r[i]]->tagged && !(h->security & PGP_TRADITIONAL_CHECKED)) 
    968970        rv = _mutt_check_traditional_pgp (Context->hdrs[Context->v2r[i]], redraw) 
    969971          || rv; 
  • curs_main.c

    r3453 r3646  
    18771877        CHECK_MSGCOUNT;  
    18781878        CHECK_VISIBLE; 
    1879         mutt_check_traditional_pgp (tag ? NULL : CURHDR, &menu->redraw); 
     1879        if (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))  
     1880          mutt_check_traditional_pgp (tag ? NULL : CURHDR, &menu->redraw); 
     1881       
    18801882        if (menu->menu == MENU_PAGER) 
    18811883        { 
  • mutt.h

    r3633 r3646  
    642642typedef struct header 
    643643{ 
    644   unsigned int security : 9;  /* bit 0-6: flags, bit 7,8: application. 
     644  unsigned int security : 10;  /* bit 0-6: flags, bit 7,8: application. 
    645645                                 see: crypt.h pgplib.h, smime.h */ 
    646646 
  • mutt_crypt.h

    r3549 r3646  
    4242#define APPLICATION_SMIME  (1 << 8) 
    4343 
     44#define PGP_TRADITIONAL_CHECKED (1 << 9) 
     45 
    4446#define PGPENCRYPT  (APPLICATION_PGP | ENCRYPT) 
    4547#define PGPSIGN     (APPLICATION_PGP | SIGN) 
  • pager.c

    r3537 r3646  
    21742174        redraw = REDRAW_FULL; 
    21752175        break; 
     2176 
     2177      case OP_CHECK_TRADITIONAL: 
     2178        CHECK_MODE (IsHeader (extra)); 
     2179        if (!(WithCrypto & APPLICATION_PGP)) 
     2180          break; 
     2181        if (!(extra->hdr->security & PGP_TRADITIONAL_CHECKED))  
     2182        { 
     2183          ch = -1; 
     2184          rc = OP_CHECK_TRADITIONAL; 
     2185        } 
     2186        break; 
    21762187       
    21772188      case OP_CREATE_ALIAS: 
  • recvattach.c

    r3495 r3646  
    817817      /* functions which are passed through from the pager */ 
    818818      case OP_CHECK_TRADITIONAL: 
    819         if (!(WithCrypto & APPLICATION_PGP)) 
     819        if (!(WithCrypto & APPLICATION_PGP) || (hdr && hdr->security & PGP_TRADITIONAL_CHECKED)) 
    820820        { 
    821821          op = OP_NULL;