This requires commit 28eb367a3743002ecb1037e2dd2ca3c709f6893d
on core distro/collabora/cp-6.2
Change-Id: I02a5616810a930c6add3c3a0373b5e25e863236c
Reviewed-on: https://gerrit.libreoffice.org/80418
Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
Tested-by: Muhammet Kara <muhammet.kara@collabora.com>
It was not very useful to let this setting configurable by the user.
On the other hand, old path in config file caused issues after
upgrade. It is better to decide the location of LOKit core
during compilation. From now on the --with-lo-path configure
option is compulsory.
Change-Id: Icdcbc21bde5dad329fdb6e30ed17efde6b0e73de
Reviewed-on: https://gerrit.libreoffice.org/79943
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
The shared_ptr allows the DocumentBroker's and ConvertToBroker to linger
after they are removed from the list, making ConvertToBroker::getInstanceCount
potentially larger than the number of documents transiently. Fix this
with a dispose method called on list removal.
Also make the arithmetic signed, to avoid unfortunate wrapping.
Also when the limit is large, don't show a message whatever happens.
Change-Id: Id2571429de48ae75e851c3fdc49e24a02aaaf6e9
On some mobile devices we can start rendering
when we don't fully have all our variables
initialized. The result is that we send to WSD
'NaN' and 'Infinity' coordinates and other
values.
To avoid this, we try to check that we have downloaded
and loaded all the JS files and that we have the bare
minimal map members in valid state before we proceed
with rendering. If not, we retry with a small delay.
Change-Id: I0c57da8829a830acf4e06ff6206c73debb54bfe6
Reviewed-on: https://gerrit.libreoffice.org/79920
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Tested-by: Szymon Kłos <szymon.klos@collabora.com>
Now the wsd docbroker thread and its peer kit
thread are trivial to match, since they are called
docbroker_xxx and kitbroker_xxx (where xxx is the
instance ID) respectively.
Also, label spare kit instances as kit_spare_xxx
to differentiate from ones with actual documents,
where xxx is a running counter to differentiate
spare instances from one another.
Now we are able to easily see (and count) the number
of spare kit instances, and match wsd and kit threads
handling a given document.
Unit-test logic updated to reflect the new thread
naming scheme.
Change-Id: I154dc8f200fbe0e65f3f5984e6dad2cef1b52e22
Reviewed-on: https://gerrit.libreoffice.org/79328
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
"Session" is too generic and can be misleading.
This is really a connection ID, or a connection-session ID,
so it's more sensible to call it ConnectionId to
signify that it's a connection-specific ID.
Change-Id: I0f12b1cf80d4853a27535101093ef6b7a3e0d438
Reviewed-on: https://gerrit.libreoffice.org/79326
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
It is std::chrono::system_clock that has to_time_t.
std::chrono::steady_clock does not have to_time_t.
std::chrono::high_resolution_clock is either the same as system_clock
(in libstdc++, on Linux) or steady_clock (libc++, on iOS).
(This change does not fix the actual bugs in the code, just makes it
compile for iOS. The new ISO8601 fractional time code is not unit
tested at the moment. The testTime() function is not part of the test
suite in WhiteBoxTests.cpp. If it is made part of it, it reveals
problems in the code (and/or in the unit test code).)
Change-Id: Id33342bc8b26465632f3d21d6ec2f3c975ae3681
Reviewed-on: https://gerrit.libreoffice.org/78550
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
Clients often need to communicate with their wopi hosts when
invoking Action_Save to provide more context when storing the
document in question. Action_Save now support passing arbitrary
string as ExtendedData entry that can be used by client to
pass any context or otherwise flags to the WOPI host, which
will receive it via the X-LOOL-WOPI-ExtendedData custom header.
See reference.html for more details.
Change-Id: I1814d1f3d984a553ffa60cec13d23b014ba59eb3
Reviewed-on: https://gerrit.libreoffice.org/74135
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
There are cases when we do get client-requests
while we are about to unload and destroy
the DocBroker. This protects against the use
of partially-destroyed DocBroker (specifically,
when TileCache is already destroyed).
Change-Id: I963f2239fd62280e70b1938d3c6f653e8af91b1e
Reviewed-on: https://gerrit.libreoffice.org/74132
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
Added functions to get file timestamp and to convert
chrono timestamp in ISO8601 fraction format and some
test cases.
Change-Id: I58961a31f7262b367cff9f33cffdec7571a2f8f7
Always log cipher list, and disable any chance of fallback
to deprecated protocols.
Change-Id: Ifdfc7a3e44e98b078a36fdda6f3c813354a79e60
Reviewed-on: https://gerrit.libreoffice.org/76465
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
StorageBase::_isExitSave was uninitialized:
wsd/Storage.hpp:181:38: runtime error: load of value 190, which is not a valid value for type 'bool'
#0 0xd02260 in StorageBase::isExitSave() const /home/vmiklos/git/libreoffice/online-san/./wsd/Storage.hpp:181:38
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior wsd/Storage.hpp:181:38 in
Seen during unit-wopi-temp.
Change-Id: I3284637d411450a35680f6499e9d29c6f94aa723
wsd/LOOLWSD.cpp:1034:14: error: ‘SSLEnabled’ is not a member of ‘LOOLWSD’
wsd/LOOLWSD.cpp:1049:14: error: ‘SSLTermination’ is not a member of ‘LOOLWSD’
Change-Id: I3e81431ef56f46a844733b797b4c443a77afeb6e
Reviewed-on: https://gerrit.libreoffice.org/77850
Reviewed-by: Henry Castro <hcastro@collabora.com>
Tested-by: Henry Castro <hcastro@collabora.com>
(In the !ENABLE_SSL case.)
Possibly the SSL or not ifdeffery could be cleaned up a bit more.
Change-Id: I0c9b4e956dcd317d6622a7394044fed0c4f2d976
Reviewed-on: https://gerrit.libreoffice.org/77780
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
WSD is responsible for checking permissions,
as we do with DisableCopy and DisablePrint,
but until now we allowed saving even on
read-only documents.
The reason, it seems, was that when we failed
to save a document due to disk space, we
set documents as read-only. So presumably
we still had to allow saving, so users
preserve their latest changes when the disk
has some free space. Meanwhile, we didn't
let users make further changes. At least
this seems to be a reasonable explanation.
Unfortunately this meant that we allowed
saving when the user had no permission,
or the document was loaded as read-only.
Now we no longer mark documents that fail
to save due to disk-space limitation as
read-only, and instead expect the client
to notify the user and (possibly) block
further edits. And read-only documents,
or users without write permission, are
no longer allowed to get saved.
This change makes sure that the ctrl+s
shortcut respects the read-only flag,
while we allow clients to disable
the default handler and decide what to
do (although now they cannot force saving
when the user has no permission, something
they could do previously).
Change-Id: I16c3b75fd3e54435d750948a25afd6f71c9f963b
Reviewed-on: https://gerrit.libreoffice.org/77594
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
This new message is identical to status: except it doesn't
imply (re)connection. It's unfortunate that status: is
assumed to be sent only when establishing connection and
loading a document, so we need a different notification
that can be sent at any time, without triggering
initalization logic on the client-side.
Change-Id: I9c804119aec292b873aeed132cc32f13c030d845
Reviewed-on: https://gerrit.libreoffice.org/69634
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/71098
Better hashing algorithm based on FNV-1a.
Adds support for salting the hash, and
for providing salt via configuration.
More unit-tests added, and better formatting.
Change-Id: I2be42675d0cdbaa73c3d7faed99e07631a9c20fc
Reviewed-on: https://gerrit.libreoffice.org/70034
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/71091
This simplifies the anonymization configuration
as virtually always they are all either enabled
together, or not at all.
Change-Id: I6fe60f5287fc5d71cd7a6ac3268eac67e5e6e9fb
Reviewed-on: https://gerrit.libreoffice.org/70033
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/71090
It seems to be strongly related to HTTP things at least in error
handling. So bypass as cleanly as possible in the MOBILEAPP case for
now.
Change-Id: If9540f166293635513a3ab06371f01ad381a8cb2
There is no "host" or "server name" in the MOBILEAPP case. The
getHost() call throws an exception.
Change-Id: If950f83b2f0b9fa7ee91bf2e2194e637414bff06
Otherwise both loolwsd and unit-copy-paste.so would have a
ShutdownRequestFlag:
==13663==ERROR: AddressSanitizer: odr-violation (0x00000208f860):
[1] size=1 'ShutdownRequestFlag' ../common/SigUtil.cpp:60:19
[2] size=1 'ShutdownRequestFlag' common/SigUtil.cpp:60:19
These globals were registered at these points:
[1]:
#0 0x5f9a18 in __asan_register_globals.part.13 /home/vmiklos/git/libreoffice/lode/packages/llvm-472c6ef8b0f53061b049039f9775ab127beafbe4.src/compiler-rt/lib/asan/asan_globals.cc:365
#1 0x7f9b903f1d0b in asan.module_ctor (/home/vmiklos/git/libreoffice/online-san/test/../test/.libs/unit-copy-paste.so+0x60ad0b)
[2]:
#0 0x5f9a18 in __asan_register_globals.part.13 /home/vmiklos/git/libreoffice/lode/packages/llvm-472c6ef8b0f53061b049039f9775ab127beafbe4.src/compiler-rt/lib/asan/asan_globals.cc:365
#1 0xe2b9fe in asan.module_ctor (/home/vmiklos/git/libreoffice/online-san/loolwsd+0xe2b9fe)
Change-Id: I247760325f804813249e814dbb4576493619dee7
Otherwise both loolwsd and unit-copy-paste.so would have a
DumpGlobalState:
==5783==ERROR: AddressSanitizer: odr-violation (0x00000208f7a0):
[1] size=1 'DumpGlobalState' ../common/SigUtil.cpp:49:19
[2] size=1 'DumpGlobalState' common/SigUtil.cpp:49:19
These globals were registered at these points:
[1]:
#0 0x5f9a08 in __asan_register_globals.part.13 /home/vmiklos/git/libreoffice/lode/packages/llvm-472c6ef8b0f53061b049039f9775ab127beafbe4.src/compiler-rt/lib/asan/asan_globals.cc:365
#1 0x7f5c5edf1c9b in asan.module_ctor (/home/vmiklos/git/libreoffice/online-san/test/../test/.libs/unit-copy-paste.so+0x60ac9b)
[2]:
#0 0x5f9a08 in __asan_register_globals.part.13 /home/vmiklos/git/libreoffice/lode/packages/llvm-472c6ef8b0f53061b049039f9775ab127beafbe4.src/compiler-rt/lib/asan/asan_globals.cc:365
#1 0xe2b98e in asan.module_ctor (/home/vmiklos/git/libreoffice/online-san/loolwsd+0xe2b98e)
Change-Id: I4b7b0238eb9b38a30875e8788c1dcb27f1d1643f
Otherwise both loolwsd and unit-copy-paste.so would have a
TerminationFlag:
==11732==ERROR: AddressSanitizer: odr-violation (0x00000208f4a0):
[1] size=1 'TerminationFlag' ../common/SigUtil.cpp:41:19
[2] size=1 'TerminationFlag' common/SigUtil.cpp:41:19
These globals were registered at these points:
[1]:
#0 0x5f9988 in __asan_register_globals.part.13 /home/vmiklos/git/libreoffice/lode/packages/llvm-472c6ef8b0f53061b049039f9775ab127beafbe4.src/compiler-rt/lib/asan/asan_globals.cc:365
#1 0x7f5df9cf18cb in asan.module_ctor (/home/vmiklos/git/libreoffice/online-san/test/../test/.libs/unit-copy-paste.so+0x60a8cb)
[2]:
#0 0x5f9988 in __asan_register_globals.part.13 /home/vmiklos/git/libreoffice/lode/packages/llvm-472c6ef8b0f53061b049039f9775ab127beafbe4.src/compiler-rt/lib/asan/asan_globals.cc:365
#1 0xe2b4fe in asan.module_ctor (/home/vmiklos/git/libreoffice/online-san/loolwsd+0xe2b4fe)
Change-Id: Ic620b143ecb77699f40676ff39d0fa7abceb34d5
We can have un-processed incoming mesages in transit after a local
transition to WAIT_DISCONNECT including some that change state.
Change-Id: I577aebbc0a6ecca695f4bc35b4d226e1a465817d
While we don't send the clipboard key
to the client during the construction
of ClientSession, we do so upon handshake
(loolclient message), and by then our state
is no longer DETACHED, rather it is LOADING.
This restores copy/paste across documents.
Change-Id: I0db50210f232afa05b1273edeb2cc163fd07c504
re-factor ClientSession state to be a simpler state machine.
Have a nice disconnect / disconnected handshake on view close.
Change-Id: Ie933cc5c7dfab46c66f4d38a4d75c459aa1cff87