[geary] "View Source" creates tmp files only readable by user: Bug #724436
- From: Jim Nelson <jnelson src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary] "View Source" creates tmp files only readable by user: Bug #724436
- Date: Thu, 9 Oct 2014 20:55:39 +0000 (UTC)
commit 4f8cadc3e8ceb6a382c8c598d095e14137b5b662
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 0148335..140ccc2 100644
--- a/src/client/conversation-viewer/conversation-viewer.vala
+++ b/src/client/conversation-viewer/conversation-viewer.vala
@@ -2176,6 +2176,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]