aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-10-25 09:26:37 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-10-25 09:26:37 +0800
commitcd0daad88d1624b136a5654068e7d782f756dd3c (patch)
tree4c68915452f9dd92f20e68f0345f77ad5995fc2f /mail
parent96a2f2dd498e889cec35d326b8e35b5ddaa25550 (diff)
downloadgsoc2013-evolution-cd0daad88d1624b136a5654068e7d782f756dd3c.tar.gz
gsoc2013-evolution-cd0daad88d1624b136a5654068e7d782f756dd3c.tar.zst
gsoc2013-evolution-cd0daad88d1624b136a5654068e7d782f756dd3c.zip
Use the mode 0666 when creating a new file and let the user's umask handle
2002-10-24 Jeffrey Stedfast <fejj@ximian.com> * mail-display.c (write_data_to_file): Use the mode 0666 when creating a new file and let the user's umask handle permissions. * folder-browser.c (message_list_drag_data_get): When using open() with the O_CREAT flag, we need to pass a mode argument. Also use O_EXCL. svn path=/trunk/; revision=18430
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog9
-rw-r--r--mail/folder-browser.c2
-rw-r--r--mail/mail-display.c2
3 files changed, 11 insertions, 2 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 9511ffcf3c..4e8ed653f8 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,12 @@
+2002-10-24 Jeffrey Stedfast <fejj@ximian.com>
+
+ * mail-display.c (write_data_to_file): Use the mode 0666 when
+ creating a new file and let the user's umask handle permissions.
+
+ * folder-browser.c (message_list_drag_data_get): When using open()
+ with the O_CREAT flag, we need to pass a mode argument. Also use
+ O_EXCL.
+
2002-10-24 Not Zed <NotZed@Ximian.com>
* subscribe-dialog.c (fe_got_children): Use a hashtable to only
diff --git a/mail/folder-browser.c b/mail/folder-browser.c
index ab9a00d66c..151e6991ad 100644
--- a/mail/folder-browser.c
+++ b/mail/folder-browser.c
@@ -330,7 +330,7 @@ message_list_drag_data_get (ETree *tree, int row, ETreePath path, int col,
uri_list = g_strdup_printf ("file://%s/%s", tmpdir, filename);
- fd = open (uri_list + 7, O_WRONLY | O_CREAT);
+ fd = open (uri_list + 7, O_WRONLY | O_CREAT | O_EXCL, 0600);
if (fd == -1) {
/* cleanup and abort */
camel_object_unref (CAMEL_OBJECT (message));
diff --git a/mail/mail-display.c b/mail/mail-display.c
index a02d323920..df71ddb368 100644
--- a/mail/mail-display.c
+++ b/mail/mail-display.c
@@ -180,7 +180,7 @@ write_data_to_file (CamelMimePart *part, const char *name, gboolean unique)
g_return_val_if_fail (CAMEL_IS_MIME_PART (part), FALSE);
- fd = open (name, O_WRONLY | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
+ fd = open (name, O_WRONLY | O_CREAT | O_EXCL, 0666);
if (fd == -1 && errno == EEXIST && !unique) {
GtkWidget *dlg;
GtkWidget *text;