[evince/mcatanzaro/#1333-gnome-3-38] Remove ability to launch actions
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evince/mcatanzaro/#1333-gnome-3-38] Remove ability to launch actions
- Date: Tue, 22 Sep 2020 15:27:39 +0000 (UTC)
commit 2d11104a936533320bc7827cb53252a9a2459b36
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Tue Sep 22 10:23:41 2020 -0500
Remove ability to launch actions
This is basically only ever used by malware. Like PDF JavaScript, it's
more dangerous than useful.
Fixes #1333
shell/ev-window.c | 57 +------------------------------------------------------
1 file changed, 1 insertion(+), 56 deletions(-)
---
diff --git a/shell/ev-window.c b/shell/ev-window.c
index 1f3ea24d..167e2710 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -6697,62 +6697,7 @@ window_configure_event_cb (EvWindow *window, GdkEventConfigure *event, gpointer
static void
launch_action (EvWindow *window, EvLinkAction *action)
{
- EvWindowPrivate *priv = GET_PRIVATE (window);
- const char *filename = ev_link_action_get_filename (action);
- GAppInfo *app_info;
- GFile *file;
- GList file_list = {NULL};
- GdkAppLaunchContext *context;
- GdkScreen *screen;
- GError *error = NULL;
-
- if (filename == NULL)
- return;
-
- if (g_path_is_absolute (filename)) {
- file = g_file_new_for_path (filename);
- } else {
- GFile *base_file;
- gchar *dir;
-
- dir = g_path_get_dirname (priv->uri);
- base_file = g_file_new_for_uri (dir);
- g_free (dir);
-
- file = g_file_resolve_relative_path (base_file, filename);
- g_object_unref (base_file);
- }
-
- app_info = g_file_query_default_handler (file, NULL, &error);
- if (!app_info) {
- ev_window_error_message (window, error,
- "%s",
- _("Unable to launch external application."));
- g_object_unref (file);
- g_error_free (error);
-
- return;
- }
-
- screen = gtk_window_get_screen (GTK_WINDOW (window));
- context = gdk_display_get_app_launch_context (gdk_screen_get_display (screen));
- gdk_app_launch_context_set_screen (context, screen);
- gdk_app_launch_context_set_timestamp (context, gtk_get_current_event_time ());
-
- file_list.data = file;
- if (!g_app_info_launch (app_info, &file_list, G_APP_LAUNCH_CONTEXT (context), &error)) {
- ev_window_error_message (window, error,
- "%s",
- _("Unable to launch external application."));
- g_error_free (error);
- }
-
- g_object_unref (app_info);
- g_object_unref (file);
- /* FIXMEchpe: unref launch context? */
-
- /* According to the PDF spec filename can be an executable. I'm not sure
- allowing to launch executables is a good idea though. -- marco */
+ /* Do nothing, https://gitlab.gnome.org/GNOME/evince/-/issues/1333 */
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]