bgsave: warn and fail on unexpected receipt of .uno:Save.

Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I097320d8b668c1bfae9052e9edc5a4df9c7c0bcf
pull/8782/head
Michael Meeks 2024-04-16 09:46:03 +01:00 committed by Caolán McNamara
parent d968b0af63
commit 5dbe4fe02f
1 changed files with 10 additions and 1 deletions

View File

@ -539,6 +539,13 @@ bool ChildSession::_handleInput(const char *buffer, int length)
newTokens.push_back(firstLine.substr(4)); // Copy the remaining part.
return unoCommand(newTokens);
}
else if (tokens[1].find(".uno:Save") != std::string::npos)
{
LOG_ERR("Unexpected UNO Save command in client");
// save should go through path below
assert(false);
return false;
}
return unoCommand(tokens);
}
@ -549,7 +556,7 @@ bool ChildSession::_handleInput(const char *buffer, int length)
SigUtil::addActivity(getId(), (doBgSave ? "bg " : "") + firstLine);
bool autosave = tokens[1] == "autosave=true";
StringVector unoSave = StringVector::tokenize("uno .uno:Save " + tokens.cat(std::string(" "), 2));
StringVector unoSave = StringVector::tokenize("uno .uno:Save " + tokens.cat(' ', 2));
bool saving = false;
if (doBgSave && autosave)
@ -1921,6 +1928,8 @@ bool ChildSession::unoCommand(const StringVector& tokens)
tokens.equals(1, ".uno:OpenHyperlink") ||
tokens.startsWith(1, "vnd.sun.star.script:"));
LOG_TRC("uno command " << tokens[1] << " " << tokens.cat(' ', 2) << " notify: " << bNotify);
// check that internal UNO commands don't make it to the core
assert (!tokens.equals(1, ".uno:AutoSave"));