[geary/geary-0.8] "View Source" creates tmp files only readable by user: Bug #724436



commit 8d6f5c2b41ccb88d891a7589eb0045f338f9dd43
Author: Jim Nelson <jim yorba org>
Date:   Thu Oct 9 13:54:37 2014 -0700

    "View Source" creates tmp files only readable by user: Bug #724436

 .../conversation-viewer/conversation-viewer.vala   |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/client/conversation-viewer/conversation-viewer.vala 
b/src/client/conversation-viewer/conversation-viewer.vala
index 3c6d777..c7c7f6b 100644
--- a/src/client/conversation-viewer/conversation-viewer.vala
+++ b/src/client/conversation-viewer/conversation-viewer.vala
@@ -2119,6 +2119,11 @@ public class ConversationViewer : Gtk.Box {
                 out temporary_filename);
             FileUtils.set_contents(temporary_filename, source);
             FileUtils.close(temporary_handle);
+            
+            // ensure this file is only readable by the user ... this needs to be done after the
+            // file is closed
+            FileUtils.chmod(temporary_filename, (int) (Posix.S_IRUSR | Posix.S_IWUSR));
+            
             string temporary_uri = Filename.to_uri(temporary_filename, null);
             Gtk.show_uri(web_view.get_screen(), temporary_uri, Gdk.CURRENT_TIME);
         } catch (Error error) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]