Bug 117607

Summary: bugfix for commit:910ae80-'wsd: to filter clientAddress before POST action.'
Product: LibreOffice Online Reporter: safirdepo.iletisim
Component: LibreOfficeAssignee: safirdepo.iletisim
Status: RESOLVED FIXED    
Severity: normal CC: xiscofauli
Priority: medium    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
Crash report or crash signature: Regression By:
Attachments: Suggested Bugfix Patch
new suggested patch file

Description safirdepo.iletisim 2018-05-14 10:26:06 UTC
Created attachment 142089 [details]
Suggested Bugfix Patch

The bug causes problem my libreoffice online as I told with below link. 

https://ask.libreoffice.org/en/question/154511/libreoffice-online-get-request-client-address-deny/

loolwsd.xml file contains net tag before post_allow tag. But in the code it does not exist as xml file content. It causes filter in the code unable to read xml file hosts. 

Suggested patch at attactment.
Comment 1 safirdepo.iletisim 2018-05-14 12:27:52 UTC
Comment on attachment 142089 [details]
Suggested Bugfix Patch

commit 9e7c555f5cbdd019b76850404b82d654a84add0f
Author: Safir Depo <safirdepo.iletisim@tubitak.gov.tr>
Date:   Mon May 14 15:26:38 2018 +0300

    bugfix for commit:910ae80-'wsd: to filter clientAddress before POST action.'

diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index 7004cf7..4ffd8c9 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -1739,7 +1739,7 @@ public:
             // Parse the host allow settings.
             for (size_t i = 0; ; ++i)
             {
-                const std::string path = "post_allow.host[" + std::to_string(i) + "]";
+                const std::string path = "net.post_allow.host[" + std::to_string(i) + "]";
                 const auto host = app.config().getString(path, "");
                 if (!host.empty())
                 {
Comment 2 safirdepo.iletisim 2018-05-14 12:29:09 UTC
Created attachment 142090 [details]
new suggested patch file