1 Open attachments as read-only so the editor won't be able to modify it;
2 otherwise the user can believe that he/she can edit it and risk to lose his/her
3 work (see upstream bug http://bugs.mutt.org/3261)
5 #528233, updated in #572203
9 @@ -492,6 +492,7 @@ int mutt_view_attachment (FILE *fp, BODY
11 if (mutt_save_attachment (fp, a, tempfile, 0, NULL) == -1)
13 + chmod (tempfile, 0400);
16 use_pipe = rfc1524_expand_command (a, tempfile, type,
17 @@ -633,7 +634,11 @@ int mutt_view_attachment (FILE *fp, BODY
19 rfc1524_free_entry (&entry);
20 if (fp && tempfile[0])
22 + /* Restore write permission so mutt_unlink can open the file for writing */
23 + chmod(tempfile, 0600);
24 mutt_unlink (tempfile);
26 else if (unlink_tempfile)