This adds a new config option to enable/disable
experimental features and behavior. The default
value can be controlled at build time by
--enable-experimental.
Change-Id: Iffcb4c71d9e0933a646251b63033b6dadcd3b809
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Reproduction:
Opening a password protected document gives an error corresponding to
'faileddocloading' and then a blank file is displayed.
Fix:
Since 0b76383346, when Document::load()
fails without any exception, onLoad() sends
"error: cmd=load kind=faileddocloading"
to the client. This is a problem when load() fails just because the
client did not provide password for a password protected document.
Besides for all "exception free cases" load() already sends the correct
error message(s) to the client. So this patch also avoids sending
duplicate error messages.
Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: I422740ab8855ed772461c23f42a5443afb729bb5
And avoid pid of 0 in getKitPids().
Change-Id: I68743a55aed080ed54d7d8576f269974c644e1b2
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
The buffer and length parameters were unused in methods in ChildSession.
Signed-off-by: Kristopher Maxwell <kristophermaxwellc@gmail.com>
Change-Id: I6aff3c92a5d787db84bbe64aa13f2f0160340f7f
This prevents the kit from becoming a zombie
when it has an early failure to connect to WSD.
Change-Id: I4e8203b2cc3d80822308236e5b47be0c0c96e9ae
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This may happen due to various reasons and
is most commonly observed during heavy testing.
We now detect when our parent has exited and
we exit forkit as well, since otherwise it
would be a zombie consuming resources.
Change-Id: I71de0315fe7bee419a9e7d0b564630ff75ae15eb
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
With --unattended, do not wait for a debugger
upon seg-faulting. This avoids the unnecessary wait
that prolongs failed unit-tests in automated runs.
Now run_unit.sh and Cypress Makefile set this flag.
Note that the wait only happens when in debug
builds, or when envar COOL_DEBUG is set. This
prevents us from waiting when running a debug
build where we can't see the output, or indeed
the run is on a CI build machine.
This flag can also be used by devs when reproducing
failures where there is no interest in attaching
a debugger. The logs are shorter and more
readable, too. At least in trace level.
Change-Id: Ice15482c6724abc47f5955402295198eb7f671ee
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
This reduces some logs from debug to trace,
especially in Socket where the amount of
activity is high, but the logs in question
don't add value in debug level.
Also supressed an error when superfluous.
This makes debug-level logs much more readable
and relevant to the main events.
Change-Id: Ie2698b56f320d15a09060cf2877477d9da0e1582
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
after switching to master view previews would remain unchanged
this patch will invalidate tiles for all the previews
Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: Ie7320d625bd95fe80fc76a459b576d6148b39276
The modified status is normally broadcast to all
views. This works fine, except with async disonnection.
With two views, one inactive, if we disconnect both,
we cannot know which disconnection will be processed
first. Depending on the order, the second one
will be used for saving. If it is the inactive user,
we will never see that the document has been saved
successfully, because we would have the modified
flag set to true and the message that updates
it to false (after saving) will be dropped.
This scenario was reproducible fairly reliably
in HTTPWSTest::testSaveOnDisconnect.
Here we make sure that we pass-through the
ModifiedStatus for inactive users as well,
since this flag is used for housekeeping.
Change-Id: Iac9ac5ee5f4bc4035587c8e34a756cddb5bddb9f
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
(cherry picked from commit ff32851738d4412e4a6e2de5380c17647b1a6fcc)
Based on previous crashes, it is useful to have more granularity
on what happened last.
Change-Id: If18a3a4d7817be23a6f8aadd301827a8e1bc007e
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
This is too restrictive security measure, so turn it off for now.
Signed-off-by: Gleb Popov <6yearold@gmail.com>
Change-Id: I6f158ed4ed77f6508c9effbad5307d43e9e5461b
The path of the NSS certdb is defined in the coolwsd.xml config
file and if the config file is set and contains the certdb files,
then the db files are copied to the jail into /tmp/certdb folder.
Also the /tmp/certdb path is set to LO_CERTIFICATE_DATABASE_PATH
env. var, which is then used as the default certdb in LibreOffice
when LOKit starts up.
Signed-off-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>
Change-Id: I72e8f28f27a0306fef9319bc6212cd99cb3f8212
Problem is, all save-as requests received urlencoded
but when it is a wopi request we change the url bit of the message
with correct path jail filename parts. At that stage it becomes decoded
already. saveAs in the core also decodes the url and thats why we should
re-encode it. But unless it is a wopi request it should be already
encoded and we should not re-encode it again.
Signed-off-by: Mert Tumer <mert.tumer@collabora.com>
Change-Id: I08b3a1cff6c3aa9271222c255f4a35aa5b984819
Appearently core expects encoded path for filenames on saveas
and decodes it at the end.
So if the file name is something like a%20b
and it becomes a b in the storage.
Signed-off-by: Mert Tumer <mert.tumer@collabora.com>
Change-Id: Ib200c92859b4ab3f262cfe88747563c42e2c6a5c
removed support for parameter "type" which is no longer sent with textinput
Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I97bb7e80fe9cc3bb0768fd37b0c15983310a538c
Core needs "notebookbar" ui mode string to activate
notebookbar widgets. If we pass "default" notebookbar
is not activated and style previews widget doesn't work.
followup for b4f588ea3c
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I758dee279c6da8b3fd41e5121f2eb2336539f327
With --with-sanitizer=address, a number of variables
get flagged as 'potentially uninitialized.
There are only a handful of these, so fixed.
Change-Id: I7ffc78b8cfd152a56ed81d97b5cd3660ce5b16b6
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
jail-id is already used a sub-directory of each tmp dir,
so there is no more "information leak" in making the tmp directory name itself match the jail-id
further naming it with jail id helps in referencing that directory for hard linking when quarantining a file
Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: Iaa635f44d1cd99571a9571113ce1cc92e203fddb
This prevents additional strings from being allocated.
Signed-off-by: Hugo Peixoto <hugo.peixoto@gmail.com>
Change-Id: I84b1e5cf4d11bf8512febe068b3097770b63dc5c
There was a pattern of calling Util::startsWith on StringVector
elements:
- Util::startsWith(tokens[0], "boo")
- Util::startsWith(tokens.getParam(token), "boo")
These two expressions would cause a new string to be allocated and
immediately released. To optimize this, a StringVector::startsWith
method is introduced.
This method works by calling compare directly on the underlying
StringVector string, avoiding creating a temporary string.
Signed-off-by: Hugo Peixoto <hugo.peixoto@gmail.com>
Change-Id: I6f27d5bb13783f39c7d4ce0644a11e57b0071244
This should take care e.g. for SharePoint user IDs, which have the
form of "domain\username", and the backslash must be escaped.
Signed-off-by: Mike Kaganski <mike.kaganski@collabora.com>
Change-Id: I75936070ad1661dc9b03e05a19b64159b0758018
Unfortunately the sequence message sent
from LO core is important, and the status
indicator finish should arrive to client side
before any dialog interactivity (i.e. Macros Warning Dialog).
However the LO core sends like 3 times status
finish for now we cannot duplicate them.
Change-Id: Ieee2ee93555b50b0e67507aae36096e10728a038
Signed-off-by: Henry Castro <hcastro@collabora.com>
This adds a new service render-search-result, which renders an
image of the position where, the search fund a hit. The search
result contains the information in which object or paragraph,
which is just the node id and node type from the document model.
The service takes the document and the search result (xml file)
as the input and returns a PNG image as the output.
Signed-off-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>
Change-Id: Iffc158c5b0a3c9a63f8d05830314c9bc1616b3b1
Signed-off-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>
Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: I12660822829c874179ccffd84dcdd33f5dde27e3
(cherry picked from commit 5a1c42c4e610a9265dfe3527c964413f029060ae)
Conflicts:
loleaflet/src/layer/tile/TileLayer.js
Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: Ief814741df4818000cef7499a8b1c9c1ce1f4371
(cherry picked from commit bfed92dffecc3b574f24920733c74565fb1ae29c)
When building against core.git master:
kit/ChildSession.cpp:2668:13: error: enumeration value 'LOK_CALLBACK_SC_FOLLOW_JUMP' not handled in switch [-Werror,-Wswitch]
It's not clear how we want to handle this in Online, so have a default
label in debug builds as well.
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Ia0b1cef33e8a5a7fbc1518586ea1e3bb13aa5f22
Normally (ideally), tiles (.bmp files) are removed as soon as the JS
has displayed them. But occasionally something goes wrong and they are
left behind. (For instance, it seems to happen if the user closes the
document immediately when it shows up.)
Do not leave them on disk until the app starts the next time.
Change-Id: I0c764280a69a16ad3b7b67c329832fd5331c2e1e
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Remove the app's copy of the document after core has saved it and we
have stored the edited version at its real location.
Remove possible leftover tile bitmaps when the app starts.
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: Ibc41be38c2cfb689c532640d148116bc06a248ab