Commit graph

1346 commits

Author SHA1 Message Date
Gabriel Masei
3046c5748b Fix removal of kit procs when they are blocked
Change-Id: Ifa2a2a56a305e33bb07ad622fce14f0e8b3e83eb
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88464
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2020-02-12 16:28:10 +01:00
Michael Meeks
39311fdae3 remove poco Environment call.
Change-Id: I967a42aa3b8a3b9fc44b3dffedef98adc4b94724
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88198
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2020-02-07 16:39:55 +01:00
Mike Kaganski
2504c88c43 Don't use Poco buffer when creating a proof
I need this to better control the byte order of values in the proof

Change-Id: I8a21c20af4cc3157c893d870f73cc2afa7910ff4
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88076
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-02-06 20:21:31 +01:00
Mike Kaganski
aaa9443eae Only warn on absent proof RSA key, don't log error
This reimplements commit bfb16d8831

Change-Id: I834a45ba4fcb939093b179f316176df790926c4e
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88096
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2020-02-06 16:05:40 +01:00
Marco Cecchetti
a46fa588b1 calc: formula input bar: adding support for text selection handles
Change-Id: I6bc276945a7fd33f1358a3aa82ce0e7f45237771
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88090
Reviewed-by: Marco Cecchetti <marco.cecchetti@collabora.com>
Tested-by: Marco Cecchetti <marco.cecchetti@collabora.com>
2020-02-06 15:58:36 +01:00
Mike Kaganski
bfb16d8831 Turn some errors to warnings, and drop unneeded stderr output
Change-Id: I63de580480f983e8179546fae6217641fa370135
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88088
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2020-02-06 12:36:55 +01:00
Jan Holesovsky
ad32888d7c mobile: Unify the mutex usage that protects the main lokit thread.
Effectively both approaches were doing the same thing, let's unify to
the iOS way to minimize the platform-specific code.

Change-Id: I11290410a536c26db054ffcb87e3b64cc2a11c07
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/84589
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2020-02-06 09:44:26 +01:00
Andras Timar
4fa8e4ee83 typo: shuting -> shutting
Change-Id: Ia33113b0c624b60479f41c8580e9b3d8d17812f4
2020-02-05 14:47:25 +01:00
Ashod Nakashian
da0f3a950a wsd: per-user cookies
Cookies may be passed from the client to the storage,
in which case each user may have its own unique set
of cookies. These cookies are now preserved in the
ClientSession, which is per connection, and are then
passed to the storage to use when communicating with
the WOPI-like backend.

(cherry picked from commit 6022faf3cc9b622b490c3f8ca91efbff8e542414)

Change-Id: Ic2e13fa541a5ee01b7383939bbbf7d46ea75684b
2020-01-28 18:10:14 +01:00
Miklos Vajna
6add8295bf test: remove documentation about no longer working CPPUNIT_TEST_NAME variant
This is not needed, the commandline to run the test is printed on
failure.

Change-Id: Ia4da4344ede4ad8c1627a5560f1bc1264f4203c7
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/87288
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2020-01-24 00:09:34 +01:00
Miklos Vajna
9f91b01633 wsd: fix Android build
Don't just rename the variable, also make sure we get the FD before we
reset our local reference to it.

Change-Id: I676f148874831eaf9f37bdcde1216c58f89229e5
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/87244
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Miklos Vajna <vmiklos@collabora.com>
2020-01-23 11:18:46 +01:00
Michael Meeks
c9cfde6d72 wsd: use port number after, rather than before allocating it.
Particularly printing it on the console, and passing it to the kit.

Change-Id: I158f97b7b219c44c885939d71af2e5e8283be4c2
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/87227
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2020-01-23 00:39:19 +01:00
Pranam Lashkari
a019c93d90 Resolved: Server crash when link opened in new tab
When trying to open a link normally from help->Online help
nothing happens but the popup is closed.

When trying to open a like forcefully in new tab
from help->online help it crashes the server.

Change-Id: I7e0944ebe521002625a84e155e379ed7e25d2309
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/85466
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2020-01-22 23:23:51 +01:00
Miklos Vajna
9a92cd2415 Fix an UB in the DocumentBroker dtor
The problem is that both the DocBrokers map and the instance returned by
Admin::instance() are static, so there it's not safe to assume that by
the time the DocumentBroker dtor runs, the static Admin instance is
still alive. Still, the DocumentBroker dtor calls Admin::instance().

Fix this by clearing the DocBrokers map in LOOLWSD::cleanup(), which is
used exactly to destroy statics in a controlled order.

Sanitizers output was:

wsd/DocumentBroker.cpp:497:23: runtime error: member call on address 0x0000024a5ba0 which does not point to an object of type 'Admin'
0x0000024a5ba0: note: object is of type 'SocketPoll'
 00 00 00 00  50 21 45 01 00 00 00 00  b8 5b 4a 02 00 00 00 00  05 00 00 00 00 00 00 00  61 64 6d 69
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'SocketPoll'
    #0 0xa10af3 in DocumentBroker::~DocumentBroker() wsd/DocumentBroker.cpp:497:23
...
    #17 0x7fa27622ddc9 in exit (/lib64/libc.so.6+0x38dc9)
    #18 0x7fa276215f90 in __libc_start_main (/lib64/libc.so.6+0x20f90)
    #19 0x670189 in _start /home/abuild/rpmbuild/BUILD/glibc-2.26/csu/../sysdeps/x86_64/start.S:120

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior wsd/DocumentBroker.cpp:497:23 in

(Seen during make check CPPUNIT_TEST_NAME="unit-each-view".)

Change-Id: I02ad44deb9de06d9973216428c640248ea2512ce
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/87174
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-01-22 09:19:05 +01:00
Mike Kaganski
0c0510cccf Implement proper proof-key value attribute
Change-Id: I3f2ad960ce6d3dad4d0b064492355b5643f345c8
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/87148
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2020-01-21 19:28:32 +01:00
Miklos Vajna
a6af954b62 wsd: fix a typo in JWTAuth::cleanup()
Change-Id: I2c88403de12e2011746964b05a0c7e239dcbfd1b
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/87151
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-01-21 17:39:09 +01:00
Michael Meeks
9126a641a9 test: switch to using ClientPortNumber to allow parallelism.
Change-Id: Ifef3bce1b217605000300b240ea74df4d264e0df
2020-01-21 15:07:54 +00:00
Michael Meeks
8f91659ae0 test: dung out redundant LOOL_TEST_CLIENT_PORT.
And cleanup other related oddities.

Change-Id: I2d179a2ece6a8553e10e406ad4e5da08a2ff58e5
2020-01-21 15:07:54 +00:00
Michael Meeks
9dfac6dab1 test: switch to parallel tests based on Unit framework.
Increase a few timeouts, bin old-style standalone unit tests,
fix a number of bugs.

Change-Id: Ia3d59466ecb9a9443807ba3445d04dd5f77e3dba
2020-01-21 15:07:54 +00:00
Michael Meeks
0599db3576 copyFile: de-poco-ize and handle EINTR and short writes.
Change-Id: I2046881c786a9f31f45c53f282de9ddd9a9cebcf
2020-01-21 15:07:54 +00:00
Michael Meeks
aadf5af77b reduce verbosity of FileServer trace logging.
Change-Id: I5a57e91742be504bcb2e51b45f6890420e52bb91
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/87134
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2020-01-21 14:39:21 +01:00
Miklos Vajna
2c9e1319d9 Fix a -Werror,-Wrange-loop-analysis warning
wsd/Storage.cpp:451:21: error: loop variable 'header' of type 'const std::pair<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >' creates a copy from type 'const std::pair<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >' [-Werror,-Wrange-loop-analysis]

Change-Id: I90a57333b0807f3457d5b1082097426a3bf9678d
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/87055
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-01-20 10:08:09 +01:00
Michael Meeks
e6a3364e93 Move file url anonymization down from LOOLWSD into FileUtil.
Change-Id: I415c73b10621d5c7c942367bbf38a3bbd9bf8f27
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/87024
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2020-01-18 20:05:35 +01:00
Michael Meeks
8cca6dcac8 Cleanup JWTAuth token before shutdown.
valgrind had some exciting double-free action on unclean shutdown.

Change-Id: Id7dd3d8ff60387ae51521bd2c74e4d6bcc30ff2e
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/87025
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2020-01-18 19:26:10 +01:00
Michael Meeks
1c754d5b11 Revert "Serve a decidedly unpretty clipboard download page"
This reverts parts of commit da455c486a.

Unfinished; also stream size calculation cannot have worked.

Change-Id: I39635fe5165b82dd36095d58cfefff4920ce3a35
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/86845
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2020-01-16 17:21:38 +01:00
Michael Meeks
6305cc70fa postMessage tests - advertise them, and do some cleaning.
Set the iframe's src in a script so we can pass on a filename cleanly.
add a postMessage: sample URI at the end of 'make run'
Move some of the more obvious pieces into framed.doc.html.

Change-Id: I2bd8215f083bcb16369421ed88acb198808c1fdb
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/86787
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2020-01-15 11:01:41 +01:00
Michael Meeks
b5f58fbe8c postMessage CSS checking improvements.
Ironically our attempts to double-check message origin against our
parent was blowing a security exception.

Instead send the list of origins we will accept from WSD, and
check them ourselves (as well as the browser check).

Why make it so hard to check that a postMessage comes from an
ancestor frame ?

Change-Id: I1311be3e1d68a31cfdc96b45a5eb5dd7f26e7ea9
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/86788
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Alexandru Vlăduţu <alexandru.vladutu@1and1.ro>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2020-01-15 10:56:27 +01:00
Jan Holesovsky
0a35e432ff android: When the mobile-wizard is open, the Back button should go a level up.
Without this, we were closing the document, which was very annoying.

Change-Id: I1e841da28c92c0e01284c2d7e2d4dbc6762bfffd
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/86779
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2020-01-14 17:44:28 +01:00
Ashod Nakashian
af58a9e761 wsd: whitespace
Change-Id: Id8185dab66f95676be2db8908d0f12c5284174fb
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/86321
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2020-01-07 11:47:04 +01:00
Michael Meeks
9cef0f385d watermarking: create SessionMap template to canonicalize views.
Use a fully reliable uniqueness check, rather than a hash, and get
simpler ids as a bonus. Fetch view data from the session itself
rather than passing it in too.

Change-Id: Ibcd625156b5a98eb280e35d6537b5c8c026d0197
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/86150
Reviewed-by: Mert Tümer <mert.tumer@collabora.com>
Tested-by: Mert Tümer <mert.tumer@collabora.com>
2020-01-06 13:52:29 +01:00
Marco Cecchetti
35831935d8 wsd: disable unsupported code on mobile
Change-Id: I5d51a536e32bdf3262f3d39dda8ddb3152fa4460
Reviewed-on: https://gerrit.libreoffice.org/85633
Reviewed-by: Marco Cecchetti <marco.cecchetti@collabora.com>
Tested-by: Marco Cecchetti <marco.cecchetti@collabora.com>
2019-12-20 20:32:42 +01:00
Henry Castro
9290981013 wsd: debug: add env variable "PAUSEFORDEBUGGER" to attach debugger
It is painful to check and search manually the PID to attach the LOKit
process when exists several pre-spawned waiting to load a document.

This patch helps to attach the debugger when the LOKit process is about
to load a document then send the "signal SIGUSR1" to resume it.

Change-Id: I3b15bd522c6ef3ef57dc3453b457dcf91f2661b9
Reviewed-on: https://gerrit.libreoffice.org/85430
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Henry Castro <hcastro@collabora.com>
Reviewed-by: Henry Castro <hcastro@collabora.com>
2019-12-20 19:57:47 +01:00
Miklos Vajna
d0fee8c6ad These can be made const
Change-Id: I952a7566176bda727f8c2e9618d41bfb7bb1240f
Reviewed-on: https://gerrit.libreoffice.org/85197
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-12-16 09:24:08 +01:00
Michael Meeks
5d5fb42715 Typo fix.
Change-Id: I4698a00a8646366bcf30aabd997c31996a58d0e0
2019-12-14 16:19:48 +00:00
Andras Timar
97ee22a8ff fix error: declaration of ‘load’ shadows a member of 'this' [-Werror=shadow]
Change-Id: I4bd4fb3ae6f01c0d03d622f90e1dfb872c396494
2019-12-13 16:05:52 +01:00
Jan Holesovsky
863111c952 mobile: Fix build.
Change-Id: Ie0f08a984b9333ca65d0fd52c71e358b7fd5f771
Reviewed-on: https://gerrit.libreoffice.org/85018
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2019-12-12 09:57:44 +01:00
Michael Meeks
948b424abb convert-to: wait for load to complete before attempting the save.
Change-Id: Iee3a8a6720bbc29fc4e113bf705f405b840e1e45
Reviewed-on: https://gerrit.libreoffice.org/85009
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2019-12-12 07:42:42 +01:00
Michael Meeks
83e02ab38b Add a time limit for badly behaved / huge document conversions.
Handles problems with load, save, and lingering DocumentBrokers.

Change-Id: I6079cba3a4fa2a84c303b3a8669d94863a04f474
2019-12-12 03:38:50 +00:00
Jan Holesovsky
f71522e7ff TemplateSaveAs is broken by design, let's disable it.
Change-Id: I67a4c6aed1c66a8350f2b938fff7bcf1dfd84768
Reviewed-on: https://gerrit.libreoffice.org/84740
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2019-12-10 16:25:47 +01:00
Miklos Vajna
b580a1eaf2 wsd: fix a typo
And disable a test that passes for me locally but fails on Jenkins.

Change-Id: Ifcdcedbac259247d784ce66185f95bfbe634381f
Reviewed-on: https://gerrit.libreoffice.org/84603
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-12-06 12:12:43 +01:00
Ashod Nakashian
86a80a4cca wsd: handle http forbidden response from wopi put
Change-Id: I597e949cd1bea612400d623f30ea260036253e89
Reviewed-on: https://gerrit.libreoffice.org/84360
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2019-12-03 16:02:16 +01:00
Marco Cecchetti
836ce7d636 formula bar: function complete
lok clients can request to complete a function name partially typed in
the formula input box.

Change-Id: If8e4485c5ed9f91a594dfcec04e0c0b10becdcd0
Reviewed-on: https://gerrit.libreoffice.org/83985
Reviewed-by: Marco Cecchetti <marco.cecchetti@collabora.com>
Tested-by: Marco Cecchetti <marco.cecchetti@collabora.com>
2019-12-02 17:34:13 +01:00
Tor Lillqvist
29b603a34f Fix build for MOBILEAPP
No Admin.hpp needed (which would cause a conflicting definitions of a
class called Document when compiling Kit.cpp).

No locks "supported" in the way the code expects for WOPI-like things.

Change-Id: Ie43311af054f2940576ce9b2b13520f24887628e
Reviewed-on: https://gerrit.libreoffice.org/84018
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
2019-11-29 12:12:30 +01:00
Michael Meeks
039ca3540e tdf#125755: specialize reduced decoding for mobile apps.
The WOPI multiple encoding magic is unpleasant; best not to try to
unwind it all now.

This fixes Download-As and SllideShow pieces.

cf. c806acb157

Change-Id: Ie06ad386c7a30e0f572e299e50fc949ce41b09f5
2019-11-28 18:05:04 +00:00
Michael Meeks
84c218786b fix calc simple, single cell content copy; add origin to plain text.
Change-Id: I7a6b0c90a74f6e3a91a840bf77c0935a300321f2
2019-11-27 19:17:27 +00:00
Michael Meeks
0d97efbfcc locking: renew lock after timeout.
Change-Id: I6191ee34239b978292aeb6795be74312a954e240
2019-11-27 19:17:27 +00:00
Michael Meeks
e3864a060e Dump DocumentBroker state more completely.
Change-Id: I3477fe70ba25d6e9a95c12f30138c3353994e384
2019-11-27 19:17:27 +00:00
Tor Lillqvist
c806acb157 tdf#125755: Fix some URI encoding issues
Now the iOS app is able to open a document called A#B?C\D&E❤️F🇨🇭G%AAHÖ.doc.
That is, with ‘#’, ‘?’, and ‘&’ that can mess things up when parsing URIs,
non-ASCII and even non-BMP characters, and an actual percent
character in the file name. Is that a complete enough test case? Will see.

Change-Id: I7fc53eaf8188f633d442d14a7f42814553169c71
Reviewed-on: https://gerrit.libreoffice.org/83395
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
(cherry picked from commit b60ccd60c59efb5a03ea698c0205a8543846d9e2)
Reviewed-on: https://gerrit.libreoffice.org/83664
Tested-by: Aron Budea <aron.budea@collabora.com>
2019-11-25 18:10:42 +01:00
Miklos Vajna
5d3a2b3f56 wsd: fix -Werror,-Wmismatched-tags
Change-Id: I863c75c5af9a19dda306f574b4e90c5da3399d1d
2019-11-25 15:02:02 +01:00
Michael Meeks
918d4ae150 Add quick link to check monitoring.
Change-Id: I069eeaf8464661aaff52f11523d70c40cc81cc46
2019-11-25 12:47:17 +00:00