kit/ChildSession.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
New commits: commit 2231f1c568f3ca4a24c03791880392a9665e19e1 Author: mert <mert.tu...@collabora.com> AuthorDate: Wed Jun 17 18:13:22 2020 +0300 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Thu Jun 18 16:32:14 2020 +0200 online: fix io error on saveas Change-Id: Icd91eacf2945c803660aaacb1d46d169b1f9bd86 Signed-off-by: mert <mert.tu...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96546 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Andras Timar <andras.ti...@collabora.com> diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp index d9bf41631..7e2a84e0d 100644 --- a/kit/ChildSession.cpp +++ b/kit/ChildSession.cpp @@ -2022,8 +2022,16 @@ bool ChildSession::saveAs(const char* /*buffer*/, int /*length*/, const StringVe return false; } - // TODO do we need a tempdir here? - url = std::string("file://") + JAILED_DOCUMENT_ROOT + pathSegments[pathSegments.size() - 1]; + std::string jailDoc = JAILED_DOCUMENT_ROOT; + if (NoCapsForKit) + { + jailDoc = Poco::URI(getJailedFilePath()).getPath(); + jailDoc = jailDoc.substr(0, jailDoc.find(JAILED_DOCUMENT_ROOT)) + JAILED_DOCUMENT_ROOT; + } + + const std::string tmpDir = FileUtil::createRandomDir(jailDoc); + const Poco::Path filenameParam(pathSegments[pathSegments.size() - 1]); + url = std::string("file://") + jailDoc + tmpDir + "/" + filenameParam.getFileName(); wopiFilename = wopiURL.getPath(); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits