From 5b1ec3bec2c87b3bcd417c84e3fec754a6e61487 Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Wed, 14 Sep 2016 18:53:26 +0200 Subject: [PATCH] Raise an error if the destination of import contain a .gns3 in path Ref https://github.com/GNS3/gns3-gui/issues/1503 --- gns3server/controller/import_project.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gns3server/controller/import_project.py b/gns3server/controller/import_project.py index bdf7fe5a..c9f2cba9 100644 --- a/gns3server/controller/import_project.py +++ b/gns3server/controller/import_project.py @@ -49,6 +49,9 @@ def import_project(controller, project_id, stream, location=None, name=None, kee :returns: Project """ + if location and ".gns3" in location: + raise aiohttp.web.HTTPConflict(text="The destination path should not contain .gns3") + with zipfile.ZipFile(stream) as myzip: try: