[Libreoffice-commits] online.git: loolwsd/DocumentBroker.cpp

Ashod Nakashian ashod.nakashian at collabora.co.uk
Sun Nov 20 00:22:29 UTC 2016


 loolwsd/DocumentBroker.cpp |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit 0c44eeb39a8401c9430556f7ee3da155f03f0371
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Sat Nov 19 09:50:42 2016 -0500

    loolwsd: support loading same document from aliased hosts
    
    Change-Id: Ib46521dc05cb01fc4ca93d51671a75eab055e3cd
    Reviewed-on: https://gerrit.libreoffice.org/30998
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/loolwsd/DocumentBroker.cpp b/loolwsd/DocumentBroker.cpp
index 1b35377..95fdd4d 100644
--- a/loolwsd/DocumentBroker.cpp
+++ b/loolwsd/DocumentBroker.cpp
@@ -131,9 +131,15 @@ Poco::URI DocumentBroker::sanitizeURI(const std::string& uri)
 
 std::string DocumentBroker::getDocKey(const Poco::URI& uri)
 {
-    // Keep the host as part of the key to close a potential security hole.
+    // If multiple host-names are used to access us, then
+    // they must be aliases. Permission to access aliased hosts
+    // is checked at the point of accepting incoming connections.
+    // At this point storing the hostname artificially discriminates
+    // between aliases and forces same document (when opened from
+    // alias hosts) to load as separate documents and sharing doesn't
+    // work. Worse, saving overwrites one another.
     std::string docKey;
-    Poco::URI::encode(uri.getHost() + uri.getPath(), "", docKey);
+    Poco::URI::encode(uri.getPath(), "", docKey);
     return docKey;
 }
 


More information about the Libreoffice-commits mailing list