Index: nautilus-2.16.3/libnautilus-private/nautilus-file.c
===================================================================
--- nautilus-2.16.3.orig/libnautilus-private/nautilus-file.c	2007-02-17 00:16:10.000000000 +0100
+++ nautilus-2.16.3/libnautilus-private/nautilus-file.c	2007-02-18 17:31:07.000000000 +0100
@@ -40,6 +40,7 @@
 #include "nautilus-link-desktop-file.h"
 #include "nautilus-metadata.h"
 #include "nautilus-module.h"
+#include "nautilus-program-choosing.h"
 #include "nautilus-search-directory.h"
 #include "nautilus-search-directory-file.h"
 #include "nautilus-thumbnails.h"
@@ -2735,6 +2736,33 @@
 		 monitor_remove, (file, client));
 }			      
 
+static gboolean
+safe_to_launch_desktop_file (NautilusFile *file)
+{
+	gboolean ret = TRUE;
+	char *uri = nautilus_file_get_uri (file);
+	char *path = NULL;
+
+	if (uri) {
+		path = gnome_vfs_get_local_path_from_uri (uri);
+	}
+
+	if (!path ||
+	    eel_str_has_prefix (path, "/mnt") ||
+	    eel_str_has_prefix (path, "/media") ||
+	    !eel_str_has_suffix (path, ".desktop")) {
+		ret = FALSE;
+	}
+
+	if (file->details->info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_IDS &&
+	    file->details->info->uid &&
+	    (uid_t) file->details->info->uid != geteuid ())
+		ret = FALSE;
+
+	g_free (uri);
+	g_free (path);
+	return ret;
+}
 
 /* Return the uri associated with the passed-in file, which may not be
  * the actual uri if the file is an desktop file or a nautilus
@@ -2749,7 +2777,9 @@
 		return NULL;
 	}
 
-	if (file->details->activation_uri != NULL) {
+	if (file->details->activation_uri != NULL &&
+	    (!eel_str_has_prefix (file->details->activation_uri, NAUTILUS_DESKTOP_COMMAND_SPECIFIER) ||
+	     safe_to_launch_desktop_file (file))) {
 		return g_strdup (file->details->activation_uri);
 	}
 	
@@ -5207,6 +5237,12 @@
 	return nautilus_file_is_mime_type (file, "application/x-desktop");
 }
 
+gboolean
+nautilus_file_is_desktop_launcher (NautilusFile *file)
+{
+	return eel_str_has_prefix (file->details->activation_uri, NAUTILUS_DESKTOP_COMMAND_SPECIFIER);
+}
+
 /**
  * nautilus_file_is_directory
  * 
Index: nautilus-2.16.3/src/file-manager/fm-directory-view.c
===================================================================
--- nautilus-2.16.3.orig/src/file-manager/fm-directory-view.c	2007-02-17 00:16:10.000000000 +0100
+++ nautilus-2.16.3/src/file-manager/fm-directory-view.c	2007-02-18 17:21:06.000000000 +0100
@@ -4571,7 +4571,8 @@
 {
 	return (nautilus_file_is_directory (file) ||
 		NAUTILUS_IS_DESKTOP_ICON_FILE (file) ||
-		nautilus_file_is_nautilus_link (file));
+		(nautilus_file_is_nautilus_link (file) &&
+		 !nautilus_file_is_desktop_launcher (file)));
 }
 
 static ActivationAction
@@ -4652,12 +4653,14 @@
 	for (node = selection; node != NULL; node = node->next) {
 		file = NAUTILUS_FILE (node->data);
 
-		other_applications_visible &=
-			(!can_use_component_for_file (file) ||
-			 nautilus_file_is_directory (file));
-
 		activation_action = get_activation_action (file);
 
+		if (activation_action != ACTIVATION_ACTION_OPEN_IN_APPLICATION &&
+		    (NAUTILUS_IS_DESKTOP_ICON_FILE (file) ||
+		     nautilus_file_is_nautilus_link (file))) {
+			other_applications_visible = FALSE;
+		}
+
 		/* Only use the default app for open if there is not
 		   a mime mismatch, otherwise we can't use it in the
 		   open with menu */
Index: nautilus-2.16.3/libnautilus-private/nautilus-file.h
===================================================================
--- nautilus-2.16.3.orig/libnautilus-private/nautilus-file.h	2007-02-18 17:09:51.000000000 +0100
+++ nautilus-2.16.3/libnautilus-private/nautilus-file.h	2007-02-18 17:11:32.000000000 +0100
@@ -155,6 +155,7 @@
 char *                  nautilus_file_get_symbolic_link_target_uri      (NautilusFile                   *file);
 gboolean                nautilus_file_is_broken_symbolic_link           (NautilusFile                   *file);
 gboolean                nautilus_file_is_nautilus_link                  (NautilusFile                   *file);
+gboolean                nautilus_file_is_desktop_launcher               (NautilusFile                   *file);
 gboolean                nautilus_file_is_executable                     (NautilusFile                   *file);
 gboolean                nautilus_file_is_directory                      (NautilusFile                   *file);
 gboolean                nautilus_file_is_in_trash                       (NautilusFile                   *file);
