summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2020-12-13 22:06:17 -0500
committerAshod Nakashian <ashod.nakashian@collabora.co.uk>2020-12-15 09:18:06 -0500
commitaee07ebe93e60d21c18fc8c3dce416583fa27866 (patch)
treeda4e08351d29c8f117e3825b2b3f10c8a5feed99
parentwsd: jail: Child-Root and Jail tree cleanup (diff)
downloadonline-private/ash/jail_template.tar.gz
online-private/ash/jail_template.zip
wsd: logs and const private/ash/jail_template
Change-Id: Id7e4f81ab9709b62eddfa747479ab593a5ad45a2 Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
-rw-r--r--common/JailUtil.cpp10
-rw-r--r--kit/ForKit.cpp3
-rw-r--r--kit/Kit.cpp3
-rw-r--r--test/UnitSession.cpp4
-rw-r--r--wsd/DocumentBroker.cpp6
-rw-r--r--wsd/LOOLWSD.cpp2
6 files changed, 18 insertions, 10 deletions
diff --git a/common/JailUtil.cpp b/common/JailUtil.cpp
index 50506646cb..d4ead301b6 100644
--- a/common/JailUtil.cpp
+++ b/common/JailUtil.cpp
@@ -250,7 +250,7 @@ public:
source = std::move(resolved);
}
- LOG_INF("linkOrCopy " << linkOrCopyTypeString(type) << " from [" << source << "] to ["
+ LOG_DBG("linkOrCopy " << linkOrCopyTypeString(type) << " from [" << source << "] to ["
<< destination << "].");
Type = type;
@@ -304,6 +304,7 @@ bool loolmount(const std::string& arg, std::string source, std::string target)
bool bind(const std::string& source, const std::string& target)
{
+ LOG_DBG("Mounting [" << source << "] -> [" << target << "].");
Poco::File(target).createDirectory();
const bool res = loolmount("-b", source, target);
if (res)
@@ -315,6 +316,7 @@ bool bind(const std::string& source, const std::string& target)
bool remountReadonly(const std::string& source, const std::string& target)
{
+ LOG_DBG("Remounting [" << source << "] -> [" << target << "].");
Poco::File(target).createDirectory();
const bool res = loolmount("-r", source, target);
if (res)
@@ -326,12 +328,12 @@ bool remountReadonly(const std::string& source, const std::string& target)
bool unmount(const std::string& target)
{
- LOG_DBG("Unmounting [" << target << "].");
+ LOG_DBG("Unmounting [" << target << ']');
const bool res = loolmount("-u", "", target);
if (res)
LOG_TRC("Unmounted [" << target << "] successfully.");
else
- LOG_ERR("Failed to unmount [" << target << "].");
+ LOG_ERR("Failed to unmount [" << target << ']');
return res;
}
@@ -718,7 +720,7 @@ bool updateDynamicFilesImpl(const std::string& sysTemplate)
// Is it outdated?
if (dstStat.isUpToDate(srcStat))
{
- LOG_INF("File [" << dstFilename << "] is already up-to-date.");
+ LOG_DBG("File [" << dstFilename << "] is already up-to-date.");
continue;
}
diff --git a/kit/ForKit.cpp b/kit/ForKit.cpp
index c3442b75d8..cc1999b3a3 100644
--- a/kit/ForKit.cpp
+++ b/kit/ForKit.cpp
@@ -347,7 +347,8 @@ static int createLibreOfficeKit(const std::string& childRoot, bool queryVersion
// Used to label the spare kit instances
static size_t spareKitId = 0;
++spareKitId;
- LOG_DBG("Forking a loolkit process with jailId: " << jailId << " as spare loolkit #" << spareKitId << '.');
+ LOG_DBG("Forking a loolkit process with jailId: " << jailId << " as spare loolkit #"
+ << spareKitId << '.');
const pid_t pid = fork();
if (!pid)
diff --git a/kit/Kit.cpp b/kit/Kit.cpp
index e532bb32d0..ae842088ea 100644
--- a/kit/Kit.cpp
+++ b/kit/Kit.cpp
@@ -212,7 +212,6 @@ public:
_obfuscatedFileId(Util::getFilenameFromURL(docKey)),
_tileQueue(std::move(tileQueue)),
_websocketHandler(websocketHandler),
- _docPassword(""),
_haveDocPassword(false),
_isDocPasswordProtected(false),
_docPasswordType(PasswordType::ToView),
@@ -1879,7 +1878,7 @@ void lokit_main(
assert(!childRoot.empty());
- LOG_DBG("Process started.");
+ LOG_DBG("Kit process [" << jailId << "] started.");
std::string userdir_url;
std::string instdir_path;
diff --git a/test/UnitSession.cpp b/test/UnitSession.cpp
index 4d62385ad6..6529c16154 100644
--- a/test/UnitSession.cpp
+++ b/test/UnitSession.cpp
@@ -61,6 +61,8 @@ public:
UnitBase::TestResult UnitSession::testBadRequest()
{
+ const char* testname = "badrequest ";
+ TST_LOG("Starting Test: " << testname);
try
{
// Try to load a bogus url.
@@ -92,6 +94,7 @@ UnitBase::TestResult UnitSession::testBadRequest()
UnitBase::TestResult UnitSession::testHandshake()
{
const char* testname = "handshake ";
+ TST_LOG("Starting Test: " << testname);
try
{
std::string documentPath, documentURL;
@@ -159,6 +162,7 @@ UnitBase::TestResult UnitSession::testHandshake()
UnitBase::TestResult UnitSession::testSlideShow()
{
const char* testname = "slideshow ";
+ TST_LOG("Starting Test: " << testname);
try
{
// Load a document
diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index 646af8d894..ba2d783802 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -26,6 +26,7 @@
#include "Admin.hpp"
#include "ClientSession.hpp"
#include "Exceptions.hpp"
+#include "JailUtil.hpp"
#include "LOOLWSD.hpp"
#include "SenderQueue.hpp"
#include "Storage.hpp"
@@ -561,7 +562,8 @@ bool DocumentBroker::load(const std::shared_ptr<ClientSession>& session, const s
const std::string sessionId = session->getId();
- LOG_INF("Loading [" << _docKey << "] for session [" << sessionId << "] and jail [" << jailId << "].");
+ LOG_INF("Loading [" << _docKey << "] for session [" << sessionId << "] in jail [" << jailId
+ << ']');
{
bool result;
@@ -583,7 +585,7 @@ bool DocumentBroker::load(const std::shared_ptr<ClientSession>& session, const s
// user/doc/jailId
const Poco::Path jailPath(JAILED_DOCUMENT_ROOT, jailId);
- std::string jailRoot = getJailRoot();
+ const std::string jailRoot = getJailRoot();
LOG_INF("jailPath: " << jailPath.toString() << ", jailRoot: " << jailRoot);
diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index 2c550684e5..abc8ed0e4f 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -3135,7 +3135,7 @@ private:
{
LOG_INF("HTTP request for: " << filePathAnonym);
- std::string fileName = filePath.getFileName();
+ const std::string& fileName = filePath.getFileName();
const Poco::URI postRequestUri(request.getURI());
const Poco::URI::QueryParameters postRequestQueryParams = postRequestUri.getQueryParameters();