[mutt] 14/17: 528233-readonly-open

Antonio Radici antonio at moszumanska.debian.org
Sun Aug 28 15:32:56 UTC 2016


This is an automated email from the git hooks/post-receive script.

antonio pushed a commit to branch patch-queue/master
in repository mutt.

commit eecdc06a834b887ce9b6ca8e36fb282dd903fbb2
Author: Antonio Radici <antonio at debian.org>
Date:   Thu Feb 27 17:07:35 2014 +0100

    528233-readonly-open
    
    Open attachments as read-only so the editor won't be able to modify it;
    otherwise the user can believe that he/she can edit it and risk to lose
    his/her work (see upstream bug http://bugs.mutt.org/3261)
    
    Debian bugs: #528233, updated in #572203
    
    Gbp-Pq: Topic upstream
    Gbp-Pq: Name 528233-readonly-open.patch
---
 attach.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/attach.c b/attach.c
index d50d54a..063de75 100644
--- a/attach.c
+++ b/attach.c
@@ -415,6 +415,7 @@ int mutt_view_attachment (FILE *fp, BODY *a, int flag, HEADER *hdr,
       FREE (&fname);
       if (mutt_save_attachment (fp, a, tempfile, 0, NULL) == -1)
 	goto return_error;
+      chmod (tempfile, 0400);
     }
 
     use_pipe = rfc1524_expand_command (a, tempfile, type,
@@ -587,7 +588,11 @@ int mutt_view_attachment (FILE *fp, BODY *a, int flag, HEADER *hdr,
   if (entry)
     rfc1524_free_entry (&entry);
   if (fp && tempfile[0])
+  {
+    /* Restore write permission so mutt_unlink can open the file for writing */
+    chmod(tempfile, 0600);
     mutt_unlink (tempfile);
+  }
   else if (unlink_tempfile)
     unlink(tempfile);
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mutt/mutt.git



More information about the pkg-mutt-commits mailing list