Commit Graph

744 Commits

Author SHA1 Message Date
Michael Jumper
233f5e27e2 GUACAMOLE-296: Merge changes reverting explicit linking of libwinpr-utils. 2017-11-06 11:24:39 -08:00
Nick Couchman
b9f8e13d80 GUACAMOLE-296: Revert manual addition of winpr-utils library. 2017-11-06 12:20:56 -05:00
itsankoff
bbafa00df0 GUACAMOLE-424: Prevent null pointer dereference for vnc client display and cursor 2017-11-02 19:53:17 +02: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
itsankoff
15f6c4f3dc GUACAMOLE-424: Fix null pointer dereference for vnc client display 2017-10-24 20:21:03 +03:00
Michael Jumper
95be88be19 GUACAMOLE-296: Merge fix for linking issues with FreeRDP 1.1 and guacai (audio input). 2017-10-14 23:45:35 -07:00
Nick Couchman
caedf26a06 GUACAMOLE-296: Break out WINPR libs into their own variable. 2017-10-13 21:25:32 -04:00
David Fort
bb527f30f8 GUACAMOLE-402: fix out-of-tree build
Use $(srcdir) in places were it's needed, so that an out-of-tree build works.
2017-10-12 15:11:27 +02:00
sanhex
3c7a09f52b GUACAMOLE-400: Fix guacd crash when ssh key fails
Root Cause:
In the ssh library of guacd, function ssh_client_thread(), when guac_ssh_get_user() fails to load private key for ssh authentication, it will return NULL. In this case, the subsequent call to guac_common_ssh_create_session() with parameter 'user=0x0' will cause guacd crash in function guac_common_ssh_authenticate() by accessing 'user->username'.

Solution:
- Update the comment of function guac_ssh_get_user() to document that NULL will be returned if fails to import key for the user.
- In function ssh_client_thread(), verify the return of guac_ssh_get_user(). If ssh_client->user is NULL, return NULL.

Test:
- Configured a ssh app with an encrypted private key and a wrong passphrase.
- Ran the ssh app from web portal and observed guacd crash.
- Applied the fix and reran the ssh app. Observed no crash.
2017-09-29 11:04:48 -07:00
Ilya Shipitsin
fc071fd1af GUACAMOLE-383: resolve issues identified by cppcheck
[src/guacd/conf-file.c:206]: (error) Memory leak: conf
[src/protocols/rdp/rdp_cliprdr.c:205]: (error) Memory leak: output
[src/terminal/display.c:283]: (error) Memory leak: display
[src/terminal/display.c:290]: (error) Memory leak: display
2017-09-20 22:55:58 +05:00
Michael Jumper
7857dd0a9a GUACAMOLE-303: Ensure there is always space for the null terminator when normalizing. 2017-07-04 12:00:43 -07:00
Michael Jumper
d51e92eb31 GUACAMOLE-303: Add "sftp-root-directory" parameter to VNC, RDP, and SSH. 2017-06-29 15:48:23 -07:00
Michael Jumper
0474f86c46 GUACAMOLE-303: Extend common SFTP filesystem such that arbitrary directories can be used as the root of the filesystem. 2017-06-29 15:36:10 -07:00
Michael Jumper
e5a1b4d8ae GUACAMOLE-326: Explicitly deny attempted reads/writes to Windows named data streams (like "foo:Zone.identifier" for the file "foo"). 2017-06-26 14:40:32 -07:00
Nick Couchman
041fcc4651 GUACAMOLE-203: Change remaining instances of timer to timeout. 2017-06-25 05:13:22 -04:00
Nick Couchman
05dfb1a6ae GUACAMOLE-203: Deal correctly with negative keepalive values. 2017-06-25 05:10:22 -04:00
Nick Couchman
8c24c77d55 GUACAMOLE-203: Change timer to timeout 2017-06-14 13:00:30 -04:00
Nick Couchman
af4d762147 GUACAMOLE-203: Move warning about minimum alive interval to single place in common code. 2017-06-14 12:49:49 -04:00
Nick Couchman
89b9a905db GUACAMOLE-203: Tweak warning message sent to users. 2017-06-14 11:11:32 -04:00
Nick Couchman
df718395e8 GUACAMOLE-203: Change alive interval from int to unsigned. 2017-06-14 10:17:28 -04:00
Nick Couchman
193051dfd5 GUACAMOLE-203: Change parameter name for consistency 2017-06-14 08:40:07 -04:00
Nick Couchman
070bd25721 GUACAMOLE-203: if statement style tweak 2017-06-14 08:27:09 -04:00
Nick Couchman
03403e3ea5 GUACAMOLE-203: Correct implementation of SSH keepalive option for SFTP connections across all protocols. 2017-05-31 21:03:14 -04:00
Nick Couchman
e7fc8a0d98 GUACAMOLE-203: Expand SSH keepalives to cover SFTP connections for other protocols. 2017-05-31 21:03:09 -04:00
Nick Couchman
9993684205 GUACAMOLE-203: Warn user if they try to enter keepalive value < 2 seconds. 2017-05-31 21:03:06 -04:00
Nick Couchman
1e3d82cc63 GUACAMOLE-203: Update comment for keep alive interval. 2017-05-31 21:03:04 -04:00
Nick Couchman
f693b02e12 GUACAMOLE-203: Tighten up code, implement constant for socket poll timer. 2017-05-31 21:02:59 -04:00
Nick Couchman
75019f5e4b GUACAMOLE-203: Add a few more comments to code. 2017-05-31 21:02:53 -04:00
Nick Couchman
8ab7e56972 GUACAMOLE-203: Implement keepalive config in SSH connection. 2017-05-31 21:02:50 -04:00
Nick Couchman
f42f05aab7 GUACAMOLE-203: Add option entries for ServerAliveInterval. 2017-05-31 21:02:38 -04:00
Michael Jumper
8024f13458 GUACAMOLE-306: Do not attempt to send VNC events with a non-existent VNC client object. 2017-05-19 14:20:28 -07:00
James Muehlner
69caa9936b GUACAMOLE-40: Merge RD gateway support. 2017-04-20 21:36:44 -07:00
Michael Jumper
228874804e GUACAMOLE-268: Use 64-bit unsigned integers to represent file size internally (identical to RDPDR). 2017-04-17 11:52:07 -07:00
Michael Jumper
09099050cb GUACAMOLE-40: Set RD gateway and load balancing settings for FreeRDP where applicable. 2017-04-10 00:13:38 -07:00
Michael Jumper
da8636ef54 GUACAMOLE-40: Add and parse RD gateway connection parameters. 2017-04-09 23:58:11 -07:00
dborth
8833c0dd79 GUACAMOLE-262: set VNC trueColour flag to 1 instead of 255 2017-04-03 09:28:22 -06:00
Michael Jumper
61896e829c GUACAMOLE-257: Set VNC/SSH file upload handlers only if SFTP is enabled. 2017-03-28 10:48:38 -07: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
d371f2d9ee GUACAMOLE-169: Move common-ssh headers to namespaced directory. 2017-02-27 14:28:23 -08:00
Michael Jumper
fb8a2766da GUACAMOLE-194: Free SSH user for VNC+SFTP and RDP+SFTP only within client free. 2017-02-26 15:10:53 -08:00
Michael Jumper
c796787f25 GUACAMOLE-218: Reset internal RDPSND audio format counter whenever a new SNDC_FORMATS PDU is received. 2017-02-25 15:08:16 -08:00
James Muehlner
077cc84d27 GUACAMOLE-208: Merge new protocol status codes. 2017-02-15 21:52:36 -08:00
Michael Jumper
4f4643dd2f GUACAMOLE-208: Report network failures to connect with UPSTREAM_NOT_FOUND. 2017-02-15 21:40:00 -08:00
Michael Jumper
a78d52e615 GUACAMOLE-208: Handle RDP disconnect reason codes. 2017-02-15 21:23:46 -08:00
Michael Jumper
12cde5d520 GUACAMOLE-200: Clear reference to active job after the job has been freed. 2017-02-15 20:11:26 -08:00
Michael Jumper
7a4b737a3a GUACAMOLE-200: Document all parameters of guac_rdp_print_job_write(). 2017-02-15 19:59:50 -08:00
Michael Jumper
bf2a5885d0 GUACAMOLE-200: Move print job cleanup into main RDP client thread. 2017-02-14 00:09:24 -08:00
Michael Jumper
5a68f932d6 GUACAMOLE-200: Maintain print jobs at top level. Do not rely on proper free of RDPDR plugin. 2017-02-14 00:02:17 -08:00
Michael Jumper
1537e475af GUACAMOLE-200: Refactor RDPDR print job object to top-level. 2017-02-13 23:51:33 -08:00
Michael Jumper
17093a8149 GUACAMOLE-200: Kill any remaining print job when connection closes. 2017-02-13 23:08:54 -08:00
Michael Jumper
d23a22b7c6 GUACAMOLE-200: Clean up PostScript document title search logic. 2017-02-13 18:42:28 -08:00
Michael Jumper
3fc43fba37 GUACAMOLE-200: Refactor RDPDR printer such that the "ack" handler cannot block. 2017-02-13 18:42:28 -08:00
James Muehlner
d831a4b9df GUACAMOLE-188: Merge alpha component support for common surface. 2017-01-29 12:45:46 -08:00
James Muehlner
135514a0d2 GUACAMOLE-94: Merge move from readdir_r to readdir. 2017-01-29 12:30:24 -08:00
Michael Jumper
b9faca923b GUACAMOLE-135: Correct Swiss French mapping of "¬", "|", and "¢" (off by one key). 2017-01-28 14:55:38 -08:00
Michael Jumper
c79b303237 GUACAMOLE-135: Clean up spacing and alignment of Swiss French keymap. 2017-01-28 14:23:33 -08:00
Michael Jumper
c6f6bb67f0 GUACAMOLE-135: Swiss Franch dead umlaut should map from keysym 0xFE57. 2017-01-28 14:22:22 -08:00
Michael Jumper
fb298acdcd GUACAMOLE-135: Abbreviate Swiss French mapping range where possible. 2017-01-28 14:21:17 -08:00
Michael Jumper
86493dda93 GUACAMOLE-135: Remove duplicate scancode mappings from Swiss French keymap. 2017-01-28 14:19:52 -08:00
Cédric Marie-Marthe
941fd9659a GUACAMOLE-135: Add Swiss-French keymap for RDP. 2017-01-28 13:35:21 -08:00
Michael Jumper
dc6cae46ca GUACAMOLE-94: Use readdir() instead of readdir_r(). Multiple threads will not be accessing the same directory stream. 2017-01-28 00:11:59 -08:00
Michael Jumper
1a5f48961c GUACAMOLE-188: Allow alpha component to be set within common surface. 2017-01-27 16:51:45 -08:00
James Muehlner
5d5fbb4d45 GUACAMOLE-172: Merge lag calculation improvements. 2017-01-24 23:26:29 -08:00
Michael Jumper
48ebbe95ea GUACAMOLE-179: Move PulseAudio support into separate utility library. 2017-01-24 17:19:06 -08:00
Michael Jumper
234f98705e GUACAMOLE-172: Use frame start as end of previous frame (ignore server-side time). 2017-01-24 00:18:07 -08:00
Michael Jumper
f641d91b55 GUACAMOLE-172: Exclude server-side rendering time from next frame's required wait (if render times are consistent, then including that time will result in duplicate waiting: once within the render loop, and again when actually flushing the display). 2017-01-24 00:18:04 -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
James Muehlner
574bec859a GUACAMOLE-119: Merge addition of missing liscense files and exclusion of generated source from source archive. 2016-11-13 10:52:16 -08:00
Michael Jumper
8fc4cc928d GUACAMOLE-119: Do not include generated sources in source tarball. 2016-11-12 18:56:18 -08:00
Michael Jumper
c12e26404a GUACAMOLE-118: Use poll() when waiting for data from RDP. Reformat for sake of readability/verification. 2016-11-11 13:45:01 -08:00
Michael Jumper
2421fc2f11 GUACAMOLE-118: Use poll() when waiting for data from SSH. 2016-11-11 13:16:57 -08:00
Michael Jumper
168359344e GUACAMOLE-118: Use poll() when waiting for data from Telnet. 2016-11-11 13:13:48 -08:00
Michael Jumper
bed38cec71 GUACAMOLE-117: Do not stop connection when the intent is to reconnect (originally broken by commit a64c3e0). 2016-10-29 15:00:53 -07:00
Michael Jumper
996f1a8ec2 GUACAMOLE-51: Require shift released and numlock active for keypad numerals. 2016-08-16 20:00:24 -07:00
Michael Jumper
69ab054323 GUACAMOLE-51: Support -num and +num option (require clear/set numlock) in keymaps. 2016-08-16 20:00:24 -07:00
Michael Jumper
0c48096147 GUACAMOLE-51: Track and synchronize remote lock key state. 2016-08-16 20:00:24 -07:00
Michael Jumper
4f4f83f9a7 GUACAMOLE-51: Isolate sending of specific RDP events within own functions. 2016-08-16 19:54:08 -07:00
Michael Jumper
78a696a86f GUACAMOLE-51: Abstract away RDP keyboard state tracking with dedicated guac_rdp_keyboard structure. 2016-08-13 18:14:04 -07:00
Michael Jumper
1ad99a312e GUACAMOLE-5: Add "read-only" parameter to RDP, SSH, and telnet (per-user, just like VNC). 2016-07-24 22:36:25 -07:00
Michael Jumper
59e66ddc77 GUACAMOLE-5: Handle VNC's "read-only" parameter on a per-user basis. 2016-07-24 22:36:25 -07:00
Michael Jumper
0641ccf601 GUACAMOLE-5: Store connection parameters at user level. Maintain reference to owner's connection parameters at client level. 2016-07-24 22:05:04 -07:00
Michael Jumper
69ddeeb06d GUACAMOLE-44: Refactor the RDPDR printer to synchronous operation. 2016-06-16 15:40:43 -07:00
Michael Jumper
c1fdbca62b GUACAMOLE-25: Avoid unnecessary allocation of temporary string for guac_rdp_ptr_to_string(). 2016-06-03 11:41:55 -07:00
Michael Jumper
402b039384 GUACAMOLE-25: Update documentation regarding loading of dynamic virtual channel plugins. 2016-06-01 22:06:17 -07:00
Michael Jumper
0d29694afc GUACAMOLE-25: Reset I/O counters upon end-of-stream. 2016-06-01 16:20:38 -07:00
Michael Jumper
0be04ea54d GUACAMOLE-25: Resample received audio as necessary. 2016-06-01 15:25:42 -07:00
Michael Jumper
1c2890b47c GUACAMOLE-25: Store PCM format expected by RDP server. 2016-05-26 10:39:33 -07:00
Michael Jumper
ad00cce0ad GUACAMOLE-25: Store audio format within common structure. 2016-05-25 14:38:22 -07:00
Michael Jumper
260d0cd340 GUACAMOLE-25: Remove STUB. 2016-05-25 13:50:29 -07:00
Michael Jumper
533a47f06d GUACAMOLE-25: Store input and output audio format. 2016-05-25 13:50:29 -07:00
Michael Jumper
320f564daf GUACAMOLE-25: Implement parsing of audio mimetypes. 2016-05-25 13:50:29 -07:00
Michael Jumper
8ccf61e6b1 GUACAMOLE-25: Support FreeRDP stable-1.0 and compatible. 2016-05-25 13:50:29 -07:00
Michael Jumper
f1d4393eb8 GUACAMOLE-25: Implement buffer attachment in Stream_New() and Stream_Free() compatibility functions. 2016-05-25 13:50:28 -07:00
Michael Jumper
1393358469 GUACAMOLE-25: Abstract DVC management away from FreeRDP for sake of API compatibility. 2016-05-25 13:50:28 -07:00
Michael Jumper
46bdf0692f GUACAMOLE-25: Delay sending of "ack" until RDP has opened the AUDIO_INPUT stream. Close audio stream with another "ack" when RDP has closed the AUDIO_INPUT stream. 2016-05-25 13:50:28 -07:00
Michael Jumper
166eba11b7 GUACAMOLE-25: Fix pointer update in audio input buffer transfer. 2016-05-25 13:50:28 -07:00
Michael Jumper
4e4dbd6a2d GUACAMOLE-25: Fix configure test for FreeRDP variations. 2016-05-25 13:50:28 -07:00
Michael Jumper
9d5871a3c8 GUACAMOLE-25: Buffer and send Data PDUs as necessary. 2016-05-25 13:50:28 -07:00