~ubuntu-branches/ubuntu/maverick/mutt/maverick

« back to all changes in this revision

Viewing changes to debian/patches/upstream/528233-readonly-open.patch

  • Committer: Package Import Robot
  • Author(s): أحمد المحمودي (Ahmed El-Mahmoudy)
  • Date: 2010-06-22 17:48:54 UTC
  • mfrom: (2.1.10 sid)
  • Revision ID: package-import@ubuntu.com-20100622174854-grpayfk2rgoyl2qk
Tags: 1.5.20-9ubuntu1
* Merge with Debian (LP: #588736). Remaining changes:
  + debian/control, debian/patches/debian-specific/build_doc_adjustments.diff:
    Use w3m (main) instead of elinks (universe) for generating documentation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
otherwise the user can believe that he/she can edit it and risk to lose his/her
3
3
work (see upstream bug http://bugs.mutt.org/3261)
4
4
 
 
5
#528233, updated in #572203
 
6
 
5
7
--- a/attach.c
6
8
+++ b/attach.c
7
 
@@ -494,6 +494,7 @@
 
9
@@ -492,6 +492,7 @@ int mutt_view_attachment (FILE *fp, BODY
 
10
       FREE (&fname);
 
11
       if (mutt_save_attachment (fp, a, tempfile, 0, NULL) == -1)
8
12
        goto return_error;
 
13
+      chmod (tempfile, 0400);
9
14
     }
10
15
 
11
 
+    chmod (tempfile, 0400);
12
16
     use_pipe = rfc1524_expand_command (a, tempfile, type,
13
 
                                       command, sizeof (command));
14
 
     use_pager = entry->copiousoutput;
 
17
@@ -633,7 +634,11 @@ int mutt_view_attachment (FILE *fp, BODY
 
18
   if (entry)
 
19
     rfc1524_free_entry (&entry);
 
20
   if (fp && tempfile[0])
 
21
+  {
 
22
+    /* Restore write permission so mutt_unlink can open the file for writing */
 
23
+    chmod(tempfile, 0600);
 
24
     mutt_unlink (tempfile);
 
25
+  }
 
26
   else if (unlink_tempfile)
 
27
     unlink(tempfile);
 
28