diff options
author | Xan Lopez <xan@igalia.com> | 2012-12-12 00:43:10 +0800 |
---|---|---|
committer | Xan Lopez <xan@igalia.com> | 2012-12-12 19:22:39 +0800 |
commit | 8b97d6e32fbe2e56a7012d731b5e864a86720504 (patch) | |
tree | e54a84f5554b8474049bde978734302b5fc37de7 | |
parent | 6ede0c3ebcbc129ea1112ee9f43427231ab50e07 (diff) | |
download | gsoc2013-epiphany-8b97d6e32fbe2e56a7012d731b5e864a86720504.tar gsoc2013-epiphany-8b97d6e32fbe2e56a7012d731b5e864a86720504.tar.gz gsoc2013-epiphany-8b97d6e32fbe2e56a7012d731b5e864a86720504.tar.bz2 gsoc2013-epiphany-8b97d6e32fbe2e56a7012d731b5e864a86720504.tar.lz gsoc2013-epiphany-8b97d6e32fbe2e56a7012d731b5e864a86720504.tar.xz gsoc2013-epiphany-8b97d6e32fbe2e56a7012d731b5e864a86720504.tar.zst gsoc2013-epiphany-8b97d6e32fbe2e56a7012d731b5e864a86720504.zip |
Remove UUID hacks to prevent self-launch
Now we can get rid of them.
https://bugzilla.gnome.org/show_bug.cgi?id=690050
-rw-r--r-- | lib/ephy-file-helpers.c | 17 | ||||
-rw-r--r-- | lib/ephy-file-helpers.h | 2 | ||||
-rw-r--r-- | lib/ephy-profile-utils.c | 2 | ||||
-rw-r--r-- | src/ephy-window.c | 10 | ||||
-rw-r--r-- | src/window-commands.c | 5 |
5 files changed, 3 insertions, 33 deletions
diff --git a/lib/ephy-file-helpers.c b/lib/ephy-file-helpers.c index 8b61085b4..92adcce1b 100644 --- a/lib/ephy-file-helpers.c +++ b/lib/ephy-file-helpers.c @@ -49,9 +49,6 @@ * atomically. */ -#define EPHY_UUID "0d82d98f-7079-401c-abff-203fcde1ece3" -#define EPHY_UUID_ENVSTRING EPHY_UUID_ENVVAR "=" EPHY_UUID - #define DELAY_MAX_TICKS 64 #define INITIAL_TICKS 2 @@ -306,20 +303,8 @@ ephy_file_helpers_init (const char *profile_dir, EphyFileHelpersFlags flags, GError **error) { - const char *uuid; gboolean private_profile; - /* See if we've been calling ourself, and abort if we have */ - uuid = g_getenv (EPHY_UUID_ENVVAR); - if (uuid && strcmp (uuid, EPHY_UUID) == 0) - { - g_warning ("Self call detected, exiting!\n"); - exit (1); - } - - /* Put marker in env */ - g_setenv (EPHY_UUID_ENVVAR, EPHY_UUID, TRUE); - ephy_file_helpers_error_quark = g_quark_from_static_string ("ephy-file-helpers-error"); files = g_hash_table_new_full (g_str_hash, @@ -417,8 +402,6 @@ ephy_file_helpers_shutdown (void) g_free (tmp_dir); tmp_dir = NULL; } - - g_unsetenv (EPHY_UUID_ENVVAR); } /** diff --git a/lib/ephy-file-helpers.h b/lib/ephy-file-helpers.h index a80f45084..8ed792fee 100644 --- a/lib/ephy-file-helpers.h +++ b/lib/ephy-file-helpers.h @@ -50,8 +50,6 @@ typedef enum EPHY_FILE_HELPERS_ENSURE_EXISTS = 1 << 3, } EphyFileHelpersFlags; -#define EPHY_UUID_ENVVAR "EPHY_UNIQUE" - gboolean ephy_file_helpers_init (const char *profile_dir, EphyFileHelpersFlags flags, GError **error); diff --git a/lib/ephy-profile-utils.c b/lib/ephy-profile-utils.c index 07c960559..2c685e05f 100644 --- a/lib/ephy-profile-utils.c +++ b/lib/ephy-profile-utils.c @@ -213,8 +213,6 @@ ephy_profile_utils_do_migration (const char *profile_directory, int test_to_run, envp = g_environ_setenv (g_get_environ (), "EPHY_LOG_MODULES", "ephy-profile", TRUE); - /* To avoid breaking test-ephy-migrator */ - envp = g_environ_unsetenv (envp, EPHY_UUID_ENVVAR); argv[i++] = version = g_strdup_printf ("%d", EPHY_PROFILE_MIGRATION_VERSION); diff --git a/src/ephy-window.c b/src/ephy-window.c index d1c0170d1..6858b47f8 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -2530,10 +2530,7 @@ decide_policy_cb (WebKitWebView *web_view, GError *error = NULL; return_value = TRUE; - /* A gross hack to be able to launch epiphany from within - * Epiphany. Might be a good idea to figure out a better - * solution... */ - g_unsetenv (EPHY_UUID_ENVVAR); + command_line = g_strdup_printf ("gvfs-open %s", uri); g_spawn_command_line_async (command_line, &error); @@ -2668,10 +2665,7 @@ policy_decision_required_cb (WebKitWebView *web_view, GError *error = NULL; return_value = TRUE; - /* A gross hack to be able to launch epiphany from within - * Epiphany. Might be a good idea to figure out a better - * solution... */ - g_unsetenv (EPHY_UUID_ENVVAR); + command_line = g_strdup_printf ("gvfs-open %s", uri); g_spawn_command_line_async (command_line, &error); diff --git a/src/window-commands.c b/src/window-commands.c index a0e013fa0..17f334a7e 100644 --- a/src/window-commands.c +++ b/src/window-commands.c @@ -534,10 +534,7 @@ notify_launch_cb (NotifyNotification *notification, gpointer user_data) { char * desktop_file = user_data; - /* A gross hack to be able to launch epiphany from within - * Epiphany. Might be a good idea to figure out a better - * solution... */ - g_unsetenv (EPHY_UUID_ENVVAR); + ephy_file_launch_desktop_file (desktop_file, NULL, 0, NULL); g_free (desktop_file); } |