[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-2-1' - kit/ForKit.cpp kit/Kit.cpp

Ashod Nakashian ashod.nakashian at collabora.co.uk
Mon Jul 31 21:07:30 UTC 2017


 kit/ForKit.cpp |   12 ++++++++++++
 kit/Kit.cpp    |   10 +++++++++-
 2 files changed, 21 insertions(+), 1 deletion(-)

New commits:
commit 82d26ce5aa7b4c61609f89971b7e3222c130cd6c
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Sun Jun 11 11:54:46 2017 -0400

    wsd: new internal command to change config values
    
    Change-Id: I8b4a573ba7b01ee6e7b3b91a00e12cc744f85fa8
    Reviewed-on: https://gerrit.libreoffice.org/38676
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>
    (cherry picked from commit 36fb1e64f0b707420ed9cc775af8b10767375746)
    Reviewed-on: https://gerrit.libreoffice.org/38761
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/kit/ForKit.cpp b/kit/ForKit.cpp
index 9aa83a20..ed3d2f2a 100644
--- a/kit/ForKit.cpp
+++ b/kit/ForKit.cpp
@@ -111,6 +111,18 @@ public:
                     LOG_WRN("Cannot spawn " << tokens[1] << " children as requested.");
                 }
             }
+            else if (tokens.size() == 3 && tokens[0] == "setconfig")
+            {
+                // Currently onlly rlimit entries are supported.
+                if (!Seccomp::handleSetrlimitCommand(tokens))
+                {
+                    LOG_ERR("Unknown setconfig command: " << message);
+                }
+            }
+            else
+            {
+                LOG_ERR("Unknown command: " << message);
+            }
         }
         catch (const std::exception& exc)
         {
diff --git a/kit/Kit.cpp b/kit/Kit.cpp
index e6c56b5e..b445c31f 100644
--- a/kit/Kit.cpp
+++ b/kit/Kit.cpp
@@ -1831,7 +1831,7 @@ void lokit_main(const std::string& childRoot,
 #endif
 
                     LOG_DBG(socketName << ": recv [" << LOOLProtocol::getAbbreviatedMessage(message) << "].");
-                    StringTokenizer tokens(message, " ", StringTokenizer::TOK_IGNORE_EMPTY | StringTokenizer::TOK_TRIM);
+                    std::vector<std::string> tokens = LOOLProtocol::tokenize(message);
 
                     // Note: Syntax or parsing errors here are unexpected and fatal.
                     if (TerminationFlag)
@@ -1877,6 +1877,14 @@ void lokit_main(const std::string& childRoot,
                             LOG_WRN("No document while processing " << tokens[0] << " request.");
                         }
                     }
+                    else if (tokens.size() == 3 && tokens[0] == "setconfig")
+                    {
+                        // Currently onlly rlimit entries are supported.
+                        if (!Seccomp::handleSetrlimitCommand(tokens))
+                        {
+                            LOG_ERR("Unknown setconfig command: " << message);
+                        }
+                    }
                     else
                     {
                         LOG_ERR("Bad or unknown token [" << tokens[0] << "]");


More information about the Libreoffice-commits mailing list