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

New commits:
commit a2809fd27277fd01d0dafdc0c4f0435fdf85db36
Author:     Ashod Nakashian <ashod.nakash...@collabora.co.uk>
AuthorDate: Thu Aug 23 21:38:01 2018 -0400
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Fri Aug 24 10:46:33 2018 +0200

    wsd: disable anonymization when allow_logging_pii=true
    
    Anonymizing is useless with trace anyway, since no
    trace log entry anonymizes, it's more useful to
    disable anonymization to help troubleshoot (which is
    the reason for enabling tracing in the first place).
    
    Change-Id: I437207e7a798c2288a5d5eb33446cb16491bfbf6
    Reviewed-on: https://gerrit.libreoffice.org/59534
    Reviewed-by: Andras Timar <andras.ti...@collabora.com>
    Tested-by: Andras Timar <andras.ti...@collabora.com>

diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index bce86d95a..404597676 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -819,16 +819,12 @@ void LOOLWSD::initialize(Application& self)
 #else
     AnonymizeUsernames = getConfigValue<bool>(conf, 
"logging.anonymize.usernames", false);
 #endif
-    if (AnonymizeUsernames)
-        setenv("LOOL_ANONYMIZE_USERNAMES", AnonymizeUsernames ? "1" : "0", 
true);
 
 #if LOOLWSD_ANONYMIZE_FILENAMES
     AnonymizeFilenames = true;
 #else
     AnonymizeFilenames = getConfigValue<bool>(conf, 
"logging.anonymize.filenames", false);
 #endif
-    if (AnonymizeFilenames)
-        setenv("LOOL_ANONYMIZE_FILENAMES", AnonymizeFilenames ? "1" : "0", 
true);
 
     if ((AnonymizeFilenames || AnonymizeUsernames) && LogLevel == "trace")
     {
@@ -836,6 +832,10 @@ void LOOLWSD::initialize(Application& self)
         {
             LOG_WRN("Enabling trace logging while anonymization is enabled due 
to logging.anonymize.allow_logging_pii setting. "
                     "This will leak personally identifiable information!");
+
+            // Disable anonymization as it's useless now.
+            AnonymizeFilenames = false;
+            AnonymizeUsernames = false;
         }
         else
         {
@@ -852,6 +852,12 @@ void LOOLWSD::initialize(Application& self)
         }
     }
 
+    if (AnonymizeFilenames)
+        setenv("LOOL_ANONYMIZE_FILENAMES", "1", true);
+
+    if (AnonymizeUsernames)
+        setenv("LOOL_ANONYMIZE_USERNAMES", "1", true);
+
     {
         std::string proto = getConfigValue<std::string>(conf, "net.proto", "");
         if (!Poco::icompare(proto, "ipv4"))
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to