From 8b19029d9740c04e0d93ca26bbf08b883fc958da Mon Sep 17 00:00:00 2001 From: Jeremy Date: Mon, 23 Feb 2015 15:56:10 -0700 Subject: [PATCH] List only executable files in upload handler. --- gns3server/handlers/upload_handler.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gns3server/handlers/upload_handler.py b/gns3server/handlers/upload_handler.py index 1d904d65..2d89e081 100644 --- a/gns3server/handlers/upload_handler.py +++ b/gns3server/handlers/upload_handler.py @@ -35,7 +35,9 @@ class UploadHandler: try: for root, _, files in os.walk(UploadHandler.image_directory()): for filename in files: - image_files.append(os.path.join(root, filename)) + image_file = os.path.join(root, filename) + if os.access(image_file, os.X_OK): + image_files.append(os.path.join(root, filename)) except OSError: pass response.template("upload.html", files=image_files)