patches/nautilus-sendto-02-mailcmd.diff
author rohinis
Tue, 29 Nov 2011 17:32:55 +0000
branchs11express-2010-11
changeset 22234 c23e64da3e06
parent 17838 e011c05147cc
permissions -rw-r--r--
2011-11-29 Rohini S <[email protected]> * patches/Python26-22-audio.diff: Fixes CVE-2010-1634 * specs/SUNWPython26.spec: Fixes CR 7085446

commit ef7c18e2f68d5b175945f60eff2137a4850a6a93
Author: Halton Huo <[email protected]>
Date:   Mon Mar 29 17:14:02 2010 +0800

    Strip arguments defined in /desktop/gnome/url-handlers/mailto/command.
    
    Fixes bug https://bugzilla.gnome.org/show_bug.cgi?id=614222

diff --git a/src/plugins/evolution/evolution.c b/src/plugins/evolution/evolution.c
index a25ade1..45b4b25 100644
--- a/src/plugins/evolution/evolution.c
+++ b/src/plugins/evolution/evolution.c
@@ -81,6 +81,8 @@ static gboolean
 init (NstPlugin *plugin)
 {
 	GConfClient *client;
+        gchar       *str;
+        gchar      **arrstr;
 
 	g_print ("Init evolution plugin\n");
 	
@@ -88,9 +90,14 @@ init (NstPlugin *plugin)
 	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
 
 	client = gconf_client_get_default ();
-	mail_cmd = gconf_client_get_string (client, DEFAULT_MAILTO, NULL);
+	str = gconf_client_get_string (client, DEFAULT_MAILTO, NULL);
 	g_object_unref (client);
 
+        arrstr = g_strsplit (str, " ", -1);
+        mail_cmd = g_strdup (arrstr [0]);
+        g_free (str);
+        g_strfreev (arrstr);
+
 	if (mail_cmd == NULL || *mail_cmd == '\0') {
 		g_free (mail_cmd);
 		mail_cmd = get_evo_cmd ();
@@ -339,7 +346,7 @@ send_files (NstPlugin *plugin,
 		get_evo_mailto (contact_widget, mailto, file_list);
 	}
 
-	cmd = g_strdup_printf (mail_cmd, mailto->str);
+	cmd = g_strdup_printf ("%s %s", mail_cmd, mailto->str);
 	g_string_free (mailto, TRUE);
 
 	g_message ("Mailer type: %d", type);