[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - wsd/LOOLWSD.cpp

Aron Budea (via logerrit) logerrit at kemper.freedesktop.org
Thu Jun 18 12:20:38 UTC 2020


 wsd/LOOLWSD.cpp |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

New commits:
commit 5e73cf4d47b2c023f266ce5bc1c3b7df5617830b
Author:     Aron Budea <aron.budea at collabora.com>
AuthorDate: Thu Jun 18 07:27:08 2020 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Thu Jun 18 14:20:19 2020 +0200

    wsd: Don't try to resolve an accepted IP address
    
    ...and pollute the logs with warnings if it fails.
    
    Change-Id: I71828205b8d020287f5b6d0bb82feb17c2fdd2f7
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96567
    Tested-by: Jenkins
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    (cherry picked from commit c76531061e3a9e1c13c6b6484a88059e8335caa1)
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96585
    Reviewed-by: Andras Timar <andras.timar at collabora.com>

diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index 93858ad28..d15e25902 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -2208,14 +2208,17 @@ public:
                 addressToCheck = Util::trim(param);
                 try
                 {
-                    hostToCheck = Poco::Net::DNS::resolve(addressToCheck).name();
-                    allow &= allowPostFrom(addressToCheck) || StorageBase::allowedWopiHost(hostToCheck);
+                    if (!allowPostFrom(addressToCheck))
+                    {
+                        hostToCheck = Poco::Net::DNS::resolve(addressToCheck).name();
+                        allow &= StorageBase::allowedWopiHost(hostToCheck);
+                    }
                 }
                 catch (const Poco::Exception& exc)
                 {
                     LOG_WRN("Poco::Net::DNS::resolve(\"" << addressToCheck << "\") failed: " << exc.displayText());
-                    // We can't find out the hostname, check the IP only
-                    allow &= allowPostFrom(addressToCheck);
+                    // We can't find out the hostname, and it already failed the IP check
+                    allow = false;
                 }
                 if(!allow)
                 {


More information about the Libreoffice-commits mailing list