From 92cdab8bf8ea1a72e1745b88e9e31b59560e6f7b Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Mon, 17 Jul 2017 19:59:46 +0200 Subject: [PATCH] discovery: Make the unknown file extensions read-only. Change-Id: Ie1467334868a7e4aa31aa69f67d0cd434ed18e7b Reviewed-on: https://gerrit.libreoffice.org/40083 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky --- wsd/LOOLWSD.cpp | 6 +++--- wsd/LOOLWSD.hpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp index 83f34ac59..2852fb7a2 100644 --- a/wsd/LOOLWSD.cpp +++ b/wsd/LOOLWSD.cpp @@ -553,7 +553,7 @@ std::string LOOLWSD::LOKitVersion; std::string LOOLWSD::ConfigFile = LOOLWSD_CONFIGDIR "/loolwsd.xml"; Util::RuntimeConstant LOOLWSD::SSLEnabled; Util::RuntimeConstant LOOLWSD::SSLTermination; -std::set LOOLWSD::ViewFileExtensions; +std::set LOOLWSD::EditFileExtensions; static std::string UnitTestLibrary; @@ -2233,8 +2233,8 @@ private: elem->setAttribute(urlsrc, uriValue); // Set the View extensions cache as well. - if (elem->getAttribute("name") == "view") - LOOLWSD::ViewFileExtensions.insert(elem->getAttribute("ext")); + if (elem->getAttribute("name") == "edit") + LOOLWSD::EditFileExtensions.insert(elem->getAttribute("ext")); } std::ostringstream ostrXML; diff --git a/wsd/LOOLWSD.hpp b/wsd/LOOLWSD.hpp index 7ed29e153..86f8dbcbe 100644 --- a/wsd/LOOLWSD.hpp +++ b/wsd/LOOLWSD.hpp @@ -55,7 +55,7 @@ public: static std::atomic NumConnections; static bool TileCachePersistent; static std::unique_ptr TraceDumper; - static std::set ViewFileExtensions; + static std::set EditFileExtensions; /// Flag to shutdown the server. std::atomic ShutdownFlag; @@ -85,7 +85,7 @@ public: /// Return truee iff extension is marked as view action in discovery.xml. static bool IsViewFileExtension(const std::string& extension) { - return ViewFileExtensions.find(extension) != ViewFileExtensions.end(); + return EditFileExtensions.find(extension) == EditFileExtensions.end(); } /// Returns the value of the specified application configuration,