X-Git-Url: https://git.llucax.com/software/mutt-debian.git/blobdiff_plain/6e0cd7b3aec391b9acd16011500a03d9924f334f..e1dc777d9c8cdc5ac54e3018a3211fa9823b81eb:/debian/patches/upstream/528233-readonly-open.patch?ds=inline diff --git a/debian/patches/upstream/528233-readonly-open.patch b/debian/patches/upstream/528233-readonly-open.patch index df29fd9..049fc09 100644 --- a/debian/patches/upstream/528233-readonly-open.patch +++ b/debian/patches/upstream/528233-readonly-open.patch @@ -2,13 +2,27 @@ 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) +#528233, updated in #572203 + --- a/attach.c +++ b/attach.c -@@ -494,6 +494,7 @@ +@@ -492,6 +492,7 @@ int mutt_view_attachment (FILE *fp, BODY + FREE (&fname); + if (mutt_save_attachment (fp, a, tempfile, 0, NULL) == -1) goto return_error; ++ chmod (tempfile, 0400); } -+ chmod (tempfile, 0400); use_pipe = rfc1524_expand_command (a, tempfile, type, - command, sizeof (command)); - use_pager = entry->copiousoutput; +@@ -633,7 +634,11 @@ int mutt_view_attachment (FILE *fp, BODY + 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); +