Commit graph

7022 commits

Author SHA1 Message Date
Tor Lillqvist
9251fefe94 Clarify remaining need for part parameter in messages 2015-04-27 21:58:54 +03:00
Tor Lillqvist
28c9561722 Get rid of the CHROOT capability after using it, or when not needing it 2015-04-27 21:55:36 +03:00
Tor Lillqvist
1b06290d2b Add a part parameter to the tile messages
The JS code always passes in 0 for now. The server parses the parameter and
calls LibreOfficeKitDocument::setPart() before calling paintTile().

Probably also the status, key, mouse and selection messages will need a part
number. The intent is after all that the protocol is as stateless as
possible. (So maybe we should also pass the document URL in each message?)
2015-04-27 21:30:26 +03:00
Tor Lillqvist
389815ac63 Introduce LOLProtocol::getTokenKeyword() and use it
The new function takes a map from keywords to integer values, and accepts
parameters in the form of either name=keyword, or for backward compatibility,
name='keyword'. Use it to parse the type parameter of the key, mouse,
selecttext and selectgraphic messages. This restricts the accepted keywords to
those actually valid for each message.
2015-04-27 21:12:20 +03:00
Tor Lillqvist
5267753b82 Add mention that MasterProcessSession::dispatchChild() should wait 2015-04-27 18:03:52 +03:00
Mihai Varga
9cd120f7ab Restore scrollbar offset 2015-04-27 16:03:50 +03:00
Tor Lillqvist
b2f34b0c3d Maybe /usr/share/fonts/ghostscript is also good to have 2015-04-27 16:01:11 +03:00
Tor Lillqvist
0019dc4943 Preserve timestamp of directories created in the jail
Needed for /usr/share/fonts so that fontconfig trusts its cache, but no harm
doing it for all directories. (Except a slight slowdown, need to see it if
has any significant impact if we would do the utime() only for directories
under /usr/share/fonts.)

Thus we need to pass the FTW_DEPTH flag to nftw() and handle FTP_DP instead of
FTP_D. We also need to make sure the directory is created also in the case of
an empty directory, for which no FTW_F callback of files inside it has been
received.

It is safest to not exit the nftw() in the FTW_SLN case.
2015-04-27 15:57:18 +03:00
Tor Lillqvist
074a54dd6c Make sure the fontconfig cache works for the sys-template
Need to copy /var/cache/fontconfig, too. For it to be valid, the directory
timestamps in /usr/share/fonts must be preserved.
2015-04-27 15:49:25 +03:00
Tor Lillqvist
be2bb356c3 Add seconds.milliseconds to the log prefix 2015-04-27 14:16:37 +03:00
Michael Meeks
6b17e8b022 Update README, and install ld.so.* into the jail. 2015-04-27 10:00:31 +01:00
Michael Meeks
1317941b5a Use shell variables to make it more cut/paste-able. 2015-04-27 09:44:59 +01:00
Tor Lillqvist
68d15726c4 Rephrase statement more logically 2015-04-27 11:27:29 +03:00
Tor Lillqvist
bced6a0771 Clarification 2015-04-27 11:26:00 +03:00
Mihai Varga
b6671341a7 The map handles keypress events but no panning keys 2015-04-27 10:18:13 +03:00
Mihai Varga
7fa1ae861d The map should not yet handle keyboard events 2015-04-27 09:57:06 +03:00
Miklos Vajna
0615ce950f LOOLSession: log error if nftw() fails
Should help finding out the problem if --lotemplate is given a
non-existing directory by mistake.
2015-04-25 01:40:16 +02:00
Tor Lillqvist
7d25ffada6 Remove part that is not relevant any longer
I don't see the busy looping any more, and child porcesses are indeed now
pre-spawned as needed (not just "re-started").
2015-04-24 18:56:24 +03:00
Tor Lillqvist
d6005eb524 Mention we need a part number parameter in many places 2015-04-24 18:54:50 +03:00
Miklos Vajna
4a7265ae76 Makefile: fix autoreconf warning
Makefile.am:18: warning: deprecated feature: target 'SETCAP' overrides 'SETCAP$(EXEEXT)'
Makefile.am:18: change your target to read 'SETCAP$(EXEEXT)'
/usr/share/automake-1.13/am/program.am: target 'SETCAP$(EXEEXT)' was defined here
Makefile.am:1:   while processing program 'SETCAP'
2015-04-24 17:27:21 +02:00
Tor Lillqvist
e9f3e815fe Don't try to run the 'display' program if there is no $DISPLAY 2015-04-24 18:18:56 +03:00
Tor Lillqvist
3ff60eaea1 Mention that the tile cache directory needs to be created 2015-04-24 17:46:01 +03:00
Mihai Varga
caf7c2e6c6 The map should not trace a resize event
The container div should handle the resize by updating the scrollbars
This fixes the map crash during window resize.
2015-04-24 17:21:38 +03:00
Tor Lillqvist
3ee29053aa Add a section about coding style 2015-04-24 14:34:43 +03:00
Tor Lillqvist
4eaffc74f0 Log the exit status of a child process, or the signal that killed it 2015-04-24 13:14:57 +03:00
Tor Lillqvist
00da867e97 Cosmetics 2015-04-24 12:49:47 +03:00
Tor Lillqvist
4782d05852 Add Util::signalName() 2015-04-24 12:49:19 +03:00
Tor Lillqvist
91d0e9329c Fix the waitpid() use
We don't want to use WNOHANG, not sure where I got that idea from. That leads
to busy looping. The loop is in a thread of its own, so it is fine to just
wait ("hang") for some child to die.
2015-04-24 11:26:41 +03:00
Tor Lillqvist
4f9739854a s/localhost/127.0.0.1/
Makes the chrooted child process more reliable on diverse distros/versions.
Let's use 127.0.0.1 in all cases for consistency.
2015-04-23 18:52:19 +03:00
Jan Holesovsky
5f2de45584 Update README with debugging hints. 2015-04-23 17:29:56 +02:00
Jan Holesovsky
2d23eaff6d Add the debug suffix to Poco libs only when self-built. 2015-04-23 17:29:56 +02:00
Jan Holesovsky
8be550056b SLEEPFORDEBUGGER is still useful for debugging, re-introduce that.
This reverts commit af3545b897.
2015-04-23 17:29:56 +02:00
Tor Lillqvist
ed07f1a4e1 Avoid accessing string out of bounds 2015-04-23 17:16:44 +03:00
Tor Lillqvist
4d717182ad Look for setcap during configury 2015-04-23 16:00:48 +03:00
Jan Holesovsky
bf929d5618 Add libcap-progs to the README as dependency. 2015-04-23 14:54:14 +02:00
Tor Lillqvist
ae500514f5 Forgot to actually have the --test switch in the example of its use 2015-04-23 15:51:10 +03:00
Tor Lillqvist
a181692255 Simplify
Just use find ... -type f instead of a for loop.

One note: I wonder how text rendering by the LO code in the child process
works even if we haven't copied any actual fonts into the sys template (and
thus chroot jail)? Is FreeType (or whatever it) already present in the
process, and font files open, even before the chroot? Weird.
2015-04-23 15:24:20 +03:00
Tor Lillqvist
d970d327b9 Don't exit if cp fails
It might be that for instance there is no /lib64/ld-*, as on a 32-bit system.
2015-04-23 15:18:22 +03:00
Tor Lillqvist
b8f2ce741e Fix thinko 2015-04-23 14:44:41 +03:00
Tor Lillqvist
b49d4d8885 Use shared_ptr and weak_ptr in attempt to make the pointer dance more robust
It was obviously very wrong to use both a unique_ptr to the
MasterProcessSession in WebSocketRequestHandler::handleRequest(), and then a
bare pointers to the peer object in the MasterProcessSession object. We got
crashes here and there related to the destructors.

Let's see if we can manage without mutexes.
2015-04-22 21:50:17 +03:00
Tor Lillqvist
eade187ebb Bin pointless logging
We logged effectively the same information a few lines earlier.
2015-04-22 21:50:04 +03:00
Tor Lillqvist
59bd08299c _childId is used only in MasterProcessSession 2015-04-22 21:49:53 +03:00
Tor Lillqvist
08f53df08a _childIdToChildSession[childId] is not used 2015-04-22 21:49:37 +03:00
Tor Lillqvist
e83559795d Mention that sudo is used 2015-04-22 21:49:23 +03:00
Tor Lillqvist
8534aebf8e Only the MasterProcessSession class uses a tile cache 2015-04-22 21:49:12 +03:00
Tor Lillqvist
d94b494c0c Check if the peer MasterProcessSession has a tile cache yet 2015-04-22 21:48:48 +03:00
Tor Lillqvist
54d106f47b Factor out WebSocket::shutdown() ignoring IOException 2015-04-22 21:48:42 +03:00
Tor Lillqvist
6b7dcdb544 Typo 2015-04-22 21:48:35 +03:00
Tor Lillqvist
520236fb7e Updates 2015-04-22 21:48:27 +03:00
Tor Lillqvist
a0292468da Catch (and ignore) Poco::IOException in a couple of places
There probably are more places where I should catch those and act
appropriately. At least in these places, where the websocket connection is
already closed, or being closed, anyway, the right thing to do is just to
ignore exceptions, which are generated from attempts to write to an already
closed Poco WebSocket, for instance.
2015-04-22 21:48:14 +03:00