From f3fdffe29ffe809becef1d2333d939ce55273dea Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Dec 08 2006 01:04:09 +0000 Subject: - Forgot to check-in evolution-2.9.3-view-attachment-uri.patch. --- diff --git a/evolution-2.9.3-view-attachment-uri.patch b/evolution-2.9.3-view-attachment-uri.patch new file mode 100644 index 0000000..a506488 --- /dev/null +++ b/evolution-2.9.3-view-attachment-uri.patch @@ -0,0 +1,46 @@ +--- evolution-2.9.3/mail/mail-ops.c.view-attachment-uri 2006-12-06 10:26:24.000000000 -0500 ++++ evolution-2.9.3/mail/mail-ops.c 2006-12-06 11:16:46.000000000 -0500 +@@ -2089,21 +2089,23 @@ + save_part_save (struct _mail_msg *mm) + { + struct _save_part_msg *m = (struct _save_part_msg *)mm; ++ mode_t mode = S_IRUSR | S_IRGRP | S_IROTH; ++ int flags = O_WRONLY | O_CREAT | O_TRUNC; + CamelDataWrapper *content; + CamelStream *stream; +- +- if(!m->readonly){ +- if (!(stream = camel_stream_vfs_new_with_uri (m->path, O_WRONLY | O_CREAT | O_TRUNC, 0644))) { +- camel_exception_setv (&mm->ex, CAMEL_EXCEPTION_SYSTEM, +- _("Cannot create output file: %s:\n %s"), +- m->path, g_strerror (errno)); +- return; +- } +- } else if (!(stream = camel_stream_vfs_new_with_uri (m->path, O_WRONLY | O_CREAT | O_TRUNC, 0444))) { ++ gchar *uri; ++ ++ uri = g_filename_to_uri (m->path, NULL, NULL); ++ ++ if (!m->readonly) ++ mode |= S_IWUSR; ++ ++ stream = camel_stream_vfs_new_with_uri (uri, flags, mode); ++ if (stream == NULL) { + camel_exception_setv (&mm->ex, CAMEL_EXCEPTION_SYSTEM, + _("Cannot create output file: %s:\n %s"), + m->path, g_strerror (errno)); +- return; ++ goto exit; + } + + content = camel_medium_get_content_object (CAMEL_MEDIUM (m->part)); +@@ -2115,6 +2117,9 @@ + g_strerror (errno)); + + camel_object_unref (stream); ++ ++exit: ++ g_free (uri); + } + + static void