Prevent deleting a GNS3 project outside the project directory. Ref #1669

This commit is contained in:
grossmj committed 2019-10-30 16:25:06 +08:00
1 parent f3ad333a21
commit 5e9810d420
2 files changed
+7 -3

No files matched your search

@@ -204,11 +204,12 @@ class ProjectHandler:
controller = Controller.instance()
config = Config.instance()
dot_gns3_file = request.json.get("path")
if config.get_section_config("Server").getboolean("local", False) is False:
log.error("Can't load the project the server is not started with --local")
log.error("Cannot load '{}' because the server has not been started with the '--local' parameter".format(dot_gns3_file))
response.set_status(403)
return
project = await controller.load_project(request.json.get("path"),)
project = await controller.load_project(dot_gns3_file,)
response.set_status(201)
response.json(project)