Commit Graph

241 Commits (master)

Author SHA1 Message Date
Ashod Nakashian 693a2e19e3 wsd: SocketPoll::poll accepts chrono duration
Cleans up some of the conversions and implicity
unit in integral types.

Change-Id: I79f35b92f8f631894e55bdb39851b050870fce96
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2020-12-22 11:24:13 -05:00
Ashod Nakashian 583c627a66 wsd: avoid single-character strings
Change-Id: I709e8e797bc5e68984823d8c46c590e109d23f18
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2020-12-09 17:19:58 +01:00
Jan Holesovsky 2e84ac374d Clarify the exit values.
Signed-off-by: Jan Holesovsky <kendy@collabora.com>
Change-Id: I3c673a8c4962fd1002d9becc4f10e3de1ed952e9
2020-11-30 11:24:31 +01:00
Ashod Nakashian b87495a791 wsd: test: add Buffer test and minor cosmetics
Change-Id: Ie4ac80984523ecd32fd81238496253b6a4015692
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2020-11-29 19:27:23 -05:00
Gleb Popov 92c0d375eb Port mount.cpp to FreeBSD.
Change-Id: I1fbce01d3c69c0eeab20a66e1d608a87b316f9f5
Signed-off-by: Gleb Popov <6yearold@gmail.com>
2020-11-16 14:02:23 +00:00
Gleb Popov 7f0b19baa7 map.cpp: Add an implementation of glibc-specific error() function.
Change-Id: Ib7b87ed27a27b050d38b9c51c0c8d7a7fca32973
Signed-off-by: Gleb Popov <6yearold@gmail.com>
2020-11-16 14:02:23 +00:00
Ashod Nakashian 8f2ded18da wsd: misc minor cleanup
Change-Id: I39911e6a6b16661173ae69e39d353e517857f282
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2020-11-02 07:56:03 -05:00
Jan Dageförde d7656402d3 Migrate code to use generic sendError
Signed-off-by: Jan Dageförde <jan.dagefoerde@googlemail.com>
Change-Id: I0a00ea1220f19479eb021538f67b6bda0c59f7ef
2020-10-28 13:12:27 +03:00
Ashod Nakashian d54758b485 mount: lool-user UID check is already done in forkit
Doing this check in loolmount complicates using it
from the multiple places we do. It hardly adds
any advantage, since we already perform the lool-user
UID check in forkit, at startup.

Change-Id: I6fa1b546663a6a3a3816d4d637b4acae1d09fccb
2020-10-19 07:34:26 +02:00
Andras Timar 9f648e159f Add missing linefeed to error message
Change-Id: I8c48c0b064124c313e699c3b324ac7987cb77e42
2020-10-13 13:41:20 +02:00
Andrea Gelmini 9d01540680 Fix typos
Change-Id: I7d487f32ca43e19023760ef3c6bb1683607f93d1
2020-10-07 12:51:08 +02:00
Andras Timar 34bc966d68 change product name
Change-Id: Ic34d324c952364442d3f4f9f0758676ab57c8a9a
2020-10-02 14:18:28 +02:00
Andras Timar 0002fdfd6c fix license headers
Change-Id: I8623770b32d278a45357dc7f757fabfadd2b4af7
2020-10-01 11:56:43 +02:00
Andras Timar 322eaf5814 systemplate files are not writable by lool user
See also f1be65668c
systemplate files should not be writable by lool user

Change-Id: I5684248d3d4b4b0ba56f8c5ab490a6e7df0e0038
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98069
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Tested-by: Jenkins
Reviewed-by: Andras Timar <andras.timar@collabora.com>
2020-07-05 13:28:28 +02:00
Ashod Nakashian 5c9988f2e3 wsd: faster jail setup via bind-mount
loolmount now works and supports mounting and
unmounting, plus numerous improvements,
refactoring, logging, etc..  When enabled,
binding improves the jail setup time by anywhere
from 2x to orders of magnitude (in docker, f.e.).

A new config entry mount_jail_tree controls
whether mounting is used or the old method of
linking/copying of jail contents. It is set to
true by default and falls back to linking/copying.
A test mount is done when the setting is enabled,
and if mounting fails, it's disabled to avoid noise.

Temporarily disabled for unit-tests until we can
cleanup lingering mounts after Jenkins aborts our
build job. In a future patch we will have mount/jail
cleanup as part of make.

The network/system files in /etc that need frequent
refreshing are now updated in systemplate to make
their most recent version available in the jails.
These files can change during the course of loolwsd
lifetime, and are unlikely to be updated in
systemplate after installation at all. We link to
them in the systemplate/etc directory, and if that
fails, we copy them before forking each kit
instance to have the latest.

This reworks the approach used to bind-mount the
jails and the templates such that the total is
now down to only three mounts: systemplate, lo, tmp.

As now systemplate and lotemplate are shared, they
must be mounted as readonly, this means that user/
must now be moved into tmp/user/ which is writable.

The mount-points must be recursive, because we mount
lo/ within the mount-point of systemplate (which is
the root of the jail). But because we (re)bind
recursively, and because both systemplate and
lotemplate are mounted for each jails, we need to
make them unbindable, so they wouldn't multiply the
mount-points for each jails (an explosive growth!)
Contrarywise, we don't want the mount-points to
be shared, because we don't expect to add/remove
mounts after a jail is created.

The random temp directory is now created and set
correctly, plus many logging and other improvements.

Change-Id: Iae3fda5e876cf47d2cae6669a87b5b826a8748df
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92829
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2020-07-01 05:42:43 +02:00
Ashod Nakashian d2d0492245 wsd: move LOOLProtocol::tokenize to Util::tokenize
The tokenizer(s) are more generic than the protocol
logic, and are used from contexts that don't involve
the protocol as such.

Change-Id: Ie8c256bf11a91e466bff794021f41603c9596a7f
2020-06-02 18:03:36 +01:00
Ashod Nakashian 224ef08c7f wsd: single-char string literals -> char
More readable and typically more efficient.

Change-Id: I9bd5bfc91f4ac255bb8ae0987708fb8b56b398f8
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95285
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2020-06-02 01:31:26 +02:00
Pranam Lashkari 8b349716eb killpoco: removed Poco::Process completely
Change-Id: Iba67abf9342c11517c69c1d94903bf4752aa87d6
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/83770
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2020-04-29 14:27:54 +02:00
Ashod Nakashian df6d942d08 wsd: harden socket weakptr
Weak pointers can be null and must be
checked before using. This fixes at least
one segfault and prevents a number of others.

Also, minimizes locking of weak pointers
in the message handlers.

Change-Id: I306501c26c3441d7bd6812d51fa17e7356126f32
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92828
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2020-04-24 15:39:17 +02:00
Michael Meeks 3e4ac31c7c killpoco: remove WebSocket includes from a couple of places.
Change-Id: I06740cd978bec8e6a74beb8ed9ef8f4f970a2535
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92470
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2020-04-18 18:29:04 +02:00
Tor Lillqvist 4eb598711c Use #pragma once
LibreOffice core uses that, too, and we support an even more
restricted set of compilers.

Change-Id: I0d0e2c8608e323eb5ef0f35ee8c46d02ab49a745
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92467
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
2020-04-18 15:00:18 +02:00
Michael Meeks 28a9c4dc05 Poll - cleanup method naming, and fix merge issues.
This mends several problems from commit
5710c86323.

Change-Id: I1b29f29ca81679608a2692488fa1ef22b2e62dfd
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92032
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2020-04-10 13:58:00 +02:00
Michael Meeks 5710c86323 Poll - switch to ppoll for closer to microsecond accuracy.
Change-Id: Ib8a2bb6f60302df8631edadbbb8db626894c457c
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92000
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2020-04-10 10:06:23 +02:00
Pranam Lashkari fba0be787f killpoco: removed Poco::Thread from tools directory
Change-Id: I3fc4a04c62a064eaefd5c31452abc4a7fe100fb4
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/83224
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2020-04-08 17:22:10 +02:00
Michael Meeks e924625cc1 re-factor: Socket / WebSocketHandler.
Essentially we want to be able to separate low-level socket code
for eg. TCP vs. UDS, from Protocol handling: eg. WebSocketHandler
and client sessions themselves which handle and send messages
which now implement the simple MessageHandlerInterface.

Some helpful renaming too:

s/SocketHandlerInterface/ProtocolHandlerInterface/

Change-Id: I58092b5e0b5792fda47498fb2c875851eada461d
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90138
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2020-03-11 16:48:03 +01:00
Miklos Vajna a7d3efdd4e Introduce StringVector::equals()
Allows comparing tokens with C strings without a heap allocation. Do the
same when comparing two tokens from two different StringVectors.

And use it at all places where operator ==() has an argument, which is a
StringVector::operator []() result.

Change-Id: Id36eff96767ab99b235ecbd12fb14446a3efa869
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90201
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2020-03-09 09:46:33 +01:00
Miklos Vajna 797c996c56 Fix -Werror,-Woverloaded-virtual warnings
Probably these were just not adapted by accident in commit
f70e627795 (WebSocket - simplify
handleMessage for now., 2020-03-05).

Change-Id: I578d95d938c0c466e9547dcda3d2b297dc347a34
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90076
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-03-06 11:31:43 +01:00
Miklos Vajna b8bd1990aa Rework LOOLProtocol::tokenize() to return a StringVector object
The bulk of this commit just changes std::vector<std::string> to
StringVector when we deal with tokens from a websocket message.

The less boring part of it is the new StringVector class, which is a
wrapper around std::vector<std::string>, and provides the same API,
except that operator[] returns a string, not a string&, and this allows
returning an empty string in case that prevents reading past the end of
the underlying array.

This means in case client code forgets to check size() before invoking
operator[], we don't crash. (See the ~3 previous commits which fixed
such crashes.)

Later the ctor could be changed to take a single underlying string to
avoid lots of tiny allocations, that's not yet done in this commit.

Change-Id: I8a6082143a8ac0b65824f574b32104d7889c184f
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89687
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-02-28 16:07:56 +01:00
Michael Meeks 9126a641a9 test: switch to using ClientPortNumber to allow parallelism.
Change-Id: Ifef3bce1b217605000300b240ea74df4d264e0df
2020-01-21 15:07:54 +00: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
Pranam Lashkari aabb5b0633 killpoco: removed StringTokenizer from tools directory
removed use of Poco::StringTokenizer from the tools directory using LOOLProtocol::tokenize and std::vecor<std::string>

Change-Id: I0673e658fd35cbdc7425a99f1dcea0b54923f52c
Reviewed-on: https://gerrit.libreoffice.org/82568
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2019-11-13 09:43:10 +01:00
Jan Holesovsky 5b5e29b430 killpoco: Don't use POCO for app exit values.
Change-Id: I2948ac45a7b4243f7afde08d5245530fdbf9a070
Reviewed-on: https://gerrit.libreoffice.org/82125
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2019-11-07 12:23:47 +01:00
DarkByt31 8aea22a32b tdf#107038 Poco::Timestamp replacement with std::chrono
Replaced Poco::DateTimeFormatter with Util::getHttpTimeNow

Change-Id: I1a8591a434140270929406386218d08c71a888cc
Reviewed-on: https://gerrit.libreoffice.org/78700
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2019-09-06 13:25:41 +02:00
Ashod Nakashian 159e6d0f72 looltool: support anonymizing strings
The user is able to override the salt,
or use the one from the config file.

Change-Id: Ida634374549fb490ec2437f557d46c44d4760c56
Reviewed-on: https://gerrit.libreoffice.org/70036
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/71094
2019-08-17 04:28:49 +02:00
Ashod Nakashian 32007cbb32 Update LOK headers and reuse callback-type-to-string helper
Also, avoid repeatedly converting INT_MAX to string.
It's an arbitrary large number, so use 1 billion,
which is probably more easily recognizable as an
arbitrary large number.

Change-Id: Ie6f898d6e8978efa29c355f3cb50b60114870f0d
Reviewed-on: https://gerrit.libreoffice.org/77593
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2019-08-17 03:38:08 +02:00
Tomaž Vajngerl cc70602939 tdf#122529 Support for table overlay - column/row change markers
This adds table markers for resizing rows and columns if the user
has the table selected or the cursor is in the table. The code
reacts to the callback "tableselected:", where the markers are
created for each column and row, if the payload (json) of course
has any data. When the marker is dragged, a uno command to resize
the table column or row border is send to the core.

Change-Id: I9b21d09639c1b2be70a1a897f9e3340b453d847e
Reviewed-on: https://gerrit.libreoffice.org/77360
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2019-08-15 05:16:04 +02:00
Tomaž Vajngerl 42c4c864fe tdf#125425 add cell selection markers and cell auto fill marker
This replaces the standard text selection marker with a cell
selection markers to resize the cell selection. This looks and
behaves better for cells in Calc and it is also easier to deal
with.

Additionally add auto fill marker to perform the auto fill action
on the cells. This was not possible to do previously unless you
hit an invisible part of the cell selection, which is not
convenient when using touch.

Change-Id: Ia02d03b7b8e8d98412ea98eb92fb47d1505ef979
Reviewed-on: https://gerrit.libreoffice.org/76494
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2019-07-29 08:51:55 +02:00
Jan Holesovsky 3a03f50784 Revert "Adapt paths to new package name"
It is not a good idea to change the configuration directory, it will affect all the existing installations.

And the service is called loolwsd - so the configuration should be called that way too.

This reverts commit 9278574289.

Change-Id: I7e6eee644e21ad2dd842742585d16133ff8e36c9
Reviewed-on: https://gerrit.libreoffice.org/72730
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-05-22 12:06:06 +02:00
Samuel Mehrbrodt 9278574289 Adapt paths to new package name
After 1dbbc5acc7

Change-Id: I64a12fb13bc8f9371821b2d5969941bfddc2514a
Reviewed-on: https://gerrit.libreoffice.org/72728
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-05-22 10:27:33 +02:00
Michael Meeks 729c124b3b perftrace: consume PROFILE_FRAME messages and chart lok ProfileZones.
Also - enable performance tracing in the kit when we're logging at
trace level.

Change-Id: I838e8d7769b0ead8508c4482c58e0e2564dcee91
2019-04-16 20:27:37 +01:00
Miklos Vajna 6d57f0a005 net: make members private in DelaySocket
Change-Id: I5970d55f0723e46892ed5bea87bb79376c7ea530
2019-01-17 08:46:11 +01:00
Miklos Vajna e1adc6ff17 tools: make members private in Config
Change-Id: I3127d0d1f460ea535295fbf8dc2bb1856b1c2ff8
2019-01-16 08:59:45 +01:00
Miklos Vajna 51adedfa67 tools: make members private in Connect
It was not used externally.

Change-Id: Ie96af8aa4c72efc17c40f453ce200e520d954365
2019-01-15 09:35:20 +01:00
Miklos Vajna 6bc1fa6215 tools: make members private in AddrSpace
Only _addrToStr needed a getter, the rest is not used externally.

Change-Id: Ie1c0f860c6aa0acc26c8c7272298225a4804a5e5
2019-01-14 08:44:04 +01:00
Miklos Vajna 6c8af8091f tools: make members private in StringData
Change-Id: I6c080264d2c66abdb6760c190f3727dd0159c865
2019-01-11 09:08:44 +01:00
Miklos Vajna 5391c09fba tools: make members private in Map
Change-Id: I9f23d5095e387888e43c0a0d2e6ed041ac5aed68
2019-01-10 09:11:55 +01:00
Samuel Mehrbrodt c377ca3fb2 loolconfig: Only show "config updated" message when something was changed
Change-Id: I2d2b1e4b57cccbbe6f5608f0468bc9dfed3fd120
Reviewed-on: https://gerrit.libreoffice.org/65997
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2019-01-09 10:45:06 +01:00
Miklos Vajna a725fea9fa Replay: make members private
Only some members neded only read-only access.

Change-Id: I8c90f315e8b946a6ce5fd8aec966d59a4b62383c
2019-01-07 08:34:07 +01:00
Miklos Vajna 32f4dd371d Stress: make members private
No external code used those members, so makes little sense to have them
as public.

Change-Id: I893dca4a42b83e0835829889d35fe3c756b97f96
2019-01-04 09:03:38 +01:00
Miklos Vajna f204ff2333 Tool: make members private
Some of the members were not used externally at all, others were just
read-only externally.

Change-Id: I8fbe5c9c027e7d0adf516b311aafb6b66134776e
2019-01-03 09:05:36 +01:00
Miklos Vajna a65a528220 TraceFileRecord: make members private
Change-Id: Ie83077b248185d7748423f512b7b61b4945bd779
2018-12-19 09:12:36 +01:00
Andras Timar 96760c5e43 ask for username (default to 'admin' if nothing set) with 'loolconfig set-admin-password'
Change-Id: I04bf3d225e4149ed69bc55e14d1ced1dd3f8f7ea
2018-11-13 14:32:37 +01:00
Jan Holesovsky efe291c320 Notify about the editing context.
And also:

* Hint the compiler to warn about the missing callbacks.
* Add few missing ones.
* Update the bundled headers.

Change-Id: I8d31363eaaea289e8a517c0b9b1142b33ce3027e
2018-11-12 18:10:57 +01:00
Miklos Vajna bf9df8d2bd Fix -Werror,-Wswitch warning
Change-Id: Id6d25955ee99d0c547d92cfbea407135a75ca47b
2018-11-09 09:20:44 +01:00
Tomaž Vajngerl 852ed5d981 handle signature status and prepare document signing in WSD
This adds handling of signature status (manually request for the
status or as a callback) in WSD.

In addition prepare support for signing of document, but don't yet
trigger the actual LOKit function (needs the JS building blocks
set up first to know how to handle the payload - certificate and
private key)

Change-Id: Ic76baa5847bb52adde616338187d5979e0093c6d
Reviewed-on: https://gerrit.libreoffice.org/62533
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2018-11-09 09:06:02 +01:00
Miklos Vajna 4724aa0cf7 Socket: do what the TODO says
Drop the list of friends and just add getters for the relevant
members.
2018-10-25 16:39:02 +02:00
Ashod Nakashian 63c3fce2c6 wsd: clang-format logging macros and pass logger explicitly
Change-Id: I37e7f4b5687b64b36e0985942627a4b84a8249eb
2018-10-16 20:12:23 -04:00
Miklos Vajna ec008efd73 tools: remove unused Poco::Util::Option include / using decl 2018-07-20 10:23:48 +02:00
Tor Lillqvist c852d9340b Fix the help message after my option handling changes last night
Change-Id: I9cc869b9957236803d41f3495eb1a444fa8ebad1
2018-07-11 11:35:59 +03:00
Tor Lillqvist 42e6a1e96d Make the loolconvert tool compatible with libreoffice --convert-to
Accept the same options, as applicable. Ignore irrelevant options
(like -env:userInstallation or --headless, but actually just ignore
anything we don't need). Handle options manually so that we can accept
them also with just one dash.

Drop superfluous verbosity. Succeed silently, as is The Unix
Philosophy (haha).

Change-Id: I05793b11886f61955db4746b864be97a6bef5674
2018-07-11 01:29:57 +03:00
Tor Lillqvist bc0f76d6ad It's /lool/convert-to, not /convert-to
(But it doesn't seem to work anyway any more.)

Change-Id: I53261cd24d945dc47e156ff16240679beeb85f6a
2018-07-10 23:14:51 +03:00
Tor Lillqvist 73dbf27ede The std::string compare() method is like strcmp(): it returns 0 on equality
Change-Id: I4d080afd98419cbdaa531cc6f2c306533bbc1737
2018-07-10 23:14:51 +03:00
Tor Lillqvist c783485a3b The option is called "server" and not "uri"
(It's the parameter of that option that is called "uri".)

Change-Id: If247a932bf8879b4eb626d850e813c3e8d5a7d60
2018-07-10 23:14:51 +03:00
Tor Lillqvist b7de2865dc Fix warning: private field '_isSSL' is not used [-Werror,-Wunused-private-field]
Change-Id: Iddf8ac7f0afa85559b03b980a558d9a4fd058473
2018-06-01 16:42:37 +03:00
Jan Holesovsky 93cc4b4548 Use std::shared_ptr consistently.
Change-Id: I6bf3ff7de47010fd78fab26a5a318bde21c1f153
2018-05-18 15:16:40 +02:00
Jan Holesovsky 82f2f2711b websocketdump: Read the port and ssl support from the config.
Change-Id: Ifc4566d5e1f2cdba1fd4bd7d53b359d81604083b
2018-05-18 15:16:40 +02:00
Michael Meeks 5a94614217 Enable SSL in outbound, client websockets ...
Switch SSL context creation to be generic rather than pure server.

Change-Id: I1b750b4ddc8c607381f5541a4f4412fa16e457d4
2018-05-18 15:16:39 +02:00
Michael Meeks 9e7dff79f3 re-factor socket factories to take a client parameter.
Change-Id: I0be98eb583b4f8081dd8ad23e688e93c55220367
2018-05-18 15:16:39 +02:00
Michael Meeks 80a13a1e7b More work on client / Monitor websocket connections.
Change-Id: Ic70fe522e24f2b1863c2d9d1dd6941785510758a
2018-05-18 15:16:39 +02:00
Michael Meeks b483f477dd Allow a 'monitor' to be connected to remotely if configured.
So far monitors have the access an permissions of an
authenticated admin.

Change-Id: I59dfa8a646a60584a5c113ee0521e9afba4f6b76
2018-05-18 15:16:39 +02:00
Andras Timar e2bc253bd9 loolconvert: print help if no args
Change-Id: I8f93e61fa73a17132842f8786557f81d049393a6
Reviewed-on: https://gerrit.libreoffice.org/54026
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2018-05-09 15:27:38 +02:00
Andras Timar 8481602061 rename looltool to loolconvert
Change-Id: I9e87c4a142bf63a8a7494861457660ab243e0924
Reviewed-on: https://gerrit.libreoffice.org/54025
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2018-05-09 15:25:38 +02:00
Michael Meeks f68d54e02a Initial websocket test tool for remote admin connections.
Change-Id: I8be2068bf7d77c70720a044556d11f5fc80b2f0c
2018-04-17 16:50:48 +01:00
Marco Cecchetti 89f37b5dd5 calc: drop down button marker
Change-Id: Ic069ad40e6749f43709760e7f4f0d96b39d5a4ce
Reviewed-on: https://gerrit.libreoffice.org/51598
Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
Tested-by: Marco Cecchetti <mrcekets@gmail.com>
2018-04-03 21:42:27 +02:00
Aron Budea c20c51d8a5 Fix unused-result warning.
Change-Id: I31fa4edd68e8a5ba973c159599e71e74406b8e6e
Reviewed-on: https://gerrit.libreoffice.org/51947
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2018-03-28 10:16:29 +02:00
Jan Holesovsky 3304e90935 The return value of system() shouldn't be ignored.
Change-Id: I7422bfb3997c205333a8558884c65f2ff3795e38
2018-03-28 09:30:27 +02:00
Jan Holesovsky aaf76a13ba loolconfig: Create a shortcut for running the systemplate update.
Change-Id: I082cf6e3f560a9c1880f0680ad4d2876d055dbc4
Reviewed-on: https://gerrit.libreoffice.org/51315
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2018-03-26 23:13:33 +02:00
Miklos Vajna 0f4da16aec Fix -Werror=switch warning
Change-Id: I9542ec33df7a2c141055264cb09dc58cb3ad7593
2018-03-21 11:05:13 +01:00
Pranav Kant 463fc60440 loolconfig: set-raw-config -> set
Change-Id: I7821bcf7bf8a6b8247e824d18b1d9f29b8db8851
2018-02-13 12:33:01 +05:30
Miklos Vajna 9733e0f7ff tools: spell out non-trivial autos to improve readability
Change-Id: I8b462c5e6ae96fb8daf2abd1ed3756a796cdd434
2018-02-07 10:18:12 +01:00
Pranav Kant f942e5a29e loolconfig: Allow changing loolwsd.xml
eg: `loolconfig set-raw-config admin_console.password admin`

And while at it, stop processing all the arguments given to the command.
Regard the first argument (without any "--") as command and let the
specific-command handling routine handle the remaining arguments the way
it wants.

Change-Id: I6cc406c56701dba2b99e0a3c4a98c505df70ee60
2018-01-26 18:34:17 +05:30
Michael Meeks 9af34dd15c loolmap: configurable width for hex dumping.
Change-Id: Id53426b84362a8a34bcbb116c6567d9264241b3c
2018-01-09 11:47:28 +00:00
Michael Meeks 8ec2738095 loolmap: re-work string dumping and scan for C strings.
Change-Id: I32b496cb83538477be8088285868bbb3236b146a
2018-01-09 11:19:27 +00:00
Pranav Kant 1353408999 loplugin:includeform
Some files weren't rewritten from the last run.

Change-Id: I8c5beadaf2cf9b367158abe6f0a5460fa3054521
2017-12-21 20:09:03 +05:30
Pranav Kant 9cbef14160 loplugin:nullptr
Change-Id: I5f0dc970e8522b63570faa0ba05ab19dd0f45d5a
2017-12-20 22:36:41 +05:30
Pranav Kant f63858433b loplugin:includeform
Change-Id: Ib62a7aa61062f00698aa3e8a144438de5c57e53d
2017-12-20 21:21:05 +05:30
Michael Meeks 864b07f5b3 Annotate string pointers in hex dumps to make sense of memory.
Change-Id: I7934ccf379dbca9862ddb911865aaeff692261bf
2017-12-15 22:45:04 +00:00
Michael Meeks 453637e8a1 loolmap: fix assert on zero parent pages.
Change-Id: Ieeac3e5fc3746e4089d8688e96bb9dcb59ee17c5
2017-12-12 12:04:19 +00:00
Michael Meeks 44600de7c7 loolmap: implement a simple string scan and dump function.
Change-Id: I056f764c99f977a0178105511dfd5406ea6dbfa5
2017-12-11 21:53:40 +00:00
Michael Meeks 7dcd2ddd90 loolmap: share some /proc opening pieces.
Change-Id: I2d8b6eeec4afad52f74153c3d7ac904dfcb5db8f
2017-12-11 21:53:40 +00:00
Michael Meeks 50cdc16884 loolmap: store address space mappings.
Change-Id: I30b61ed8407996923f07368263bc8b773dfdc061
2017-12-11 21:53:40 +00:00
Miklos Vajna a597fa9a47 loolmap: clean up dead assignment
style gets re-assigned on all paths below.

Change-Id: I4164f745c00e39b82410820cffe4682c079fd741
Reviewed-on: https://gerrit.libreoffice.org/46211
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2017-12-11 09:49:51 +01:00
Michael Meeks 73327ce2ec loolmap: more cleanup print more metrics.
Change-Id: Ie6d82222a5d8960a317ea22d0628e6250330bbc7
2017-12-04 21:55:14 +00:00
Pranav Kant 849eb0d500 lokdialog: Adapt to LOK dialog API changes
Change-Id: I653304e71573eb253e09a72bc87d54b8554ba7ff
2017-12-04 22:13:50 +05:30
Pranav Kant 99a7f1f992 Fix build; no operator== on std::stringstream
I guess we wanted to match strings there.

Change-Id: I5b76435144ce931718cc758963e79de7d0f5a9ea
2017-12-04 19:04:25 +05:30
Michael Meeks 886a8a7ab8 loolmap - improve page annotation, and page diffs, count dirty bytes.
Change-Id: Iaaae8fca2bdd11961682d6f8dafa38e4ca51c44c
2017-12-01 17:39:28 +00:00
Michael Meeks 26876e6165 loolmap - read the parent's page data for unshared pages too.
Change-Id: I23bb319fa4694638efc82c7af86224d2e041160c
2017-11-30 13:33:25 +00:00
Michael Meeks 0778b72697 Dump hex contents of un-shared memory.
Change-Id: I47dfa8a0b48d0ba34b7462301b83e2721617814d
2017-11-29 03:33:16 +00:00
Michael Meeks 16898cbffc RLE compress sharing bitmap for display.
Change-Id: Ib47e2ceb481c0a9b4c36fc6f5304bf03acec128b
2017-11-29 02:38:33 +00:00
Michael Meeks 65f3d658cb Collect anonymous and file backed mappings too.
Change-Id: I7bf23917436bdffb483b288414409ccc53ed540c
2017-11-28 18:46:09 +00:00
Michael Meeks 2fb4521a9c Dump unshared heap memory ascii-art map by page..
Change-Id: I21ef386958e651b53b4d8eef434958a20adcbe68
2017-11-28 18:08:26 +00:00
Michael Meeks 5540fc0b7f Cleanup, memory map dumper, add <pid> mode, and collect heap pages.
Change-Id: I14e428b96c591e84ec9f50f0a75782c97660944b
2017-11-28 17:27:34 +00:00
Miklos Vajna bb7ac21d44 Make sure that loop index type is never narrower than the length type
Change-Id: I19aac80850c0371085ca6364412d5ac9207220d0
2017-11-06 09:14:38 +01:00
Tor Lillqvist a0b82c9fdb Avoid warning: ‘%s’ directive output may be truncated writing up to 255 bytes
... into a region of size 58

Change-Id: I725c537ed21553e9dc34ba006a39917e1549b6a7
2017-10-26 12:03:38 +03:00
Miklos Vajna 409be28c8b Config: avoid redundant string initialization
Change-Id: Ia90aae804c3656f54e8f36ca5ef1fd52a99e05c9
2017-10-17 09:04:04 +02:00
Andras Timar 11ad1b4ab9 loolconfig: don't show option for set-support-key, it it's not compiled in
Change-Id: Ie3baeee860e5ef0a797a3061373e266f40b41809
2017-10-12 21:40:55 +02:00
Jan Holesovsky 783e3552c0 Support key logic in loolws + improvements in loolconfig.
To be able to set the support key directly from the command line, and to show
the option, etc.

Change-Id: Iac93bc47a6f4b9d5a5ad0ac8b06bda978e01b760
Reviewed-on: https://gerrit.libreoffice.org/43098
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2017-10-06 11:37:18 +02:00
Michael Meeks 79053911fc Support key logic and verification.
Change-Id: Ie55150b99df3e80239236571af185502196ad3e9
Reviewed-on: https://gerrit.libreoffice.org/43097
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
(cherry picked from commit 56385cb8ac)
Reviewed-on: https://gerrit.libreoffice.org/43099
2017-10-03 21:52:45 +02:00
Pranav Kant 55de8e6c1b lokdialog: Add dialog related callbacks
Change-Id: I5dc54c4bdbaf066b3b089a00fbc89b943e73caae
2017-10-02 15:40:23 +05:30
Pranav Kant 67bf4dc212 loolconfig: print help information from option set
Change-Id: Ifbc5ca72d17444b8fdefb7093744cbead1922a31
2017-08-31 09:24:44 +05:30
Pranav Kant 08efd75e31 wsd: fix incorrect password hash format written to config file
Regression from 9a75040bf0

Change-Id: I82cd3db17a18702a046973cfe863fdda750b363b
2017-08-30 17:22:33 +05:30
Aditya Dewan c3711a4375 Extending WOPI implementaion to introduce 'Save As' feature
Change-Id: Ic4c80f4c4b54944143682c25a5878c1336787b27
Reviewed-on: https://gerrit.libreoffice.org/40946
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-08-17 19:25:44 +02:00
Andras Timar 945d74c237 wsd: fix compilation with old OpenSSL that does not have PKCS5_PBKDF2_HMAC()
Change-Id: If48641f6cbcc4d4ded78ea5cc9c9f66063a2ac0a
Reviewed-on: https://gerrit.libreoffice.org/39779
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2017-07-31 19:40:37 +02:00
Miklos Vajna 9a75040bf0 tools: avoid string concatenation resulting in allocation of unnecessary temporary strings
By using std::stringstream instead.

Change-Id: I6fe12afd4adc13166746b1d98bf8ea75a28208e5
2017-07-03 08:08:54 +02:00
Miklos Vajna ad8584f5d7 tools: initializer for base class XMLConfiguration is redundant, remove it
Also run the clang static analyzer on net/ by excluding test/, and not
explicitly listing all non-test directories.

Change-Id: Iac203f1cf9161da1c51501de8b0c3cc9dc6e2027
2017-06-22 09:03:54 +02:00
Pranav Kant ee026723ed Bin redundant code
Change-Id: Id691052e343cea73f3dec512ee6f4d4960f9614b
2017-06-07 10:15:54 +05:30
Pranav Kant 7a4bc5b95a admin-console: Check the password against hashed value in config
The new password hash property is called secure_password in the config
file. `loolconfig` tool should be used to set the password hash in
appropriate format with desired salt length, password length, number of
iterations in PBKDF2.

To be backward compatible, plain-text password for admin-console in
config file is still accepted in case secure_password property is
missing from the config file.

Change-Id: If229999dac62856e368555c0242c4aa6f8061fba
2017-05-25 01:18:31 +05:30
Pranav Kant 9bd89e89c3 loolconfig: tool to generate admin password hash with PBKDF2
A normal usage to set the admin password would be like :

loolconfig set-admin-password --config-file ./loolwsd.xml

Other command line options can also be given, like --pwd-salt-length,
--pwd-hash-length, --pwd-iterations.

Change-Id: I2a6f8d25e068b53a3f945426f0779c8410b2c8ba
2017-05-25 01:18:31 +05:30
Marco Cecchetti 024e786e85 calc: added an address input field
Change-Id: Ic030724e392693847a195b5e53866b40ebad7435
Reviewed-on: https://gerrit.libreoffice.org/37359
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-05-11 17:55:23 +02:00
Marco Cecchetti 1e0deae3df Calc: changed the way header are updated on row/col insertion/deletion
Now when a row/col is inserted/removed or resized is the core to
notify the client that current header is no more valid and a new
header should be requested by the client to core.

In this way core can notify the header invalidation to all views.

Change-Id: Ia3c1872b73cfb3458cd0d35907291a9fc9eebd11
Reviewed-on: https://gerrit.libreoffice.org/36729
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2017-04-21 15:45:15 +02:00
Michael Meeks 0eaef6c896 config.h - get includes right: must always be the first include. 2017-03-10 10:47:43 +01:00
Ashod Nakashian 3831cd0169 wsd: drop bad sessions when send fails while replaying
Change-Id: I77c2ecd65f20a65e40d78fdc4d7d8ca2b4821270
Reviewed-on: https://gerrit.libreoffice.org/34116
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-02-10 07:05:37 +00:00
Ashod Nakashian d0b9de7615 wsd: handle and ignore failed connection when replaying
Change-Id: I11c29b8c0076e9500f9df743f438bf6f4dbe88d1
Reviewed-on: https://gerrit.libreoffice.org/34115
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-02-10 07:04:48 +00:00
Ashod Nakashian c7a5798abc wsd: handle exceptions so a bad session doesn't stop replaying
Change-Id: I2a92c8f16ab9f6a1a5d55472c5db0f9d6ed3fa67
Reviewed-on: https://gerrit.libreoffice.org/34114
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-02-10 07:03:55 +00:00
Ashod Nakashian 53a8101331 wsd: log the trace file duration and each record before executing
Change-Id: Ia5c21f01198de3dc655fe3bf247178dd04f5eaa7
Reviewed-on: https://gerrit.libreoffice.org/34113
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-02-10 07:03:26 +00:00
Miklos Vajna 04b591b8c6 tools: remove unused using declarations in Stress
Change-Id: Icf4ca0f7532d0254513d5dd47f7914a52c60e46e
2017-02-09 10:09:38 +01:00
Jan Holesovsky 964ae25ccf fuzzer: Factor out the replay functionality to a separate file.
Change-Id: Ief946b1703ef1ca0b17de3467dce66b4c3da2601
2017-02-08 08:35:13 +01:00
Jan Holesovsky 02e118387a Avoid including LibreOfficeKit.h.
Change-Id: I112b79790839352ffd0d82394ffc7e2d8e8dcf44
2017-02-07 13:27:14 +01:00
Ashod Nakashian 7d58df49fa wsd: new config to enable/disable snapshots when recording trace
By default snapshots are disabled, since trace recording
is enabled, to avoid unexpectedly flooding the disk.

Change-Id: I6c8728e14801f0a72accde1378455ec0e6046e3e
2017-02-05 22:03:18 -05:00
Samuel Mehrbrodt 1f2d04a5e4 Online, not on-line
Change-Id: I93a8322dceca7c1ed95449c6aeb4ae854b982957
Reviewed-on: https://gerrit.libreoffice.org/33886
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2017-02-03 13:47:30 +00:00
Pranav Kant 440ca8e2f7 Initial support for comments lok api
Change-Id: I1fc48e245a47f7b8d4260009d8c377c30d0b8820
2017-01-27 23:36:24 +05:30
Tor Lillqvist 11ae90cfcb No Hungarian notation please
Change-Id: Ia624de45a792db7e39f2245aaea7d940b30b0db2
2017-01-13 14:52:08 +02:00
Tor Lillqvist a36d4b0fc3 Reanme png namespace to Png for consistency
As far as I see, we tend to use the same namespace name as the
basename of the corresponding include file, and this stuff is defined
in a file called Png.hpp.

Change-Id: Id859e13e94568abd9f1d5b4ef3bfbbb0c156db11
2017-01-04 13:35:26 +02:00
Pranav Kant 9680a13af3 fix build - std::accumulate not member of std
Fallback from ba9ffb4775

Previously, std::accumulate was included indirectly through
<random> header

Change-Id: I7e481d87bf390c52e9bf87a9f1040ae4b5974b16
2017-01-02 12:15:43 +05:30
Ashod Nakashian ba9ffb4775 wsd: include cleanup
Change-Id: Id481cfbab6be12a095918bdc7318fb3584345307
Reviewed-on: https://gerrit.libreoffice.org/32548
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-12-31 23:22:15 +00:00
Noel Grandin 0caeab803b loplugin:loopvartoosmall
Change-Id: I32f75fac7626b9ae56fa3f898bfa50051a22677f
Reviewed-on: https://gerrit.libreoffice.org/32362
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
2016-12-27 10:15:38 +00:00
Noel Grandin 80b0eaa773 loplugin:unnecessaryoverride
Change-Id: Ib077de07e832ae30137f465596961731954d8e62
Reviewed-on: https://gerrit.libreoffice.org/32340
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
2016-12-22 14:41:10 +00:00
Noel Grandin 4ed820d3d5 add a configure option for using clang compiler plugins
and apply the nullptr plugin.

Lots of hacking in my LO tree required to make this work, will probably
end up needing to add an extra parameter to the LO side.

Change-Id: I02ae1dcdece9d9ddf05f7757f6696e3a5d7d1f14
Reviewed-on: https://gerrit.libreoffice.org/32339
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
2016-12-22 14:23:42 +00:00
Ashod Nakashian 1376856107 wsd: logging updates
Change-Id: Icbee0349a3cfda5a56f8d681c779484e18b98ab6
Reviewed-on: https://gerrit.libreoffice.org/32287
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-12-21 15:01:20 +00:00
Michael Meeks c1a398977f Adapt makefiles, includes etc. to new locations. 2016-11-25 09:58:57 +00:00
Michael Meeks cca657c8f2 Apply the pre-branch rename script to re-organize the source. 2016-11-25 09:58:48 +00:00