rpms/evolution/devel evolution-2.9.3-view-attachment-uri.patch, NONE, 1.1

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Fri Dec 8 01:04:11 UTC 2006


Author: mbarnes

Update of /cvs/dist/rpms/evolution/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv15380

Added Files:
	evolution-2.9.3-view-attachment-uri.patch 
Log Message:
- Forgot to check-in evolution-2.9.3-view-attachment-uri.patch.


evolution-2.9.3-view-attachment-uri.patch:
 mail-ops.c |   25 +++++++++++++++----------
 1 files changed, 15 insertions(+), 10 deletions(-)

--- NEW FILE evolution-2.9.3-view-attachment-uri.patch ---
--- 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




More information about the fedora-cvs-commits mailing list