aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/ChangeLog7
-rw-r--r--mail/em-composer-prefs.c17
2 files changed, 17 insertions, 7 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index b705728b06..8de4e11651 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,10 @@
+2004-04-28 Jeffrey Stedfast <fejj@ximian.com>
+
+ * em-composer-prefs.c (sig_add_script_response): Use
+ g_shell_parse_argv() to get the actual script path and then check
+ that we can exec argv[0] rather than treating the entire
+ command-line as the signature script. Fixes bug #57305.
+
2004-04-28 Not Zed <NotZed@Ximian.com>
* message-list.c (ml_selection_clear_event): return the right
diff --git a/mail/em-composer-prefs.c b/mail/em-composer-prefs.c
index 554e115e78..b5193900ed 100644
--- a/mail/em-composer-prefs.c
+++ b/mail/em-composer-prefs.c
@@ -355,9 +355,10 @@ sig_add_cb (GtkWidget *widget, EMComposerPrefs *prefs)
static void
sig_add_script_response (GtkWidget *widget, int button, EMComposerPrefs *prefs)
{
- const char *name;
- char *script;
+ char *script, **argv = NULL;
GtkWidget *entry;
+ const char *name;
+ int argc;
if (button == GTK_RESPONSE_ACCEPT) {
entry = glade_xml_get_widget (prefs->sig_script_gui, "fileentry_add_script_script");
@@ -365,10 +366,10 @@ sig_add_script_response (GtkWidget *widget, int button, EMComposerPrefs *prefs)
entry = glade_xml_get_widget (prefs->sig_script_gui, "entry_add_script_name");
name = gtk_entry_get_text (GTK_ENTRY (entry));
- if (script && *script) {
+ if (script && *script && g_shell_parse_argv (script, &argc, &argv, NULL)) {
struct stat st;
- if (stat (script, &st) && S_ISREG (st.st_mode) && access (script, X_OK) == 0) {
+ if (stat (argv[0], &st) && S_ISREG (st.st_mode) && access (argv[0], X_OK) == 0) {
GtkWidget *parent;
ESignature *sig;
@@ -385,14 +386,16 @@ sig_add_script_response (GtkWidget *widget, int button, EMComposerPrefs *prefs)
}
gtk_widget_hide (prefs->sig_script_dialog);
- g_free(script);
+ g_strfreev (argv);
+ g_free (script);
return;
}
}
- e_error_run((GtkWindow *)prefs->sig_script_dialog, "mail:signature-notscript", script, NULL);
- g_free(script);
+ e_error_run((GtkWindow *)prefs->sig_script_dialog, "mail:signature-notscript", argv ? argv[0] : script, NULL);
+ g_strfreev (argv);
+ g_free (script);
return;
}