[kupfer] objects: Require execute permission for file-based AppLeaves



commit 55cef881699c18d586495c94461f44a075cdf57b
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Thu Dec 10 22:43:33 2009 +0100

    objects: Require execute permission for file-based AppLeaves
    
    Require execute permisson for parsing AppLeaves from files (like from
    the Desktop). This is what Gnome does. It is to close a security hole
    from downloading files from other places (since without this,
    downloaded files may disguise under any name/description).

 kupfer/objects.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/kupfer/objects.py b/kupfer/objects.py
index 17ed153..898d79a 100644
--- a/kupfer/objects.py
+++ b/kupfer/objects.py
@@ -377,7 +377,7 @@ class AppLeaf (Leaf, PicklingHelperMixin, pretty.OutputMixin):
 		else:
 			# Construct an AppInfo item from either path or item_id
 			from gio.unix import DesktopAppInfo, desktop_app_info_new_from_filename
-			if self.init_path:
+			if self.init_path and os.access(self.init_path, os.X_OK):
 				item = desktop_app_info_new_from_filename(self.init_path)
 			elif self.init_item_id:
 				try:



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