Commit 7c402f97 authored by Jim Krehl's avatar Jim Krehl

prevent loading of non-Application type .desktop files, BNC #328155

svn path=/branches/openSUSE-10.3/; revision=359
parent ca78e5e6
......@@ -9,4 +9,3 @@ Jaap A. Haitsma
Jonh Wendell
William Jon McCann
Larry Ewing
Roy Marples
......@@ -150,11 +150,18 @@ application_tile_new_full (const gchar *desktop_item_id,
desktop_item = load_desktop_item_from_unknown (desktop_item_id);
if (desktop_item)
if (
desktop_item &&
gnome_desktop_item_get_entry_type (desktop_item) == GNOME_DESKTOP_ITEM_TYPE_APPLICATION
)
uri = gnome_desktop_item_get_location (desktop_item);
if (! desktop_item || ! uri)
if (! uri) {
if (desktop_item)
gnome_desktop_item_unref (desktop_item);
return NULL;
}
this = g_object_new (APPLICATION_TILE_TYPE, "tile-uri", uri, NULL);
priv = APPLICATION_TILE_GET_PRIVATE (this);
......
......@@ -644,5 +644,5 @@ static void
disown_spawned_child (gpointer user_data)
{
setsid ();
setpgid (0, 0);
setpgrp ();
}
......@@ -120,16 +120,18 @@ libslab_gnome_desktop_item_new_from_unknown_id (const gchar *id)
}
basename = g_strrstr (id, "/");
if (basename)
if (basename) {
basename++;
item = gnome_desktop_item_new_from_basename (basename, 0, &error);
item = gnome_desktop_item_new_from_basename (basename, 0, &error);
if (! error)
return item;
else {
g_error_free (error);
error = NULL;
if (! error)
return item;
else {
g_error_free (error);
error = NULL;
}
}
return NULL;
......
......@@ -184,16 +184,18 @@ load_desktop_item_from_unknown (const gchar *id)
}
basename = g_strrstr (id, "/");
if (basename)
if (basename) {
basename++;
item = gnome_desktop_item_new_from_basename (basename, 0, &error);
item = gnome_desktop_item_new_from_basename (basename, 0, &error);
if (! error)
return item;
else {
g_error_free (error);
error = NULL;
if (! error)
return item;
else {
g_error_free (error);
error = NULL;
}
}
return NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment