Commit Graph

75 Commits

Author SHA1 Message Date
Jim Chen
9c10ddae3b GUACAMOLE-470: Fix incompatible pointer type warning under older GCC.
Older versions of GCC (prior to 5.1) emits an "incompatible pointer
type" warning when passing `foo(*)[]` as `const foo(*)[]`. This was
changed in GCC 5.1, and this patch adds explicit casts to remove the
warning under older GCC.
2018-05-27 23:46:16 -04:00
Jim Chen
6da9236ffd GUACAMOLE-470: Reset character attributes on terminal reset.
The character attributes such as foreground/background colors should be
reset as well when performing a terminal reset.
2018-05-26 23:18:27 -04:00
Jim Chen
1bd537c350 GUACAMOLE-470: Support configurable colors in color-scheme parameter.
Add support for configuring individual colors in the color-scheme
parameter, by parsing the parameter content into name-value pairs.
Backward compatibility is preserved by translating previously supported
values into corresponding new values.
2018-05-26 23:18:27 -04:00
Jim Chen
f8b35078fc GUACAMOLE-470: Add support for configurable default palette.
Add support for configuring a default palette for a terminal display.
When the default palette is specified during display creation, that
palette is used instead of GUAC_TERMINAL_INITIAL_PALETTE when resetting
the display palette.
2018-05-15 22:05:59 -04:00
Nick Couchman
c898f35959 GUACAMOLE-269: Clean up terminal backspace initialization. 2018-04-02 07:47:49 -04:00
Nick Couchman
112ce5299e GUACAMOLE-269: Remove unnecessary dynamic allocation. 2018-03-24 14:54:27 -04:00
Nick Couchman
c3e1b2afef GUACAMOLE-269: Fix minor style issues and update comments. 2018-03-08 10:48:22 -05:00
Nick Couchman
33cca46346 GUACAMOLE-269: Remove debug code. 2018-03-08 10:48:22 -05:00
Nick Couchman
dd78d230ea GUACAMOLE-269: Backspace key should send null-terminated string. 2018-03-08 10:48:22 -05:00
Nick Couchman
46e908c06e GUACAMOLE-269: Allow backspace key to be configured. 2018-03-08 10:48:21 -05:00
Michael Jumper
81a0e66d9f GUACAMOLE-313: Include current button state within mouse update for completeness. 2018-01-26 16:21:53 -08:00
sanhex
d33bd8deff GUACAMOLE-384: fixing segfault during ssh disconnect
Root Cause:
See the core dump and Valgrind report posted on Jira. guacd was reading a ssh terminal which had been freed. When a ssh connection is terminated, guac_ssh_client_free_handler() will be called from guacd_exec_proc() -> guac_client_free() with pointer client->free_handler. In guac_ssh_client_free_handler(), when ssh_client->term is freed, ssh_client->client_thread may still be using the ssh_client->term. It causes the crash reported in this bug.

The stack trace exposing the problem can be found by running guacd under Valgrind with a ssh test script. The test script repeats doing ssh login and logout for 5000 times.

Solution:
In guac_ssh_client_free_handler(), before calling guac_terminal_free(ssh_client->term), close the stdin pipe of the terminal to stop reading the pipe with guac_terminal_read_stdin() in ssh_input_thread(). So that ssh_input_thread() can be terminated in this case. Call pthread_join() to wait for ssh_client_thread() terminating before freeing the terminal.

Add a new function guac_terminal_stop() to close the pipe and set the fds to invalid (-1). Call it in guac_ssh_client_free_handler() and guac_terminal_free().

Checking the client running state in ssh_input_thread() and ssh_client_thread() to make sure they can be terminated when the client is stopped in guacd_exec_proc() by another thread.

Test:
- Confirmed ssh connection works normally.
- Observed the child process of guacd exits when ssh connection is terminated.
- Reran the ssh test script. Observed no crash.
2017-10-29 18:11:15 -07:00
Michael Jumper
eec3607b16 GUACAMOLE-279: Migrate to mutable terminal color palette. 2017-07-10 14:08:21 -07:00
Michael Jumper
2146200dfd GUACAMOLE-280: Add support for faint (low) intensity SGR. 2017-05-21 13:46:21 -07:00
Michael Jumper
eaa71f5717 GUACAMOLE-278: Move terminal palette/color definitions into dedicated files. 2017-04-23 13:23:58 -07:00
Michael Jumper
48fc4afc5b GUACAMOLE-278: Copy terminal color values rather than referencing only by palette index. 2017-04-23 13:23:48 -07:00
James Muehlner
2c2824fc5b Merge 0.9.12-incubating changes back to master. 2017-03-13 22:13:10 -07:00
Michael Jumper
fe8771e181 GUACAMOLE-231: Notifying terminal for mouse movement is no longer necessary (common cursor sends its own position updates without requiring new frames). 2017-03-11 14:58:52 -08:00
James Muehlner
1d5d8784b3 Merge 0.9.12-incubating changes back to master. 2017-03-10 09:46:59 -08:00
Michael Jumper
6a1db08299 GUACAMOLE-231: Notify terminal when display is modified due to mouse cursor movement. 2017-03-06 22:41:19 -08:00
James Muehlner
c4903a8e36 Merge 0.9.12-incubating changes back to master. 2017-02-28 10:32:49 -08:00
Michael Jumper
3f7ccb6b9a GUACAMOLE-169: Move terminal headers to namespaced directory. 2017-02-27 14:34:46 -08:00
Michael Jumper
da81d16c27 GUACAMOLE-206: Do not drop keys while Alt is held. 2017-02-14 21:25:20 -08:00
Michael Jumper
a6e3f19bf7 GUACAMOLE-149: Ignore zero-width characters. 2017-01-31 23:57:02 -08:00
Michael Jumper
fc6f36150f GUACAMOLE-193: Take character attributes into account when testing for visibility. 2017-01-30 22:39:49 -08:00
Michael Jumper
eee928548d GUACAMOLE-169: Use proper namespace for internal common headers. 2017-01-23 23:26:26 -08:00
Michael Jumper
e5b3af8ffe GUACAMOLE-86: Remove terminal emulator's STDOUT pipe. Use pthread_cond_t to signal modification. 2017-01-16 00:02:30 -08:00
Michael Jumper
a1fc5bc733 GUACAMOLE-118: Use poll() when waiting for data to be written to the terminal emulator. 2016-11-11 13:12:12 -08:00
Michael Jumper
72fb8ffdfe GUACAMOLE-51: Explicitly map number pad keys within Guacamole terminal emulator. 2016-06-14 14:20:30 -07:00
Michael Jumper
4da3bef4ec GUACAMOLE-1: Relicense C files. 2016-03-28 20:39:19 -07:00
Michael Jumper
8f6a585b09 GUAC-1389: Rename guac_terminal_add_user() to guac_terminal_dup(). 2016-03-14 16:03:05 -07:00
Michael Jumper
d59a6ebf62 GUAC-1389: Remove use of guac_common_display from terminal. 2016-03-14 16:00:21 -07:00
Michael Jumper
a14e0fa3fb GUAC-1389: Redraw / resync terminal contents. 2016-03-14 16:00:21 -07:00
Michael Jumper
60dec61c51 GUAC-1389: Redraw / resync scrollbar state when a new user joins a terminal session. 2016-03-14 16:00:21 -07:00
Michael Jumper
e750ca9499 GUAC-1389: Update terminal to support screen sharing. 2016-03-09 12:57:41 -08:00
Michael Jumper
d9dacedbe0 GUAC-1452: Log typescript creation/failure. 2016-01-27 12:43:53 -08:00
Michael Jumper
0d5355560e GUAC-1452: Fix inverted logic for typescript alloc return value. 2016-01-27 12:43:53 -08:00
Michael Jumper
b2a356d4b8 GUAC-1452: Write to and flush typescript automatically. 2016-01-27 12:43:52 -08:00
Michael Jumper
3f4bac3d04 GUAC-1452: Add base typescript implementation and stubs. 2016-01-25 17:04:15 -08:00
Michael Jumper
4bc5ebe7da GUAC-1452: Ensure pipe is flushed and closed if terminal is destroyed. 2016-01-13 18:07:37 -08:00
Michael Jumper
ff557a7f01 GUAC-1452: Echo to pipe stream if open (buffered). 2016-01-13 17:38:13 -08:00
Michael Jumper
051701d566 GUAC-1452: Provide for storage of pipe stream within terminal struct. 2016-01-13 10:37:41 -08:00
Michael Jumper
fa443249c9 GUAC-1195: Use color scheme constants and names. 2015-07-28 16:43:23 -07:00
Michael Jumper
029b3bdb80 GUAC-1195: Configure default foreground/background when terminal is created. 2015-07-28 15:59:20 -07:00
Michael Jumper
da367b373f GUAC-1028: Fix race condition on terminal resize. 2015-02-05 17:21:33 -08:00
Michael Jumper
eb9c6fb899 GUAC-803: Continue reading data until end of frame. 2015-02-04 19:22:22 -08:00
Michael Jumper
61337d5614 GUAC-803: Notify terminal of changes instead of explicitly flushing/syncing. 2015-02-04 19:22:22 -08:00
Michael Jumper
c39201cd8b GUAC-803: Write to terminal STDOUT using length-prefixed packets, such that zero-length writes are legal. 2015-02-04 19:22:22 -08:00
Michael Jumper
207d97bec0 GUAC-803: Use normal pointer when mouse is over scrollbar. 2015-02-04 01:01:39 -08:00
Michael Jumper
fc476fd99e GUAC-803: Actually scroll when the scrollbar handle is dragged. 2015-02-04 00:41:45 -08:00