Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid logging user content from spreadsheet cells #7177

Merged
merged 1 commit into from Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 11 additions & 1 deletion kit/Kit.cpp
Expand Up @@ -1790,7 +1790,17 @@ class Document final : public DocumentManagerInterface
}
}

const std::string abbrMessage = getAbbreviatedMessage(data, size);
std::string abbrMessage;
#ifndef BUILDING_TESTS
if (AnonymizeUserData)
{
abbrMessage = "...";
}
else
#endif
{
abbrMessage = getAbbreviatedMessage(data, size);
}
LOG_ERR("Child session [" << sessionId << "] not found to forward message: " << abbrMessage);
}
else
Expand Down
6 changes: 4 additions & 2 deletions wsd/COOLWSD.cpp
Expand Up @@ -3858,13 +3858,15 @@ class PrisonerRequestDispatcher final : public WebSocketHandler
}
else if (child && child->getPid() > 0)
{
const std::string abbreviatedMessage = COOLWSD::AnonymizeUserData ? "..." : message->abbr();
LOG_WRN("Child " << child->getPid() << " has no DocBroker to handle message: ["
<< message->abbr() << ']');
<< abbreviatedMessage << ']');
}
else
{
const std::string abbreviatedMessage = COOLWSD::AnonymizeUserData ? "..." : message->abbr();
LOG_ERR("Cannot handle message with unassociated Kit (PID " << _pid << "): ["
<< message->abbr());
<< abbreviatedMessage);
}
}

Expand Down
3 changes: 2 additions & 1 deletion wsd/DocumentBroker.cpp
Expand Up @@ -3658,7 +3658,8 @@ bool DocumentBroker::forwardToClient(const std::shared_ptr<Message>& payload)
}
else
{
LOG_WRN("Client session [" << sid << "] not found to forward message: " << payload->abbr());
const std::string abbreviatedPayload = COOLWSD::AnonymizeUserData ? "..." : payload->abbr();
LOG_WRN("Client session [" << sid << "] not found to forward message: " << abbreviatedPayload);
}
}
}
Expand Down