summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaun McCance <shaunm@src.gnome.org>2008-04-07 21:59:35 +0000
committerShaun McCance <shaunm@src.gnome.org>2008-04-07 21:59:35 +0000
commitebc06efab468e5b6c0b474a398f2f4d51947c338 (patch)
treecdf2f34795647cc5f7ceec5eda112e93e24d095e
parentcc3e8ab7da9bd91e974ccce27d1314942ec7e457 (diff)
downloadyelp-ebc06efab468e5b6c0b474a398f2f4d51947c338.tar.gz
- Don't launch external programs under GDM (#525447)
* src/yelp-window.c: - Don't launch external programs under GDM (#525447) svn path=/trunk/; revision=3122
-rw-r--r--ChangeLog5
-rw-r--r--src/yelp-window.c18
2 files changed, 20 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 7c35a96d..3ecb16ea 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-04-07 Shaun McCance <shaunm@gnome.org>
+
+ * src/yelp-window.c:
+ - Don't launch external programs under GDM (#525447)
+
=== 2.22.0 ===
2008-03-09 Don Scorgie <dscorgie@svn.gnome.org>
diff --git a/src/yelp-window.c b/src/yelp-window.c
index a85b8ed0..ff296dce 100644
--- a/src/yelp-window.c
+++ b/src/yelp-window.c
@@ -1014,7 +1014,7 @@ yelp_window_load (YelpWindow *window, const gchar *uri)
if (priv->uri && g_str_equal (real_uri, priv->uri)) {
doc = priv->current_document;
} else {
- g_free (priv->base_uri);
+ gchar *old_base_uri = priv->base_uri;
priv->base_uri = NULL;
switch (type) {
@@ -1057,7 +1057,17 @@ yelp_window_load (YelpWindow *window, const gchar *uri)
gint status = 0;
GError *error = NULL;
- priv->base_uri = g_strdup ("file:///fakefile");
+ priv->base_uri = old_base_uri;
+
+ /* disallow external links when running in the GDM greeter session */
+ if (g_getenv ("RUNNING_UNDER_GDM") != NULL) {
+ gchar *message = g_strdup_printf (_("The requested URI \"%s\" is invalid"), trace_uri);
+
+ window_error (window, _("Unable to load page"), message, FALSE);
+ g_free (message);
+
+ return;
+ }
cmd = g_strdup_printf ("gnome-open %s", uri);
if (!g_spawn_command_line_sync (cmd, &str_stdout, &str_stderr, &status, &error)) {
@@ -1079,9 +1089,11 @@ yelp_window_load (YelpWindow *window, const gchar *uri)
break;
default:
- priv->base_uri = g_strdup ("file:///fakefile");
+ priv->base_uri = old_base_uri;
break;
}
+ if (old_base_uri != priv->base_uri)
+ g_free (old_base_uri);
}
if (doc) {