[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-cd-3-2' - common/Log.hpp wsd/LOOLWSD.cpp

Ashod Nakashian ashod.nakashian at collabora.co.uk
Thu Jul 12 14:12:10 UTC 2018


 common/Log.hpp  |    2 ++
 wsd/LOOLWSD.cpp |    4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 8338a90a7de23d25edd7ff7b60654856987452b4
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Thu Jun 28 00:47:20 2018 -0400

    wsd: allow tracing with anonymization
    
    Useful for troubleshooting and other non-prod setups.
    
    To enable, add a subnode under logging/anonymize in
    loolwsd.xml called allow_logging_pii with a boolean
    value of true:
    
    <logging>
      <anonymize>
        <allow_logging_pii>true</allow_logging_pii>
      </anonymize>
    </logging>
    
    Change-Id: If74acaac0ea442ee5a7860453182180663a5108b
    Reviewed-on: https://gerrit.libreoffice.org/56568
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/common/Log.hpp b/common/Log.hpp
index 152fea1b4..e630c5678 100644
--- a/common/Log.hpp
+++ b/common/Log.hpp
@@ -10,6 +10,8 @@
 #ifndef INCLUDED_LOG_HPP
 #define INCLUDED_LOG_HPP
 
+#include "config.h"
+
 #include <functional>
 #include <sstream>
 #include <string>
diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index aa21a6c60..6bfaa9305 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -778,7 +778,7 @@ void LOOLWSD::initialize(Application& self)
 
     if (AnonymizeFilenames || AnonymizeUsernames)
     {
-        if (LogLevel == "trace")
+        if (LogLevel == "trace" && !getConfigValue<bool>(conf, "logging.anonymize.allow_logging_pii", false))
         {
             const char failure[] = "Anonymization and trace-level logging are incompatible. "
                 "Please reduce logging level to debug or lower in loolwsd.xml to prevent leaking sensitive user data.";
@@ -793,7 +793,7 @@ void LOOLWSD::initialize(Application& self)
 
     const auto logToFile = getConfigValue<bool>(conf, "logging.file[@enable]", false);
     std::map<std::string, std::string> logProperties;
-    for (size_t i = 0; ; ++i)
+    for (std::size_t i = 0; ; ++i)
     {
         const std::string confPath = "logging.file.property[" + std::to_string(i) + "]";
         const auto confName = config().getString(confPath + "[@name]", "");


More information about the Libreoffice-commits mailing list