[epiphany] Remove UUID hacks to prevent self-launch



commit 8b97d6e32fbe2e56a7012d731b5e864a86720504
Author: Xan Lopez <xan igalia com>
Date:   Tue Dec 11 17:43:10 2012 +0100

    Remove UUID hacks to prevent self-launch
    
    Now we can get rid of them.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=690050

 lib/ephy-file-helpers.c  |   17 -----------------
 lib/ephy-file-helpers.h  |    2 --
 lib/ephy-profile-utils.c |    2 --
 src/ephy-window.c        |   10 ++--------
 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 8b61085..92adcce 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 a80f450..8ed792f 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 07c9605..2c685e0 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 d1c0170..6858b47 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 a0e013f..17f334a 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);
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]