Compare commits

...

3413 Commits

Author SHA1 Message Date
Virtually Nick
47b9360d46
GUACAMOLE-1714: Merge update guacenc for const parameters/values introduced in FFmpeg 5.0. 2023-02-02 20:36:32 -05:00
Mike Jumper
98c2a6adcb
GUACAMOLE-377: Merge correction ensuring users receive a proper frame boundary when joining. 2023-01-24 14:25:09 -08:00
Alex Leitner
3b0a9bac75 GUACAMOLE-377: Send a sync instruction to users when synchronizing surfaces. 2023-01-23 20:55:01 +00:00
Mike Jumper
f6893ed319 Merge 1.5.0 changes back to master. 2023-01-10 21:54:05 -08:00
James Muehlner
a5214c971a
GUACAMOLE-1604: Merge version number bumps for 1.5.0. 2023-01-10 17:16:43 -08:00
Mike Jumper
ccfcef8c0f GUACAMOLE-1604: Add explicit libtool version info for libguac-terminal. 2023-01-10 17:08:15 -08:00
Mike Jumper
1a7a57ed19 GUACAMOLE-1604: Update libtool version info for libguac (interfaces added and changed).
The only changed interface here is the guac_user_info struct, which now
has a "name" member.
2023-01-10 17:07:16 -08:00
Mike Jumper
eac064bde9 GUACAMOLE-1604: Bump version number to 1.5.0. 2023-01-10 17:02:06 -08:00
Virtually Nick
4afc1d85ce Merge 1.5.0 changes back to master. 2023-01-04 15:53:11 -05:00
Virtually Nick
818b5f79df
GUACAMOLE-1538: Merge add missing documentation for libguac-terminal. 2023-01-04 15:51:05 -05:00
Mike Jumper
8ef60bfa9d GUACAMOLE-1538: Document parameters of libguac-terminal handlers. 2023-01-04 12:40:21 -08:00
Mike Jumper
d90e0e97fe GUACAMOLE-1538: Add missing documentation for libguac-terminal functions. 2023-01-04 12:22:02 -08:00
Mike Jumper
ec7964e8fb GUACAMOLE-1538: Return number of bytes written for guac_terminal_write() and guac_terminal_printf(). 2023-01-04 12:05:02 -08:00
James Muehlner
add7ce361b Merge 1.5.0 changes back to master. 2022-11-29 03:46:57 +00:00
James Muehlner
7d16f67d6d
GUACAMOLE-1293: Merge fix for double acquisition/release of rwlock. 2022-11-28 14:31:44 -08:00
Mike Jumper
e3adb97085 GUACAMOLE-1293: Do not re-acquire __users_lock while already held for writing.
Per POSIX spec, the behavior of acquiring a read lock on a rwlock that's
already acquired for writing is undefined. From the documentation for
pthread_rwlock_rdlock():

"... Results are undefined if the calling thread holds a write lock on
rwlock at the time the call is made."
2022-11-28 13:37:41 -08:00
Mike Jumper
55941823ec Merge 1.5.0 changes back to master. 2022-11-25 23:24:08 -08:00
Mike Jumper
07acce8a76
GUACAMOLE-1293: Merge support for notifying when a user has joined/left a connection. 2022-11-25 23:23:13 -08:00
Virtually Nick
5b1677f21a GUACAMOLE-1293: Fix copy-pasta and style issues; add user ID to information passed to client. 2022-11-25 21:57:44 -05:00
Virtually Nick
623c398005 GUACAMOLE-1293: Change new user info member to simply "name" to clarify its purpose. 2022-11-24 18:13:06 -05:00
Virtually Nick
aa92239edd GUACAMOLE-1293: Rename new enum values to be more consistent with existing code. 2022-11-08 07:45:38 -05:00
Virtually Nick
897712c743 GUACAMOLE-1293: Update and add debug logging. 2022-11-08 07:45:38 -05:00
Virtually Nick
02b24d0101 GUACAMOLE-1293: Simplify the assignment of strings/constants. 2022-11-08 07:45:38 -05:00
Virtually Nick
26eadc37a3 GUACAMOLE-1293: Move to status code plus arguments for msg instruction. 2022-11-08 07:45:38 -05:00
Virtually Nick
6d7156bc70 GUACAMOLE-1293: Update struct member that stores human-readable name. 2022-11-08 07:45:38 -05:00
Virtually Nick
6312e1720d GUACAMOLE-1293: Add support for notifying owner of users joining and leaving. 2022-11-08 07:45:38 -05:00
Virtually Nick
cb7ae25177 GUACAMOLE-1293: Add support for the name handshake instruction. 2022-11-08 07:45:38 -05:00
Virtually Nick
a4adb3f5c0 GUACAMOLE-1293: Add protocol support for msg instruction. 2022-11-08 07:45:38 -05:00
Dan Fandrich
5cf408ebbb GUACAMOLE-1714: Adapt to const parameters of ffmpeg 5.0. 2022-11-07 12:16:35 -08:00
Mike Jumper
3ca6bb0a61
GUACAMOLE-1708: Merge correction to missing Czech keyboard character mapping. 2022-11-06 09:05:52 -08:00
Max
457a169c49 GUACAMOLE-1708: Added Czech keyboard keymap fix missing char 2022-11-06 12:17:21 +01:00
Mike Jumper
bad381cebe
GUACAMOLE-1708: Merge RDP support for Czech keyboard layout. 2022-11-05 08:56:56 -07:00
Max
6171da6d0b GUACAMOLE-1708: Added Czech keyboard keymap for RDP 2022-11-01 21:56:23 +01:00
Mike Jumper
067f2a91a0
GUACAMOLE-1682: Merge automatic newline normalization of terminal clipboard. 2022-10-18 12:41:48 -07:00
Alex Leitner
bc52485570 GUACAMOLE-1682: Normalize conflicting newline encodings in clipboards between Linux and Windows systems for ssh sessions. 2022-10-18 19:38:56 +00:00
Mike Jumper
b20afa275a
GUACAMOLE-1669: Merge fix for RSA key upgrade failure if FIPS mode is enabled. 2022-09-13 14:45:55 -07:00
James Muehlner
b096e47f57 GUACAMOLE-1669: Include ext-info-c in preferred KEX algorithms to ensure RSA key upgrades can happen. 2022-09-13 21:39:38 +00:00
Mike Jumper
4d211e0c9e
GUACAMOLE-1674: Merge changes removing NLA from negotiation if FIPS is enabled. 2022-09-08 09:44:47 -07:00
James Muehlner
dffbeac57a GUACAMOLE-1674: Warn about NLA mode if FIPS mode is enabled, or disable if possible. 2022-08-30 23:23:56 +00:00
Mike Jumper
0361adc01f
GUACAMOLE-1669: Merge FIPS support for SSH connections. 2022-08-24 15:29:46 -07:00
James Muehlner
1971a9dad2 GUACAMOLE-1669: Prefer FIPS compliant ciphers and algorithms when FIPS mode is enabled. 2022-08-24 22:23:46 +00:00
Virtually Nick
5dbf4820ab Merge 1.5.0 changes back to master. 2022-08-19 15:48:51 -04:00
Virtually Nick
b2eb13a178
GUACAMOLE-1540: Merge correct automated retrieval of Docker build dependencies. 2022-08-19 15:30:31 -04:00
Michael Jumper
2bc9d5ff01 GUACAMOLE-1540: Correct regex stripping of package version (major number may have multiple digits). 2022-08-19 12:12:29 -07:00
Michael Jumper
5918cc9f7c GUACAMOLE-1540: Ignore failures to find packages associated with libraries we build ourselves. 2022-08-19 12:12:29 -07:00
James Muehlner
15f6e9f678 Merge 1.5.0 changes back to master. 2022-08-16 18:48:31 +00:00
James Muehlner
b5addfe3da
GUACAMOLE-1540: Merge Alpine Linux docker base image with manual library builds. 2022-08-16 09:40:45 -07:00
Michael Jumper
7f4246b6d5 GUACAMOLE-1540: Manual build all core protocol libraries for Docker image using Alpine Linux base. 2022-08-16 08:39:54 -07:00
Virtually Nick
6ab82446bb
GUACAMOLE-1652: Merge only call SSL init functions when the library version requires it. 2022-07-30 07:36:37 -04:00
James Muehlner
9c93337d97 GUACAMOLE-1652: Migrate OpenSSL initialization to modern methods for OpenSSL >= 1.1.0. 2022-07-30 02:24:31 +00:00
James Muehlner
cdee93ae25 GUACAMOLE-1652: Only call SSL init functions when the library version requires it. 2022-07-30 02:22:36 +00:00
Mike Jumper
eee3ac092c
GUACAMOLE-1622: Merge correction to terminal resize regression. 2022-07-13 16:20:19 -07:00
Alex Leitner
5bb56ed5ba GUACAMOLE-1622: Restructured code to resolve scrollbar resizing bug where the scrollbar would clip off the side of the terminal. This fix also resolves the issue where the text would blur at certain intervals of resizing the window. 2022-07-13 21:57:47 +00:00
Mike Jumper
0aae5eeadb
GUACAMOLE-1636: Merge corrections to typos within RDP comments/documentation. 2022-07-13 13:55:05 -07:00
Jimmy
6d994db9d2 GUACAMOLE-1636: Fix a typo mistake invokved. 2022-07-13 23:47:13 +03:00
Jimmy
cba5484be0 GUACAMOLE-1636: Fix a typo mistake recieved. 2022-07-13 23:41:42 +03:00
Jimmy
4048dd4900 GUACAMOLE-1636: Fix a typo mistake assicated. 2022-07-13 23:32:12 +03:00
Jimmy
98556fbe2e GUACAMOLE-1636: Fix a typo mistake coordinare. 2022-07-13 23:24:06 +03:00
Jimmy
f438a36612 GUACAMOLE-1636: Fix a typo mistake synchonize. 2022-07-13 23:17:50 +03:00
Jimmy
e8d966aec6 GUACAMOLE-1636: Fix a typo mistake Versoin. 2022-07-13 23:10:36 +03:00
Jimmy
523532a52d GUACAMOLE-1636: Fix a typo mistake offscren. 2022-07-13 23:02:37 +03:00
Mike Jumper
51c640fdbd
GUACAMOLE-1436: Merge addition of missing FreeRDP winpr headers. 2022-07-05 12:09:00 -07:00
Virtually Nick
4cf1bfae0e
GUACAMOLE-377: Merge update unit tests for new prototype of guac_protocol_send_sync(). 2022-07-05 14:30:57 -04:00
Michael Jumper
9642afc468 GUACAMOLE-377: Update unit tests for new prototype of guac_protocol_send_sync().
The new guac_protocol_send_sync() requires an additional parameter: the
number of logical frames associated with the sync.
2022-07-05 10:58:38 -07:00
James Muehlner
ffb6c809be
GUACAMOLE-1622: Merge addition of margins to ssh sessions. 2022-06-22 09:32:00 -07:00
Alex Leitner
64ea9c4d1f GUACAMOLE-1622: Clarified comments to describe if param is a pointer. 2022-06-21 16:16:52 +00:00
Alex Leitner
a5834fd319 GUACAMOLE-1622: Separated logic into single responsibility functions. 2022-06-16 17:09:41 +00:00
Alex Leitner
1e9cd9137b GUACAMOLE-1622: Added margins to ssh sessions. 2022-06-15 16:59:20 +00:00
James Muehlner
d4cd9b3e3a
GUACAMOLE-377: Merge support for RemoteFX. 2022-06-09 17:41:23 -07:00
Michael Jumper
31f1b2c7c4 GUACAMOLE-377: Rename single-letter "e" event arguments variable to "args" for readability. 2022-06-09 09:02:11 -07:00
Michael Jumper
ce27936ed5 GUACAMOLE-377: Add frame boundaries around cursor set operations if otherwise absent. 2022-06-09 09:02:11 -07:00
Michael Jumper
b7f05b9e4f GUACAMOLE-377: Ensure backing surface of underlying FreeRDP GDI implementation is resized when desktop is resized. 2022-06-09 09:02:11 -07:00
Michael Jumper
d5761ad625 GUACAMOLE-377: Warn about required color depth only if actually overridden. 2022-06-09 09:02:11 -07:00
Michael Jumper
b26f9d64d6 GUACAMOLE-377: Clarify usage of EndPaint to detect frames. 2022-06-09 09:02:11 -07:00
Michael Jumper
da80163e24 GUACAMOLE-377: Enable graphics pipeline extension by default. 2022-06-09 09:02:11 -07:00
Michael Jumper
28396ae345 GUACAMOLE-377: Expect explicit RDP frame boundaries only after at least one frame boundary has been received. 2022-05-18 15:43:54 -07:00
Michael Jumper
a0e9f6ed9b GUACAMOLE-377: Leverage client timestamp tracking for RDP frame duration. 2022-05-18 15:43:54 -07:00
Michael Jumper
bde8cdee46 GUACAMOLE-377: Add general RDP support for frame markers. 2022-05-18 15:43:54 -07:00
Michael Jumper
669e02b4dc GUACAMOLE-377: Leverage RDPGFX to report remote frame statistics to the client. 2022-05-12 13:50:20 -07:00
Michael Jumper
52c8683bcf GUACAMOLE-377: Add protocol-level support for reporting remote frame statistics. 2022-05-12 13:50:20 -07:00
Michael Jumper
c19eab9691 GUACAMOLE-377: Revise processing lag calculations to consider cumulative processing lag. 2022-05-12 13:50:20 -07:00
Michael Jumper
dd85c54961 GUACAMOLE-377: Add handling for EndPaint required by software GDI implementation of RDPGFX. 2022-05-12 13:50:20 -07:00
Michael Jumper
c795bf9e4a GUACAMOLE-377: Control RemoteFX / GFX support with "enable-gfx" parameter. 2022-05-12 13:50:20 -07:00
Michael Jumper
c469300941 GUACAMOLE-377: Support for RDPGFX. 2022-05-12 13:50:20 -07:00
James Muehlner
81300052e0
GUACAMOLE-1595: Merge mouse mask initialization fix. 2022-05-02 17:24:58 -07:00
Michael Jumper
df4e5c6fdf GUACAMOLE-1595: Ensure all mouse buttons are initially released when terminal starts. 2022-05-03 00:20:08 +00:00
Virtually Nick
a175a3d902
GUACAMOLE-1312: Merge add Canadian French RDP keymap 2022-03-23 09:58:58 -04:00
Kaven Rousseau
9cbd768210 GUACAMOLE-1312: Added fr_ca keymap 2022-03-17 16:13:42 -04:00
Virtually Nick
c716a07abc Merge 1.5.0 changes back to master. 2022-03-17 15:24:48 -04:00
Virtually Nick
c880f02fe8
GUACAMOLE-1115: Merge ensure RDP print process does not block itself from completing. 2022-03-17 15:20:51 -04:00
Michael Jumper
ce88fa4d4a GUACAMOLE-1115: Forcibly kill any outstanding PDF filter job when cleaning up resources. 2022-03-17 18:35:38 +00:00
Michael Jumper
d734bac590 GUACAMOLE-1115: Do not hold general RDP message lock while waiting for print operations.
Holding the message lock will block handling of things like mouse and
keyboard events, as the message lock must be acquired before sending the
corresponding messages to the RDP server. If mouse and keyboard events
are blocked, then handling of further Guacamole instructions like "ack"
is also blocked. If the print job is blocked until an "ack" is received,
this results in deadlock.
2022-03-17 18:35:20 +00:00
Mike Jumper
75a11b05b2
GUACAMOLE-1543: Merge changes moving recording structures/functions to the public API. 2022-03-01 09:58:50 -08:00
James Muehlner
854b5ecbb8 GUACAMOLE-1543: Move recording functionality from common to libguac. 2022-03-01 04:01:44 +00:00
Mike Jumper
d8073f9b17
GUACAMOLE-1538: Merge corrections to libguac-terminal build and scope. 2022-02-28 16:56:04 -08:00
James Muehlner
46e813343e GUACAMOLE-1538: Only the core functionality of the terminal lib should be public. 2022-03-01 00:33:55 +00:00
James Muehlner
ad0155b5f5 GUACAMOLE-1538: Make it clear which functions are getters by adding _get_ to the name of each. 2022-02-24 12:02:36 -08:00
James Muehlner
0856e94ece GUACAMOLE-1538 Use dashes instead of underscores in filenames for consistency with libguac public API. 2022-02-24 11:12:05 -08:00
James Muehlner
1c97cdb115 GUACAMOLE-1538: Autogenerate docs for new library. 2022-02-23 13:49:32 -08:00
James Muehlner
ce2ffdf75f GUACAMOLE-1538: Improve code style and cleanliness. 2022-02-22 20:37:42 -08:00
James Muehlner
6dd33a8d90 GUACAMOLE-1538: Do not use terminal internals outside of terminal code. 2022-02-22 16:06:48 -08:00
James Muehlner
589e0ecd03 GUACAMOLE-1538 - Consolidate clipboard handling; opaque clipboard struct to avoid exposing internal guac_common_clipboard. 2022-02-22 14:04:47 -08:00
James Muehlner
037045a054 GUACAMOLE-1538: Explicitly include the common lib; ensure no undefined symbols. 2022-02-22 11:07:30 -08:00
James Muehlner
63bf5b329c GUACAMOLE-1538: Rename library to match conventions. 2022-02-22 09:41:08 -08:00
Mike Jumper
dc9dfe562f
GUACAMOLE-1540: Merge changes correcting Docker-specific search for FreeRDP install location. 2022-02-21 17:32:23 -08:00
James Muehlner
757928dfa1 GUACAMOLE-1540: Search for libfreerdp2 installation directly instead of checking links. 2022-02-21 16:57:48 -08:00
Virtually Nick
a0faa02616
GUACAMOLE-1538: Merge refactor libguac_terminal for easier extensibility, and migrate to shared library. 2022-02-21 14:30:40 -05:00
James Muehlner
44d76da21a GUACAMOLE-1538: Use an options struct instead of hardcoding params in constructor. 2022-02-21 11:27:20 -08:00
James Muehlner
05c6131cf3 GUACAMOLE-1538: Update libguac_terminal to be a shared library. 2022-02-21 11:27:13 -08:00
Mike Jumper
001347b4e8
GUACAMOLE-1540: Merge migration of guacd Docker image to Ubuntu 21.10. 2022-02-18 16:20:17 -08:00
James Muehlner
edce11fcb4 GUACAMOLE-1540: Build using Ubuntu 21.10 as a base instead of buster-slim. 2022-02-18 15:48:18 -08:00
James Muehlner
e78d589e25
GUACAMOLE-876: Merge null-check fix for RDP open file check. 2022-02-18 13:50:03 -08:00
Michael Jumper
06461cac53 GUACAMOLE-876: Test for open files only if filesystem has been allocated. 2022-02-18 13:40:15 -08:00
Virtually Nick
8e94b00587
GUACAMOLE-1495: Merge add keymap for Polish keyboard layout for RDP 2022-02-17 12:46:01 -05:00
Virtually Nick
9245d02bc5
GUACAMOLE-462: Merge create recordings/typescripts with group read permission. 2022-02-17 12:43:51 -05:00
Michael Jumper
4d41b38a24 GUACAMOLE-462: Create recordings/typescripts with group read permission.
Previously, all recordings/typescripts were strictly readable by the
service user that created them (guacd). This prevents reading by other
services like the Guacamole web application. Instead,
recordings/typescripts should at least be group-readable.
2022-02-17 09:25:28 -08:00
Mike Jumper
29535e6cb8
GUACAMOLE-876: Merge changes deferring reconnect-to-resize until active transfers are complete. 2022-02-02 09:56:41 -08:00
Virtually Nick
10126444bf GUACAMOLE-876: Avoid disrupting open files and active print jobs to update display. 2022-02-01 21:45:10 -05:00
Mike Jumper
23612720ce
GUACAMOLE-745: Merge support for OpenSSH-format private keys / Ed25519. 2022-01-12 11:38:12 -08:00
Joshua Roys
f84db7d166 GUACAMOLE-745: Support OpenSSH private keys & ED25519
Let libssh2 parse PEM and ssh-native keys. Requires libssh2 1.9.0+
compiled against a crypto backend supporting ed25519.
2022-01-12 09:02:11 -05:00
ClassicGOD
a1d0d0aea4
GUACAMOLE-1495: add entry for pl_pl_qwerty
Add pl_pl_qwerty.keymap to rdp_keymaps
2022-01-10 20:31:41 +01:00
ClassicGOD
534158c1cb
GUACAMOLE-1495: add pl_pl_qwerty keymap
Add keymap file for Polish keyboard layout
2022-01-10 20:28:11 +01:00
Mike Jumper
56dca9880d
GUACAMOLE-1435: Merge correction to FreeRDP plugin entrypoint return type. 2022-01-03 21:59:57 -08:00
Virtually Nick
703f258b06 GUACAMOLE-1435: Correctly return UINT for DVCPluginEntry 2022-01-03 20:15:11 -05:00
Virtually Nick
bce1d2a434 GUACAMOLE-1436: Add winpr file.h dependencies as required. 2021-12-27 09:42:57 -05:00
Virtually Nick
084ddaf81f Merge 1.4.0 changes back to master. 2021-12-25 10:21:40 -05:00
Virtually Nick
be9041fefd
GUACAMOLE-478: Merge add clipboard line ending normalization option for RDP. 2021-12-25 10:18:39 -05:00
Michael Jumper
09bd4af77e GUACAMOLE-478: Add optional clipboard line ending normalization for RDP. 2021-12-25 00:31:17 -08:00
Michael Jumper
7472310a03 GUACAMOLE-478: Implement encoding translation functions for normalizing newline sequences. 2021-12-25 00:07:47 -08:00
Virtually Nick
27db57f704 Merge 1.4.0 changes back to master. 2021-12-24 19:24:36 -05:00
Virtually Nick
1f6f45e6e9
GUACAMOLE-1190: Merge explicitly use "localhost" as guacd default bind host, matching default of webapp. 2021-12-24 19:23:53 -05:00
Michael Jumper
e3e75464fb GUACAMOLE-1190: Explicitly use "localhost" as guacd default bind host, matching default of webapp. 2021-12-24 15:45:28 -08:00
Virtually Nick
90322cd4d3 Merge 1.4.0 changes back to master. 2021-12-19 22:17:47 -05:00
Virtually Nick
b9cc76058b
GUACAMOLE-1047: Merge notify connecting client of invalid connection IDs. 2021-12-19 18:39:15 -05:00
Michael Jumper
daa052398e GUACAMOLE-1047: Remove unnecessary use of snprintf() in favor of guacd_log(). 2021-12-18 15:13:10 -08:00
Virtually Nick
6760974912 Merge 1.4.0 changes back to master. 2021-12-11 07:44:56 -05:00
Virtually Nick
e84317ff86
GUACAMOLE-1411: Merge bump version numbers to 1.4.0. 2021-12-11 07:44:19 -05:00
Michael Jumper
a1a758f13c GUACAMOLE-1411: Update libtool version info for libguac (interfaces added and changed). 2021-12-10 23:55:16 -08:00
Michael Jumper
8dc92e69ca GUACAMOLE-1411: Bump version numbers to 1.4.0. 2021-12-10 23:51:34 -08:00
Virtually Nick
73ac4fcdbe
GUACAMOLE-1330: Merge dynamically allocate AVPacket when possible 2021-11-08 18:47:03 -05:00
Michael Jumper
bc6b5cef25 GUACAMOLE-1330: Dynamically allocate AVPacket when supported (static allocation deprecated as of libavcodec 58.133.100). 2021-11-08 15:24:36 -08:00
Virtually Nick
491be8382a
GUACAMOLE-1416: Merge fix unreleased terminal lock in ssh_client_thread 2021-09-10 10:40:10 -04:00
ycaibb
329171a950 GUACAMOLE-1416: Fix unreleased the lock in the ssh_client_thread
GUACAMOLE-1416: Fix unreleased the lock ssh_client->term_channel_lock in the ssh_client_thread.
2021-09-10 22:26:32 +08:00
Virtually Nick
12b8eac514
GUACAMOLE-1388: Merge ensure RDP-specific resources are cleaned up after channel disconnect. 2021-07-29 19:54:35 -04:00
Michael Jumper
2524af80a9 GUACAMOLE-1388: Ensure RDP-specific resources are cleaned up after channel disconnect.
Without these changes, RDP-specific resources like the CLIPRDR and RDPEI
channels may remain from past connections if the RDP connection is
dynamically reconnected via the "Reconnect" display resize method,
resulting in assertion failures or memory errors if those stale
resources are reused after reconnect is completed.
2021-07-28 15:50:18 -07:00
Virtually Nick
91d79da49f
GUACAMOLE-1386: Merge add proper RDP mapping of "Meta" ("Windows") key. 2021-07-27 09:51:48 -04:00
Michael Jumper
eb52b4e258 GUACAMOLE-1386: Add proper RDP mapping of "Meta" ("Windows") key. 2021-07-26 19:59:12 -07:00
Mike Jumper
278745d6d8
GUACAMOLE-1064: Merge Norwegian keyboard layout for RDP. 2021-06-02 22:34:29 -07:00
Øyvind Harboe
910c87bda0 GUACAMOLE-1064: add Norwegian keyboard
Tested on top of Guacamole 1.3.0

The following works beyond a simple smoke-test:

- æøå
- \
- |
- dead acute á
- dead grave à
- dead umlaut ö
- dead cirumflex ê
- dead tilde ~
2021-06-03 07:02:05 +02:00
Mike Jumper
31b4246e18
GUACAMOLE-1350: Merge corrections for defined but unused leave_handlers. 2021-05-25 11:44:35 -07:00
Jimmy
a91c4b3869 GUACAMOLE-1350: Add code to join leave_handler when connecting in other protocols. 2021-05-25 02:03:07 +03:00
Jimmy
26d87aa5d3 GUACAMOLE-1350: Add code to join leave_handler when connecting in rdp. 2021-05-24 01:11:28 +03:00
Mike Jumper
44145f681a
GUACAMOLE-1215: Merge correction for escaping of backslashes in JSON strings. 2021-05-17 12:25:23 -07:00
Virtually Nick
0182de6d18 GUACAMOLE-1215: Add backslash to list of JSON-escaped characters. 2021-05-17 14:15:38 -04:00
Mike Jumper
df25aa9fdc
GUACAMOLE-1276: Merge correction for 32-bit truncation regression affecting RDP uploads. 2021-05-14 10:51:13 -07:00
Virtually Nick
68fc594247 GUACAMOLE-1276: Correct file upload offset type. 2021-05-14 09:19:28 -04:00
Virtually Nick
a6a7e8ac26
GUACAMOLE-1201: Merge throttle outbound audio data to avoid overflowing RDP server audio input buffer. 2021-05-01 22:10:11 -04:00
Michael Jumper
189d8fab30 GUACAMOLE-1201: Throttle outbound audio data to avoid overflowing RDP server audio input buffer.
The RDP specification for the AUDIO_INPUT channel requires that all
audio be sent in packets of a specific size. Guacamole does correctly
limit itself to sending packets of this size to the RDP server, but will
send quite a few of these packets all at once if it has received more
audio data than the RDP packet size. This is OK in principle (the
Guacamole client should be able to send audio in packets of whatever
size it chooses), but may overwhelm the software running within the RDP
server if the amount of data received exceeds the available buffer
space, resulting in dropped samples.

As there is no way to know the size of the remote audio buffer, we need
to instead ensure that audio is streamed as close to real time as
possible, with each audio packet of N bytes not being sent until roughly
the amount of time represented by those N bytes has elapsed since the
last packet. This throttling ensures that software expecting to process
audio in real time should never run out of buffer space.

That said, if we never exceed the per-packet data rate and occasionally
send a packet earlier than real time would dictate, unavoidable latency
in sending/receiving audio data would accumulate over time. For example,
if each audio packet represents 10ms of audio data, but we receive that
audio packet 10.1ms after the previous packet, we need to adjust the
timing of the next audio packet(s) to account for that additional 0.1ms.
Simply waiting 10ms after sending each packet would cause that 0.1ms to
accumulate each time it occurs, eventually resulting in noticable
latency and finally running out of buffer space.

Thus, these changes:

1. Leverage a flush thread and per-packet scheduling to ensure that each
   flushed audio packet does not exceed the equivalent real time rate.
2. Calculate the amount of additional latency from the amount of data
   received beyond the required packet size, and amortize scheduling
   corrections to account for that latency over the next several audio
   packets.

This ensures that audio is streamed exactly as it is received if the
audio matches the packet size of the RDP server, and audio that is
received in a different size or varying sizes is buffered and throttled
to keep things within the expectations of software running within the
RDP server.
2021-05-01 16:23:32 -07:00
Virtually Nick
e90e438cf6
GUACAMOLE-1283: Merge add synchronization around absolutely all outbound RDP messages. 2021-04-17 13:11:32 -04:00
Michael Jumper
bf6922b31e GUACAMOLE-1283: Remove redundant parameters from guac_rdp_audio_buffer callback.
The buffer and data parameters of the guac_rdp_audio_buffer flush
handler are redundant now that the guac_rdp_audio_buffer is being passed
to the handler. They can instead be referenced as audio_buffer->packet
and audio_buffer->data respectively.
2021-04-13 17:47:56 -07:00
Michael Jumper
27e762d06f GUACAMOLE-1283: Add synchronization around absolutely all outbound RDP messages.
The FreeRDP library is intended to be threadsafe, but is not reliably so
with respect to legacy RDP encryption and outbound messages. When
outbound messages are sent by multiple threads, the encryption key used
for legacy RDP encryption may not be updated correctly, resulting in a
fatal connection error like:

"ERRINFO_DECRYPT_FAILED (0x00001192):(a) Decryption using Standard RDP
Security mechanisms (section 5.3.6) failed. (b) Session key creation
using Standard RDP Security mechanisms (section 5.3.5) failed."
2021-04-08 15:43:15 -07:00
Virtually Nick
b2ae2fdf00
GUACAMOLE-1307: Merge use VerifyCertificateEx callback if supported. 2021-03-10 14:38:43 -05:00
Michael Jumper
1b78f611d3 GUACAMOLE-1307: Use VerifyCertificateEx callback if supported. 2021-03-09 22:53:11 -08:00
James Muehlner
e2a136f41e
GUACAMOLE-1302: Merge support for forcing lossless compression in VNC and RDP connections. 2021-03-03 19:31:25 -08:00
Michael Jumper
18a0362dab GUACAMOLE-1302: Add RDP support for forcing lossless compression. 2021-03-03 19:29:14 -08:00
Michael Jumper
c2b7e2d039 GUACAMOLE-1302: Add VNC support for forcing lossless compression. 2021-03-03 19:29:14 -08:00
Michael Jumper
27f8403178 GUACAMOLE-1302: Always use lossless compression for text-based protocols leveraging the terminal. 2021-03-03 19:29:14 -08:00
Michael Jumper
0729a6cc73 GUACAMOLE-1302: Add surface/display level support for forcing lossless compression. 2021-03-03 19:29:14 -08:00
Virtually Nick
d9d5c79644
GUACAMOLE-1305: Merge fix pt-br keyboard layout 2021-03-03 16:19:20 -05:00
Higor Cavalcanti
650e7ad90f GUACAMOLE-1305: Fix pt-br keyboard layout. Key being recognized as right shift. 2021-03-03 16:49:59 -03:00
Virtually Nick
7bbab0efdd
GUACAMOLE-1174: Merge correct handling of truncated parameters when appending to URLs. 2021-02-21 20:32:47 -05:00
Michael Jumper
a920932703 GUACAMOLE-1174: Correct logic detecting truncation of appended parameter.
The previous implementation passed `length - str_len` to `snprintf()`,
yet compared the return value to `length`. This is incorrect, as
`length` is not the buffer size provided to `snprintf()`.
2021-02-21 15:05:53 -08:00
Michael Jumper
c7935736da GUACAMOLE-1174: Add unit tests for URL utility functions. 2021-02-21 15:05:53 -08:00
Michael Jumper
7f55399304 GUACAMOLE-1174: Clarify behavior of URL parameter appending function. 2021-02-21 14:15:17 -08:00
Mike Jumper
5428ac5057
GUACAMOLE-1174: Merge support for Kubernetes "exec" API call. 2021-02-21 11:09:53 -08:00
Tomer Gabel
a8cf250c98 GUACAMOLE-1047: Changed returned status code per review 2021-02-14 16:21:54 +02:00
James Muehlner
ca1fbd5e98
GUACAMOLE-1204: Merge addition of server-side support for multi-touch events. 2021-02-11 20:53:22 -08:00
Michael Jumper
d16ba33dee GUACAMOLE-1204: Add support for including touch events within session recordings. 2021-02-11 20:12:21 -08:00
Michael Jumper
5eb2867733 GUACAMOLE-1204: Add RDP support for multi-touch events via RDPEI channel. 2021-02-11 20:12:21 -08:00
Michael Jumper
048a59310b GUACAMOLE-1204: Add support for declaring layer multi-touch capabilities. 2021-02-11 20:12:21 -08:00
Michael Jumper
c88c0d1c89 GUACAMOLE-1204: Add libguac support for processing the "touch" instruction. 2021-02-11 20:12:21 -08:00
Virtually Nick
4a38d39694
GUACAMOLE-1277: Merge unswap - and _ on fr-be-azerty keymap 2021-02-02 15:54:12 -05:00
Sander Vanheule
841dc28e9b GUACAMOLE-1277: Unswap -/_ on fr-be-azerty keymap
When using the fr-be-azerty remote keyboard layout on an RDP connection,
the dash ('-') and underscore ('_') are swapped.

Underscore and dash are located on the same key on a Belgian azerty
layout. Dash should be the normal/unshifted character, and underscore
should be the shifted character. The current mapping has this the other
way around, so let's fix this.

Signed-off-by: Sander Vanheule <Sander.Vanheule@UGent.be>
2021-02-02 19:53:51 +01:00
Mike Jumper
c122a5f14a
GUACAMOLE-1133: Merge build-time sanity check for libvncserver usage of gcrypt. 2021-01-24 14:15:35 -08:00
Nick Couchman
5cee64514f GUACAMOLE-1133: Add gcrypt build dependency for Docker image. 2021-01-23 22:16:58 -05:00
Nick Couchman
b40b7e7bf6 GUACAMOLE-1133: Add build check for headers when libvncserver includes gcrypt support. 2021-01-23 22:04:38 -05:00
Mike Jumper
6d526cb60f
GUACAMOLE-1133: Merge addition of GCrypt initialization to VNC startup process. 2021-01-22 21:33:10 -08:00
Nick Couchman
46bed49a43 GUACAMOLE-1133: initialize GCrypt in VNC protocol prior to client start-up. 2021-01-21 21:14:18 -05:00
Virtually Nick
c769d18cf6
GUACAMOLE-1263: Merge mark freed memory as freed prior to calling rfbClientCleanup(). 2021-01-15 14:51:36 -05:00
Michael Jumper
612c5eba20 GUACAMOLE-1263: Mark freed memory as freed prior to calling rfbClientCleanup().
Older versions of libvncclient did not free all memory within
rfbClientCleanup(), but this has been corrected as of their 0.9.12
release. As guacamole-server may well be built against older versions of
libvncclient, we can't simply remove the manual free() calls, but we
should be sure to set any memory that we free ourselves to NULL so that
rfbClientCleanup() does not attempt to free it again.
2021-01-15 11:46:16 -08:00
Virtually Nick
fe62300223
GUACAMOLE-1259: Merge include missing config.h header for sake of conditional Stream_Free(). 2021-01-10 13:09:39 -05:00
Michael Jumper
0b6b14b71e GUACAMOLE-1259: Include missing config.h header for sake of conditional Stream_Free().
The changes introduced by GUACAMOLE-1181 (commit 2c86e20) were made
conditional as older versions of FreeRDP will automatically free the
wStream, resulting in a double-free if we attempt to do so ourselves.

The macro controlling that conditional code is defined within config.h,
which is missing here. Without that macro, the call to Stream_Free()
always occurs, and we get a double-free with older FreeRDP.
2021-01-09 21:15:50 -08:00
Virtually Nick
1c3e86dc2c
GUACAMOLE-1191: Merge always disable the glyph cache due to stability issues. 2021-01-09 22:46:12 -05:00
Michael Jumper
9dc793b0e5 GUACAMOLE-1191: Always disable the glyph cache, as FreeRDP no longer considers the feature to be stable. 2021-01-09 17:49:32 -08:00
Virtually Nick
1e6c42594f
GUACAMOLE-1254: Merge add support for libuuid as alternative to OSSP UUID. 2021-01-07 12:21:11 -05:00
Michael Jumper
430182dce2 GUACAMOLE-1254: Add unit tests for unique ID generation. 2021-01-06 22:51:07 -08:00
Michael Jumper
f710e00d26 GUACAMOLE-1254: Use libuuid rather than OSSP UUID if available.
The libuuid library is widely available (part of util-linux) and much
more frequently updated. The OSSP UUID library works great, but was last
updated in 2008 and causes some confusion for users that have libuuid.
2021-01-06 20:58:22 -08:00
Mike Jumper
53f981f864
GUACAMOLE-1245: Merge support for specifying Wake-on-LAN port. 2020-12-30 21:06:13 -08:00
Nick Couchman
a37668e9f5 GUACAMOLE-1245: Add support for specifying Wake-on-LAN port. 2020-12-30 16:50:38 -05:00
Nick Couchman
68c5dd1730 Merge 1.3.0 changes back to master. 2020-12-25 07:31:03 -05:00
Virtually Nick
90e15cb706
GUACAMOLE-1241: Merge avoid double-free when building against FreeRDP development snapshot. 2020-12-25 07:30:06 -05:00
Michael Jumper
9475c0b6fa GUACAMOLE-1241: Build against Debian repository that has non-snapshot version of FreeRDP.
Debian stable currently provides a FreeRDP package that is a snapshot of
commit 2693389a103394e035edc2a01055ca2c9ccccb21, whereas
stable-backports provides a FreeRDP package from release 2.2.0. Only a
release or release candidate can be relied upon for consistent behavior.
2020-12-24 13:15:58 -08:00
Michael Jumper
218f8d36b1 GUACAMOLE-1241: Disable build against FreeRDP development snapshots unless *explicitly* overridden. 2020-12-22 20:53:06 -08:00
Nick Couchman
d20b385834 Merge 1.3.0 changes back to master. 2020-12-22 19:05:16 -05:00
Virtually Nick
b608bb1513
GUACAMOLE-1242: Merge move "connection closed" log message to debug level. 2020-12-22 18:02:35 -05:00
Michael Jumper
3196f9f0d0 GUACAMOLE-1242: Move "connection closed" log message to debug level.
It is expected under normal circumstances that the connection may be
abruptly closed, including during the handshake. For example, this will
commonly occur when a TCP load balancer is performing a simple service
health check.

An message noting that the connection has been closed during the
Guacamole protocol handshake is really only of benefit when debugging,
where that information may provide useful context. If not debugging, the
message amounts to log noise.
2020-12-22 13:00:48 -08:00
Virtually Nick
2fc3a43e87
GUACAMOLE-1225: Merge fix simple typo, verfying -> verifying, in code documentation 2020-12-21 08:00:29 -05:00
Tim Gates
ced24fde7d
GUACAMOLE-1225: fix simple typo, verfying -> verifying
There is a small typo in src/libguac/tests/parser/read.c, src/libguac/tests/socket/fd_send_instruction.c, src/libguac/tests/socket/nested_send_instruction.c.

Should read `verifying` rather than `verfying`.

Fixes https://issues.apache.org/jira/browse/GUACAMOLE-1225
2020-12-21 17:04:52 +11:00
Michael Jumper
c6e8ad7a38 Merge 1.3.0 changes back to master. 2020-12-09 17:29:20 -08:00
Mike Jumper
47c7450f0f
GUACAMOLE-1110: Merge changes adding a guacd service group. 2020-12-09 17:28:17 -08:00
benrubson
4a5a350f59 GUACAMOLE-1110: Create a proper dedicated service group 2020-12-07 10:35:06 +01:00
Virtually Nick
b48e34fc3e
GUACAMOLE-1227: Merge build support for generic VNC credentials only if supported by libvncclient. 2020-12-03 07:14:34 -05:00
Michael Jumper
d40db7cd3c GUACAMOLE-1227: Build support for generic VNC credentials only if supported by libvncclient. 2020-12-02 22:55:16 -08:00
Yaroslav Nikonorov
004f57e19a GUACAMOLE-1174: Add prototype and docstrings for guac_kubernetes_append_endpoint_param function. 2020-11-18 15:30:34 +02:00
Yaroslav Nikonorov
7809447c3f GUACAMOLE-1174: Add parameters to the endpoint path using function guac_kubernetes_append_endpoint_param. 2020-11-18 14:57:59 +02:00
Yaroslav Nikonorov
7a1ba51bae GUACAMOLE-1174: Determine parameter delimiter, compute the buffer string length, fix the buffer string length usage, verify buffer null terminated. 2020-11-18 14:52:24 +02:00
Michael Jumper
9df3e294c3 Merge 1.3.0 changes back to master. 2020-11-03 14:29:52 -08:00
Mike Jumper
7fcddef117
GUACAMOLE-1205: Merge version number bump to 1.3.0. 2020-11-03 14:29:21 -08:00
Nick Couchman
c867d392d0 GUACAMOLE-1205: Update Guacamole Server version numbers for 1.3.0 release 2020-11-03 14:54:55 -05:00
Nick Couchman
8faeea18f8 Merge 1.3.0 changes back to master. 2020-11-03 14:02:38 -05:00
Virtually Nick
c2c67ee34d
GUACAMOLE-221: Merge handle FREERDP_ERROR_* constants only when defined. 2020-11-03 13:54:31 -05:00
Michael Jumper
1e3fc25268 GUACAMOLE-221: Handle FREERDP_ERROR_* constants only when defined.
Only FreeRDP 2.0.0-rc3 and later support all the constants used within
src/protocols/rdp/error.c.
2020-11-03 10:14:51 -08:00
Nick Couchman
299b7b4370 Merge 1.3.0 changes back to master. 2020-11-02 22:17:33 -05:00
Virtually Nick
1e856d4e2d
GUACAMOLE-221: Merge rely on FreeRDP error code if no RDP disconnect reason is available. 2020-11-02 22:16:43 -05:00
Nick Couchman
5124e78e05 Merge 1.3.0 changes back to master. 2020-11-02 20:35:00 -05:00
Virtually Nick
4d3280e817
GUACAMOLE-221: Merge terminate keep-alive thread immediately upon guac_socket_free(). 2020-11-02 20:09:18 -05:00
Michael Jumper
8041585379 GUACAMOLE-221: Increase verbosity of logged FreeRDP-related errors. 2020-11-02 15:40:29 -08:00
Michael Jumper
2a4ecda216 GUACAMOLE-221: Terminate keep-alive thread immediately upon guac_socket_free().
The keep-alive interval is identical to the timed client free used by
guacd. This results in a race condition where there is a random chance
that guacd will assume that the client has failed to terminate in a
timely manner simply because guac_socket_free() is waiting for the
keep-alive thread to finish.
2020-11-02 14:57:43 -08:00
Nick Couchman
e3df475bda Merge 1.3.0 changes back to master. 2020-11-02 16:16:22 -05:00
Virtually Nick
c48feb30f5
GUACAMOLE-221: Merge ensure guacd always enables broadcast socket keep-alive. 2020-11-02 16:00:59 -05:00
Michael Jumper
1e550b58d9 GUACAMOLE-221: Ensure guacd always enables broadcast socket keep-alive. 2020-11-02 12:51:58 -08:00
Michael Jumper
1e8d9d92a5 GUACAMOLE-221: Rely on FreeRDP error code if no RDP disconnect reason is available. 2020-11-02 12:38:06 -08:00
Nick Couchman
7563402631 Merge 1.3.0 changes back to master. 2020-10-30 10:13:25 -04:00
Virtually Nick
0be71a8c67
GUACAMOLE-1182: Merge ensure converted clipboard data is freed after being sent. 2020-10-30 10:12:25 -04:00
Nick Couchman
4e6ad1939f Merge 1.3.0 changes back to master. 2020-10-30 08:34:16 -04:00
Virtually Nick
c7d3814450
GUACAMOLE-1181: Merge rely on automatic freeing of wStream only for FreeRDP 2.0.0-rc3 through 2.0.0-rc4. 2020-10-29 22:23:35 -04:00
Michael Jumper
c1ad6115a2 GUACAMOLE-1181: Warn users if the internal behavior of their version of FreeRDP cannot be tested and may be unreliable. 2020-10-29 18:29:47 -07:00
Michael Jumper
256487c95a GUACAMOLE-1181: Only free wStream after send if FreeRDP requires this. 2020-10-29 18:29:47 -07:00
Michael Jumper
2c86e20ab9 GUACAMOLE-1181: Free wStream after send is complete/cancelled. 2020-10-28 20:23:37 -07:00
Michael Jumper
683ef1722e GUACAMOLE-1182: Ensure converted clipboard data is freed after being sent. 2020-10-28 16:36:50 -07:00
Yaroslav Nikonorov
79239e3be0 GUACAMOLE-1174: Create function for appending endpoint params, fix endpoint params overwriting. 2020-10-20 12:44:38 +03:00
Yaroslav Nikonorov
6b58e2e5a9 GUACAMOLE-1174: Free exec_command setting. 2020-10-20 12:44:38 +03:00
Yaroslav Nikonorov
164f792b86 GUACAMOLE-1174: Remove option use-exec, add snprintf result validation, fix code formatting. 2020-10-08 13:18:58 +03:00
Mike Jumper
2aa0218cc7
GUACAMOLE-1190: Merge guacd support for listening on IPv6 addresses. 2020-10-08 00:32:32 -07:00
Jonas Zeiger
8d683b560c GUACAMOLE-1190: Specify correct address family when creating socket 2020-10-07 10:02:28 +02:00
Virtually Nick
c449d83790
GUACAMOLE-1185: Merge fix typo in RDP audio input comment. 2020-10-03 07:45:38 -04:00
Jimmy
d6a817f58c GUACAMOLE-1185: Fixed one typo mistake. 2020-09-28 10:35:05 +03:00
Michael Jumper
ceabd68e28 Merge 1.3.0 changes back to master. 2020-09-27 16:36:00 -07:00
Mike Jumper
558eb149f4
GUACAMOLE-1031: Merge correction to handling of RDP SFTP upload directory. 2020-09-27 16:34:56 -07:00
Michael Jumper
3e1e1bd268 Merge 1.3.0 changes back to master. 2020-09-20 20:35:26 -07:00
Mike Jumper
aa870debad
GUACAMOLE-221: Merge server-side support for parameter prompting. 2020-09-20 20:31:34 -07:00
Nick Couchman
3e19583b29 GUACAMOLE-221: Switch VNC credentials to NULL when parameter is not passed 2020-09-20 14:41:29 -04:00
Nick Couchman
9e1dada14b GUACAMOLE-221: Add CUnit tests for guac_strdup() 2020-09-20 14:41:29 -04:00
Nick Couchman
3b4007c9fa GUACAMOLE-221: Tweak logic for when RDP domain is requested. 2020-09-20 14:41:29 -04:00
Nick Couchman
bfb54f72a0 GUACAMOLE-221: Clean up libguac, protocol changes, and documentation. 2020-09-20 14:41:29 -04:00
Nick Couchman
6605f217c5 GUACAMOLE-221: Rollback changes to SSH protocol prompting 2020-09-17 21:12:33 -04:00
Nick Couchman
b6d3edb749 GUACAMOLE-221: Move VNC and RDP argv to new callback. 2020-09-17 21:12:33 -04:00
Nick Couchman
f70fdfc612 GUACAMOLE-221: Add back in SSH credential argv support; fix style and comments. 2020-09-15 14:48:15 -04:00
Nick Couchman
ec3cdfd17b GUACAMOLE-221: We need to flush the socket after sending required. 2020-09-15 14:48:15 -04:00
Nick Couchman
26b9850d87 GUACAMOLE-221: Remove bad rebase code. 2020-09-15 14:48:15 -04:00
Nick Couchman
98dbf15d0b GUACAMOLE-221: Fix up SSH terminal prompt fallback. 2020-09-15 14:48:15 -04:00
Nick Couchman
e8feeabfef GUACAMOLE-221: Implement CUnit tests for protocol version comparison and conversion. 2020-09-15 14:48:15 -04:00
Nick Couchman
0db61198e9 GUACAMOLE-221: Fix up lots of comments, streamline code, and fix SSH mutex lock. 2020-09-15 14:48:15 -04:00
Nick Couchman
bc8ed4e104 GUACAMOLE-221: Implement guacd support for verifying that client can accept the required instruction. 2020-09-15 14:48:15 -04:00
Nick Couchman
b00b629b96 GUACAMOLE-221: Clean up VNC mutex; update comments. 2020-09-15 14:48:15 -04:00
Nick Couchman
0761908a77 GUACAMOLE-221: Sockets start keep alive by default. 2020-09-15 14:48:15 -04:00
Nick Couchman
c579e7337f GUACAMOLE-221: Implement function for sending required to client owner. 2020-09-15 14:48:15 -04:00
Nick Couchman
5ec2551761 GUACAMOLE-221: Use constants for parameters updated via argv or required instructions. 2020-09-15 14:48:15 -04:00
Nick Couchman
5881209f12 GUACAMOLE-221: Move keep-alives to protocol implementation and only send required instruction to owner. 2020-09-15 14:48:15 -04:00
Nick Couchman
5c309f5cb1 GUACAMOLE-221: Move away from reserved function names. 2020-09-15 14:48:15 -04:00
Nick Couchman
7759f9b1c0 GUACAMOLE-221: Add socket keepalive when sending required fields. 2020-09-15 14:48:15 -04:00
Nick Couchman
51b9c9c103 GUACAMOLE-221: Remove manual addition of null terminator 2020-09-15 14:48:15 -04:00
Nick Couchman
4318083511 GUACAMOLE-221: Fix up style, comments, and variable names. 2020-09-15 14:48:15 -04:00
Nick Couchman
939d954810 GUACAMOLE-221: Extract array writing in protocol into common function and document. 2020-09-15 14:48:15 -04:00
Nick Couchman
76ef6332cc GUACAMOLE-221: Make lock, condition, and flags specific to credentials. 2020-09-15 14:48:15 -04:00
Nick Couchman
7369bed22c GUACAMOLE-221: Add support for sending multiple params in required. 2020-09-15 14:48:15 -04:00
Nick Couchman
21a5d9ee62 GUACAMOLE-221: Add protocol functions for sending prompt to client. 2020-09-15 14:48:15 -04:00
Yaroslav Nikonorov
7683a17d69 GUACAMOLE-1174: Added exec call implementation for kubernetes protocol 2020-09-10 19:59:03 +03:00
Virtually Nick
382d72a26a
GUACAMOLE-1158: Merge handle received clipboard data only if copy has not been disabled. 2020-08-24 15:47:42 -04:00
Michael Jumper
df33cd0874 GUACAMOLE-1158: Handle received clipboard data only if copy has not been disabled. 2020-08-24 12:23:01 -07:00
Mike Jumper
be01e7e93a
GUACAMOLE-1151: Merge exclusion of NetBeans project directory via .gitignore. 2020-08-08 23:45:46 -07:00
Nick Couchman
7ee9c64c04 GUACAMOLE-1151: Add .gitignore entry for NetBeans project directory 2020-08-05 16:43:43 -04:00
Virtually Nick
a2fb09021b
GUACAMOLE-221: Merge add convenience API for automatically handling received "argv" streams. 2020-07-08 08:30:47 -04:00
Michael Jumper
0cdc51acd1 GUACAMOLE-221: Correct faulty double-increment of args (should advance ONE at a time). 2020-07-06 18:19:08 -07:00
Michael Jumper
aa3a9cde6c GUACAMOLE-221: Migrate Kubernetes handling of "argv" to guac_argv_*() convenience API. 2020-07-06 18:19:08 -07:00
Michael Jumper
08a57d3375 GUACAMOLE-221: Migrate telnet handling of "argv" to guac_argv_*() convenience API. 2020-07-06 18:19:08 -07:00
Michael Jumper
2f6de25418 GUACAMOLE-221: Migrate SSH handling of "argv" to guac_argv_*() convenience API. 2020-07-06 18:19:08 -07:00
Michael Jumper
f8f2c7f747 GUACAMOLE-221: Allow callers to request that argument values be automatically echoed to all connected users. 2020-07-06 18:19:08 -07:00
Michael Jumper
a8151c40c4 GUACAMOLE-221: Implement libguac convenience API for awaiting and processing argument streams. 2020-07-06 18:19:08 -07:00
Mike Jumper
f0dee00d33
GUACAMOLE-1110: Merge support for running the "guacd" Docker image as a specific service user. 2020-07-02 22:34:35 -07:00
Mike Jumper
3fc3880f0e
GUACAMOLE-1122: Merge fix for build failure due to conditionally-missing variable declaration. 2020-07-02 22:30:58 -07:00
Nick Couchman
d35a97d28e GUACAMOLE-1122: Correct scope of settings variable for RDP user file handler." 2020-07-02 16:50:23 -04:00
Mathias
7d06113cbe
GUACAMOLE-1110: Replace user nobody with guacd 2020-06-30 12:41:35 +02:00
Virtually Nick
c10ceab7e8
GUACAMOLE-1114: Merge fix the destruction of some thread mutexes 2020-06-26 14:19:39 -05:00
Jimmy
d34745a40b GUACAMOLE-1114: Clean up clipboard mutex lock. 2020-06-26 23:19:23 +03:00
Jimmy
264192fd25 GUACAMOLE-1114: Clean up print job mutex lock 2020-06-26 23:18:02 +03:00
Nick Couchman
79c6e5787d Merge staging/1.2.0 changes back to master. 2020-06-25 17:56:43 -04:00
Virtually Nick
6042222d44
GUACAMOLE-474: Merge properly enforce file new upload/download restrictions. 2020-06-25 17:52:11 -04:00
Michael Jumper
7de6ba7ea9 GUACAMOLE-474: Do not allow RDPDR file downloads via "get" instructions if downloads are disabled. 2020-06-25 14:43:37 -07:00
Michael Jumper
630798503c GUACAMOLE-474: Ensure RDPDR "Download" folder behaves as a normal folder if downloads are disabled. 2020-06-25 14:43:37 -07:00
Michael Jumper
f4ff5f337c GUACAMOLE-474: Enforce upload disable option at low level, warning if not blocked at higher level as expected. 2020-06-25 14:43:37 -07:00
Michael Jumper
d8c32b1e82 GUACAMOLE-474: Enforce download disable option at low level, warning if not blocked at higher level as expected. 2020-06-25 14:41:39 -07:00
Mathias
86176ff770
GUACAMOLE-1110: Shrinks container footprint, higher security and reliability check
Dockage image size will reduced by install only package dependencies (without recommendations). The guacd process runs as a non-privileged user and will be checked by netcat.
2020-06-25 17:51:29 +02:00
Nick Couchman
45a0cd943b Merge staging/1.2.0 changes back to master. 2020-06-24 20:19:10 -04:00
Virtually Nick
99fce8fa19
GUACAMOLE-465: Merge correct usage of printf-like guacenc_log(). 2020-06-24 20:16:58 -04:00
Michael Jumper
af2c109079 GUACAMOLE-465: Correct printf-style format string (should be "%s" for strings, not "%d"). 2020-06-24 17:14:25 -07:00
Michael Jumper
4ac0940e81 GUACAMOLE-465: Remove redundant newline character from calls to guacenc_log(). 2020-06-24 17:14:23 -07:00
Virtually Nick
3a87dd0c96
GUACAMOLE-465: Merge remove superfluous access check prior to attempting file deletion. 2020-06-24 20:10:34 -04:00
Nick Couchman
37965a961e Merge staging/1.2.0 changes back to master. 2020-06-24 20:09:05 -04:00
Virtually Nick
9ee956f765
GUACAMOLE-465: Merge correct possible leak of malloc'd video structure. 2020-06-24 20:08:20 -04:00
Michael Jumper
096a067b1f GUACAMOLE-465: Correct possible leak of malloc'd video structure. 2020-06-24 13:56:16 -07:00
Michael Jumper
8d9049942d GUACAMOLE-465: Remove superfluous access check prior to attempting file deletion. 2020-06-24 13:41:03 -07:00
Nick Couchman
708769b4c3 Merge staging/1.2.0 changes back to master. 2020-06-24 13:11:17 -04:00
Virtually Nick
614f38767e
GUACAMOLE-465: Merge produce MPEG-4 output within a proper container. 2020-06-24 13:10:32 -04:00
Nick Couchman
f1f1b0d438 Merge staging/1.2.0 changes back to master. 2020-06-24 12:59:34 -04:00
Virtually Nick
4815f62358
GUACAMOLE-966: Merge bump libguac version number for 1.2.0. 2020-06-24 12:58:40 -04:00
Nick Couchman
025525f93a Merge staging/1.2.0 changes back to master. 2020-06-24 12:55:34 -04:00
Virtually Nick
debd888cf5
GUACAMOLE-518: Merge correct behavior of keys typed with AltGr. 2020-06-24 12:54:37 -04:00
Michael Jumper
3e73e392a0 GUACAMOLE-966: Bump libguac version number for 1.2.0 (interfaces added, none changed or removed). 2020-06-24 02:37:35 -07:00
Michael Jumper
fb94ef9e9a GUACAMOLE-495: Add whitespace and reflow as necessary to improve readability. 2020-06-24 02:25:02 -07:00
Michael Jumper
628f2fd815 GUACAMOLE-518: Ensure all keys are released even if the key pressed client-side is unknown except through dead keys. 2020-06-24 00:54:39 -07:00
Michael Jumper
3798d85bd1 GUACAMOLE-518: Count client-side pressed keys independently of server-side keys. 2020-06-24 00:54:39 -07:00
Michael Jumper
2407157d00 GUACAMOLE-518: Handle modifier status correctly when multiple modifier keys are involved. 2020-06-24 00:54:39 -07:00
Michael Jumper
7d17e6898a GUACAMOLE-518: Remove unused GUAC_KEYSYMS_* constants. 2020-06-24 00:54:39 -07:00
Michael Jumper
337f3bbff2 GUACAMOLE-518: Map both Right Alt and AltGr to Windows' Right Alt.
Windows expects the Right Alt key to be sent for AltGr.
2020-06-23 22:05:18 -07:00
Michael Jumper
9b891e2360 GUACAMOLE-495: Update guacenc mangpage - the MPEG-4 output is no longer a raw stream. 2020-06-23 15:48:41 -07:00
Michael Jumper
81601d99fe GUACAMOLE-465: Reformat/reflow comments to match established style. 2020-06-23 15:40:04 -07:00
Nick Couchman
e8deeeae97 Merge staging/1.2.0 changes back to master. 2020-06-23 14:19:37 -04:00
Virtually Nick
5f5080994f
GUACAMOLE-518: Merge correct Caps Lock and Shift behavior within RDP keymap translation system. 2020-06-23 14:18:58 -04:00
Michael Jumper
60944f1092 GUACAMOLE-518: Keep locally-tracked keyboard lock status in sync with remote changes to keyboard locks. 2020-06-23 11:11:19 -07:00
Michael Jumper
a246403137 GUACAMOLE-518: Update German keymap to define behavior of Caps Lock.
On German keyboards, Caps Lock behaves like Shift, affects all
characters except dead keys, "°", "<", ">", "-", "_", and any keys
requiring AltGr, and is undone by Shift.
2020-06-23 11:11:19 -07:00
Michael Jumper
3f375a4501 GUACAMOLE-518: Update Swiss German keymap to define behavior of Caps Lock.
On Swiss German keyboards, Caps Lock turns all letters uppercase and is
undone by Shift, except for letters which instead rely on Shift to
determine their identity (accented letters).

For example, the key directly to the right of "P" produces "ü" if no
modifiers or locks are active. With Shift pressed, the key changes
identity to "è", with the state of Caps Lock determining the case:

| Shift | Caps  | Result |
|-------|-------|--------|
|       |       | "ü"    |
|       |   X   | "Ü"    |
|   X   |       | "è"    |
|   X   |   X   | "È"    |

This goes for all accented characters in the Swiss German layout.
2020-06-23 11:11:19 -07:00
Michael Jumper
e8153f9002 GUACAMOLE-518: Update French keymap to define behavior of Caps Lock.
On French keyboards, Caps Lock behaves like Shift, affects all
characters including dead keys but excluding "<", ">", "²", and any keys
requiring AltGr, and is undone by Shift.
2020-06-23 11:11:19 -07:00
Michael Jumper
568e037012 GUACAMOLE-518: Update Swiss French keymap to define behavior of Caps Lock.
On Swiss French keyboards, Caps Lock affects only non-accented letters
and is undone by Shift.
2020-06-23 11:11:19 -07:00
Michael Jumper
31d05de72a GUACAMOLE-518: Update Belgian French keymap to define behavior of Caps Lock.
On Belgian French keyboards, Caps Lock behaves like Shift, affects all
characters including dead keys but excluding "<", ">", "²", "³", and any
keys requiring AltGr, and is undone by Shift.
2020-06-23 11:11:19 -07:00
Michael Jumper
f884ab76b1 GUACAMOLE-518: Update Italian keymap to define behavior of Caps Lock.
On Italian keyboards, Caps Lock affects only non-accented letters and is
undone by Shift.
2020-06-23 11:11:19 -07:00
Michael Jumper
1117cf052c GUACAMOLE-518: Update Turkish-Q keymap to define behavior of Caps Lock.
On Turkish-Q keyboards, Caps Lock affects only letters (including
accented letters) except for "é", and is undone by Shift.
2020-06-23 11:11:19 -07:00
Michael Jumper
b69248048c GUACAMOLE-518: Update Swedish keymap to define behavior of Caps Lock.
On Swedish keyboards, Caps Lock affects only letters (including accented
letters) and is undone by Shift.
2020-06-23 11:11:19 -07:00
Michael Jumper
38737a8353 GUACAMOLE-518: Update Brazilian Portuguese keymap to define behavior of Caps Lock.
On Brazilian Portuguese keyboards, Caps Lock affects only letters
(including accented letters) and is undone by Shift.
2020-06-23 11:11:19 -07:00
Michael Jumper
5c1a2fc44c GUACAMOLE-518: Update Latin American keymap to define behavior of Caps Lock.
On Latin American keyboards, Caps Lock affects only letters (including
accented letters) and is undone by Shift.
2020-06-23 11:11:19 -07:00
Michael Jumper
ba3d1de3bb GUACAMOLE-518: Update Spanish keymap to define behavior of Caps Lock.
On Spanish keyboards, Caps Lock affects only letters (including accented
letters) and is undone by Shift.
2020-06-23 11:11:19 -07:00
Michael Jumper
2cec040b9e GUACAMOLE-518: Update Danish keymap to define behavior of Caps Lock.
On Danish keyboards, Caps Lock affects only letters (including accented
letters) and is undone by Shift.
2020-06-23 11:11:19 -07:00
Michael Jumper
e9652becfd GUACAMOLE-518: Update Hungarian keymap to define behavior of Caps Lock.
On Hungarian keyboards, Caps Lock affects only letters (including
accented letters) except those requiring AltGr, and is undone by Shift.
2020-06-23 11:11:19 -07:00
Michael Jumper
31a415cc59 GUACAMOLE-518: Update UK English keymap to define behavior of Caps Lock.
On UK English keyboards, Caps Lock affects only letters (including
accented letters) and is undone by Shift.
2020-06-23 11:11:19 -07:00
Michael Jumper
024e281252 GUACAMOLE-518: Update US English keymap to define behavior of Caps Lock.
On US English keyboards, Caps Lock affects only letters and is undone by
Shift.
2020-06-23 11:11:19 -07:00
Michael Jumper
48b3d5038f GUACAMOLE-518: Automatically release any automatically-pressed keys after user has released all keys on the client side. 2020-06-23 11:11:19 -07:00
Michael Jumper
cb6ffd06e6 GUACAMOLE-518: Allow multiple possible definitions (means of typing a particular key) for each keysym. 2020-06-23 11:11:19 -07:00
Michael Jumper
67450d89f3 GUACAMOLE-518: Correct signedness of keyboard flag variables. 2020-06-22 10:05:37 -07:00
Michael Jumper
96c4c208b4 GUACAMOLE-518: Ensure keyboard state is always updated for all keys pressed/released. 2020-06-22 10:05:37 -07:00
Michael Jumper
7fd54c56a8 GUACAMOLE-518: Modifications to generate.pl should result in regeneration of all keymaps. 2020-06-21 21:05:43 -07:00
Michael Jumper
ce0982fefd GUACAMOLE-518: Track and update modifier states based on overall flags, not keysyms. 2020-06-21 21:05:43 -07:00
Nick Couchman
0c784d434c Merge staging/1.2.0 changes back to master. 2020-06-20 20:53:18 -04:00
Virtually Nick
120be65dbc
GUACAMOLE-1076: Merge correct RemoteApp launch behavior. 2020-06-20 20:51:21 -04:00
Michael Jumper
7598f5a95a GUACAMOLE-1076: Use proper constants to represent RemoteApp high contrast support flags. 2020-06-20 16:09:43 -07:00
Michael Jumper
d5608fb8a2 GUACAMOLE-1076: Send same System Parameters Update PDUs as Apache Guacamole 1.0.0 and older. 2020-06-20 15:09:00 -07:00
Michael Jumper
a7732e72be GUACAMOLE-1076: Ensure Client Information PDU is sent during RAIL handshake (required by spec). 2020-06-20 14:32:53 -07:00
Michael Jumper
6a50d3076c GUACAMOLE-1076: Set RAIL flag for expanding environment variables within RemoteApp arguments (match v1.0.0 behavior). 2020-06-20 14:14:29 -07:00
Michael Jumper
29b055b511 Merge 1.2.0 changes back to master. 2020-06-18 12:52:30 -07:00
Mike Jumper
f899fe0b2f
GUACAMOLE-1053: Merge restoration of proper locking on RDP structures. 2020-06-18 12:51:34 -07:00
Grigory Trenin
d76502d169 GUACAMOLE-1053: guacd segfaults when user actively presses keys at RDP disconnect time 2020-06-18 05:57:33 -04:00
Michael Jumper
787ae317fc Merge 1.2.0 changes back to master. 2020-06-17 14:12:12 -07:00
Mike Jumper
e82eb45a74
GUACAMOLE-513: Merge improvements to Wake-on-LAN error handling and wait behavior. 2020-06-17 14:11:27 -07:00
Nick Couchman
db4b155c51 GUACAMOLE-513: Update default WoL boot wait time to 0. 2020-06-17 15:27:12 -04:00
Virtually Nick
72489d5690
GUACAMOLE-1103: Merge fix the incorrect comment on enable_sftp variable in RDP 2020-06-17 14:10:16 -04:00
Jimmy
2c2f372def GUACAMOLE-1103: Fixed the incorrect comment of the enable_sftp variable of the guac_rdp_settings structure. 2020-06-17 23:01:13 +03:00
Nick Couchman
e51c269a51 GUACAMOL-513: Correctly handle unknown address families. 2020-06-17 06:50:43 -04:00
Nick Couchman
b0bcb30346 GUACAMOLE-513: Merge socket calls and handle IP family determination correctly. 2020-06-16 16:48:51 -04:00
Nick Couchman
ec305903d0 GUACAMOLE-513: Add guac_error handling for WoL 2020-06-16 15:06:51 -04:00
Nick Couchman
57c4dbf454 GUACAMOLE-513: No need to close socket when socket was never opened. 2020-06-16 11:50:36 -04:00
Nick Couchman
30bbb892db GUACAMOLE-513: Handle cases where socket open fails. 2020-06-09 19:29:22 -04:00
Michael Jumper
b8ecfe2425 Merge 1.2.0 changes back to master. 2020-06-09 10:43:10 -07:00
Mike Jumper
9ca382e2aa
GUACAMOLE-513: Merge addition of new defaults.h header to Makefile.am. 2020-06-09 10:42:37 -07:00
Nick Couchman
0c59897da9 GUACAMOLE-513: New defaults header needs to be in Makefile.am 2020-06-09 13:06:40 -04:00
Michael Jumper
b6568d11b3 Merge 1.2.0 changes back to master. 2020-06-09 01:15:43 -07:00
Mike Jumper
65c07b75cc
GUACAMOLE-513: Merge support for Wake-on-LAN. 2020-06-09 01:15:11 -07:00
Michael Jumper
a5a89bcf1d Merge 1.2.0 changes back to master. 2020-06-08 10:42:40 -07:00
Mike Jumper
32723d229f
GUACAMOLE-474: Merge corrections to file upload/download build failures. 2020-06-08 10:40:05 -07:00
Nick Couchman
2aa2ccc90c GUACAMOLE-513: Properly close WOL socket. 2020-06-07 20:33:19 -04:00
Nick Couchman
df8030d9bb GUACAMOLE-513: Implement defaults header for protocol constants. 2020-06-07 20:27:42 -04:00
Nick Couchman
42e223f4a6 GUACAMOLE-474: Correct variable name and scope errors in RDP fs code. 2020-06-07 19:51:02 -04:00
Michael Jumper
4dce306a04 Merge 1.2.0 changes back to master. 2020-06-07 16:31:08 -07:00
Mike Jumper
e526174009
GUACAMOLE-474: Merge support for selectively disabling file uploads and downloads. 2020-06-07 16:30:37 -07:00
Nick Couchman
af89f828eb Merge staging/1.2.0 changes back to master. 2020-06-07 07:22:05 -04:00
Virtually Nick
d03d45fbf0
GUACAMOLE-1059: Merge correct verification of sound format index. 2020-06-07 07:20:22 -04:00
Michael Jumper
4184a52c98 GUACAMOLE-1059: Sound format index should be checked against maximum number of formats, not byte size of array. 2020-06-06 23:50:28 -07:00
Nick Couchman
ec093d3cea GUACAMOLE-474: Minor style and debug message tweaks. 2020-05-29 07:39:39 -04:00
Michael Jumper
029563a4b9 Merge 1.2.0 changes back to master. 2020-05-25 02:43:01 -07:00
Mike Jumper
8d895f13c7
GUACAMOLE-1059: Merge explicit non-fatal check for invalid RDP audio format request. 2020-05-25 02:41:51 -07:00
Nick Couchman
ff34146f57 GUACAMOLE-1059: Log array boundary violation for sound formats. 2020-05-24 08:55:58 -04:00
Nick Couchman
234f5aff1a GUACAMOLE-1059: Check array boundary for sound formats. 2020-05-16 21:12:53 -04:00
Michael Jumper
a0e11dc817 Merge staging/1.2.0 changes back to master. 2020-05-07 14:10:33 -07:00
Mike Jumper
0bf65ce8b0
GUACAMOLE-1059: Merge changes leveraging appropriate FreeRDP checks to verify input stream length. 2020-05-07 14:09:47 -07:00
Nick Couchman
557e2f5944 GUACAMOLE-1059: Fine tune comments and log messages. 2020-05-06 10:17:20 -04:00
Nick Couchman
47bf3ab672 GUACAMOLE-1059: Verify correct number of bytes for incoming wave. 2020-05-05 17:15:47 -04:00
Nick Couchman
315a8a7179 GUACAMOLE-1059: Correctly handle issues processing audio input formats. 2020-05-05 16:53:13 -04:00
Nick Couchman
e761e47cd0 GUACAMOLE-1059: Add missing checks and fix up warning messages. 2020-05-05 16:33:59 -04:00
Nick Couchman
71769b9715 GUACAMOLE-1059: Add missing check for manually copied buffer. 2020-05-04 19:49:15 -04:00
Nick Couchman
ac9e5e91f6 GUACAMOLE-1059: Remove bad check of audio stream against body_size. 2020-05-04 17:53:38 -04:00
Nick Couchman
98f0c271fb GUACAMOLE-1059: Add explanatory comments and additional logging. 2020-05-04 17:45:17 -04:00
Nick Couchman
8560ff9718 GUACAMOLE-1059: Move rdpsnd body size check to correct location. 2020-05-04 12:11:37 -04:00
Nick Couchman
ce28575b3a GUACAMOLE-1059: Use FreeRDP function for verifying Stream length before reading. 2020-05-04 08:48:40 -04:00
Tomer Gabel
8838199f5c GUACAMOLE-1047: Notify connecting client on unrecognized connection ID 2020-04-23 16:53:17 +03:00
Nick Couchman
f910d29083 GUACAMOLE-1031: Add call for RDP to pay attention to upload directory 2020-04-16 12:20:58 -04:00
Nick Couchman
02a7291742 GUACAMOLE-513: Adjust names of constants and fix style. 2020-04-15 09:42:22 -04:00
Mike Jumper
9c37fc5617
GUACAMOLE-949: Merge removal of unused UNIX_TIME macro. 2020-04-13 23:16:25 -07:00
Nick Couchman
a55e1893dd GUACAMOLE-949: Remove unused UNIX_TIME macro. 2020-04-02 15:53:51 -04:00
Nick Couchman
b077013c30 GUACAMOLE-474: Hide Download folder if downloads are disabled. 2020-04-02 14:58:06 -04:00
Nick Couchman
bbb794966b Merge staging/1.2.0 changes back to master. 2020-03-22 20:30:42 -04:00
Virtually Nick
e78eb589d9
GUACAMOLE-952: Merge correct security negotiation behavior for Hyper-V / VMConnect. 2020-03-22 20:29:33 -04:00
Michael Jumper
04b8633410 GUACAMOLE-952: Add security negotiation mode specific to Hyper-V / VMConnect. 2020-03-22 16:27:55 -07:00
Michael Jumper
aa8c8cac84 GUACAMOLE-952: Remove incorrect Preconnection PDU warning left over from old FreeRDP support. 2020-03-22 16:27:55 -07:00
Nick Couchman
a0d4bacbc6 GUACAMOLE-513: Support determining IPv4 or IPv6. 2020-03-19 09:12:15 -04:00
Nick Couchman
0feda1fa2f GUACAMOLE-513: Make packet size a constant. 2020-03-19 09:12:15 -04:00
Nick Couchman
45e46bd245 GUACAMOLE-513: Move sleep to protocol implementations; update comments and headers. 2020-03-19 09:12:15 -04:00
Nick Couchman
3dc2591517 GUACAMOLE-513: Add debug logging for sending WoL. 2020-03-19 09:12:15 -04:00
Nick Couchman
3d4a27607d GUACAMOLE-513: Implement settings and code for Wake-on-LAN support. 2020-03-18 13:29:58 -04:00
Virtually Nick
fba6ef461c
GUACAMOLE-982: Merge fix the error log message when the creating thread of RDP client fails 2020-03-09 18:45:11 -04:00
Jimmy
fa86d18353 GUACAMOLE-982: Fix the error log message when the creating thread of RDP client fails. 2020-03-09 23:16:28 +02:00
Nick Couchman
f47491eaca Merge staging/1.2.0 changes back to master. 2020-03-02 18:38:03 -05:00
Virtually Nick
e4407167ab
GUACAMOLE-979: Merge ensure all FreeRDP settings strings are independent duplicates of their corresponding Guacamole settings. 2020-03-02 18:36:33 -05:00
Virtually Nick
253213b29d
GUACAMOLE-978: Merge respond to Handshake/HandshakeEx PDU received via RAIL with client Handshake PDU. 2020-03-02 18:35:53 -05:00
Michael Jumper
5e1b92cb65 GUACAMOLE-979: Ensure all FreeRDP settings strings are independent duplicates of their corresponding Guacamole settings.
FreeRDP 2.0.0 will automatically free all settings strings when the
settings structure is freed. As we will also do the same for our own
settings strings, the FreeRDP settings must be kept independent. There
is no guarantee that the FreeRDP settings will be pushed before an error
causes the connection to abort, nor that the FreeRDP settings will not
need to be pushed multiple times due to an automatic reconnect.
2020-03-02 15:02:03 -08:00
Michael Jumper
789463ce76 GUACAMOLE-978: Respond to Handshake/HandshakeEx PDU received via RAIL with client Handshake PDU. 2020-03-02 14:15:27 -08:00
Nick Couchman
cc688485db Merge staging/1.2.0 changes back to master. 2020-02-28 13:51:13 -05:00
Virtually Nick
cf845be5ee
GUACAMOLE-917: Merge add missing non-dead tilde to German keymap for RDP. 2020-02-28 13:49:45 -05:00
Michael Jumper
28983d964b GUACAMOLE-917: Add missing non-dead tilde to German keymap for RDP. 2020-02-28 10:47:22 -08:00
Michael Jumper
0832dda409 Merge 1.2.0 changes back to master. 2020-02-26 18:51:06 -08:00
Mike Jumper
4b4b11da57
GUACAMOLE-966: Merge bump of guacamole-server version number to 1.2.0. 2020-02-26 18:50:30 -08:00
Nick Couchman
34d798a0ff GUACAMOLE-966: Bump server version to 1.2.0 2020-02-25 20:45:54 -05:00
Nick Couchman
811d2f70e4 Merge staging/1.2.0 changes back to master. 2020-02-24 22:50:10 -05:00
Virtually Nick
83d2f30f8b
GUACAMOLE-818: Merge break SFTP directory JSON at blob boundaries. Do not skip entries. 2020-02-24 21:14:49 -05:00
Michael Jumper
8ea9b14a80 GUACAMOLE-818: Break SFTP directory JSON at blob boundaries. Do not skip entries.
The intent of the previous version of the SFTP directory listing code
was to break the JSON transfer at blob boundaries, waiting for an ack
before sending the next blob, however the ordering of the "blob_written"
and directory read checks could result in a directory entry being
skipped at the boundary of each blob.

The proper order would be to check the "blob_written" flag first,
however the "blob_written" flag is unnecessary. It's simpler and more
correct to just break out of the loop once the desired blob has been
flushed.
2020-02-24 17:58:29 -08:00
Virtually Nick
d2ee11f15a
GUACAMOLE-962: Merge allow misbehaving RDP servers to use OpaqueRect and PatBlt. 2020-02-24 20:27:20 -05:00
Michael Jumper
a80cd8db06 GUACAMOLE-962: Restore OpaqueRect and PatBlt handlers.
This commit effectively reverts commit 9855d875c794e9517567e89ad13acccd7e7e03d0.

With relaxed order checks enabled, FreeRDP will indeed invoke the
OpaqueRect and PatBlt handlers (even though we do not announce support
for those orders) as long as handlers are provided.
2020-02-24 16:48:14 -08:00
Michael Jumper
3b0abe376e GUACAMOLE-962: Request relaxed RDP order checks if supported by FreeRDP. 2020-02-24 16:48:14 -08:00
Mike Jumper
090bb3bbea
GUACAMOLE-958: Merge changes correcting race condition and potential deadlock in guacd_timed_client_free(). 2020-02-13 09:49:35 -08:00
Jonas Zeiger
783aa85c1b GUACAMOLE-958: Avoid race/deadlock in guacd_timed_client_free() 2020-02-12 15:06:25 +01:00
Virtually Nick
5ecad1c3d9
GUACAMOLE-947: Merge fix the initialization issue of CLIPRDR_FORMAT_LIST object 2020-02-06 16:54:39 -05:00
Jimmy
659cdd09a0 GUACAMOLE-947: Fix the initialization issue of CLIPRDR_FORMAT_LIST object. 2020-02-06 18:17:40 +02:00
Sean Reid
fe0658dd36 GUACAMOLE-465: resolved issues brought up in PR159 and added compatibility with recent versions of libavcodec 2020-02-02 16:34:40 -05:00
Sean Reid
fb237d4fc9 GUACAMOLE-465: resolved issues brought up in PR159 (unneeded dynamic mem allocation, style guide violations) 2020-02-02 16:34:40 -05:00
Sean Reid
bb825de73b GUACAMOLE-465: added dependency to libavformat as first step to supporting other types of codecs and containers in guacenc. migrated existing functionality to use the libavformat library for writing the files. there is not differnce to the user with this patch, but it provides a good base to finish this new feature from later 2020-02-02 16:34:40 -05:00
Nick Couchman
1a699686b9 GUACAMOLE-474: Implement logic to disable file transfers in each protocol. 2020-01-26 03:33:08 -05:00
Nick Couchman
42e382062c GUACAMOLE-474: Add parameter processing for file upload/download disable. 2020-01-26 03:33:08 -05:00
Mike Jumper
68a6285818
GUACAMOLE-625: Merge changes correcting failing build due to trailing whitespace in Makefile.am. 2020-01-24 08:09:32 -08:00
Nick Couchman
0e845a2914 GUACAMOLE-625: Remove trailing whitespace in Makefile.am and fix style 2020-01-24 10:32:25 -05:00
Virtually Nick
550e13ae9f
GUACAMOLE-625: Merge include Latin American RDP keymap 2020-01-24 10:07:10 -05:00
Adolfo Gómez García
b13fae7a9f GUACAMOLE-625: Included Latin American keymap 2020-01-24 10:50:23 +01:00
Nick Couchman
0aecca3e04 Merge staging/1.1.0 changes back to master. 2020-01-22 16:25:39 -05:00
Virtually Nick
a054073ec7
GUACAMOLE-935: Merge do not assign SVC plugin context as it may be automatically freed. 2020-01-22 16:23:38 -05:00
Michael Jumper
8ebe5c571a GUACAMOLE-935: Do not assign SVC plugin context as it may be automatically freed.
FreeRDP version 2.0.0-rc0 and older will automatically free whatever
entry_points->pInterface is set to when the channel plugin is unloaded.
This doesn't happen in later versions, but will result in a double-free
upon disconnect for 2.0.0-rc0 in our case. As we don't need pInterface,
we can safely set this to NULL and avoid the issue entirely.
2020-01-22 11:10:50 -08:00
James Muehlner
28f7d3694e Merge 1.1.0 changes back to master. 2020-01-21 23:30:27 -08:00
James Muehlner
3bc00c429a
GUACAMOLE-935: Merge fix for differing rdpBitmap free behavior. 2020-01-21 23:28:46 -08:00
Michael Jumper
87a3c7392b GUACAMOLE-935: Periods within regexes must be escaped if intended to match literal periods. 2020-01-21 22:35:26 -08:00
Michael Jumper
49df9f04e0 GUACAMOLE-935: Use C preprocessor to determine FreeRDP version rather than running a test program.
AC_RUN_IFELSE cannot be used when cross-compiling, whereas AC_EGREP_CPP
can.
2020-01-21 22:40:18 -08:00
Michael Jumper
26dfc533bd GUACAMOLE-935: Free internals of rdpBitmap only when required.
In FreeRDP 2.0.0-rc0 and earlier, Bitmap_Free(bitmap) invokes the free
handler of the given bitmap, frees bitmap->data, and then frees the
bitmap. The implementation-specific free handler needs to be aware only
of the implementation's own concerns.

After FreeRDP 2.0.0-rc0, Bitmap_Free(bitmap) only invokes the
implementation-specific free handler, and it's on the implementation to
know that bitmap->data must be manually freed with _aligned_free() and
bitmap must be freed with free(). The implementation-specific free
handler must be aware of the internals of the library.

See commit 8dda26a.
2020-01-21 22:35:26 -08:00
James Muehlner
75b658c6c9
GUACAMOLE-934: Merge support for the Play Sound PDU. 2020-01-21 22:08:44 -08:00
James Muehlner
24b6a3f357
GUACAMOLE-931: Merge FreeRDP user home directory safety checks. 2020-01-21 21:43:49 -08:00
Michael Jumper
b21d19d37d GUACAMOLE-934: Correct waveform calculation. Switch to triangle wave to reduce aliasing distortion. 2020-01-21 00:03:42 -08:00
Michael Jumper
b8148b0daf GUACAMOLE-934: Handle potential lack of available audio streams. 2020-01-20 21:16:36 -08:00
Michael Jumper
ddc09b161a GUACAMOLE-934: Add support for the Play Sound PDU. 2020-01-20 18:36:06 -08:00
Michael Jumper
32f8f20852 GUACAMOLE-931: Verify that home directory is both a directory and writable for sake of FreeRDP initialization. 2020-01-20 11:49:11 -08:00
Nick Couchman
a447b3dc1a Merge staging/1.1.0 changes back to master. 2020-01-20 03:51:47 -05:00
Virtually Nick
0cd9ba387b
GUACAMOLE-929: Merge update copyright date to 2020. 2020-01-20 03:50:29 -05:00
Michael Jumper
35e44db713 GUACAMOLE-929: Update copyright date to 2020. 2020-01-19 13:36:09 -08:00
Nick Couchman
cc8d879a12 Merge staging/1.1.0 changes back to master. 2020-01-18 06:16:54 -05:00
Virtually Nick
77f6168729
GUACAMOLE-928: Merge keep FreeRDP plugins of Docker image within /usr/local/guacamole 2020-01-18 06:15:23 -05:00
Virtually Nick
a384e749e2
GUACAMOLE-927: Merge automatically set $HOME for sake of FreeRDP initialization process 2020-01-18 06:13:45 -05:00
Michael Jumper
2c6be5afd1 GUACAMOLE-928: Keep all build artifacts of Docker image within /usr/local/guacamole, including FreeRDP plugins. 2020-01-17 16:15:31 -08:00
Michael Jumper
0676e70325 GUACAMOLE-927: Abort RDP connection if FreeRDP fails to initialize. 2020-01-17 15:54:56 -08:00
Michael Jumper
39f7d5a843 GUACAMOLE-927: Automatically set $HOME for sake of FreeRDP initialization process. 2020-01-17 15:50:47 -08:00
Nick Couchman
fd2c5b9259 Merge staging/1.1.0 changes back to master. 2020-01-16 15:06:56 -05:00
Virtually Nick
39defa27fa
GUACAMOLE-249: Merge automatically determine correct location for FreeRDP plugins. 2020-01-16 15:04:45 -05:00
Michael Jumper
be5cdf52c1 GUACAMOLE-249: Allow detected FreeRDP plugin directory to be overridden with --with-freerdp-plugin-dir. 2020-01-16 11:57:14 -08:00
Michael Jumper
37dceed8ec GUACAMOLE-249: Automatically determine correct location for FreeRDP plugins. 2020-01-15 21:55:27 -08:00
Virtually Nick
65b4722a1a
GUACAMOLE-249: Merge remove extra warning resulting from merge 2020-01-14 19:17:22 -05:00
Michael Jumper
fcac1a26f8 GUACAMOLE-249: Remove extra warning resulting from merge.
If the admin intentionally disables both copy and paste, then there is
no need to log a warning that this is the case; it was intentional. A
warning will likely set off alarm bells within production log monitoring
systems.
2020-01-14 15:50:23 -08:00
Nick Couchman
956c5f293e Merge staging/1.1.0 changes back to master. 2020-01-14 16:27:09 -05:00
Virtually Nick
3e22526ad9
GUACAMOLE-249: Merge migrate to FreeRDP 2.x 2020-01-14 14:21:26 -05:00
Michael Jumper
99b00a8cc0 GUACAMOLE-249: Add -Werror to CPPFLAGS for FreeRDP tests to ensure tests fail when pointers are incompatible. 2020-01-13 18:17:56 -08:00
Michael Jumper
de3300ed89 GUACAMOLE-249: Preserve CPPFLAGS such that modifications needed for FreeRDP tests affect only FreeRDP tests. 2020-01-13 18:17:32 -08:00
Michael Jumper
3dfd2467c3 GUACAMOLE-249: Remove RAIL callback typecasts, relying instead on configure tests to check need for const. 2020-01-13 16:34:02 -08:00
Michael Jumper
e5fdda1286 GUACAMOLE-249: Remove CLIPRDR callback typecasts, relying instead on configure tests to check need for const. 2020-01-13 16:34:02 -08:00
Michael Jumper
308d7a09a8 GUACAMOLE-249: Support rdpGlyph callback format used in FreeRDP 2.0.0-rc3 and older (used UINT32 instead of INT32). 2020-01-13 16:34:02 -08:00
Michael Jumper
9a34caf40f GUACAMOLE-249: The FreeRDPConvertColor() function is also known as ConvertColor(), but was only available as ConvertColor() in older FreeRDP 2.0.0 release candidates. 2020-01-13 16:08:17 -08:00
Michael Jumper
eaae203e94 GUACAMOLE-249: Ensure RAIL message handlers are accepted by compiler regardless of whether const is required. 2020-01-13 15:41:56 -08:00
Michael Jumper
4282da662f GUACAMOLE-249: Restructure audio input such that audio buffer can be separately linked.
On some platforms, the libguacai-client.so plugin for FreeRDP reports an
unlinked symbol:

    undefined symbol: guac_freerdp_dynamic_channel_collection_add	(/usr/local/lib/freerdp2/libguacai-client.so)

This symbol is actually unused within the plugin, but may be referenced
due to being defined within a function in a common piece of source
shared between the plugin and the RDP support.

Separating the actual common components such that they can be included
by both the RDP support and the libguacai-client.so plugin removes the
potential for unused pieces being flagged as missing.
2020-01-12 22:04:01 -08:00
Michael Jumper
e9846945c7 GUACAMOLE-249: Test endianness of platform without violating strict aliasing rules.
Dereferencing a uint8_t array as uint32_t causes a build failure with
some compilers as it breaks strict aliasing rules.
2020-01-12 14:34:44 -08:00
Michael Jumper
4b1243fbf8 GUACAMOLE-249: Ensure CLIPRDR message handlers are accepted by compiler regardless of whether const is required.
Without a typecast, errors like the following are generated by the
compiler:

    channels/cliprdr.c: In function 'guac_rdp_cliprdr_channel_connected':
    channels/cliprdr.c:477:27: error: assignment from incompatible pointer type [-Werror]
         cliprdr->MonitorReady = guac_rdp_cliprdr_monitor_ready;
                               ^
    channels/cliprdr.c:478:31: error: assignment from incompatible pointer type [-Werror]
         cliprdr->ServerFormatList = guac_rdp_cliprdr_format_list;
                                   ^
    channels/cliprdr.c:479:38: error: assignment from incompatible pointer type [-Werror]
         cliprdr->ServerFormatDataRequest = guac_rdp_cliprdr_format_data_request;
                                          ^
    channels/cliprdr.c:480:39: error: assignment from incompatible pointer type [-Werror]
         cliprdr->ServerFormatDataResponse = guac_rdp_cliprdr_format_data_response;
                                           ^
    cc1: all warnings being treated as errors

This is because FreeRDP commit 65812bd added const to the pointer
argument of each of these handlers, wheras older versions of FreeRDP
lack const here. Our implementations of these functions declare const
and thus do not match the older prototype, though they are compatible
with it.
2020-01-12 14:06:34 -08:00
Michael Jumper
5e9c7cdb42 GUACAMOLE-249: Correct typo: "of common RDPDR header" should be "of the common RDPDR header". 2020-01-11 20:24:12 -08:00
Michael Jumper
01c731e241 GUACAMOLE-249: Clean up documentation for arbitrary pipe SVC. No need to say "automatically" everywhere. 2020-01-11 20:22:23 -08:00
Michael Jumper
92d97a3244 GUACAMOLE-249: Correct typo: "indicating" should be "indicates". 2020-01-11 20:21:00 -08:00
Michael Jumper
e9670df145 GUACAMOLE-249: Correct typo: "updating" should be "update". 2020-01-11 20:19:51 -08:00
Michael Jumper
a3d9a685e8 GUACAMOLE-249: Handle failure to send either response required for monitor ready. 2020-01-11 20:18:27 -08:00
Michael Jumper
f805a80bc1 GUACAMOLE-249: Switch return type of guac_rdp_cache_bitmap() back to void - it doesn't fail, and isn't dictated by the FreeRDP API. 2020-01-11 20:14:35 -08:00
Michael Jumper
62ee36142d GUACAMOLE-249: Refactor guac_freerdp_channels_load_plugin() to log a warning if plugin limits are reached. 2020-01-09 14:12:08 -08:00
Michael Jumper
b3a713bf7a GUACAMOLE-249: Clean up basename logic of file downloads. Add unit test. 2020-01-09 13:36:37 -08:00
Michael Jumper
c4f6c5161c GUACAMOLE-249: Remove accidentally-inserted "0" from end of comment. 2020-01-09 13:11:45 -08:00
Michael Jumper
feb376ea1e GUACAMOLE-249: Fix misspelled "instruction" and "have" in comments. 2020-01-09 13:10:05 -08:00
Michael Jumper
2139d40e97 GUACAMOLE-249: Remove accidental double spaces from RDP comments. 2020-01-09 13:00:56 -08:00
Michael Jumper
55959b5456 GUACAMOLE-249: Until parameter prompting is available, do not auto-negotiate for NLA if username and password have not been provided. 2020-01-06 13:47:19 -08:00
Michael Jumper
666c4fb299 GUACAMOLE-249: Do not include "extended mode" NLA in security negotiation as negotiation fails (see FreeRDP defaults). 2020-01-06 13:39:59 -08:00
Michael Jumper
67c5bdfdfe GUACAMOLE-249: Do not attempt to free SVC-specific data if it hasn't actually been allocated. 2020-01-06 13:35:35 -08:00
Michael Jumper
dc8c60f30f GUACAMOLE-249: freerdp_channels_data() is already the default value of ReceiveChannelData. 2020-01-06 13:22:24 -08:00
Michael Jumper
80988cd6f4 GUACAMOLE-249: Provide SetNull and SetDefault implementations for rdpPointer. 2020-01-06 13:09:51 -08:00
Michael Jumper
1f24c47e29 GUACAMOLE-249: Remove empty struct definitions added by Include What You Use. 2020-01-06 11:40:08 -08:00
Michael Jumper
0677a9ae4d GUACAMOLE-249: Common surface should still pay attention to dirty flag, regardless of the new special case for unrealized surfaces. 2020-01-06 11:18:10 -08:00
Michael Jumper
a54a12362c GUACAMOLE-249: Use ReadColor() / WriteColor() around FreeRDPConvertColor().
The latter expects color input to be in an intermediate representation
resulting from using ReadColor(), and produces color output which cannot
be used until converted back with WriteColor().
2020-01-06 11:04:44 -08:00
Michael Jumper
e325dbc672 GUACAMOLE-249: Add/remove headers as necessary based on run through Include What You Use (IWYU) tool. 2020-01-04 13:07:28 -08:00
Michael Jumper
9855d875c7 GUACAMOLE-249: Remove handlers for PatBlt and OpaqueRect. FreeRDP will not invoke these if the corresponding OrderSupport element is FALSE, thus they will never be called. 2020-01-04 11:53:11 -08:00
Michael Jumper
2bbc4bfbff GUACAMOLE-249: Move keyboard-related source back to root of RDP (ease merge). Not truly needed as much as the rest of the restructure. 2020-01-04 11:50:08 -08:00
Michael Jumper
f57382f885 GUACAMOLE-249: Determine FreeRDP pixel format corresponding to local Cairo surfaces based on local platform endianness. 2020-01-04 01:11:12 -08:00
Michael Jumper
555973f6b0 GUACAMOLE-249: Remove unnecessary bitmap conversion - will happen automatically when FreeRDP invokes bitmap->Decompress(). 2020-01-04 00:00:21 -08:00
Michael Jumper
902c5e1bd4 GUACAMOLE-249: Alpha component must be in highest-order byte. 2020-01-03 23:42:34 -08:00
Michael Jumper
1bc9384ea8 GUACAMOLE-249: Claim support only for RDP orders that are explicitly supported, independently of any FreeRDP defaults. 2020-01-03 17:29:16 -08:00
Michael Jumper
36f227586e GUACAMOLE-249: Defer draws to unrealized (server-side) buffers until they are actually needed client-side.
Though deferred creation of buffers is already intended, creation was
not actually being deferred in practice as the act of initializing the
buffer with a solid rect of color was causing the buffer to be realized,
even if that initialization process is the only drawing operation that
will ever occur to that buffer.
2020-01-03 16:35:37 -08:00
Michael Jumper
2d4412316f GUACAMOLE-249: Do not draw background for glyphs when "redundant" (transparent). 2020-01-01 20:33:46 -08:00
Michael Jumper
d7151e0d84 GUACAMOLE-249: Push FreeRDP settings in preconnect hander (OrderSupport is reset otherwise).
We set the values within the OrderSupport array to match which RDP
messages we have implemented within guac_rdp_push_settings(). This array
is reset to its default values prior to the preconnect handler being
invoked, thus guac_rdp_push_settings() MUST be invoked within the
preconnect handler for its settings to have the intended effect.

Without proper values within OrderSupport, the initial RDP negotiation
process will claim support for messages that we don't actually support,
resulting in graphical artifacts and unexpected behavior.
2019-12-31 16:23:39 -08:00
Michael Jumper
7ef1dcafba GUACAMOLE-249: Convert absolutely all rdpBitmaps before attempting to draw. 2019-12-31 16:17:36 -08:00
Michael Jumper
f33416949f GUACAMOLE-249: RAIL plugin for FreeRDP 2.0.0 requires that the Client Execute PDU be sent manually. 2019-12-30 17:43:39 -08:00
Michael Jumper
8dda26af54 GUACAMOLE-249: Free rdpBitmap and rdpGlyph within custom free handlers (not automatically freed like rdpPointer). 2019-12-30 16:11:13 -08:00
Michael Jumper
0926864ecb GUACAMOLE-249: Redirect FreeRDP log messages to debug level of guac_client_log(). 2019-12-29 18:44:41 -08:00
Michael Jumper
9ad3bc9a49 GUACAMOLE-249: Log RDPDR debug messages at GUAC_LOG_DEBUG level. 2019-12-29 18:12:01 -08:00
Michael Jumper
6940875e6e GUACAMOLE-249: Refactor away old stream.h and guac_rdp_stream. 2019-12-29 18:04:51 -08:00
Michael Jumper
d2083a1aed GUACAMOLE-249: Refactor RDPDR to be more documentable. Document RDPDR fully. 2019-12-29 18:04:51 -08:00
Michael Jumper
36545cc92c GUACAMOLE-249: Document absolutely all parameters and return types for RDP support. 2019-12-29 18:04:51 -08:00
Michael Jumper
a54c61e860 GUACAMOLE-249: Support for OpaqueRect MUST NOT be claimed without supporting PatBlt. OpaqueRect implies PatBlt and vice versa. 2019-12-28 19:36:43 -08:00
Michael Jumper
fbb759ab82 GUACAMOLE-249: Correct mismatched ifndef/define header include check. 2019-12-28 19:36:43 -08:00
Michael Jumper
ab05502494 GUACAMOLE-249: Correct missing/incorrect documentation for RDP callback parameters. 2019-12-28 19:36:43 -08:00
Michael Jumper
12febd5162 GUACAMOLE-249: Remove unused SEC_TO_UNIX_EPOCH constant. 2019-12-27 21:12:39 -08:00
Michael Jumper
6c239a7b98 GUACAMOLE-249: Use filesystem constants defined by FreeRDP and WinPR headers rather than defining our own. 2019-12-27 21:12:18 -08:00
Michael Jumper
598b86a4cf GUACAMOLE-249: Correct @file annotations within Doxygen comments of renamed headers. 2019-12-27 20:55:06 -08:00
Michael Jumper
69831995cb GUACAMOLE-249: Remove prototype for guac_rdp_bitmap_decompress(), which is no longer defined nor used. 2019-12-27 15:24:25 -08:00
Michael Jumper
47a1dcc82e GUACAMOLE-249: Message flags of clipboard data response must be set to CB_RESPONSE_OK for data to be accepted. 2019-12-25 02:04:13 -08:00
Michael Jumper
0c7091198f GUACAMOLE-249: Use correct start location of clipboard buffer (accidentally used pointer to end). 2019-12-25 02:03:23 -08:00
Michael Jumper
bced87cff9 GUACAMOLE-249: FreeRDP 2.0.0 requires the Clipboard Capabilities PDU to be manually sent. 2019-12-25 01:34:57 -08:00
Michael Jumper
024fc2a1f7 GUACAMOLE-249: Callbacks for "drdynvc" plugin should return CHANNEL_RC_OK, including entry point. 2019-12-23 19:26:49 -08:00
Michael Jumper
4752863b5b GUACAMOLE-249: Remove now-unnecessary status.h FreeRDP compatibility header. 2019-12-23 13:35:32 -08:00
Michael Jumper
d7bbee35b0 GUACAMOLE-249: Reorganize includes to match code standard. 2019-12-23 13:32:36 -08:00
Michael Jumper
a63dcb46b2 GUACAMOLE-249: Rename and restructure RDP source files more sensibly. 2019-12-23 13:29:37 -08:00
Michael Jumper
827951dcf6 GUACAMOLE-249: Remove RDP constant definitions which are defined within FreeRDP headers. 2019-12-22 21:24:07 -08:00
Michael Jumper
875d51c1ed GUACAMOLE-249: Dynamically wrap channel entry points (FreeRDP will refuse to associate the same entry point with multiple channels). 2019-12-22 20:34:30 -08:00
Michael Jumper
664586ea54 GUACAMOLE-249: VirtualChannelEntryEx entry point is supposed to accept a PCHANNEL_ENTRY_POINTS_EX. 2019-12-22 17:33:35 -08:00
Michael Jumper
4612e79b8d GUACAMOLE-249: Remove "guacsnd" plugin in favor of leveraging common SVC implementation. 2019-12-22 14:29:01 -08:00
Michael Jumper
3255b182ab GUACAMOLE-249: Remove "guacsvc" plugin in favor of leveraging common SVC implementation. 2019-12-22 14:07:01 -08:00
Michael Jumper
352b9c517c GUACAMOLE-249: Add common SVC plugin implementation as future simplified basis for RDPSND, RDPDR, etc. 2019-12-22 13:36:35 -08:00
Michael Jumper
7b93b3d2e9 GUACAMOLE-249: Gradually reassemble received chunks of RDPSND data. 2019-12-21 22:51:43 -08:00
Michael Jumper
a7352b1429 GUACAMOLE-249: Remove lock around usage of FreeRDP (new library appears threadsafe). 2019-12-21 20:02:17 -08:00
Michael Jumper
ee4d91ea98 GUACAMOLE-249: Migrate RDPDR support to FreeRDP 2.0.0 plugin API. 2019-12-21 19:53:44 -08:00
Michael Jumper
68710a6702 GUACAMOLE-249: Migrate loading of RDPDR support (guacdr plugin) to abstract function. 2019-12-21 19:53:44 -08:00
Michael Jumper
6f2b124472 GUACAMOLE-249: Migrate RDPSND support to FreeRDP 2.0.0 plugin API. 2019-12-21 19:41:00 -08:00
Michael Jumper
0497a33ece GUACAMOLE-249: Migrate loading of RDPSND support ("guacsnd" plugin) to abstract function. 2019-12-21 19:41:00 -08:00
Michael Jumper
f3cef7e2f0 GUACAMOLE-249: Add example for testing arbitrary SVC support. 2019-12-21 13:42:30 -08:00
Michael Jumper
233c0555c3 GUACAMOLE-249: Migrate SVC support to FreeRDP 2.0.0 plugin API. 2019-12-21 13:42:30 -08:00
Virtually Nick
c97b8f287e
GUACAMOLE-901: Merge add Belgian French keymap 2019-11-29 12:28:41 -05:00
Jukka-Pekka Virtanen
1822e59ac3 GUACAMOLE-901: Belgian French keymap
Add Belgian French keymap file and add it to build process. Keymap is
based on https://commons.wikimedia.org/wiki/File:Belgian_pc_keyboard.svg
2019-11-19 11:53:02 +02:00
Michael Jumper
fa0ad267b8 GUACAMOLE-249: Update Docker build to use FreeRDP 2.0.0. 2019-11-04 19:26:04 -08:00
Mike Jumper
6ae6ea587b
GUACAMOLE-871: Merge support for DECTECM private mode sequence (show/hide cursor). 2019-10-16 09:54:19 -07:00
Maxime Coste
199c2a0961 GUACAMOLE-871: Add support for hidden cursor (DECTECM) 2019-10-15 20:24:51 +11:00
Michael Jumper
77a32398e5 GUACAMOLE-249: Migrate to plugin naming style used by FreeRDP 2.0.0. 2019-10-14 14:13:19 -07:00
Michael Jumper
6dc8b57ca4 GUACAMOLE-249: Update RAIL (RemoteApp) support to FreeRDP 2.0.0 API. 2019-10-14 11:15:43 -07:00
Michael Jumper
07f6e6afc2 GUACAMOLE-249: Remove guac_rdp_dvc_list, relying instead on the DVC channel collection within rdpSettings. 2019-10-13 15:30:21 -07:00
Michael Jumper
eab07b4a61 GUACAMOLE-249: Add trace-level logging of received and sent CLIPRDR PDUs. 2019-10-13 14:28:06 -07:00
Michael Jumper
de493ba959 GUACAMOLE-249: Send Format List Response PDU after successfully processing a Format List PDU. 2019-10-13 14:28:06 -07:00
Michael Jumper
9dd1555c81 GUACAMOLE-249: Do not include CB_RESPONSE_OK flag in Format List PDU.
The CLIPRDR specification requires that the msgFlags field for the
Format List PDU be set to 0x0000. The function within FreeRDP overrides
this value to 0x0000, but it is still incorrect to attempt to set it.
2019-10-13 14:28:06 -07:00
Michael Jumper
8c7984d201 GUACAMOLE-249: Free GDI implementation. Do not allocate cache (unnecessary). 2019-10-13 14:28:06 -07:00
Michael Jumper
b64b8f375a GUACAMOLE-249: Restore support for CLIPRDR channel. 2019-10-13 14:28:06 -07:00
Michael Jumper
831606a4e9 GUACAMOLE-249: Use pkg-config to determine location of FreeRDP headers. 2019-10-11 17:56:21 -07:00
Michael Jumper
cc7cd78e5b GUACAMOLE-249: Centralize handling of connected channels. 2019-10-08 11:44:26 -07:00
Michael Jumper
16be3af03c GUACAMOLE-249: Load FreeRDP plugins regardless of entry point interface.
Most plugins built into FreeRDP implement the PVIRTUALCHANNELENTRYEX
entry point, but the FreeRDP standard function for loading plugins only
supports PVIRTUALCHANNELENTRY. It appears that only the commandline
argument parser included with FreeRDP was updated to leverage the new
entry points.
2019-10-06 14:44:26 -07:00
Michael Jumper
b89ed7ff15 GUACAMOLE-249: Migrate wait mechanism to event handle interface. 2019-10-06 14:32:12 -07:00
Michael Jumper
17045d5d3a GUACAMOLE-249: Use reversed byte order for colors locally (verification needed). 2019-09-29 16:08:27 -07:00
Michael Jumper
7904d9c002 GUACAMOLE-249: Initialize FreeRDP's GDI implementation (default GDI handlers will otherwise fail). 2019-09-29 15:44:34 -07:00
Michael Jumper
7a7ffc2c19 GUACAMOLE-249: Add missing pixel format parameter to pointer image copy. 2019-09-29 15:44:34 -07:00
Michael Jumper
65fe6c9735 GUACAMOLE-249: Correct incorrect syntax introduced by initial partial migration (commit a5b62aa82). 2019-09-29 15:44:34 -07:00
Michael Jumper
c311d8bde9 GUACAMOLE-249: Rely on default bitmap/GDI/pointer handlers for all but those that must be overridden. 2019-09-29 15:44:34 -07:00
Michael Jumper
1e692094be GUACAMOLE-249: Correct remaining void returns from BOOL handlers. 2019-09-29 15:44:34 -07:00
Michael Jumper
7332e633dc GUACAMOLE-249: Add "nla-ext" option for extended NLA mode. 2019-09-29 15:44:34 -07:00
Michael Jumper
2ed0d042a3 GUACAMOLE-249: Default to negotiated security mode, not old "RDP" encryption. 2019-09-29 14:34:05 -07:00
Michael Jumper
a76e307176 GUACAMOLE-249: RDP "DisableEncryption" settings flag has been inverted and renamed to "UseRdpSecurityLayer". 2019-09-29 14:25:47 -07:00
Michael Jumper
6886665f65 GUACAMOLE-249: Comment out usage of old event interface. 2019-09-29 14:15:41 -07:00
Michael Jumper
703ce5c223 GUACAMOLE-249: Remove usage of old FreeRDP channels interface. 2019-09-29 14:15:13 -07:00
Michael Jumper
ad7ab67571 GUACAMOLE-249: The freerdp/gdi/gdi.h header is required to access contents of rdpGdi struct. 2019-09-22 14:58:23 -07:00
Michael Jumper
9fa9adbd58 GUACAMOLE-249: Migrate to libwinpr "CF_*" constants for clipboard formats.
The "CB_FORMAT_*" constants which used to be defined by FreeRDP no
longer exist.
2019-09-22 14:58:23 -07:00
Michael Jumper
3b560044bc GUACAMOLE-249: Correct prototype of certificate verification callback. If accepting the certificate, request that FreeRDP not store it. 2019-09-22 14:49:30 -07:00
Michael Jumper
82664b4e6b GUACAMOLE-249: Correct prototypes of GDI handlers. 2019-09-22 14:49:30 -07:00
Michael Jumper
fbfbaff540 GUACAMOLE-249: Correct prototypes of pointer handlers. 2019-09-22 14:49:30 -07:00
Michael Jumper
e4a68d776f GUACAMOLE-249: Correct prototypes of glyph handlers. 2019-09-22 14:49:30 -07:00
Michael Jumper
9b08a716d6 GUACAMOLE-249: Comment out remaining usage of SVC. 2019-09-22 14:49:03 -07:00
Michael Jumper
554251cc72 GUACAMOLE-249: Remove usage of CLRCONV. 2019-09-22 14:49:00 -07:00
Michael Jumper
17d31d94b7 GUACAMOLE-249: Remove all legacy FreeRDP compatibility. 2019-09-22 14:48:56 -07:00
Michael Jumper
a5b62aa82e GUACAMOLE-249: Migrate to newer API (partial). 2019-09-22 14:48:26 -07:00
Mike Jumper
b181026e58
GUACAMOLE-861: Merge correction to RDPDR filesystem timestamp conversion. 2019-08-22 10:25:55 -07:00
unknown
4cc9c2d3e1 GUACAMOLE-861: Fixes WINDOWS_TIME calculation
This fixes the UNIX time to FILETIME conversion in WINDOWS_TIME macro,
according to MSDN (addition instead of subtraction).
2019-08-21 23:05:45 +03:00
Virtually Nick
f34be230aa
GUACAMOLE-859: Merge correct Caps Lock keysym sent via RDP 2019-08-13 21:11:46 -04:00
Weston Thayer
a189c9ab8a GUACAMOLE-859: Remove +ext from Caps Lock keymapping.
When connected with a Guacamole RDP session, the keysym for Caps Lock (0xffe5) is sent over RDP as scancode 0xe03a. Windows does not understand this scancode, thus does not generate the correct VK (Virtual Key) events. Removing +ext from the keymap sends the scancode 0x003a, which is correctly recognized by Windows as Caps Lock. This enables Windows applications to listen for key down and key up events on the Caps Lock key while connected via a Guacamole RDP session.

Note: this issue likely went un-noticed for a long time because it only impacts the key up and down events for the Caps Lock key, not Caps Lock's effect on sending uppercase [A-Z] characters.
2019-08-13 21:00:26 -04:00
Mike Jumper
51463209a8
GUACAMOLE-514: Merge support for VNC authentication involving usernames. 2019-08-12 18:02:24 -07:00
Nick Couchman
7ac840090e GUACAMOLE-514: Slight correction to debug message. 2019-08-12 19:45:45 -04:00
Nick Couchman
61d12f1668 GUACAMOLE-514: VNC client should abort on credential error. 2019-08-09 13:08:36 -04:00
Nick Couchman
f21621e677 GUACAMOLE-514: Remove x509 support. 2019-08-09 13:05:40 -04:00
Nick Couchman
88425160ae GUACAMOLE-514: Write x509 authentication factors to temp files. 2019-08-09 13:05:40 -04:00
Nick Couchman
b9001f4ec7 GUACAMOLE-514: Add missing parameter tag. 2019-08-09 13:05:40 -04:00
Nick Couchman
4329739d3e GUACAMOLE-514: Remove CRL check flag. 2019-08-09 13:05:40 -04:00
Nick Couchman
90d55956d0 GUACAMOLE-514: use correct client in log call. 2019-08-09 13:05:40 -04:00
Nick Couchman
51ae8a41a1 GUACAMOLE-514: Add guacd support for extended VNC credentials. 2019-08-09 13:05:40 -04:00
Nick Couchman
f962eab27a Merge 1.1.0 changes back to master. 2019-08-09 13:01:54 -04:00
Virtually Nick
381ff1a421
GUACAMOLE-630: Merge expose terminal color/font changes. 2019-08-09 13:01:05 -04:00
Michael Jumper
43269920db GUACAMOLE-630: Clarify usage of argv-related guac_user_callback implementations. 2019-08-07 20:16:01 -07:00
Michael Jumper
f56df8b8be GUACAMOLE-630: Automatically send current color scheme and font to users joining SSH, telnet, and Kubernetes connections. 2019-08-04 12:52:00 -07:00
Michael Jumper
ccfcfb116d GUACAMOLE-630: Persist details of color scheme and font changes. 2019-08-04 12:44:43 -07:00
Michael Jumper
4dabea37af GUACAMOLE-630: Allow guac_terminal_parse_color_scheme() to dictate color scheme format. 2019-08-04 11:55:45 -07:00
Michael Jumper
0516d599cf GUACAMOLE-630: Disallow NULL color schemes.
A color scheme string should always be provided, even if blank.
Disallowing NULL allows assumptions to be made which simplifies the
logic surrounding persisting provided configuration values.
2019-08-04 11:45:41 -07:00
Michael Jumper
b5191caddc GUACAMOLE-630: Accept pre-defined color schemes in all cases, not just during terminal creation. 2019-08-04 11:37:42 -07:00
Michael Jumper
0c7898c55a GUACAMOLE-630: Expose terminal font/color configuration changes to connected clients. 2019-08-03 19:53:07 -07:00
Nick Couchman
289ceac222 Merge 1.1.0 changes back to master. 2019-08-03 17:16:45 -04:00
Virtually Nick
e25f83d629
GUACAMOLE-623: Merge add support for adjusting terminal for Kubernetes via "argv". 2019-08-03 17:14:30 -04:00
Michael Jumper
e6835795f0 GUACAMOLE-623: Add support for setting terminal font for Kubernetes via "argv". 2019-08-03 14:04:30 -07:00
Nick Couchman
b6005cc8a0 Merge 1.1.0 changes back to master. 2019-07-31 12:39:32 -04:00
Virtually Nick
95039ea3b3
GUACAMOLE-629: Merge allow "argv" instructions to be sent from server to client. 2019-07-31 12:37:51 -04:00
Michael Jumper
ca073db5b6 GUACAMOLE-629: Add convenience functions for immediately sending the current value of a connection parameter. 2019-07-30 14:05:50 -07:00
Michael Jumper
c3a295e9b7 GUACAMOLE-629: Add convenience function for automatically splitting data across a series of blob instructions. 2019-07-30 14:05:50 -07:00
Michael Jumper
c47aa0cea1 GUACAMOLE-629: Define constant for maximum blob size. 2019-07-30 13:34:24 -07:00
Michael Jumper
c1b8250300 GUACAMOLE-629: Move constants for Guacamole protocol to dedicated "*-constants.h" header. 2019-07-30 13:33:18 -07:00
Michael Jumper
a763d47bc7 GUACAMOLE-629: Add support for sending "argv" instructions from server to client. 2019-07-30 13:06:46 -07:00
Michael Jumper
a3101e9744 Merge 1.1.0 changes back to master. 2019-07-26 14:38:25 -07:00
Mike Jumper
c26672e281
GUACAMOLE-422: Merge explicit handling of "nop" instruction. 2019-07-26 14:37:54 -07:00
Nick Couchman
26bb10a486 GUACAMOLE-422: Add empty handler and trace logging for nop instruction. 2019-07-23 14:29:50 -04:00
Mike Jumper
41b0c21322
GUACAMOLE-847: Merge fix for leaked RDPSND packet memory. 2019-07-20 12:15:18 -07:00
Frank Riley
87a5479ff8 GUACAMOLE-847: Fix severe memory leak when using audio with RDP 2019-07-20 06:14:36 -07:00
Mike Jumper
b4ef38c064
GUACAMOLE-837: Merge RDP support for Hungarian keyboards. 2019-07-11 21:20:08 -07:00
Nick Couchman
ce7bea66cf Merge 1.1.0 changes back to master. 2019-07-11 09:10:26 -04:00
Virtually Nick
1a9d1e8b71
GUACAMOLE-547: Merge copy password from settings. 2019-07-11 09:08:12 -04:00
fgiuba
55add063c5 GUACAMOLE-547: Add missing space between brackets. 2019-07-11 13:37:03 +02:00
fgiuba
9228d2637a GUACAMOLE-547: Do not ignore password from settings. 2019-07-11 13:37:03 +02:00
P-Zs
8f1826d3e4 GUACAMOLE-837: Update Makefile.am to reference the new Hungarian keymap file 2019-07-10 00:55:31 +02:00
P-Zs
badee3274b GUACAMOLE-837: Add Hungarian RDP keymap file to code base 2019-07-10 00:55:31 +02:00
Michael Jumper
e149fd4f70 Merge 1.1.0 changes back to master. 2019-06-20 00:47:46 -07:00
Mike Jumper
7e9b97007e
GUACAMOLE-547: Merge support for SSH NONE authentication method. 2019-06-20 00:46:55 -07:00
Nick Couchman
1baa91f852 GUACAMOLE-547: Minor changes to function documentation. 2019-06-19 12:38:05 -04:00
Nick Couchman
22874e2388 GUACAMOLE-547: Document return value of credential handler. 2019-06-18 17:59:33 -04:00
Nick Couchman
3511991e2f GUACAMOLE-547: Fixes for style and documentation. 2019-06-18 07:52:05 -04:00
Nick Couchman
9a51d513f2 GUACAMOLE-547: Provide documentation for the new callback function. 2019-06-18 07:37:02 -04:00
Nick Couchman
3d15454097 GUACAMOLE-547: Use a call-back function for getting the password. 2019-06-18 07:37:02 -04:00
Nick Couchman
4641da06ac GUACAMOLE-547: Relocate NULL check and log when NONE succeeds. 2019-06-18 07:37:02 -04:00
Nick Couchman
b7dca0ed16 GUACAMOLE-547: Add support for SSH NONE authentication method. 2019-06-18 07:37:02 -04:00
Michael Jumper
a1c382c8ce Merge 1.1.0 changes back to master. 2019-04-30 17:26:21 -07:00
Mike Jumper
8b53be49f3
GUACAMOLE-422: Merge changes to Guacamole protocol handshake adding flexibility and timezone support. 2019-04-30 17:25:26 -07:00
Nick Couchman
bf741a46d6 GUACAMOLE-422: Minor style and debug changes. 2019-04-27 21:37:26 -04:00
Virtually Nick
652ca302cb
GUACAMOLE-772: Merge reduce Docker image size for guacd 2019-04-25 15:41:45 -04:00
Nick Couchman
93a240b8ad GUACAMOLE-422: Add debugging and check argument count. 2019-04-24 22:21:18 -04:00
Mike Jumper
5e8f5eaa50
GUACAMOLE-296: Merge changes linking libwinpr / libwinpr-utils as needed. 2019-04-24 15:35:16 -07:00
Mike Jumper
fc68113d75
GUACAMOLE-414: Merge support for libvncclient's TLS threadsafety callbacks. 2019-04-24 15:29:32 -07:00
Nick Couchman
4b43de963e GUACAMOLE-422: Break handshake out into separate function; NULL out timezone when not received. 2019-04-22 11:49:46 -04:00
Nick Couchman
588e0f194a GUACAMOLE-422: Fix return documentation on opcode handler function. 2019-04-19 15:50:29 -04:00
Nick Couchman
ab12b2aa8e GUACAMOLE-422: More substantial comment for protocol version; NULL out timezone at beginning of handshake. 2019-04-19 15:48:14 -04:00
Nick Couchman
98cb7ccf67 GUACAMOLE-422: Fix comment and style. 2019-04-17 15:12:46 -04:00
Nick Couchman
75c0deac1f GUACAMOLE-422: Update comment style for consistency. 2019-04-17 15:03:27 -04:00
Nick Couchman
54f88531d4 GUACAMOLE-422: Try to avoid memory leaks with mimetypes. 2019-04-17 15:00:46 -04:00
Nick Couchman
340aef5362 GUACAMOLE-422: Update to remove first argument 2019-04-17 14:41:35 -04:00
Nick Couchman
379fce2d77 GUACAMOLE-422: Rename new opcode handler function. 2019-04-11 17:21:36 -04:00
Nick Couchman
c750b18f60 GUACAMOLE-422: Handle sending version internally. 2019-04-11 17:18:27 -04:00
Nick Couchman
2f57564f5d GUACAMOLE-422: Remove duplicate code and migrate handshake to user handlers. 2019-04-11 17:18:27 -04:00
Nick Couchman
2b68925ec9 GUACAMOLE-422: Add protocol version as initial item passed back in args. 2019-04-11 17:18:27 -04:00
Nick Couchman
0ee47e0186 GUACAMOLE-422: Change handshake to ignore order of opcodes. 2019-04-11 17:18:27 -04:00
Nick Couchman
5480b288e8 GUACAMOLE-422: Remove NULL check for parser argv. 2019-04-11 17:18:27 -04:00
Nick Couchman
5caa8a25f7 GUACAMOLE-422: SSH parameter should use handshake for default. 2019-04-11 17:18:27 -04:00
Nick Couchman
6fae0b4b23 GUACAMOLE-422: Use timezone from handshake when parameter does not exist. 2019-04-11 17:18:27 -04:00
Nick Couchman
f70aa4939f GUACAMOLE-422: Add client timezone to handshake. 2019-04-11 17:16:43 -04:00
Nick Couchman
cd3432e594 Merge 1.1.0 changes back to master. 2019-04-10 06:18:53 -04:00
Virtually Nick
b90e566e1b
GUACAMOLE-637: Merge add missing libguac include path to tests. 2019-04-10 06:14:28 -04:00
Michael Jumper
0c25782036 GUACAMOLE-637: Add missing libguac include path to RDP and common-ssh tests. 2019-04-09 23:36:03 -07:00
James Muehlner
6dad6cd919 Merge 1.1.0 changes back to master. 2019-04-09 21:52:28 -07:00
James Muehlner
dd4c3968d1 GUACAMOLE-637: Merge migration to new libguac string functions. 2019-04-09 21:49:16 -07:00
Mike Jumper
dc71987fca
GUACAMOLE-764: Merge correction to size of RDP file read/write offsets (all should be 64-bit). 2019-04-09 11:25:15 -07:00
m-khan-glyptodon
871f31353b GUACAMOLE-764: Updated variable type for offsets to uint64_t to increase rdp write to a 64-bit addressable space 2019-04-08 15:27:58 -07:00
m-khan-glyptodon
2db7ffbaab GUACAMOLE-764: Updated variable type for offsets to uint64_t to increase rdp read to a 64-bit addressable space 2019-04-08 15:00:59 -07:00
Mathias
61070cb367
GUACAMOLE-772: Switched runtime image to debian slim 2019-04-08 12:28:46 +02:00
Michael Jumper
f8ec709e33 GUACAMOLE-637: Correct naming of SFTP unit tests. 2019-04-07 16:51:53 -07:00
Michael Jumper
cda7bca126 GUACAMOLE-637: Add RDP filesystem and SFTP unit tests for path depth. 2019-04-07 16:51:33 -07:00
Michael Jumper
6e2be38ae2 GUACAMOLE-637: Add path depth limits to generated paths in unit tests. 2019-04-07 16:36:16 -07:00
Michael Jumper
986f7f5d64 GUACAMOLE-637: Use same logic for RDP filesystem path normalization as SFTP. 2019-04-07 16:30:27 -07:00
Michael Jumper
1591980579 GUACAMOLE-637: Simplify SFTP path normalization logic. Correct behavior to match documentation. 2019-04-07 16:14:00 -07:00
Michael Jumper
591e494dfd GUACAMOLE-637: Add unit tests for RDP filesystem path normalization. 2019-04-07 13:56:52 -07:00
Michael Jumper
f19754cfa6 GUACAMOLE-637: Add unit tests for SFTP path normalization. 2019-04-07 13:50:53 -07:00
Michael Jumper
24ab5ca85b GUACAMOLE-637: Remove unnecessary .gitignore files. Universally exclude test output. Remove duplicated exclusions. 2019-04-07 11:50:43 -07:00
Nick Couchman
1b8e31b70c GUACAMOLE-296: Add checks for Stream functions in winpr libraries. 2019-03-24 16:12:20 -04:00
Michael Jumper
ffe0b57faa Merge 1.1.0 changes back to master. 2019-03-24 13:00:45 -07:00
Nick Couchman
a4521208ba GUACAMOLE-414: Remove unnecessary rfbconfig include. 2019-03-24 15:09:58 -04:00
Mike Jumper
3989c40da6
GUACAMOLE-694: Merge addition of "ca-certificates" dependency for Docker image. 2019-03-24 12:03:19 -07:00
Nick Couchman
a6f2ab9d93 GUACAMOLE-414: Use correct formatting for string from strerror. 2019-03-10 17:41:45 -04:00
Nick Couchman
bfc6c1e6e0 GUACAMOLE-414: Convert errors to strings from ptread_mutex_lock and unlock. 2019-03-10 17:40:34 -04:00
Nick Couchman
36817f3774 GUACAMOLE-414: Clean up style and move mutex init to client allocation. 2019-03-10 17:33:14 -04:00
Nick Couchman
df4c93b3e8 GUACAMOLE-414: Use configure checks for finding TLS locking support. 2019-03-10 15:22:49 -04:00
Nick Couchman
c90c057e12 GUACAMOLE-414: Add version checks for TLS locking. 2019-03-09 21:46:02 -05:00
Nick Couchman
e9a10d66b7 GUACAMOLE-414: Add pthread lock and callbacks for TLS write locking. 2019-03-09 21:27:30 -05:00
Virtually Nick
5e2ddb890a
GUACAMOLE-381: Merge add parameters for disabling clipboard copy/paste. 2019-02-24 22:41:47 -05:00
Nick Couchman
1300b64bb9 GUACAMOLE-694: Add ca-certificates packages as runtime dependency. 2019-02-22 04:59:09 -05:00
Michael Jumper
228cea4af1 GUACAMOLE-381: Disable outbound transfers from terminal protocols if "disable-copy" is set. 2019-02-19 12:11:24 -08:00
Michael Jumper
254615509a GUACAMOLE-381: Disable or ignore outbound clipboard transfers for VNC/RDP if "disable-copy" is set. 2019-02-19 11:45:30 -08:00
Michael Jumper
993d5c5707 GUACAMOLE-381: Disable inbound clipboard transfer if "disable-paste" is set. 2019-02-19 11:40:32 -08:00
Michael Jumper
7d2b7126db GUACAMOLE-381: Add copy/paste disable flags for all supported protocols. 2019-02-19 11:34:18 -08:00
Nick Couchman
802e5b5547 Merge 1.1.0 changes back to master. 2019-02-09 14:55:07 -05:00
Virtually Nick
67a2b75fe6
GUACAMOLE-729: Merge bump version to 1.1.0 2019-02-09 14:49:36 -05:00
Michael Jumper
cb227cc3a1 GUACAMOLE-729: Bump version number of guacctl. 2019-02-09 11:38:16 -08:00
Michael Jumper
a0d030a7ae GUACAMOLE-729: Update libtool version info for libguac (interfaces added and changed). 2019-02-09 11:20:06 -08:00
Michael Jumper
193f721c7b GUACAMOLE-729: Bump version number to 1.1.0. 2019-02-09 11:18:26 -08:00
Virtually Nick
7065ff5586
GUACAMOLE-712: Merge add Danish to RDP 2019-02-06 09:01:33 -05:00
netromnetrom
aeb9b99a6c
Merge pull request #2 from netromnetrom/patch-1
Patch 1
2019-02-06 12:01:19 +01:00
netromnetrom
877eca691c
Merge pull request #1 from netromnetrom/patch-2
Patch 2
2019-02-06 11:58:08 +01:00
Mike Jumper
63ede7e406
GUACAMOLE-693: Merge update to NOTICE copyright year (2018 -> 2019). 2019-01-24 16:44:21 -08:00
Michael Jumper
c6feef6c86 GUACAMOLE-637: Clarify purpose of initial empty path component. Fix normalization logic to ensure that empty component is always present. 2019-01-23 20:28:09 -08:00
Michael Jumper
350d8e5995 GUACAMOLE-637: Document failsafe behavior of guac_strlcat() in the event the destination buffer is not terminated as required. 2019-01-23 19:02:19 -08:00
Michael Jumper
ba8fd17394 GUACAMOLE-637: "concatentation" ... not "contatenation". 2019-01-23 18:53:06 -08:00
Michael Jumper
9fb713d804 GUACAMOLE-637: Correct grammar of documentation for guac_strl*() unit tests. 2019-01-23 18:51:53 -08:00
Michael Jumper
b7761e9a2e GUACAMOLE-637: The $^ variable is non-portable and specific to GNU Make. As otherwise POSIX-compliant platforms may not provide this variable, we shouldn't use it here. 2019-01-23 18:44:45 -08:00
Michael Jumper
789e3883d6 GUACAMOLE-637: Not all systems place Perl in /usr/bin. The line #!/usr/bin/env perl should be used for portability. 2019-01-23 18:44:45 -08:00
Michael Jumper
7da837b42a GUACAMOLE-637: The __BSD_VISIBLE macro is required for strlcpy() and strlcat() to be available in libc's string.h. 2019-01-23 18:44:45 -08:00
Michael Jumper
e6c5da315e GUACAMOLE-637: Add unit tests for guac_strljoin(). 2019-01-23 18:44:45 -08:00
Michael Jumper
258946cd88 GUACAMOLE-637: Correctly handle string lengths as size_t (unsigned). 2019-01-23 18:44:45 -08:00
Michael Jumper
068f33aaef GUACAMOLE-637: Add unit tests for guac_strlcat(). 2019-01-23 18:44:45 -08:00
Michael Jumper
dec3642905 GUACAMOLE-637: Add unit tests for guac_strlcpy(). 2019-01-23 18:44:45 -08:00
Michael Jumper
fdd3292f09 GUACAMOLE-637: Simplify path translation logic. Update to use guac_strl*(). Fix return values. 2019-01-23 18:44:45 -08:00
Michael Jumper
3549da0dd1 GUACAMOLE-637: Replace usages of strncat() with guac_strlcat(). 2019-01-23 18:44:45 -08:00
Michael Jumper
e5c1147cf6 GUACAMOLE-637: Replace usages of strncpy() with guac_strlcpy(). 2019-01-23 18:44:45 -08:00
Michael Jumper
5bf6a1479c GUACAMOLE-637: Add convenience function for joining an array of strings using a given delimiter. 2019-01-23 18:44:45 -08:00
Michael Jumper
a78f254611 GUACAMOLE-637: Add strlcat() implementation. Use libc strlcat() if available. 2019-01-23 18:44:45 -08:00
Michael Jumper
d7909a77aa GUACAMOLE-637: Add strlcpy() implementation. Use libc strlcpy() if available. 2019-01-23 18:44:45 -08:00
Michael Jumper
f6953e1317 GUACAMOLE-637: Use proper namespaced path for Guacamole headers within libguac source. 2019-01-23 18:44:45 -08:00
Nick Couchman
10e06c15c9 GUACAMOLE-693: Update copyright year to 2019. 2019-01-23 17:15:13 -05:00
netromnetrom
7b7c8a1b02
Update Makefile.am 2019-01-22 16:24:56 +01:00
netromnetrom
a06edb9deb
Update and rename dk_dk_qwerty.keymap to da_dk_qwerty.keymap 2019-01-22 14:36:05 +01:00
Nick Couchman
768b2ba0f5 GUACAMOLE-661: Merge mark "nest" instruction and socket as deprecated. 2019-01-07 12:45:18 -05:00
Michael Jumper
d73b86b4b7 GUACAMOLE-661: Mark "nest" instruction and socket as deprecated. 2019-01-07 09:37:08 -08:00
Nick Couchman
bb9560716d GUACAMOLE-662: Merge correct behavior of nested socket. 2019-01-07 06:34:28 -05:00
Michael Jumper
cc4671d7a1 GUACAMOLE-662: Correct handling of buffering within nested socket.
The nested socket implementation seems to have never been properly
updated since guac_socket was changed to rely on implementation-specific
buffering. This meant that absolutely every write resulted in a nest
instruction being sent to the parent socket.

Data should instead be built up within the internal buffer, with each
flush writing as much of the internal buffer as possible within a nest
instruction, leaving any partial UTF-8 characters at the end of the
buffer for later completion with future writes.
2019-01-06 17:09:35 -08:00
Michael Jumper
47ad6f4b59 GUACAMOLE-662: Properly initialize nested socket index (fixes GUACAMOLE-510). 2019-01-06 17:09:35 -08:00
Nick Couchman
aba7b987d3 GUACAMOLE-662: Merge fix handling of unit tests within buid. 2019-01-06 19:42:12 -05:00
Michael Jumper
b6477ea7ae GUACAMOLE-354: Merge RDP keymap for Swiss-German keyboards. 2018-12-04 10:58:34 -08:00
Andrin
01142e6dd8 GUACAMOLE-354: Fixed keyboard name. 2018-12-04 08:30:36 +01:00
Nick Couchman
bbb6afaf46 GUACAMOLE-638: Merge avcodec_register_all() should be used only if not deprecated. 2018-11-21 07:24:20 -05:00
Andrin
9486ec7cc4 GUACAMOLE-354: Add Swiss-German keymap for RDP 2018-11-20 14:10:36 +01:00
Michael Jumper
476b431041 GUACAMOLE-662: Migrate tests to test runners generated by new convenience script. Remove unnecessary test runners. 2018-11-17 18:06:40 -08:00
Michael Jumper
877bf59cb6 GUACAMOLE-662: Force line-buffered output. 2018-11-17 12:41:48 -08:00
Michael Jumper
ca4009c982 GUACAMOLE-662: Log test output in TAP format. 2018-11-17 12:41:48 -08:00
Michael Jumper
d7118fda70 GUACAMOLE-662: Add utility script for automatically generating CUnit test runners. 2018-11-16 22:23:55 -08:00
Michael Jumper
2827af33d6 GUACAMOLE-662: Correct fork logic (main test process should be PARENT, not child). 2018-11-16 12:53:42 -08:00
Michael Jumper
867e63b524 GUACAMOLE-638: avcodec_register_all() should be used only if not deprecated. 2018-11-12 16:36:15 -08:00
Michael Jumper
0d435e2435 GUACAMOLE-422: Merge support for specifying the timezone of RDP and SSH sessions. 2018-11-12 09:12:19 -08:00
Nick Couchman
7b1ba3f269 GUACAMOLE-422: Fix spelling mistake. 2018-11-12 12:09:51 -05:00
Nick Couchman
d1b3695282 GUACAMOLE-422: Fix type in strerror() 2018-11-12 11:56:57 -05:00
Nick Couchman
f61539c4e7 GUACAMOLE-422: Quick fixes for style and logging. 2018-11-12 11:55:07 -05:00
Nick Couchman
9a944637be GUACAMOLE-422: Fix function declaration for pushing settings. 2018-11-11 17:25:12 -05:00
Nick Couchman
4bd19160de GUACAMOLE-422: Add logging for RDP timzeone. 2018-11-11 17:22:03 -05:00
Nick Couchman
b3be9eb869 GUACAMOLE-422: Revert addition of logging for setting TZ variable. 2018-11-11 16:07:20 -05:00
Nick Couchman
0b71559017 GUACAMOLE-422: Add errno header. 2018-11-11 15:48:02 -05:00
Nick Couchman
e2b4de9d95 GAUCAMOLE-422: Add warning messages when TZ cannot be set. 2018-11-11 15:45:24 -05:00
Nick Couchman
d7ed452d69 GUACAMOLE-422: Update comments on timezone settings. 2018-11-11 15:30:17 -05:00
Nick Couchman
5536b836ad GUACAMOLE-422: Add support for passing through TZ in SSH. 2018-11-11 14:11:40 -05:00
Nick Couchman
ffdc98d024 GUACAMOLE-422: Support timezone redirection in RDP via TZ variable. 2018-11-11 14:09:23 -05:00
Nick Couchman
381c5d1a76 GUACAMOLE-630: Merge allow font parameters of active terminal session to be changed. 2018-11-11 14:03:58 -05:00
Michael Jumper
5683be0ea3 GUACAMOLE-630: Allow SSH/telnet font family and size to be updated. 2018-11-10 14:22:23 -08:00
Michael Jumper
9e28de70ec GUACAMOLE-630: Separate setting of font family/size from terminal display initialization. 2018-11-10 14:22:23 -08:00
Nick Couchman
d2cb7a9ce9 GUACAMOLE-630: Merge allow color scheme of active terminals to be changed. 2018-11-10 10:45:56 -05:00
Michael Jumper
0cf24219d8 GUACAMOLE-630: Define maximum "argv" stream length for SSH and telnet with symbolic constants. 2018-11-09 20:27:28 -08:00
Nick Couchman
e132c79348 GUACAMOLE-649: Merge add support for setting LANG environment variable via SSH. 2018-11-09 20:40:29 -05:00
Michael Jumper
edbdd08476 GUACAMOLE-649: Allow SSH connection to continue despite failure to set LANG environment variable. 2018-11-08 19:29:32 -08:00
Michael Jumper
454682979e GUACAMOLE-649: Add support for setting LANG environment variable via SSH. 2018-11-04 21:20:47 -08:00
Michael Jumper
f293c5e9c0 GUACAMOLE-630: Do not entirely reset terminal state when color scheme is changed. 2018-10-22 23:23:27 -07:00
Michael Jumper
dcab540839 GUACAMOLE-630: Persist semantics of default foreground/background with dedicated palette pseudo-indexes. 2018-10-22 23:23:27 -07:00
Michael Jumper
2f16eadb35 GUACAMOLE-630: Allow color scheme to be changed from webapp via argv streams. 2018-10-22 23:23:27 -07:00
Michael Jumper
6f9f2189f2 GUACAMOLE-630: Separate color scheme parsing into own files. 2018-10-22 23:23:27 -07:00
Michael Jumper
6f49194640 Merge 1.0.0 changes back to master. 2018-10-16 09:05:37 -07:00
Michael Jumper
0ffda8aaf0 GUACAMOLE-527: Merge correction to order of SFTP parameters for VNC. 2018-10-16 09:03:02 -07:00
Nick Couchman
34c088882b GUACAMOLE-527: Correct issue with order of VNC SFTP settings. 2018-10-16 09:27:45 -04:00
Nick Couchman
f8d2bd13b1 GUACAMOLE-353: Merge clarify applicability of ASF header when transcluded into generated build files. 2018-10-03 10:11:56 -04:00
Michael Jumper
d851f10a48 GUACAMOLE-353: Clarify applicability of ASF header when transcluded into generated build files. 2018-10-02 20:37:49 -07:00
Nick Couchman
356dcef9e8 GUACAMOLE-623: Merge include dependencies of Kubernetes support in Docker image build. 2018-09-27 21:25:30 -04:00
Nick Couchman
7352d66819 GUACAMOLE-623: Merge start terminal once Kubernetes connection is ready. 2018-09-27 21:23:58 -04:00
Michael Jumper
64b1572d13 GUACAMOLE-623: Include dependences of Kubernetes support in Docker image build. 2018-09-27 09:34:53 -07:00
Michael Jumper
7374b29364 GUACAMOLE-623: Start terminal once Kubernetes connection is ready (necessary since merge of GUACAMOLE-622). 2018-09-27 09:33:31 -07:00
Nick Couchman
b0be808036 GUACAMOLE-623: Merge fix build against older libwebsockets. 2018-09-27 04:36:15 -04:00
Michael Jumper
9c593bde89 GUACAMOLE-623: Kill connection if libwebsockets is destroying the underlying WebSocket.
Older versions of libwebsockets will not necessarily invoke close events
under all circumstances, and will instead sometimes summarily destroy
the WebSocket. Thankfully there is another event for that, and newer
versions of libwebsockets continue to define that event. We can hook
into both to handle disconnect.
2018-09-26 22:31:25 -07:00
Michael Jumper
44d3433ea9 GUACAMOLE-623: Explicitly bypass certificate checks if requested.
For older versions of libwebsockets, simply requesting that OpenSSL
ignore the verification result is insufficient, as libwebsockets
manually checks and confirms the verification result, producing an error
in all but specific cases.
2018-09-26 22:01:46 -07:00
Michael Jumper
7ee624844a GUACAMOLE-623: Remove unnecessary initialization of pwsi.
The pwsi member was previously used to ensure the lws structure was made
available to invocations of the event callback early in the connection
lifecycle such that the underlyin guac_client could always be retrieved.
Since the migration to guac_kubernetes_lws_current_client, this is not
necessary, and isn't supported in older versions of libwebsockets
anyway.
2018-09-26 21:52:53 -07:00
Michael Jumper
b48a1b3a5d GUACAMOLE-623: Use libwebsockets' dummy callback only if defined. 2018-09-26 21:51:07 -07:00
Michael Jumper
d8618b0682 GUACAMOLE-623: Support older libwebsockets SSL initialization. 2018-09-26 21:50:19 -07:00
Nick Couchman
af93cfb32a GUACAMOLE-623: Merge include Kubernetes plugin in dist directories. 2018-09-26 12:56:45 -04:00
Michael Jumper
acfc759527 GUACAMOLE-623: Include Kubernetes plugin in dist directories. 2018-09-26 09:40:50 -07:00
Nick Couchman
760f7a649a GUACAMOLE-629: Merge add support for updating connection parameters of in-progress connections. 2018-09-26 08:47:32 -04:00
Nick Couchman
2d6ce1a5fd GUACAMOLE-632: Merge dynamic JPEG/WebP quality scaling. 2018-09-26 08:45:32 -04:00
Nick Couchman
43db1965ef GUACAMOLE-623: Merge support for terminals of containers in Kubernetes pods. 2018-09-26 08:43:30 -04:00
Michael Jumper
61df2956b3 GUACAMOLE-623: Clean up logging (libwebsockets adds newline characters). 2018-09-25 21:30:52 -07:00
Michael Jumper
83a531bc89 GUACAMOLE-623: Add support for SSL. 2018-09-25 21:30:52 -07:00
Michael Jumper
2e50573531 GUACAMOLE-623: Move I/O-related functions into separate files. 2018-09-25 21:30:52 -07:00
Michael Jumper
5e3aec6df2 GUACAMOLE-623: Add missing documentation for URL character test. 2018-09-25 21:30:51 -07:00
Michael Jumper
371eed1f93 GUACAMOLE-623: Add missin includes. Remove unnecessary includes. 2018-09-25 21:30:51 -07:00
Michael Jumper
77a866129b GUACAMOLE-623: Add warning when Kubernetes support will not be built. Fix summary output from configure. 2018-09-25 21:30:51 -07:00
Michael Jumper
c5f67a31dc GUACAMOLE-623: Add configure test for LWS_CALLBACK_CLIENT_CLOSED (only defined in recent libwebsockets and required if present). 2018-09-25 21:30:51 -07:00
Michael Jumper
ed56093888 GUACAMOLE-623: Generate Kubernetes API endpoint dynamically. 2018-09-25 21:30:51 -07:00
Michael Jumper
34f8f8b30d GUACAMOLE-623: Redirect libwebsockets logging to guacd's debug level log. 2018-09-25 21:30:51 -07:00
Michael Jumper
fe7edce569 GUACAMOLE-623: Add support for terminal resize. Redraw Kubernetes container upon connect. 2018-09-25 21:30:51 -07:00
Michael Jumper
b7c938c239 GUACAMOLE-623: Send typed data to Kubernetes via the STDIN channel. 2018-09-25 21:30:51 -07:00
Michael Jumper
f35517b3ff GUACAMOLE-623: Add outbound message buffer. 2018-09-25 21:30:51 -07:00
Michael Jumper
cbe593503f GUACAMOLE-623: Do not return -1 from libwebsockets callback. Doing so results in automatic cleanup of part of the context, resulting in a segfault when lws_context_destroy() is invoked. 2018-09-25 21:30:51 -07:00
Michael Jumper
f72877bf0d GUACAMOLE-623: Handle data received from Kubernetes. 2018-09-25 21:30:51 -07:00
Michael Jumper
7165fa949d GUACAMOLE-623: Stub out implementation of WebSocket client for Kubernetes. 2018-09-25 21:30:51 -07:00
Michael Jumper
519c90a887 GUACAMOLE-623: Default to unencrypted Kubernetes connections. 2018-09-25 21:30:51 -07:00
Michael Jumper
5bae422b29 GUACAMOLE-623: libwebsockets requires an integer port number. 2018-09-25 21:30:51 -07:00
Michael Jumper
b8bd0e4c6a GUACAMOLE-623: Add base skeleton for Kubernetes protocol support. 2018-09-25 21:30:51 -07:00
Michael Jumper
45e8503ead GUACAMOLE-632: Dynamically scale JPEG/WebP quality depending on measured processing lag. 2018-09-25 13:28:21 -07:00
Michael Jumper
8456c050ea GUACAMOLE-629: Add support for updating connection parameters of in-progress connections. 2018-09-25 11:40:08 -07:00
Nick Couchman
54fda21366 GUACAMOLE-622: Merge withold first terminal frame until connection is verified. 2018-09-21 20:26:47 -04:00
Nick Couchman
d7cfff324e GUACAMOLE-628: Merge correct RDP scancode mapping for right control key. 2018-09-21 20:13:30 -04:00
Michael Jumper
622a849bae GUACAMOLE-628: Correct RDP scancode mapping for right control key. 2018-09-21 16:25:11 -07:00
Michael Jumper
462d494ed8 GUACAMOLE-622: Match each line against all regexes. 2018-09-21 14:29:01 -07:00
Michael Jumper
442b1d5cc2 GUACAMOLE-622: Start terminal for telnet only after login status is known (if login success/failure detection enabled). 2018-09-21 14:29:01 -07:00
netromnetrom
5f8c6470ff
Update Makefile.am
Danish keyboard layout
2018-09-11 13:44:29 +02:00
netromnetrom
948d1bcac8
Create dk_dk_qwerty.keymap
Danish keyboard layout
2018-09-11 13:40:25 +02:00
Michael Jumper
1178b475da GUACAMOLE-622: Do not allow STDIN to be redirected if the terminal is not yet started. 2018-09-02 23:04:14 -07:00
Michael Jumper
286cbf32a7 GUACAMOLE-622: Ensure connection to guacd is kept alive even if the SSH daemon is taking its time responding. Lengthy connect times due to DNS verification, PAM, etc. are not uncommon. 2018-09-02 23:04:14 -07:00
Michael Jumper
4606607309 GUACAMOLE-622: Start terminal for SSH only after SSH connection succeeds. 2018-09-02 23:04:14 -07:00
Michael Jumper
0b39b0fc5f GUACAMOLE-622: Implicitly invoke guac_terminal_start() if prompting is required. 2018-09-02 23:04:14 -07:00
Michael Jumper
61a51df1b2 GUACAMOLE-622: Require guac_terminal_start() to be invoked before the terminal will render frames or accept user input. 2018-09-02 23:04:14 -07:00
Nick Couchman
332e187813 Merge 1.0.0 changes back to master. 2018-08-24 12:17:20 -04:00
Nick Couchman
a1ba91b01d GUACAMOLE-470: Merge support named colors in color-scheme configuration. 2018-08-24 12:15:58 -04:00
Jim Chen
eb5aa14a6f GUACAMOLE-470: Support named colors in color-scheme configuration.
When parsing named colors, treat semi-colons as string terminators, so
we can properly parse named colors within the color-scheme
configuration.
2018-08-24 10:42:24 -04:00
Nick Couchman
911e60cf5c GUACAMOLE-610: Merge add support for changing scrollback buffer size. 2018-08-19 14:49:26 -04:00
Michael Jumper
994cb95893 GUACAMOLE-610: Add console code for altering scrollback size on the fly. 2018-08-18 11:26:12 -07:00
Michael Jumper
0e6d549a40 GUACAMOLE-610: Allow scrollback size to be specified for SSH and telnet. 2018-08-18 11:12:55 -07:00
Michael Jumper
6a576f0121 GUACAMOLE-610: Limit terminal width/height to 1024 characters. 2018-08-18 11:12:50 -07:00
Nick Couchman
0062f61d67 Merge 1.0.0 changes back to master. 2018-07-31 08:12:30 -04:00
Nick Couchman
427c4c8b44 GUACAMOLE-559: Merge fix race condition in receipt of clipboard data by terminal. 2018-07-31 08:10:47 -04:00
Michael Jumper
4f25410aa9 GUACAMOLE-559: Guarantee ordered modification to the clipboard. Do not allow modification of clipboard while clipboard contents are being sent. 2018-07-30 23:53:03 -07:00
Michael Jumper
860a5fca8f GUACAMOLE-559: Maintain terminal clipboard at client level such that it is guaranteed to exist immediately after user connects. 2018-07-30 23:53:03 -07:00
Nick Couchman
d8cb2218ee GUACAMOLE-597: Merge add optional flags to OSC for controlling redirected terminal output. 2018-07-27 22:08:20 -04:00
Michael Jumper
e66178ff9a GUACAMOLE-597: Add flag for forcing automatic flushing of pipe stream. 2018-07-27 14:23:50 -07:00
Michael Jumper
99b17b0ac4 GUACAMOLE-597: Add flag which sends terminal output to both the user's display and the open pipe stream. 2018-07-27 14:23:44 -07:00
Michael Jumper
e02df8d550 GUACAMOLE-597: Additionally parse integer flags which may affect pipe stream contents. 2018-07-27 14:23:33 -07:00
James Muehlner
79ce5ad8b0 GUACAMOLE-573: Merge scrollback buffer check to fix text selection. 2018-07-17 22:06:20 -07:00
Michael Jumper
b0b0b186f5 GUACAMOLE-573: Ensure scrollback buffer bounds cannot be exceeded. Remove incorrect bounds checks. 2018-07-17 21:55:46 -07:00
Michael Jumper
f5b5ac7183 Merge 1.0.0 changes back to master. 2018-07-05 22:54:36 -07:00
Michael Jumper
71f993b25d GUACAMOLE-446: Merge changes adding support for overriding default RDP virtual drive name. 2018-07-05 22:53:29 -07:00
Michael Jumper
83f8dd50df Merge 1.0.0 changes back to master. 2018-07-05 14:42:15 -07:00
Michael Jumper
f980d4b926 GUACAMOLE-587: Merge changes allowing up to 128 elements per Guacamole instruction. 2018-07-05 14:40:00 -07:00
Nick Couchman
adcdb080cb GUACAMOLE-587: Increase max number of elements per instruction. 2018-07-05 16:42:33 -04:00
Nick Couchman
5e942c9a67 GUACAMOLE-446: Valid default value for the filesystem name. 2018-07-03 23:23:38 -04:00
Nick Couchman
958fb4c8e0 GUACAMOLE-446: Pass through drive name to RDPDR stream. 2018-07-03 23:20:11 -04:00
Nick Couchman
cfcfe8866c GUACAMOLE-446: Add settings for drive name. 2018-07-03 22:59:30 -04:00
Michael Jumper
35237a4f88 Merge 1.0.0 changes back to master. 2018-07-03 19:32:36 -07:00
Michael Jumper
da1e078242 GUACAMOLE-445: Merge support for defining the RDP printer name. 2018-07-03 19:24:07 -07:00
Nick Couchman
a1ec5d9ad7 GUACAMOLE-445: Implement per-device announce stream, set it up with device initalization, and collect them all during the annonuce process. 2018-07-03 22:13:11 -04:00
Nick Couchman
e68fe81938 GUACAMOLE-445: Pass printer name from settings to RDP session. 2018-07-03 22:12:30 -04:00
Nick Couchman
b21f00c29d GUACAMOLE-445: Add settings for printer name. 2018-06-26 19:23:52 -04:00
Michael Jumper
67680bd2d5 Merge 1.0.0 changes back to master. 2018-06-25 17:27:10 -07:00
Michael Jumper
addb473148 GUACAMOLE-527: Merge support for SSH host key checking. 2018-06-25 17:22:09 -07:00
Nick Couchman
fe44fd7c3b GUACAMOLE-527: Remove unused error message length variable. 2018-06-25 20:04:26 -04:00
Nick Couchman
7bc6a62365 GUACAMOLE-527: Do not call a remote host key a fingerprint. 2018-06-25 13:57:01 -04:00
Nick Couchman
ba684962b6 GUACAMOLE-527: Plug some memory leaks before returning NULL. 2018-06-25 13:50:19 -04:00
Nick Couchman
f9379dc6bb GUACAMOLE-527: Get full error message when key verification fails. 2018-06-25 08:37:34 -04:00
Nick Couchman
7e254955e8 GUACAMOLE-527: Slight tweak to error message. 2018-06-25 08:31:37 -04:00
Nick Couchman
ebbb7492e7 GUACAMOLE-527: Add warning if no known host keys are provided. 2018-06-25 08:31:37 -04:00
Nick Couchman
27c977adb2 GUACAMOLE-527: Make sure ssh_known_hosts exists before trying to load. 2018-06-25 08:31:37 -04:00
Nick Couchman
428243bb78 GUACAMOLE-527: Move host key checking to a separate function. 2018-06-25 08:31:37 -04:00
Nick Couchman
ac2b4f8d12 GUACAMOLE-527: Check either provided key or key file, if it exists. 2018-06-25 08:31:37 -04:00
Nick Couchman
aec2be6da2 GUACAMOLE-527: Remove unnecessary includes. 2018-06-25 08:31:37 -04:00
Nick Couchman
2bebb96804 GUACAMOLE-527: Fix host key options in the protocol settings. 2018-06-25 08:31:37 -04:00
Nick Couchman
551598e0a4 GUACAMOLE-527: Use libssh2_knownhost_readline and remove host key type. 2018-06-25 08:31:37 -04:00
Nick Couchman
42044e4279 GUACAMOLE-527: Clean up memory and logging. 2018-06-25 08:31:37 -04:00
Nick Couchman
ec4315dfbe GUACAMOLE-527: Correct names of parameters coming from client. 2018-06-25 08:31:37 -04:00
Nick Couchman
5bb616832e GUACAMOLE-527: Order SSH handshake correctly, and remove unnecessary logging. 2018-06-25 08:31:37 -04:00
Nick Couchman
c080569cac GUACAMOLE-527: Fix issue with null host_key variable. 2018-06-25 08:31:37 -04:00
Nick Couchman
2f0c6dcfa3 GUACAMOLE-527: Add error logging for known host checks. 2018-06-25 08:31:37 -04:00
Nick Couchman
9112c4f32f GUACAMOLE-527: Enable host key setting for SFTP connections. 2018-06-25 08:31:37 -04:00
Nick Couchman
0d82cd1e6c GUACAMOLE-527: Add host key and type settings. 2018-06-25 08:31:37 -04:00
Nick Couchman
171bae1f5c GUACAMOLE-527: Add basic check for known hosts file for SSH connections. 2018-06-25 08:31:37 -04:00
Nick Couchman
c120aa0274 GUACAMOLE-574: Merge allow SSH/Telnet input from STDIN pipe. 2018-06-18 20:17:42 -04:00
Michael Jumper
b650bef139 GUACAMOLE-574: Redirect STDIN from pipe stream named "STDIN" for SSH and telnet. 2018-06-18 14:31:09 -07:00
Michael Jumper
97593958e4 GUACAMOLE-574: Add support for reading STDIN from a pipe stream. 2018-06-18 14:31:09 -07:00
Nick Couchman
f3d9c2f610 GUACAMOLE-573: Merge allow selection of text while scrolling. 2018-06-18 09:32:18 -04:00
Nick Couchman
7bfd3e1c6a GUACAMOLE-572: Merge fix typo in README. 2018-06-18 06:26:30 -04:00
Liron Newman
da2e8220f3
GUACAMOLE-572: Fix typo from "test-based protocol" to "text-based protocol" 2018-06-17 17:40:59 +01:00
Michael Jumper
ecda5c1df9 GUACAMOLE-573: Read selection only within bounds of terminal/scrollback. 2018-06-17 00:01:47 -07:00
Michael Jumper
1756c01522 GUACAMOLE-573: Update selected region when terminal scrolls. 2018-06-17 00:01:47 -07:00
Michael Jumper
6f08ef2a07 GUACAMOLE-573: Allow text selection to be expanded using Shift (fixes GUACAMOLE-191). 2018-06-17 00:01:47 -07:00
Michael Jumper
c0d323828e GUACAMOLE-573: Copy terminal data directly into clipboard. Do not assume selected region will be strictly visible. 2018-06-16 23:58:38 -07:00
Michael Jumper
f87af06ad6 GUACAMOLE-573: Move terminal text selection code into own file. 2018-06-16 23:58:34 -07:00
Nick Couchman
30e90b2425 Merge 1.0.0 changes back to master. 2018-06-07 04:35:11 -04:00
Nick Couchman
334849e2a6 GUACAMOLE-570: Bump version number to 1.0.0. 2018-06-07 04:34:05 -04:00
Michael Jumper
107fdda1f0 GUACAMOLE-570: Update libtool version info for libguac (interfaces added and removed). 2018-06-05 21:48:39 -07:00
Michael Jumper
6850fd40fe GUACAMOLE-570: Bump version number to 1.0.0. 2018-06-05 21:47:40 -07:00
Michael Jumper
21f54b9e12 GUACAMOLE-470: Merge changes addressing broken build / GCC warning. 2018-05-27 21:13:25 -07:00
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
Michael Jumper
526152b9c6 GUACAMOLE-564: Merge changes ignoring APC sequences within Guacamole's terminal emulator. 2018-05-27 09:31:35 -07:00
Michael Jumper
81bba1b587 GUACAMOLE-470: Merge support for fully configurable terminal color palette. 2018-05-27 08:49:18 -07:00
Nick Couchman
4eae5d2e6d GUACAMOLE-565: Merge add terminal-type parameter for SSH and telnet. 2018-05-27 07:18:46 -04:00
Jim Chen
87df97317f GUACAMOLE-565: Add terminal-type parameter for SSH and Telnet.
Add a terminal-type parameter for SSH and Telnet connections, to specify
the terminal emulator type that is passed to programs. If not specified,
the default type of "linux" is used in keep with existing behavior.
2018-05-26 23:30:22 -04:00
Jim Chen
b96afce222 GUACAMOLE-564: Hide APC escape sequence.
An APC escape sequence contains an arbitrary string command between
(ESC _) and (ESC \) sequences. While we don't support any APC commands, we
should ignore any commands that we do encounter.
2018-05-26 23:25:56 -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
03d9c51b5d GUACAMOLE-470: Fix crash when X11 color is not found.
Fix a crash when an X11 color name is not found. The variable to
null-check should be `found`, not `color`.
2018-05-26 23:18:27 -04:00
Jim Chen
7e68901ceb GUACAMOLE-470: Set palette index for parsed RGB colors.
Parsed RGB colors do not correspond to any palette entry, so set the
palette index to -1.
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
b61a6ab758 GUACAMOLE-482: Merge allow encoding to proceed despite invalid instructions. 2018-04-13 14:46:01 -04:00
Michael Jumper
8d43c4344d GUACAMOLE-482: Ignore invalid instructions within guacenc. Log failure at debug level. 2018-04-12 15:07:45 -07:00
Nick Couchman
325c8061ea GUACAMOLE-407: Merge refactor guacd Docker to debian:stable base. 2018-04-04 17:00:30 -04:00
Nick Couchman
6d8319e1bd GUACAMOLE-533: Merge process cleanup following disconnect. 2018-04-02 18:17:36 -04:00
Michael Jumper
70b2b8a1bf GUACAMOLE-269: Merge support for overriding the character sequence sent for backspace for SSH/telnet. 2018-04-02 12:19:02 -07:00
Nick Couchman
dc1918b217 GUACAMOLE-269: Don't abort on ttymode issue, just log a warning. 2018-04-02 15:05:56 -04:00
Nick Couchman
7453bc8f44 GUACAMOLE-269: Clean up logging and comments, and simplify code. 2018-04-02 15:04:03 -04:00
Nick Couchman
b441181c18 GUACAMOLE-269: Remove unnecessary data structure and array size, and update comments. 2018-04-02 10:43:57 -04:00
Nick Couchman
ea946f2492 GUACAMOLE-269: Changes to initializing opcode array. 2018-04-02 09:10:11 -04:00
Nick Couchman
c898f35959 GUACAMOLE-269: Clean up terminal backspace initialization. 2018-04-02 07:47:49 -04:00
Michael Jumper
d6a5695f8a GUACAMOLE-533: Wait at most 5 seconds for connection processes to terminate following disconnect. 2018-04-01 23:35:17 -07:00
Michael Jumper
0126880dad GUACAMOLE-407: As the Docker base image lacks the "en_US" locale, we must instead use "C.UTF-8" to ensure characters render correctly. 2018-04-01 22:05:06 -07:00
Michael Jumper
b3c1471180 GUACAMOLE-407: Explicitly set LD_LIBRARY_PATH such that linker can find guacd's protocol plugins. 2018-04-01 21:50:41 -07:00
Michael Jumper
1f60526ab8 GUACAMOLE-407: Do not build guaclog within guacd Docker image. The guacd image should contain only guacd. 2018-04-01 21:36:59 -07:00
Michael Jumper
14389326b4 GUACAMOLE-407: Remove unnecessary setting of LC_ALL within build (only needed at runtime). 2018-04-01 21:31:44 -07:00
Michael Jumper
eb282e49d9 GUACAMOLE-407: Use Debian (stable) instead of Ubuntu. 2018-04-01 21:26:30 -07:00
Michael Jumper
2e4fb5b91c GUACAMOLE-407: Upgrade Docker image to Ubuntu 17.10. 2018-04-01 21:16:38 -07:00
Michael Jumper
d6510360d0 GUACAMOLE-407: Dynamically derive runtime dependencies. 2018-04-01 21:16:38 -07:00
Michael Jumper
554d3209db GUACAMOLE-407: Restrict runtime dependencies to only those libraries which are actually linked. 2018-04-01 21:16:38 -07:00
Michael Jumper
72638aa03e GUACAMOLE-407: Update Docker image to use more recent packages by switching to Ubuntu. 2018-04-01 21:16:38 -07:00
Michael Jumper
3516704b82 GUACAMOLE-42: Merge changes adding support for specifying the guacd log level for the Docker image. 2018-03-31 10:53:39 -07:00
Nick Couchman
a9d01af104 GUACAMOLE-42: Run CMD so that ENV can be used. 2018-03-29 04:32:06 -04:00
Nick Couchman
1cfba83164 GUACAMOLE-42: Configure log level in docker. 2018-03-28 19:55:56 -04:00
Nick Couchman
e16bfd7837 GAUCAMOLE-269: Memory effeciency updates. 2018-03-24 15:50:11 -04:00
Nick Couchman
11136f7d7b GUACAMOLE-269: More documentation updates. 2018-03-24 15:09:34 -04:00
Nick Couchman
112ce5299e GUACAMOLE-269: Remove unnecessary dynamic allocation. 2018-03-24 14:54:27 -04:00
Nick Couchman
86dde85b2d GUACAMOLE-269: Comment and spelling updates. 2018-03-24 14:53:22 -04:00
Michael Jumper
e2feb41605 GUACAMOLE-30: Merge support for systemd. 2018-03-16 23:18:18 -07:00
Nick Couchman
fef819fbb9 GUACAMOLE-30: Add license to file and want network.target. 2018-03-16 17:02:53 -04:00
Nick Couchman
f75579de7e GUACAMOLE-30: Change from script to data. 2018-03-15 07:30:55 -04:00
Nick Couchman
77cac3b30d GUACAMOLE-30: Implement systemd script for guacd 2018-03-15 06:52:41 -04:00
Michael Jumper
344ed4f42e GUACAMOLE-523: Merge changes registering RDPDR devices using the configured RDP client name. 2018-03-08 11:14:37 -08:00
Nick Couchman
a27757682a GUACAMOLE-523: Add default value for client name. 2018-03-08 12:21:04 -05:00
Nick Couchman
b72bcafecd GUACAMOLE-523: Pass configured client name through for redirect messages. 2018-03-08 12:16:31 -05:00
Nick Couchman
45b832bfdc GUACAMOLE-269: Remove all dynamic allocation and simplify implementation. 2018-03-08 11:36:15 -05:00
Nick Couchman
dd7522bd9f GUACAMOLE-269: Get rid of dynamic allocation and properly free up data structures. 2018-03-08 10:48:22 -05:00
Nick Couchman
c3e1b2afef GUACAMOLE-269: Fix minor style issues and update comments. 2018-03-08 10:48:22 -05:00
Nick Couchman
64ca77f3a5 GUACAMOLE-269: Change struct to struct pointer. 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
c286668b79 GUACAMOLE-269: Name functions per Guacamole standards. 2018-03-08 10:48:22 -05:00
Nick Couchman
9bd28321e5 GUACAMOLE-269: Fix up style in comments. 2018-03-08 10:48:21 -05:00
Nick Couchman
fd58d31eea GUACAMOLE-269: Use backspace config to set up tty modes. 2018-03-08 10:48:21 -05:00
Nick Couchman
46e908c06e GUACAMOLE-269: Allow backspace key to be configured. 2018-03-08 10:48:21 -05:00
Nick Couchman
2ace9385a2 GUACAMOLE-269: Add documentation for the defines and variables. 2018-03-08 10:48:21 -05:00
Nick Couchman
5583748b54 GUACAMOLE-269: Move constant declaration to ttymode.c 2018-03-08 10:48:21 -05:00
Nick Couchman
f1bf70a4a2 GUACAMOLE-269: Add basic support for sending TTY mode encoding. 2018-03-08 10:48:21 -05:00
Nick Couchman
bc1e2f5276 GUACAMOLE-517: Merge add definition for "Print Screen" key to base RDP keymap. 2018-03-06 15:20:02 -05:00
Michael Jumper
5d37530687 GUACAMOLE-517: Add definition for "Print Screen" key to base RDP keymap. 2018-03-06 12:01:50 -08:00
Michael Jumper
bc5b01d4d8 GUACAMOLE-448: Merge support for configuring the level of caching used by RDP. 2018-02-22 00:39:31 -08:00
Nick Couchman
d239207f0f GUACAMOLE-448: Add support for configuring glyph caching. 2018-02-20 15:35:50 -05:00
Nick Couchman
3187a641cf GUACAMOLE-471: Merge update copyright year in NOTICE to 2018 2018-02-07 22:38:16 -05:00
Nick Couchman
329cc9ee48 GUACAMOLE-351: Merge add "-v" parameter 2018-02-07 22:35:42 -05:00
Michael Jumper
3b327378eb GUACAMOLE-351: Add "-v" option which causes guacd to print its version information and exit. 2018-02-07 13:45:13 -08:00
Michael Jumper
f4f5b4e65a GUACAMOLE-351: Separate guac_config structure into own header file, independent of how that config is loaded. 2018-02-07 13:33:52 -08:00
Michael Jumper
5f27616f32 GUACAMOLE-471: Update copyright year in NOTICE to 2018. 2018-02-07 12:48:02 -08:00
James Muehlner
05f54d098c GUACAMOLE-502: Merge cessastion of name instruction in RDP/VNC to avoid incorreclty updating window title. 2018-02-06 22:43:46 -08:00
James Muehlner
599ca960aa GUACAMOLE-500: Merge buffer size compilation warning fix. 2018-02-06 22:30:07 -08:00
Michael Jumper
cd0e48234a GUACAMOLE-500: Explicitly guarantee typescript filename cannot exceed buffer size. 2018-02-06 22:13:55 -08:00
James Muehlner
5b58c7e15b GUACAMOLE-324: Merge buffer write bug fix. 2018-02-06 21:38:27 -08:00
James Muehlner
9ed3baf004 GUACAMOLE-482: Merge encoding error handling improvements. 2018-02-06 21:30:30 -08:00
Michael Jumper
9705b39c2b GUACAMOLE-324: Continuously write chunks of data until entire buffer has been sent. 2018-02-06 21:29:31 -08:00
Michael Jumper
19b5050fbf GUACAMOLE-482: Fail overall encoding process if any instruction handler reports failure. 2018-02-06 21:19:24 -08:00
Michael Jumper
b0c14bd59f GUACAMOLE-482: Report video encoding failure if frame flush fails. 2018-02-06 21:18:39 -08:00
James Muehlner
1cf86e12a1 GUACAMOLE-485: Merge terminal emulator build fix. 2018-02-06 20:54:56 -08:00
Michael Jumper
d75a18e603 GUACAMOLE-485: Disable build of terminal emulator if Pango was manually disabled. 2018-02-06 20:21:14 -08:00
Michael Jumper
02cd424d18 GUACAMOLE-502: Do not send connection name / hostname (which may be internal information). 2018-02-06 20:12:53 -08:00
Nick Couchman
4d7191147c GUACAMOLE-313: Merge add support for including key events within session recordings. 2018-02-02 16:16:42 -05:00
Nick Couchman
ebc6b9429f GUACAMOLE-492: Merge remove guaclog binary erroneously added to source tree. 2018-01-31 22:42:48 -05:00
Michael Jumper
139251ea73 GUACAMOLE-492: Remove guaclog binary erroneously added to source tree. 2018-01-31 16:45:09 -08:00
Nick Couchman
3f6acb6378 GUACAMOLE-313: Merge remove handling of Unicode codepoints which cannot actually be represented by an X11 keysym. 2018-01-30 19:06:01 -05:00
Nick Couchman
b1d050285a GUACAMOLE-313: Merge ensure keydef structure is freed in all cases. 2018-01-30 19:04:22 -05:00
Nick Couchman
8ca6ff3a94 GUACAMOLE-313: Merge exclude built guaclog.1 mangpage from git. 2018-01-30 18:41:28 -05:00
Nick Couchman
35eebe8553 GUACAMOLE-313: Merge properly initialize modifier flag for all keydefs. 2018-01-30 18:39:41 -05:00
Michael Jumper
7f9e61a1f2 GUACAMOLE-313: Exclude built guaclog.1 manpage from git. 2018-01-30 15:28:15 -08:00
Michael Jumper
555126441e GUACAMOLE-313: Remove code handling Unicode codepoints which cannot be represented by X11 keysyms. 2018-01-30 15:26:25 -08:00
Michael Jumper
cfd69cd122 GUACAMOLE-313: Clarify logic testing for Unicode keysyms. 2018-01-30 15:26:05 -08:00
Michael Jumper
5f547fb118 GUACAMOLE-313: Ensure keydef structure is freed in all cases. 2018-01-30 15:16:56 -08:00
Michael Jumper
575ff91369 GUACAMOLE-313: Properly initialize modifier flag for all keydefs. 2018-01-30 15:11:23 -08:00
Nick Couchman
5f5b4ea8eb GUACAMOLE-313: Merge add "guaclog" utility for producing human-readable interpreatations of keys pressed in session recordings. 2018-01-30 14:07:35 -05:00
Nick Couchman
08f854ffef GUACAMOLE-313: Merge add support for logging mouse cursor information. 2018-01-30 14:05:39 -05:00
Nick Couchman
c543adddb2 GUACAMOLE-352: Merge clean up keymap lookup/update logic for the sake of verifiability. 2018-01-29 12:13:21 -05:00
Michael Jumper
053d9d420c GUACAMOLE-352: Clean up keymap lookup/update logic for sake of verifiability. 2018-01-28 23:09:50 -08:00
Nick Couchman
4e5a7e97ad GUACAMOLE-352: Merge add support for typing using dead keys within RDP. 2018-01-28 07:59:22 -05:00
Michael Jumper
9a5b5574a8 GUACAMOLE-352: Type using dead keys when necessary and possible. 2018-01-28 01:32:58 -08:00
Michael Jumper
5d56985479 GUACAMOLE-352: Add utility function for checking whether a keysym exists within the current RDP keyboard layout. 2018-01-28 00:56:24 -08:00
Nick Couchman
e37fb1dad9 GUACAMOLE-489: Merge lock both wrapped sockets when performing operations through a tee socket. 2018-01-27 17:20:28 -05:00
Nick Couchman
57428a95aa GUACAMOLE-490: Merge take channel mask into account when rendering image streams to buffers. 2018-01-27 17:17:24 -05:00
Michael Jumper
4fb17d5610 GUACAMOLE-313: Add flags for controlling the contents of session recordings. 2018-01-26 16:42:24 -08:00
Michael Jumper
876516a1fb GUACAMOLE-313: Add support for including key states within session recordings. 2018-01-26 16:42:14 -08:00
Michael Jumper
b21aef565b GUACAMOLE-313: Add function for sending "key" instructions. 2018-01-26 16:42:14 -08:00
Michael Jumper
fdd17e3042 GUACAMOLE-313: Note that guacenc/guaclog are related. 2018-01-26 16:24:45 -08:00
Michael Jumper
c0b2871b31 GUACAMOLE-313: Document log format. 2018-01-26 16:24:45 -08:00
Michael Jumper
b7257d9ae4 GUACAMOLE-313: Include unknown keys within log. 2018-01-26 16:24:45 -08:00
Michael Jumper
5e5f1fcb3e GUACAMOLE-313: Add missing keysyms. Track modifier keys only. 2018-01-26 16:24:45 -08:00
Michael Jumper
5b612b856a GUACAMOLE-313: Refactor guaclog to produce simpler, greppable output. 2018-01-26 16:24:45 -08:00
Michael Jumper
86b09c8cf7 GUACAMOLE-313: Add remaining key names. Use Unicode where possible. 2018-01-26 16:24:45 -08:00
Michael Jumper
3633af5e41 GUACAMOLE-313: Use binary search to find human-readable names for known keys. 2018-01-26 16:24:45 -08:00
Michael Jumper
df29735c83 GUACAMOLE-313: Separate naming logic for keysyms. Align previously-pressed keys. 2018-01-26 16:24:43 -08:00
Michael Jumper
d39757b4dc GUACAMOLE-313: Continuously track key press/release. 2018-01-26 16:24:14 -08:00
Michael Jumper
ebc731aaf3 GUACAMOLE-313: Add guaclog utility with stubbed interpretation of key events. 2018-01-26 16:24:04 -08:00
Michael Jumper
81a0e66d9f GUACAMOLE-313: Include current button state within mouse update for completeness. 2018-01-26 16:21:53 -08:00
Michael Jumper
7eb4e22515 GUACAMOLE-313: Use mouse timestamps for frames as well as sync. 2018-01-26 16:21:51 -08:00
Michael Jumper
a74d6a2aaf GUACAMOLE-313: Include timestamp with mouse position reporting. 2018-01-26 16:21:49 -08:00
Michael Jumper
e2455d6f26 GUACAMOLE-313: Do not render cursor unless mouse has actually moved. 2018-01-26 16:21:47 -08:00
Michael Jumper
cafcd90f9f GUACAMOLE-313: Add support for the "mouse" instruction to guacenc. 2018-01-26 16:21:45 -08:00
Michael Jumper
a14832c4da GUACAMOLE-313: Implement the "cursor" instruction to guacenc. 2018-01-26 16:21:43 -08:00
Michael Jumper
df770ae4ea GUACAMOLE-313: Add support for including mouse location within session recordings. 2018-01-26 16:21:28 -08:00
Michael Jumper
b37e73488f GUACAMOLE-313: Provide reference to in-progress screen recording. 2018-01-26 16:21:24 -08:00
Michael Jumper
dc5245025e GUACAMOLE-489: Lock both wrapped sockets when performing operations through a tee socket. 2018-01-26 16:17:45 -08:00
Michael Jumper
dcaf7b2c21 GUACAMOLE-490: Take channel mask into account when rendering image streams to buffers. 2018-01-26 16:08:51 -08:00
Michael Jumper
db85163e20 GUACAMOLE-384: Merge fix for potential segfault if SSH connection is closed while output is still being written to the terminal. 2018-01-23 14:44:47 -08:00
Nick Couchman
8c844e6eab GUACAMOLE-484: Merge ensure disconnect reason code is checked for orderly RDP disconnect. 2018-01-22 15:29:26 -05:00
Michael Jumper
822a6c6b9d GUACAMOLE-484: Do not flush frame if connection closed mid-frame. 2018-01-22 12:24:07 -08:00
Michael Jumper
61c16a89d2 GUACAMOLE-484: Always clean up after orderly disconnect. 2018-01-22 12:23:39 -08:00
Michael Jumper
d562cb7648 GUACAMOLE-484: Ensure disconnect reason code is checked for orderly RDP disconnect. 2018-01-22 12:16:09 -08:00
Michael Jumper
0f78b01e81 GUACAMOLE-456: Merge multi-stage Docker build changes. 2018-01-19 13:37:01 -08:00
Michael Jumper
11605ff5ed GUACAMOLE-481: Merge Turkish keymap for RDP. 2018-01-09 19:12:05 -08:00
csenel
93b3eebc5d
GUACAMOLE-481: Add Turkish Q keymap for RDP 2018-01-09 10:53:05 +03:00
Nick Couchman
66ffda24f0 GUACAMOLE-448: Add support for configuring bitmap caching. 2018-01-02 18:26:29 -05:00
Nick Couchman
5295886f68 Merge 0.9.14 changes back to master. 2018-01-01 16:27:03 -05:00
Nick Couchman
7c191d7be0 GUACAMOLE-423: Merge bump version number to 0.9.14. 2018-01-01 16:23:37 -05:00
Nick Couchman
f72de10328 GUACAMOLE-307: Merge the size instruction can also apply to buffers. 2017-12-09 12:55:19 -05:00
Michael Jumper
ff6c4b04f4 GUACAMOLE-307: The "size" instruction can also apply to buffers, not just layers. 2017-12-08 14:54:15 -08:00
Michael Jumper
1b81549c97 GUACAMOLE-423: Update libtool version info for libguac (interfaces added, none changed/removed). 2017-12-07 19:10:45 -08:00
Michael Jumper
37236207a0 GUACAMOLE-423: Bump version number to 0.9.14. 2017-12-07 19:10:45 -08:00
Michael Jumper
76a6e41031 GUACAMOLE-423: Automatically populate package version within manpages. 2017-12-07 19:10:45 -08:00
Nick Couchman
e3d8c3fa12 Merge 0.9.14 changes back to master. 2017-12-06 10:04:34 -05:00
Nick Couchman
6322874d3a GUACAMOLE-436: Merge remove incubator prefixes and DISCLAIMER. 2017-12-06 10:02:44 -05:00
Carl Harris
e4f4761c87 GUACAMOLE-456: use Docker multi-stage build 2017-12-06 07:57:12 -05:00
Michael Jumper
798ba1e5be GUACAMOLE-423: Automatically populate package version within Doxyfile. 2017-12-06 01:13:39 -08:00
Michael Jumper
89912dc657 GUACAMOLE-436: Remove old references to pre-Incubator project. 2017-12-06 00:54:21 -08:00
Michael Jumper
a514f03fd4 GUACAMOLE-436: Remove incubator prefix from repositories and URLs. 2017-12-06 00:54:21 -08:00
Michael Jumper
d201344443 GUACAMOLE-436: Remove Incubator DISCLAIMER file. 2017-12-06 00:54:21 -08:00
Michael Jumper
2c12c12850 GUACAMOLE-424: Merge changes addressing potential NULL-pointer dereference in VNC user leave handler. 2017-11-15 07:05:21 -08:00
itsankoff
aa6d81d6f9 GUACAMOLE-424: Update doc comments 2017-11-15 15:02:08 +02:00
Michael Jumper
a75bca1e95 GUACAMOLE-273: Merge RDP support for Portuguese Brazilian keyboard. 2017-11-14 17:17:34 -08:00
Frode Langelo
fc599d2aec GUACAMOLE-273: Remove Mac remapping of €. 2017-11-14 20:04:49 +00:00
Michael Jumper
493fa4df16 GUACAMOLE-233: Merge RDP support for Spanish keyboards. 2017-11-14 10:56:28 -08:00
Michael Jumper
c4c32264bf GUACAMOLE-434: Merge RDP support for UK English keyboards. 2017-11-14 10:55:53 -08:00
Frode Langelo
fc15850288 GUACAMOLE-233: Add Spanish keymap for RDP. 2017-11-13 22:57:21 +00:00
Frode Langelo
a8174eeac9 GUACAMOLE-273: Fix comment for remapping of €. 2017-11-13 22:52:39 +00:00
Frode Langelo
ed8a32f98b GUACAMOLE-273: Add Brazillian ABNT2 keymap for RDP. 2017-11-13 22:43:42 +00:00
Frode Langelo
625eee0caa GUACAMOLE-434: Add UK English keymap for RDP. 2017-11-13 22:26:29 +00:00
itsankoff
e139b20d12 GUACAMOLE-424: Remove check against NULL for display cursor 2017-11-13 14:51:31 +02:00
itsankoff
f7990af6d0 GUACAMOLE-424: Return NULL if guac_common_display allocation fails 2017-11-13 14:50:44 +02:00
itsankoff
da0fc1a6d8 GUACAMOLE-424: Add doc comment for guac_common_cursor_alloc 2017-11-13 14:49:44 +02:00
Michael Jumper
025fc0525f Merge 0.9.14-incubating changes back to master. 2017-11-06 11:29:37 -08:00
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
Michael Jumper
012a3497eb GUACAMOLE-411: Merge changes fully initializing CMSG buffer prior to use. 2017-10-14 17:50:47 -07:00
Nick Couchman
caedf26a06 GUACAMOLE-296: Break out WINPR libs into their own variable. 2017-10-13 21:25:32 -04:00
Nick Couchman
9487eb2dc9 GUACAMOLE-296: Fix linking issue that causes audio issues with FreeRDP 1.1 2017-10-13 21:04:13 -04:00
Nick Couchman
c49c57ef30 GUACAMOLE-402: Merge fix out-of-tree build 2017-10-12 12:35:46 -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
Jukka-Pekka Virtanen
c8eaa91ad3 GUACAMOLE-411: Fixed using uninitialized values in guacd_send_fd 2017-10-10 12:41:19 +03:00
Michael Jumper
d35cc7a83e GUACAMOLE-400: Merge changes correcting segfault when an SSH private key cannot be imported. 2017-09-29 12:05:56 -07: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
Michael Jumper
1d0e63b251 GUACAMOLE-398: Merge fix for address info memory leak. 2017-09-27 10:27:22 -07:00
Nick Couchman
9200bc789f GUACAMOLE-398: Use freeaddrinfo() instead of free() on the linked list. 2017-09-27 13:24:58 -04:00
Nick Couchman
e4dd8de4f1 GUACAMOLE-398: Fix memory leak identified by Coverity in common ssh code. 2017-09-27 13:02:41 -04:00
Michael Jumper
afb554a014 GUACAMOLE-396: Merge support for connecting to IPv6 hosts via SSH. 2017-09-26 19:46:17 -07:00
James
f559701645 GUACAMOLE-396: Fixing ssh socket for IPv6 address
Root Cause:
In the ssh library of guacd, the TCP socket for connecting to ssh server is created with AF_INET. So it does not support IPv6 address.

Solution:
When guacd creates the socket for ssh in guac_common_ssh_create_session(), stop using hard coded AF_INET for socket() call, use the address family which is returned from getaddrinfo().

Test:
- Connected successfully via ssh connections with IPv4 and IPv6 hosts.
- No connection error in guacd logs.
- Simulated a connection failure with specifying a ssh server which does not exist. guacd worked well in this case.
2017-09-26 17:19:18 -07:00
Nick Couchman
4e80960933 GUACAMOLE-391: Merge resolve low-impact memory leak. 2017-09-24 08:42:46 -04:00
Ilya Shipitsin
d2102e5705 GUACAMOLE-391: resolve low impact memory leak 2017-09-24 13:42:59 +05:00
Michael Jumper
c5f674340a GUACAMOLE-383: Merge fix for low-impact memory leaks identified by cppcheck. 2017-09-23 13:31:01 -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
Nick Couchman
99e6f89eba GUACAMOLE-279: Merge implement console codes for palette modification. 2017-08-13 20:32:06 -04:00
Michael Jumper
b0d9bbc121 GUACAMOLE-279: Add explicit definitions for each human-readable xterm color. 2017-08-13 15:12:05 -07:00
Michael Jumper
27cf97cb9e GUACAMOLE-279: Handle xterm palette assignments, parsing each color as an X11 color spec. 2017-08-13 15:12:05 -07:00
Nick Couchman
6400af605e GUACAMOLE-325: Merge restore Windows-compatibility at libguac level. 2017-08-13 14:24:58 -04:00
Nick Couchman
ef18f858cb GUACAMOLE-279: Merge migrate to mutable terminal color palette. 2017-08-12 15:18:46 -04:00
Michael Jumper
c53575b18c GUACAMOLE-279: Use guac_terminal_color for color palette assignments. 2017-07-11 08:24:18 -07:00
Michael Jumper
eec3607b16 GUACAMOLE-279: Migrate to mutable terminal color palette. 2017-07-10 14:08:21 -07:00
Michael Jumper
d3c5a8a050 GUACAMOLE-325: Add Winsock-specific guac_socket implementation. 2017-07-05 20:55:03 -07:00
Michael Jumper
eb73563445 GUACAMOLE-325: Explicitly check for Winsock. 2017-07-05 20:55:02 -07:00
Michael Jumper
d85f61deaf GUACAMOLE-325: Do not lock files on Windows. Use Windows-specific _mkdir() call where necessary. 2017-07-05 20:55:02 -07:00
Michael Jumper
1c404d1881 GUACAMOLE-325: Use recv() on Windows platforms. 2017-07-05 20:55:02 -07:00
Michael Jumper
944857d130 GUACAMOLE-325: Include -no-undefined in libguac libtool flags. 2017-07-05 20:55:02 -07:00
Michael Jumper
7b8d250bd5 GUACAMOLE-325: Explicitly check for libdl, using it if provided and warning if both libdl and dlopen() are absent. 2017-07-05 20:55:02 -07:00
Michael Jumper
9dcddd1947 GUACAMOLE-325: Use select() if poll() is unavailable. 2017-07-05 20:55:02 -07:00
Michael Jumper
50d2dd51cb GUACAMOLE-325: Check whether poll() is defined. 2017-07-05 20:55:02 -07:00
James Muehlner
6236eb8f98 GUACAMOLE-337: Merge move of libguacd code into public libguac API. 2017-07-05 19:56:06 -07:00
Michael Jumper
b608d2266b GUACAMOLE-337: Clarify behavior of guac_user_handle_connection(). 2017-07-05 19:54:06 -07:00
James Muehlner
3fdd1e973a GUACAMOLE-303: Merge null terminator overflow fix. 2017-07-05 19:31:10 -07: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
Nick Couchman
07db9808a0 GUACAMOLE-303: Merge Allow root directory of SFTP filesystem to be configured. 2017-07-03 17:47:05 -04:00
Michael Jumper
60141175dd GUACAMOLE-337: Document that socket-ssl.h is not guaranteed to be present. 2017-07-01 18:55:20 -07:00
Michael Jumper
f504b1a5e8 GUACAMOLE-337: Move libguacd functionality into libguac. 2017-07-01 18:50:03 -07:00
Michael Jumper
5b748a4b42 GUACAMOLE-337: Separate definition of guacd read timeout from libguacd. 2017-07-01 18:50:03 -07:00
Michael Jumper
06a5043442 GUACAMOLE-337: Include only *-types.h headers when only types are needed. 2017-07-01 18:50:03 -07:00
Michael Jumper
f311c23ffa GUACAMOLE-337: Move SSL socket into libguac. 2017-07-01 18:50:03 -07:00
Michael Jumper
78dbf64416 GUACAMOLE-337: Add missing libtool flags for libguacd. 2017-07-01 16:05:17 -07:00
Michael Jumper
3a46fffe44 GUACAMOLE-337: Do not include config.h in libguacd public headers. 2017-07-01 16:05:14 -07:00
Michael Jumper
6c484c1efd GUACAMOLE-337: Limit public libguacd API to simply user handshake handling and SSL/TLS sockets. 2017-07-01 16:05:12 -07:00
Michael Jumper
7f3b985cc6 GUACAMOLE-337: Install libguacd as a normal library. 2017-07-01 16:05:11 -07:00
Michael Jumper
69d8d87ec9 GUACAMOLE-337: Remove unnecessary include of syslog.h by libguacd. 2017-07-01 16:05:08 -07:00
Michael Jumper
a56a7207ac GUACAMOLE-337: Remove unnecessary link to libguac-common for libguacd. 2017-07-01 16:04:52 -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
James Muehlner
836fc3eaa0 GUACAMOLE-326: Merge rejection of reads and writes to Windows data streams. 2017-06-26 21:07:09 -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
Michael Jumper
d9c1ce7738 GUACAMOLE-203: Merge support for SSH/SFTP connection keep-alive packets. 2017-06-25 12:01:02 -07:00
Nick Couchman
a5efbb5933 GUACAMOLE-203: Fix function prototype to remove const. 2017-06-25 14:56:50 -04:00
Nick Couchman
650f7a0a32 GUACAMOLE-203: if is not a function... 2017-06-25 14:10:42 -04:00
Nick Couchman
041fcc4651 GUACAMOLE-203: Change remaining instances of timer to timeout. 2017-06-25 05:13:22 -04:00
Nick Couchman
711cdd6929 GUACAMOLE-203: Allow keepalive param to be modified inside the function. 2017-06-25 05:13:12 -04:00
Nick Couchman
05dfb1a6ae GUACAMOLE-203: Deal correctly with negative keepalive values. 2017-06-25 05:10:22 -04:00
Nick Couchman
ed77114038 GUACAMOLE-203: Fix issue using guac_client_log instead of guac_user_log. 2017-06-14 13:01:01 -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
770a2805e4 Merging 0.9.13-incubating changes back to master. 2017-06-03 22:42:51 -04:00
Nick Couchman
ca3563a38e GUACAMOLE-314: Merge bump version to 0.9.13-incubating. 2017-06-03 19:33:40 -04:00
Michael Jumper
584c108d1a GUACAMOLE-314: Bump libtool version info (interface added, none changed/removed). 2017-06-01 22:52:12 -07:00
Michael Jumper
57ee384180 GUACAMOLE-314: Bump version numbers to 0.9.13-incubating. 2017-06-01 22:48:02 -07: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
James Muehlner
9ee224f2ca GUACAMOLE-280: Merge low intensity SGR option. 2017-05-26 18:11:06 -07:00
Michael Jumper
9da27ad578 GUACAMOLE-280: Ensure bold and half-bright attributes cancel each other out. 2017-05-21 13:48:10 -07:00
Michael Jumper
2146200dfd GUACAMOLE-280: Add support for faint (low) intensity SGR. 2017-05-21 13:46:21 -07:00
James Muehlner
6d2cfdabf8 GUACAMOLE-306: Merge VNC client null check fix. 2017-05-21 11:20:05 -07: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
04205a9b97 GUACAMOLE-278: Merge counter fix for SGR parser. 2017-05-07 21:30:52 -07:00
Michael Jumper
58e26eb312 GUACAMOLE-278: argc value received by 256-color SGR sequence parser must equal the number of remaining argv elements. 2017-04-27 10:15:58 -07:00
James Muehlner
0e5498fc83 GUACAMOLE-278: Merge SGR bright color support for terminal. 2017-04-26 22:13:01 -07:00
James Muehlner
79b3b1029c GUACAMOLE-265: Merge connection name update change. 2017-04-26 21:54:43 -07:00
Michael Jumper
4b7c679808 GUACAMOLE-265: Set connection name when terminal window title is changed. 2017-04-26 21:19:56 -07:00
James Muehlner
d88b5d1011 GUACAMOLE-278: Merge 256-color support for terminal. 2017-04-26 21:13:51 -07:00
Michael Jumper
2a91e2ff2d GUACAMOLE-278: Add support for xterm's bright SGR colors (90-97 and 100-107). 2017-04-26 21:06:08 -07:00
Michael Jumper
a04022883c GUACAMOLE-278: Provide constants defining locations of dark vs. intense colors in 16-color palette. 2017-04-26 21:01:53 -07:00
James Muehlner
008ba46597 GUACAMOLE-282: Merge alpha fix for common surface transfer functions. 2017-04-26 20:17:24 -07:00
Michael Jumper
691a3ab840 GUACAMOLE-282: Correct common surface transfer functions to copy/ignore alpha channel as required. 2017-04-24 11:57:12 -07:00
Michael Jumper
10180095d8 GUACAMOLE-278: Handle (but ignore) xterm's 256-color palette redefinition OSC. 2017-04-23 13:59:03 -07:00
Michael Jumper
e4ce7b0eeb GUACAMOLE-278: Ignore 256-color SGR sequences which contain out-of-range values. 2017-04-23 13:52:08 -07:00
Michael Jumper
19f7424c62 GUACAMOLE-278: Log unhandled/invalid sequences at DEBUG level. 2017-04-23 13:52:07 -07:00
Michael Jumper
87fba523ee GUACAMOLE-278: Handle xterm 256-color SGR sequences. 2017-04-23 13:24:13 -07:00
Michael Jumper
11bf6f05c4 GUACAMOLE-278: Expand terminal palette to 256 entries. Use xterm colors for entries 16 through 255. 2017-04-23 13:24:04 -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
69caa9936b GUACAMOLE-40: Merge RD gateway support. 2017-04-20 21:36:44 -07:00
James Muehlner
d3fa5e7fbd GUACAMOLE-268: Merge RDP file size fix. 2017-04-20 08:49:20 -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
Michael Jumper
af8ef9f526 GUACAMOLE-40: Test whether FreeRDP supports RD gateways and/or load balancing. 2017-04-09 23:17:01 -07:00
Michael Jumper
37fe3548de GUACAMOLE-262: Merge workaround for bug in upstream handling of VNC "truecolor" flag. 2017-04-03 15:45:55 -07:00
dborth
8833c0dd79 GUACAMOLE-262: set VNC trueColour flag to 1 instead of 255 2017-04-03 09:28:22 -06:00
James Muehlner
2ac1f14973 GUACAMOLE-260: Merge updated copyright year. 2017-03-31 11:14:22 -07:00
James Muehlner
3b0b36ad5d GUACAMOLE-259: Merge logging of frame timing information. 2017-03-31 10:55:34 -07:00
Michael Jumper
1081131aa5 GUACAMOLE-259: Log server and user frame timing information at TRACE level. 2017-03-31 10:48:58 -07:00
James Muehlner
457c48ec71 GUACAMOLE-259: Merge addition of new TRACE log level. 2017-03-31 10:45:41 -07:00
Michael Jumper
4dd41fa7d2 GUACAMOLE-260: Update copyright year in NOTICE to 2017. 2017-03-30 19:41:04 -07:00
Michael Jumper
e910dcbfcc GUACAMOLE-259: Add TRACE log level. 2017-03-30 01:15:51 -07:00
James Muehlner
aba2b46a7c GUACAMOLE-257: Merge sftp file upload handler fix. 2017-03-29 11:33:34 -07: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
114f5b23e3 GUACAMOLE-251: Merge removal of MAINTANER from Dockerfile. 2017-03-26 12:27:31 -07:00
Michael Jumper
8cc9a47e5c GUACAMOLE-251: Remove MAINTAINER instruction from Dockerfile. 2017-03-25 19:59:50 -07:00
Michael Jumper
039a1c52e4 GUACAMOLE-239: Merge support for CLOCK_MONOTONIC. 2017-03-23 21:05:49 -07:00
Roman Stoffel
ddc1aa0b5f GUACAMOLE-239: When available, use CLOCK_MONOTONIC to prevent backwards running time 2017-03-23 23:06:24 +01:00
James Muehlner
516c4a0593 Merge 0.9.12-incubating changes back to master. 2017-03-17 10:43:50 -07:00
James Muehlner
cbca2f169b GUACAMOLE-240: Merge PulseAudio callback fix. 2017-03-17 10:40:15 -07:00
Michael Jumper
6a3ce58ab7 GUACAMOLE-240: Document parameters and behavior of PulseAudio callbacks. 2017-03-15 22:26:11 -07:00
Michael Jumper
adf9db7454 GUACAMOLE-240: Always pass guac_pa_stream to PulseAudio callbacks. 2017-03-15 21:24:29 -07:00
James Muehlner
2c2824fc5b Merge 0.9.12-incubating changes back to master. 2017-03-13 22:13:10 -07:00
James Muehlner
145762a2b0 GUACAMOLE-231: Merge server-side production of new mouse instruction. 2017-03-13 22:11:17 -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
Michael Jumper
240e18cd92 GUACAMOLE-231: Broadcast mouse position only to users who are not moving the mouse. 2017-03-11 14:57:09 -08:00
Michael Jumper
ae7e8d3890 GUACAMOLE-231: Report mouse position using new "mouse" instruction. Rely on client-side cursor layer implementation. 2017-03-11 14:57:09 -08:00
Michael Jumper
1a96c5b415 GUACAMOLE-231: Add "mouse" instruction for server reporting of mouse position. 2017-03-11 14:57:09 -08:00
James Muehlner
1d5d8784b3 Merge 0.9.12-incubating changes back to master. 2017-03-10 09:46:59 -08:00
James Muehlner
cf05eca68b GUACAMOLE-231: Merge mouse update fix. 2017-03-10 09:46:03 -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
da7b77d2ec Merge 0.9.12-incubating changes back to master. 2017-03-01 09:43:39 -08:00
James Muehlner
de9b8d6d2c GUACAMOLE-226: Merge default layer opacity fix. 2017-03-01 09:42:40 -08:00
Michael Jumper
72284cfc7c GUACAMOLE-226: All new layers are fully opaque. 2017-03-01 08:45:12 -08:00
James Muehlner
1f8dbb265e GUACAMOLE-205: Merge OpenSSL 1.1 version API upgrade. 2017-02-28 18:49:44 -08:00
Michael Jumper
270d51d4d4 GUACAMOLE-205: Use semantically-named macro rather than repeatedly and explicitly check OpenSSL version. 2017-02-28 13:01:30 -08:00
Michael Jumper
98a5faaa77 GUACAMOLE-205: Provide OpenSSL 1.1 API shims for missing accessors. 2017-02-28 13:01:30 -08:00
Michael Jumper
dbfb782dd5 GUACAMOLE-205: Update to 1.1 version of OpenSSL API. 2017-02-28 13:01:30 -08:00
James Muehlner
c8fca94899 GUACAMOLE-223: Merge thread safety fix for SSL. 2017-02-28 10:55:17 -08:00
James Muehlner
c4903a8e36 Merge 0.9.12-incubating changes back to master. 2017-02-28 10:32:49 -08:00
James Muehlner
3ff8323153 GUACAMOLE-169: Merge namespaced directory reshuffle. 2017-02-28 10:28:45 -08:00
James Muehlner
08ce4331bb GUACAMOLE-225: Merge updated version numbers. 2017-02-28 10:26:38 -08:00
James Muehlner
eb5ef5a027 GUACAMOLE-194: Merge removal of double-free code. 2017-02-28 10:19:58 -08:00
James Muehlner
3157361077 GUACAMOLE-224: Merge removal of AUTHORS file. 2017-02-28 10:12:18 -08:00
Michael Jumper
f85978e43a GUACAMOLE-225: Bump libtool version info (interface added, none changed/removed). 2017-02-28 09:47:53 -08:00
Michael Jumper
e27996b199 GUACAMOLE-225: Bump version numbers to 0.9.12-incubating. 2017-02-28 09:47:49 -08:00
Michael Jumper
af46b484dd GUACAMOLE-224: Remove AUTHORS file for the same reason we're removing @author tags. 2017-02-27 23:18:46 -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
James Muehlner
c344aa854f GUACAMOLE-222: Merge explicit closing of STFP downloaded files. 2017-02-26 14:53:38 -08:00
Michael Jumper
9218a79e62 GUACAMOLE-223: Set required thread-related callbacks for OpenSSL. 2017-02-26 14:32:08 -08:00
Michael Jumper
cf01d0d634 GUACAMOLE-223: Link against libcrypto as well as libssl. 2017-02-26 14:25:56 -08:00
Michael Jumper
821feeabb0 GUACAMOLE-223: Always invoke SSL_free(). 2017-02-26 14:25:50 -08:00
Michael Jumper
58b85da8f2 GUACAMOLE-222: Ensure files downloaded via SFTP are explicitly closed upon completion. 2017-02-26 14:11:42 -08:00
James Muehlner
f23133043b Merge 0.9.12-incubating changes back to master. 2017-02-26 00:43:17 -08:00
James Muehlner
a808a6b177 GUACAMOLE-188: Merge usage of Porter-Duff operator for blending ARGB surfaces. 2017-02-26 00:39:25 -08:00
James Muehlner
4fe5d7f642 Merge 0.9.12-incubating changes back to master. 2017-02-26 00:23:52 -08:00
James Muehlner
6939142d2f GUACAMOLE-217: Merge libavcodec version number update. 2017-02-26 00:22:12 -08:00
James Muehlner
2703c5afff GUACAMOLE-217: Merge libavcodec version number update. 2017-02-25 23:49:23 -08:00
James Muehlner
6449f047e5 GUACAMOLE-218: Merge audio format counter fix. 2017-02-25 23:44:46 -08:00
Michael Jumper
0fb567bb53 GUACAMOLE-188: Clamp alpha blending results to maximum component value (0xFF). 2017-02-25 19:57:10 -08:00
Michael Jumper
12d29569a6 GUACAMOLE-188: Use Porter-Duff "over" operator when drawing with ARGB surfaces. 2017-02-25 19:57:10 -08:00
Michael Jumper
d40b2d8153 GUACAMOLE-217: FFmpeg's decoupled I/O functions were not available until libavcodec 57.37.100. 2017-02-25 19:42:43 -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
0210b7dc6b GUACAMOLE-208: Add protocol status codes representing upstream network errors and session behavior. 2017-02-15 21:23:07 -08:00
James Muehlner
cd8646b38f Merge 0.9.12-incubating changes back to master. 2017-02-15 20:53:17 -08:00
James Muehlner
a7ee5edd8b GUACAMOLE-200: Merge fix for print blocking input handling. 2017-02-15 20:50:11 -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
James Muehlner
0ea95822bc GUCAMOLE-206: Merge fix for dropped keys while alt pressed. 2017-02-15 19:44:02 -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
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
4da4ce7279 GUCAMOLE-149: Merge zero-width character fix for potential infinite loop. 2017-02-01 10:17:43 -08:00
Michael Jumper
a6e3f19bf7 GUACAMOLE-149: Ignore zero-width characters. 2017-01-31 23:57:02 -08:00
James Muehlner
09c493b39c GUACAMOLE-193: Merge fix for whitespace background color. 2017-01-30 23:31:01 -08:00
Michael Jumper
fc6f36150f GUACAMOLE-193: Take character attributes into account when testing for visibility. 2017-01-30 22:39:49 -08:00
James Muehlner
d831a4b9df GUACAMOLE-188: Merge alpha component support for common surface. 2017-01-29 12:45:46 -08:00
James Muehlner
075c770432 GUACAMOLE-187: Merge surface resize optimization. 2017-01-29 12:37:52 -08:00
James Muehlner
701268271d GUACAMOLE-167: Merge move away from deprecated avodec_encode_video2() when possible. 2017-01-29 12:34:21 -08:00
James Muehlner
135514a0d2 GUACAMOLE-94: Merge move from readdir_r to readdir. 2017-01-29 12:30:24 -08:00
James Muehlner
0d0f6b9c69 GUACAMOLE-135: Merge new Swiss-French RDP keymap. 2017-01-29 12:27:49 -08:00
James Muehlner
6695da4b16 GUACAMOLE-148: Merge terminal scrolling fix. 2017-01-29 12:12:00 -08:00
Michael Jumper
b796b2c933 GUACAMOLE-148: Clarify that the cursor is expected to potentially exceed the terminal bounds. 2017-01-28 22:54:06 -08:00
Michael Jumper
6c1eeb96b0 GUACAMOLE-148: Move cursor bounds checking to common location (where necessary). 2017-01-28 22:48:45 -08:00
Michael Jumper
073fbe684d GUACAMOLE-148: Scroll automatically only when cursor is within scrolling region. 2017-01-28 22:47:06 -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
9a51675e32 GUACAMOLE-167: Use avcodec_send_frame() / avcodec_receive_packet() when available. 2017-01-27 20:29:45 -08:00
Michael Jumper
1a5f48961c GUACAMOLE-188: Allow alpha component to be set within common surface. 2017-01-27 16:51:45 -08:00
Michael Jumper
f353411460 GUACAMOLE-187: Do not perform surface resize unless the new size is actually different. 2017-01-27 16:44:24 -08:00
James Muehlner
ea6b094e24 GUACAMOLE-185: Merge rectangle clipping fix. 2017-01-25 21:53:38 -08:00
Michael Jumper
a72531b65c GUACAMOLE-185: Fix copy/transfer rectangle calculation. Clip source to bounds, NOT to clipping rectangle. 2017-01-25 21:05:08 -08:00
Michael Jumper
2de7d017f5 GUACAMOLE-185: Clip copy/transfer operations to fit source as well as destination. 2017-01-25 21:05:08 -08:00
James Muehlner
3f2cdb1971 GUACAMOLE-184: Merge empty surface fix. 2017-01-25 21:01:20 -08:00
Michael Jumper
bd3d482ade GUACAMOLE-184: Only send contents of surface if non-empty. 2017-01-25 19:28:07 -08:00
James Muehlner
5d5fbb4d45 GUACAMOLE-172: Merge lag calculation improvements. 2017-01-24 23:26:29 -08:00
Frode Langelo
070d46b096 GUACAMOLE-180: Merge change making surface and display threadsafe. 2017-01-25 07:04:09 +00:00
Michael Jumper
5d1de67a0c GUACAMOLE-180: Make common display threadsafe. 2017-01-24 18:01:04 -08:00
Michael Jumper
b7e0e080da GUACAMOLE-180: Make common surface threadsafe. 2017-01-24 18:00:57 -08:00
James Muehlner
b8f4f19c36 GUACAMOLE-179: Merge move of PulseAudio support into library. 2017-01-24 17:49:37 -08:00
James Muehlner
67a5d9a5dd GUACAMOLE-176: Merge support for layer location and opacity for guac_common_surface. 2017-01-24 17:39:03 -08:00
Michael Jumper
6bd19b6ac6 GUACAMOLE-176: Support layer location and opacity for guac_common_surface. 2017-01-24 17:30:51 -08:00
Michael Jumper
440668a78a GUACAMOLE-179: Use non-owner users of connection to determine audio encoding if necessary. 2017-01-24 17:19:10 -08:00
Michael Jumper
48ebbe95ea GUACAMOLE-179: Move PulseAudio support into separate utility library. 2017-01-24 17:19:06 -08:00
James Muehlner
5d2c9676f4 GUACAMOLE-175: Merge move of guacd core into library. 2017-01-24 16:38:50 -08:00
James Muehlner
396eaa21f2 GUACAMOLE-178: Merge cursor layer z index fix. 2017-01-24 16:25:35 -08:00
Michael Jumper
6645e858ca GUACAMOLE-178: Ensure shared cursor layer is always above all other layers. 2017-01-24 16:17:42 -08:00
Michael Jumper
4c06d755f9 GUACAMOLE-175: Move guacd_handle_user() to libguacd. 2017-01-24 15:44:59 -08:00
Michael Jumper
45adc63597 GUACAMOLE-175: Split logging between guacd and libguacd. 2017-01-24 15:44:55 -08:00
Michael Jumper
d7a604c8b2 GUACAMOLE-175: Move common core of guacd into libguacd utility library. 2017-01-24 15:44:51 -08:00
James Muehlner
a1886f51bd GUACAMOLE-171: Merge move of broadcast socket to public API. 2017-01-24 11:49:29 -08:00
James Muehlner
8cd98b5298 GUACAMOLE-170: Merge client args default change. 2017-01-24 11:44:40 -08:00
James Muehlner
52ccd276da GUACAMOLE-169: Merge common namespace normalization. 2017-01-24 11:42:31 -08:00
Michael Jumper
6131ad0341 GUACAMOLE-172: Ignore insane timestamps when calculating lag. 2017-01-24 00:18:10 -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
9e6e4e520c GUACAMOLE-172: Clarify processing lag calculations. 2017-01-24 00:18:00 -08:00
Michael Jumper
7a65a63aa9 GUACAMOLE-171: Do not require knowledge of broadcast socket internals (do not acquire write lock around join/leave handlers). 2017-01-23 23:43:36 -08:00
Michael Jumper
98b92f0900 GUACAMOLE-171: Separate broadcast socket from client. Ensure socket remains threadsafe even if no users are connected. 2017-01-23 23:43:32 -08:00
Michael Jumper
9d2bb31a9d GUACAMOLE-170: Init guac_client args by default. 2017-01-23 23:35:16 -08:00
Michael Jumper
eee928548d GUACAMOLE-169: Use proper namespace for internal common headers. 2017-01-23 23:26:26 -08:00
Frode Langelo
0ef87c443b Merge 0.9.11-incubating changes back to master. 2017-01-17 19:07:08 +00:00
Frode Langelo
5d2cfb7f25 GUACAMOLE-86: Merge removal of terminal emulator's STDOUT pipe. 2017-01-17 17:58:16 +00: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
0611bd1c45 Merge 0.9.11-incubating changes back to master. 2017-01-11 15:11:11 -08:00
Michael Jumper
cf9aeef83b GUACAMOLE-157: Merge fix for segfault upon VNC disconnect. 2017-01-11 15:09:15 -08:00
Frode Langelo
6c05dc026e GUACAMOLE-157: Initialize SSH SSL lock array to NULL and test for NULL-ness before freeing. 2017-01-11 22:40:34 +00:00
James Muehlner
6d4b7a94f6 Merge 0.9.11-incubating changes back to master. 2017-01-10 13:25:11 -08:00
James Muehlner
1fef1f4461 GUACAMOLE-154: Merge updated version number. 2017-01-10 10:51:51 -08:00
Michael Jumper
8b08a0e444 GUACAMOLE-154: Bump libtool version-info. 2017-01-09 11:38:47 -08:00
Michael Jumper
7759210f29 GUACAMOLE-154: Bump guacamole-server version numbers to 0.9.11-incubating. 2017-01-09 11:36:06 -08:00
James Muehlner
e0e42e8aa8 Merge changes for 0.9.10-incubating release back to master. 2016-12-18 10:51:15 -08:00
James Muehlner
68fdd4d290 GUACAMOLE-145: Merge README changes for updated dependency information. 2016-12-18 10:44:24 -08:00
James Muehlner
bb13105338 GUACAMOLE-143: Merge fix for missing files in server artifact. 2016-12-18 10:30:34 -08:00
Michael Jumper
40cc1536af GUACAMOLE-145: Update README to include (correct) required and optional dependencies. 2016-12-17 22:00:55 -08:00
Michael Jumper
6101be6234 GUACAMOLE-143: Include guacd-docker within source .tar.gz. 2016-12-17 21:15:13 -08:00
Michael Jumper
2a55474c92 GUACAMOLE-143: Include CONTRIBUTING within source .tar.gz. 2016-12-17 21:09:17 -08:00
Michael Jumper
c61037c4a6 GUACAMOLE-143: Include DISCLAIMER and NOTICE within source .tar.gz. 2016-12-17 20:59:57 -08:00
James Muehlner
ecc3a7d49b Merge release-specific changes for 0.9.10-incubating back to master. 2016-11-13 11:33:44 -08:00
James Muehlner
78e6215cbd GUACAMOLE-119: Merge integration of Apache Rat into client and associated new license notices. 2016-11-13 11:17:03 -08:00
James Muehlner
0ea047ea25 GUACAMOLE-68: Merge fix for FFmpeg, Pango related build issues. 2016-11-13 11:01:25 -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
4a29979667 GUACAMOLE-119: Add Apache license boilerplate to manpage source. 2016-11-12 19:40:39 -08:00
Michael Jumper
cb93d42dea GUACAMOLE-119: Add Apache license boilerplate to Doxyfile. 2016-11-12 19:40:39 -08:00
Michael Jumper
406a58de35 GUACAMOLE-68: Use AV_PIX_FMT_RGB32 and AV_PIX_FMT_YUV420P constants (not PIX_FMT_RGB32 and PIX_FMT_YUV420P). 2016-11-12 19:40:12 -08:00
Michael Jumper
4ea5f163f0 GUACAMOLE-68: Remove -pedantic flag for subprojects depending on libraries which use compiler extensions. 2016-11-12 19:40:01 -08:00
Michael Jumper
8fc4cc928d GUACAMOLE-119: Do not include generated sources in source tarball. 2016-11-12 18:56:18 -08:00
James Muehlner
7c3430ba0f GUACAMOLE-118: Merge switchover from select to poll. 2016-11-11 16:19:54 -08:00
James Muehlner
6436996eb7 GUACAMOLE-117: Merge fix for closing socket upon failed handshake. 2016-11-11 16:11:37 -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
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
12d575b8e6 GUACAMOLE-118: Migrate to poll() instead of select() for guacd's SSL/TLS guac_socket implementation. 2016-11-11 13:06:05 -08:00
Michael Jumper
9d6d2aeba7 GUACAMOLE-118: Migrate to poll() instead of select() for file descriptor guac_socket implementation. 2016-11-11 13:03:43 -08:00
Michael Jumper
ca2b426252 GUACAMOLE-117: Close socket file descriptor if SSL/TLS handshake fails. 2016-11-11 12:25:28 -08:00
James Muehlner
a46ce4cc3b GUACAMOLE-115: Merge server-side explicit disconnect fix. 2016-11-07 10:57:04 -08:00
Michael Jumper
1817ef4ce0 GUACAMOLE-115: Explicitly signal disconnect at end of connection. 2016-11-07 10:29:00 -08:00
James Muehlner
16a8b9b94b GUACAMOLE-117: Merge RDP disconnect fix. 2016-10-30 12:23:20 -07: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
0c3d89fe17 GUACAMOLE-107: Merge updates to website and project name. 2016-10-26 22:20:27 -07:00
James Muehlner
a23bf783a9 GUACAMOLE-107: Restored reference to download section on website. 2016-10-26 22:13:59 -07:00
James Muehlner
9e2adf5b6a GUACAMOLE-107 Remove references to old website and Apachify project name. 2016-10-26 21:57:07 -07:00
James Muehlner
13fbb7f878 GUACAMOLE-97: Merge updated README for docker image. 2016-10-12 19:09:59 -07:00
Michael Jumper
5ce9b1a32f GUACAMOLE-97: Update guacd Docker README.md with respect to Apache. 2016-10-04 12:25:07 -07:00
Michael Jumper
3c459100d7 GUACAMOLE-110: Merge fix for timestamp rounding bug in guacenc. 2016-10-03 11:38:41 -07:00
Roman
3a3de3e87d GUACAMOLE-110: Fix guacenc framerate rounding affecting video length 2016-10-03 11:51:24 -04:00
James Muehlner
701e44a0cb GUACAMOLE-93: Merge fix for server docker build. 2016-08-28 14:53:42 -07:00
Michael Jumper
4f84be1c31 GUACAMOLE-93: Move Dockerfile to root of repository. 2016-08-28 14:17:26 -07:00
Michael Jumper
b6a988fcb1 GUACAMOLE-93: Build guacd-docker using parent guacamole-server source. 2016-08-26 14:37:58 -07:00
Michael Jumper
4326029984 GUACAMOLE-87: Merge changes bumping version numbers for 0.9.10-incubating. 2016-08-25 22:53:32 -07:00
James Muehlner
96f853d8ff GUACAMOLE-87: Bump libtool version-info. 2016-08-25 22:29:02 -07:00
James Muehlner
e92bb2c824 GUACAMOLE-87: Bump guacamole-server version numbers to 0.9.10-incubating. 2016-08-25 21:59:25 -07:00
James Muehlner
2a0d2445c1 GUACAMOLE-51: Merge lock state synchronziation change for RDP. 2016-08-16 20:18:59 -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
James Muehlner
f73822d348 GUACAMOLE-51: Merge change to seperate RDP keyboard handling. 2016-08-16 19:58:42 -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
James Muehlner
4734d15fb6 GUACAMOLE-5: Merge read-only server side parameter. 2016-07-24 22:44:44 -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
James Muehlner
425f7baa2b GUACAMOLE-44: Merge change of RDPDR printer operation to synchronous. 2016-06-16 15:43:32 -07:00
Michael Jumper
69ddeeb06d GUACAMOLE-44: Refactor the RDPDR printer to synchronous operation. 2016-06-16 15:40:43 -07:00
James Muehlner
96dc9512bb GUACAMOLE-51: Merge changes to numpad key handling. 2016-06-14 19:20:19 -07:00
Michael Jumper
72fb8ffdfe GUACAMOLE-51: Explicitly map number pad keys within Guacamole terminal emulator. 2016-06-14 14:20:30 -07:00
James Muehlner
4e17e4837d GUACAMOLE-25: Merge change to avoid unnecessary string allocation. 2016-06-06 09:16:05 -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
James Muehlner
995b6d669a GUACAMOLE-25: Merge RDP audio input addition." 2016-06-02 11:44:16 -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
5030c0603a GUACAMOLE-25: Add status code reporting the normal closure of a resource. 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
Michael Jumper
63cd2ce512 GUACAMOLE-25: Partially handle the Open PDU. 2016-05-25 13:50:28 -07:00
Michael Jumper
86806a3759 GUACAMOLE-25: Handle the server's Sound Formats PDU. 2016-05-25 13:50:28 -07:00
Michael Jumper
503ffb0d45 GUACAMOLE-25: Implement message processing. Stub handlers. 2016-05-25 13:50:28 -07:00
Michael Jumper
1088332376 GUACAMOLE-25: Add support for multiple versions of IWTSVirtualChannelCallback. 2016-05-25 13:50:28 -07:00
Michael Jumper
ac94fd4cd0 GUACAMOLE-25: Add stub callbacks for AUDIO_INPUT data handling. 2016-05-25 13:50:28 -07:00
Michael Jumper
9cd89e6580 GUACAMOLE-25: Allocate proper number of argument entries. 2016-05-25 13:50:28 -07:00
Michael Jumper
4fdcfebf25 GUACAMOLE-25: Set AudioCapture flag if audio input is enabled. 2016-05-25 13:50:28 -07:00
Michael Jumper
36cc9f492f GUACAMOLE-25: Convert guac_client pointer to/from a string for sake of FreeRDP's DVC API. 2016-05-25 13:50:28 -07:00
Michael Jumper
21ab9d765d GUACAMOLE-25: Add stub "guacai" plugin for AUDIO_INPUT channel support. 2016-05-25 13:50:28 -07:00
James Muehlner
ec93a2989f GUACAMOLE-33: Merge mouse duplication user disconnect fix. 2016-05-23 20:45:18 -07:00
James Muehlner
fa3565e617 Merge rdp performance flag fixes. 2016-05-23 20:43:36 -07:00
Michael Jumper
9ae667e6bc GUACAMOLE-35: Fix logic of desktop_composition flag. 2016-05-23 20:39:26 -07:00
James Muehlner
055aa1b059 Merge client cleanup fix. 2016-05-23 20:36:55 -07:00
Michael Jumper
2b8e1555c6 GUACAMOLE-33: Fix comment regarding user removal. 2016-05-23 13:58:30 -07:00
Michael Jumper
82fd6a279b GUACAMOLE-33: Implement leave handlers for RDP, SSH, and telnet. 2016-05-23 13:58:30 -07:00
Michael Jumper
46b29edc5f GUACAMOLE-33: Actually use VNC's leave handler. 2016-05-23 13:58:30 -07:00
Michael Jumper
92e2f4e420 GUACAMOLE-33: Restore guac_common_cursor_remove_user() (reverts commit af7968e). 2016-05-23 13:58:30 -07:00
Michael Jumper
a64c3e0179 GUACAMOLE-34: Ensure guac_client_stop() or guac_client_abort() are called in ALL cases where the client thread terminates. 2016-05-23 13:58:01 -07:00
Michael Jumper
88b422987e GUACAMOLE-35: Ensure performance flag values are applied. 2016-05-23 13:55:37 -07:00
James Muehlner
c7bf4f78ab Merge inclusion of docker image. 2016-05-20 15:38:41 -07:00
Michael Jumper
66859010e7 GUACAMOLE-27: Add Docker image from old guacd-docker repository. Update license. 2016-05-20 14:45:12 -07:00
James Muehlner
7e3c28a1c2 Merge updated contribution guidelines. 2016-05-17 23:52:04 -07:00
Michael Jumper
7e2aea5765 GUACAMOLE-3: Bring CONTRIBUTING up-to-date with the migration to Apache. 2016-05-17 23:46:52 -07:00
Michael Jumper
facc0a794e GUAC-1517: Only allocate one audio stream for RDP connection. 2016-03-31 14:25:31 -07:00
James Muehlner
f611ea7b65 GUAC-1511: Merge libguac audio input support. 2016-03-30 15:39:39 -07:00
Michael Jumper
bdbe1df43c GUAC-1511: Add user audio handler and definition. Handle received "audio" instructions. 2016-03-30 15:32:09 -07:00
James Muehlner
60bf39f828 GUAC-1517: Merge resource cleanup change. 2016-03-30 13:11:56 -07:00
Michael Jumper
ba673c52b0 GUAC-1517: Only allocate filesystem objects once per Guacamole connection. Do not reallocate when RDP automatically reconnects due to resize. 2016-03-30 12:22:32 -07:00
Michael Jumper
e777faac4c GUACAMOLE-1: Add DISCLAIMER. 2016-03-28 20:39:50 -07:00
Michael Jumper
87bceac9ff GUACAMOLE-1: Add required LICENSE and NOTICE. Remove old MIT license. 2016-03-28 20:39:48 -07:00
Michael Jumper
5b4a02e8a5 GUACAMOLE-1: Relicense RDP keymaps and associated Perl script. 2016-03-28 20:39:45 -07:00
Michael Jumper
f4b8c70f79 GUACAMOLE-1: Relicense build/shell scripts. 2016-03-28 20:39:38 -07:00
Michael Jumper
4da3bef4ec GUACAMOLE-1: Relicense C files. 2016-03-28 20:39:19 -07:00
Michael Jumper
ecbb6fc6b3 GUAC-1164: Do not load "drdynvc" plugin unless actually needed. 2016-03-22 16:50:49 -07:00
James Muehlner
f97a681f1d Merge pull request #133 from glyptodon/rdp-disconnect-leaks
GUAC-1164: Ensure RDP-related memory is freed between connect/disconnect cycles.
2016-03-18 14:40:55 -07:00
Michael Jumper
1cb4325422 GUAC-1164: Init/uninit common SSH client only once. Do not touch display if RDP server is not connected. 2016-03-17 18:29:27 -07:00
Michael Jumper
0a1f01ce3f GUAC-1164: Ensure locks used by OpenSSL are always freed. 2016-03-17 18:10:42 -07:00
Michael Jumper
0fb8a49e62 GUAC-1164: Do not send clipboard notification to RDP server if RDP server is not connected. 2016-03-17 18:06:23 -07:00
Michael Jumper
7c3d108e21 GUAC-1164: Duplicate strings which FreeRDP will free when it frees its settings structure. 2016-03-17 18:05:16 -07:00
Michael Jumper
e57c9ddd86 GUAC-1164: Free private key used for SSH login. 2016-03-17 17:30:32 -07:00
Michael Jumper
0a4bfc95d1 GUAC-1164: Ensure audio stream and context are freed upon disconnect. 2016-03-17 17:30:32 -07:00
Michael Jumper
8c37db8a07 GUAC-1164: Add missing free() for client connection ID. 2016-03-17 16:03:58 -07:00
Michael Jumper
176ff96a26 GUAC-1164: Ensure elements of SVC names array are freed. 2016-03-17 15:54:15 -07:00
James Muehlner
3614c48240 Merge pull request #130 from glyptodon/out-of-bounds
GUAC-236: Do not exceed available buffers/layers/streams.
2016-03-16 22:10:37 -07:00
James Muehlner
5a3bc7ab04 Merge pull request #131 from glyptodon/bad-fd
GUAC-236: Do not attempt to lock/close fd if open fails.
2016-03-16 22:09:34 -07:00
Michael Jumper
1dfdcec34c GUAC-236: Do not attempt to lock/close fd if open fails. 2016-03-16 21:52:30 -07:00
Michael Jumper
ec2524eb97 GUAC-236: Do not exceed available buffers/layers/streams. 2016-03-16 21:48:25 -07:00
James Muehlner
55f5d1cca3 Merge pull request #129 from glyptodon/rdp-resize
GUAC-1164: Add parameter for automatically reconnecting when display changes
2016-03-16 21:37:06 -07:00
Michael Jumper
c336ce39e2 GUAC-1164: Document guac_rdp_handle_connection(). 2016-03-16 21:30:46 -07:00
James Muehlner
b63763cf53 Merge pull request #128 from glyptodon/libavcodec-compat
GUAC-236: Provide support for much older versions of libavcodec.
2016-03-16 20:45:58 -07:00
Michael Jumper
89f6bd4fae GUAC-236: Provide support for much older versions of libavcodec. 2016-03-16 18:51:15 -07:00
Michael Jumper
db82c6fa02 GUAC-1164: Delay display resize relative to display manager creation or reconnect. 2016-03-16 15:27:24 -07:00
Michael Jumper
3997e44810 GUAC-1164: Do not load display update channel unless needed. 2016-03-16 15:02:13 -07:00
Michael Jumper
de78a6efed GUAC-1164: Reset request throttle after reconnect completed (prevent excessive reconnecting due to lengthy connects). 2016-03-16 14:56:14 -07:00
Michael Jumper
8d14118469 GUAC-1164: Add setting for specifying the resize method, if any. 2016-03-16 14:44:16 -07:00
James Muehlner
1fedb71f76 Merge pull request #127 from glyptodon/libjpeg-compat
GUAC-236: Do not use features specific to libjpeg-turbo. Ensure compatibility with libjpeg.
2016-03-16 12:08:33 -07:00
Michael Jumper
fd430e8b69 GUAC-236: Do not use features specific to libjpeg-turbo. Ensure compatibility with libjpeg. 2016-03-16 11:56:04 -07:00
James Muehlner
a1822c5a2c Merge pull request #126 from glyptodon/recording-docs
GUAC-236: Add missing documentation for screen recording parameters of VNC and RDP.
2016-03-16 10:55:35 -07:00
Michael Jumper
0a5e57362e GUAC-236: Add missing plurals. 2016-03-16 10:45:11 -07:00
Michael Jumper
534d0e580e GUAC-236: Add missing documentation for screen recording parameters of VNC and RDP. 2016-03-16 10:26:10 -07:00
Michael Jumper
67a0a1fe46 GUAC-1164: Do not refer to disp member if it does not exist. 2016-03-15 22:11:06 -07:00
Michael Jumper
fc71dcadb0 GUAC-1164: Do not include disply update channel functionsn unless display update channel support is present. 2016-03-15 22:07:38 -07:00
Michael Jumper
81ebfbb5ca GUAC-1164: rdp_disp.[ch] must now be built in all cases. 2016-03-15 22:02:35 -07:00
Michael Jumper
4e2b90cc0a GUAC-1164: Conditionally build display update channel support. 2016-03-15 21:59:28 -07:00
Michael Jumper
2e73e5eef9 GUAC-1164: Dispose of layers/buffers when display/cursor are freed. 2016-03-15 21:49:26 -07:00
Michael Jumper
fc40e9f14c GUAC-1164: Automatically reconnect when display size changes. 2016-03-15 21:48:56 -07:00
James Muehlner
f5f77fea35 Merge pull request #125 from glyptodon/screen-recording
GUAC-246: Implement screen recording
2016-03-15 20:41:28 -07:00
Michael Jumper
e2030c03d0 GUAC-236: They're buffers, not buggers. 2016-03-15 20:34:22 -07:00
Michael Jumper
86eb9c4b8a GUAC-236: Fix copypasto in guacenc_display_free_*() - we are freeing, not allocating. 2016-03-15 19:35:06 -07:00
Michael Jumper
32779ee15f GUAC-236: Provide -f option for overriding locking behavior. 2016-03-15 17:24:25 -07:00
Michael Jumper
9d43e22592 GUAC-236: Acquire read lock on input files for guacenc. Refuse to encode in-progress recordings. 2016-03-15 17:08:39 -07:00
Michael Jumper
0361dd2392 GUAC-236: Acquire write lock on output file for in-progress screen recordings. 2016-03-15 17:06:52 -07:00
Michael Jumper
c50561ef10 GUAC-236: Open output stream using file descriptor. Only write output file if it does not yet exist. 2016-03-15 16:43:13 -07:00
Michael Jumper
73bf5ce6f4 GUAC-236: Remove unused macros. 2016-03-15 12:26:35 -07:00
Michael Jumper
acf2d2b004 GUAC-236: Correct typos in comments. 2016-03-15 12:26:13 -07:00
James Muehlner
399f97542a Merge pull request #124 from glyptodon/screen-sharing-telnet
GUAC-1389: Add screen sharing support to telnet.
2016-03-14 20:33:40 -07:00
Michael Jumper
e3d1af1953 GUAC-236: Add screen recording support to telnet. 2016-03-14 20:26:31 -07:00
Michael Jumper
570bcc3822 GUAC-236: Add generalized ffmpeg-compat.h header to cover various API changes. 2016-03-14 20:22:04 -07:00
Michael Jumper
770fec0d88 GUAC-236: Define av_frame_free() / av_frame_alloc() if not present. 2016-03-14 20:22:04 -07:00
Michael Jumper
812f8b8cbf GUAC-236: Include guacenc.1 in EXTRA_DIST. 2016-03-14 20:22:04 -07:00
Michael Jumper
8ed0cd5f16 GUAC-236: Maintain aspect ratio by adding letterboxes / pillarboxes as necessary. 2016-03-14 20:22:04 -07:00
Michael Jumper
2798536a7a GUAC-236: Document transfer as currently unimplemented (rarely used). 2016-03-14 20:22:03 -07:00
Michael Jumper
be0a9e728f GUAC-236: Implement JPEG. 2016-03-14 20:22:03 -07:00
Michael Jumper
c16832f11a GUAC-236: Fix manual section number. 2016-03-14 20:22:03 -07:00
Michael Jumper
e298975918 GUAC-236: Document usage. Use correct extension (.m4v). 2016-03-14 20:22:03 -07:00
Michael Jumper
e74ea54eb9 GUAC-236: Add FILE to usage descriptions. 2016-03-14 20:22:03 -07:00
Michael Jumper
710edc03ff GUAC-236: Simplify command-line options, restricting to known-good combination. Can add other formats as possible later. 2016-03-14 20:22:03 -07:00
Michael Jumper
ecf3a0302a GUAC-236: There actually isn't a -f option. 2016-03-14 20:22:03 -07:00
Michael Jumper
2f93e6ce67 GUAC-236: Output sensible messages at sensible times. 2016-03-14 20:22:03 -07:00
Michael Jumper
c4f7bae10b GUAC-236: Do not create output file until after everything has been validated. 2016-03-14 20:22:03 -07:00
Michael Jumper
3d67598ec9 GUAC-236: Parse command-line arguments. 2016-03-14 20:22:03 -07:00
Michael Jumper
59844d8e59 GUAC-236: Reset log level back to INFO. Define default elsewhere. 2016-03-14 20:22:03 -07:00
Michael Jumper
7575506443 GUAC-236: Add missing comment for use of sws_scale(). 2016-03-14 20:22:03 -07:00
Michael Jumper
cb1d5e03b5 GUAC-236: Increase default bitrate. 2016-03-14 20:22:03 -07:00
Michael Jumper
0f467a5d51 GUAC-236: Convert each Guacamole frame to a proper AVFrame. 2016-03-14 20:22:03 -07:00
Michael Jumper
96b3dd4e7c GUAC-236: Add libswscale to build. 2016-03-14 20:22:03 -07:00
Michael Jumper
f9f08627ff GUAC-286: Actually write video output to file. 2016-03-14 20:22:03 -07:00
Michael Jumper
1ce39306cb GUAC-236: Do not store buffer - encode directly. Flush frames at end. 2016-03-14 20:22:03 -07:00
Michael Jumper
1a3e1465fa GUAC-236: Pass encoding parameters from root level of utility. Declare defaults in header. 2016-03-14 20:22:03 -07:00
Michael Jumper
c37eda37fd GUAC-236: Define framerate with macro. 2016-03-14 20:22:03 -07:00
Michael Jumper
38c431e8a2 GUAC-236: Record internal presentation timestamp in same format as libavcodec. 2016-03-14 20:22:03 -07:00
Michael Jumper
9eddaeee3d GUAC-236: Allocate and maintain frame data for encoding. 2016-03-14 20:22:03 -07:00
Michael Jumper
9a5b503da5 GUAC-236: Add libavutil to build. 2016-03-14 20:22:03 -07:00
Michael Jumper
17df235c4e GUAC-236: Actually open and init codec. Replace PNG output with stub. 2016-03-14 20:22:03 -07:00
Michael Jumper
a8cba53537 GUAC-236: Perform codec lookup via libavcodec. 2016-03-14 20:22:03 -07:00
Michael Jumper
d94915c515 GUAC-236: Ensure display allocation can handle video preparation failures. 2016-03-14 20:22:03 -07:00
Michael Jumper
19ac6e8286 GUAC-236: Abstract video encoding process as guacenc_video struct. Move PNG-writing stub therein. 2016-03-14 20:22:03 -07:00
Michael Jumper
09a4f4da39 GUAC-236: Add libavcodec to guacenc build. Conditionally compile guacenc and guacd. 2016-03-14 20:22:03 -07:00
Michael Jumper
0676a7a51c GUAC-236: Add missing LDFLAGS for guacenc. 2016-03-14 20:22:03 -07:00
Michael Jumper
6fc208554d GUAC-236: Add session recording parameters to VNC, RDP, and SSH. 2016-03-14 20:22:02 -07:00
Michael Jumper
a3fef4c1fc GUAC-236: Add common functions for creating client-level session recordings (Guacamole protocol dumps). 2016-03-14 20:22:02 -07:00
Michael Jumper
dc2feba72c GUAC-236: Add guac_socket_tee() function which allocates a socket that delegates all operations to a primary socket while duplicating write operations to a secondary socket. 2016-03-14 20:22:02 -07:00
Michael Jumper
bd5bd29ec0 GUAC-236: Ensure client socket is always freed. 2016-03-14 20:22:02 -07:00
Michael Jumper
a5ec24c17b GUAC-236: Fix buffer resize (contents were being cleared). 2016-03-14 20:22:02 -07:00
Michael Jumper
3a972d4845 GUAC-236: Use temporary surface if source rect might intersect dest rect. 2016-03-14 20:22:02 -07:00
Michael Jumper
21c568c0b4 GUAC-236: Implement WebP decoding. 2016-03-14 20:22:02 -07:00
Michael Jumper
960ee263e8 GUAC-236: Split massive display code into more reasonable files. 2016-03-14 20:22:02 -07:00
Michael Jumper
a24152df02 GUAC-236: Flatten and render all layers upon sync. 2016-03-14 20:22:02 -07:00
Michael Jumper
79181567e5 GUAC-236: Store and preseve frame buffer within each layer. 2016-03-14 20:22:02 -07:00
Michael Jumper
80b3d51a49 GUAC-236: Add function for copying buffer state. 2016-03-14 20:22:02 -07:00
Michael Jumper
1d4e6ce924 GUAC-236: Fix comparator. Sort in descending order of depth. 2016-03-14 20:22:02 -07:00
Michael Jumper
2e93499383 GUAC-236: Render layers in order (position not yet correct). Output as PNG frames for verification. 2016-03-14 20:22:02 -07:00
Michael Jumper
19814a4c8a GUAC-236: Layers should be parented to default layer by default. 2016-03-14 20:22:02 -07:00
Michael Jumper
e3d0c5e5ef GUAC-236: Do not resize buffers if unnecessary. 2016-03-14 20:22:02 -07:00
Michael Jumper
ba9c1a2efd GUAC-236: Ensure buffers are resized to fit draw operations (unless they are within layers). 2016-03-14 20:22:02 -07:00
Michael Jumper
83beccf7e4 GUAC-236: Ensure rectangle is explicitly set when painting buffers. 2016-03-14 20:22:02 -07:00
Michael Jumper
bd84315824 GUAC-236: Implement PNG decoding using Cairo's built-in PNG functions. 2016-03-14 20:22:02 -07:00
Michael Jumper
a15a86ed00 GUAC-236: Assemble entire image data prior to decoding. Switch to simple decoder function (no struct). 2016-03-14 20:22:02 -07:00
Michael Jumper
3661cadf4e GUAC-236: Implement blob, end, and img instructions. 2016-03-14 20:22:02 -07:00
Michael Jumper
d29d5bbc99 GUAC-236: Add helper functions for invoking stream data/end handlers. 2016-03-14 20:22:02 -07:00
Michael Jumper
f535ccfb54 GUAC-236: Invoke init/free handlers as required. 2016-03-14 20:22:02 -07:00
Michael Jumper
578bedcd07 GUAC-236: Add image stream allocation and management functions. 2016-03-14 20:22:02 -07:00
Michael Jumper
8ff8ccc92b GUAC-236: Free all buffers with appropriate function. 2016-03-14 20:22:02 -07:00
Michael Jumper
5149d6d5c4 GUAC-236: Add decoder search function. 2016-03-14 20:22:02 -07:00
Michael Jumper
083e48d089 GUAC-236: Add stub structure for image decoding. 2016-03-14 20:22:02 -07:00
Michael Jumper
8c0a9b8bc5 GUAC-236: Replace placeholder with required mask and index properties. 2016-03-14 20:22:02 -07:00
Michael Jumper
088f1dfede GUAC-236: Implement copy. 2016-03-14 20:22:02 -07:00
Michael Jumper
96104c099b GUAC-236: Ignore free attempts on NULL buffers. 2016-03-14 20:22:01 -07:00
Michael Jumper
dea754d846 GUAC-236: Handle dispose of buffers. 2016-03-14 20:22:01 -07:00
Michael Jumper
36b625818d GUAC-236: Log protocol violations at WARNING level. 2016-03-14 20:22:01 -07:00
Michael Jumper
d1642cbcba GUAC-236: Cursor must be ignored for now (no mouse position information in recording). 2016-03-14 20:22:01 -07:00
Michael Jumper
ac78b7a7a5 GUAC-236: Implement cfill and rect. 2016-03-14 20:22:01 -07:00
Michael Jumper
160453c3e9 GUAC-236: Implement buffer retrieval functions. 2016-03-14 20:22:01 -07:00
Michael Jumper
9407f8bcde GUAC-236: Layers must default to unparented. 2016-03-14 20:22:01 -07:00
Michael Jumper
a0197ee2c2 GUAC-236: Implement buffer resize. 2016-03-14 20:22:01 -07:00
Michael Jumper
696c3c3184 GUAC-236: Stub resize of buffers. Implement size. 2016-03-14 20:22:01 -07:00
Michael Jumper
314d66727a GUAC-236: Implement alloc/free of layers. Implement shade, move, and dispose. 2016-03-14 20:22:01 -07:00
Michael Jumper
899cdb4c00 GUAC-236: Fully implement sync instruction. Stub timestamp update for display. 2016-03-14 20:22:01 -07:00
Michael Jumper
4634ce391a GUAC-236: Allocate and pass display to all instruction handlers. 2016-03-14 20:22:01 -07:00
Michael Jumper
f286bd92c7 GUAC-236: Add display, buffer, image, and stream abstractions. 2016-03-14 20:22:01 -07:00
Michael Jumper
23af2d3041 GUAC-236: Handle sync instruction. 2016-03-14 20:22:01 -07:00
Michael Jumper
f842d1c0a4 GUAC-236: Parse base64 from blobs. 2016-03-14 20:22:01 -07:00
Michael Jumper
91197ffad2 GUAC-236: Allow instruction handlers to touch the argument values. 2016-03-14 20:22:01 -07:00
Michael Jumper
0e5a7bb5c2 GUAC-236: Add argument parsing stubs to instruction handlers. 2016-03-14 20:22:01 -07:00
Michael Jumper
d530d92651 GUAC-236: Add stub handlers for each required instruction. 2016-03-14 20:22:01 -07:00
Michael Jumper
a926a6dc3b GUAC-236: Handle specific instructions via an opcode/handler mapping. 2016-03-14 20:22:01 -07:00
Michael Jumper
1f54ea10dd GUAC-236: Display DEBUG-level messages for now. 2016-03-14 20:22:01 -07:00
Michael Jumper
c850744faa GUAC-236: Actually parse input files. 2016-03-14 20:22:01 -07:00
Michael Jumper
5e5186be07 GUAC-236: Log failures vs. total files. 2016-03-14 20:22:01 -07:00
Michael Jumper
652ea5ddf9 GUAC-236: Add stub guacenc utility (encode Guacamole protocol to video). 2016-03-14 20:22:01 -07:00
Michael Jumper
35746efca8 GUAC-1389: Document guac_telnet_compile_regex(). 2016-03-14 20:12:55 -07:00
Michael Jumper
9253d877a2 GUAC-1389: Do not handle input events until terminal exists. 2016-03-14 20:05:45 -07:00
Michael Jumper
4faf1829d2 GUAC-1389: Add screen sharing support to telnet. 2016-03-14 19:47:36 -07:00
James Muehlner
3f51d3da02 Merge pull request #123 from glyptodon/fake-merge-screen-sharing-008-ssh
GUAC-1389: Add screen sharing support to SSH.
2016-03-14 18:51:37 -07:00
Michael Jumper
3a4aec3708 GUAC-1389: Document parameters of SSH client thread. 2016-03-14 18:32:03 -07:00
Michael Jumper
fa43a94e02 GUAC-1389: Rely on API definition for handler. 2016-03-14 18:27:52 -07:00
Michael Jumper
7c2766b34b GUAC-1389: Abort correctly if password or keyboard-interactive auth fails (fixes GUAC-1381). 2016-03-14 17:33:17 -07:00
Michael Jumper
075b7ffba9 GUAC-1389: Add screen sharing support to SSH. 2016-03-14 17:33:17 -07:00
James Muehlner
a236e92444 Merge pull request #122 from glyptodon/fake-merge-screen-sharing-007-terminal
GUAC-1389: Update terminal to support screen sharing.
2016-03-14 17:26:12 -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
a101838162 GUAC-1389: Include select layer when syncing. 2016-03-14 16:00:21 -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
James Muehlner
b8c5ccb321 Merge pull request #121 from glyptodon/improve-lag-compensation
GUAC-1389: Stretch RDP and VNC frames until client has caught up.
2016-03-08 19:37:44 -08:00
Michael Jumper
1787683f1b GUAC-1389: Stretch RDP frames until client has caught up. Do same with VNC. Reduce frame timeout to 0 (essentially automatic now). 2016-03-08 18:12:43 -08:00
James Muehlner
aac4efa955 Merge pull request #120 from glyptodon/improve-lag-compensation
GUAC-1389: Include frame rendering time in lag calculations. Sleep only if necessary.
2016-03-08 16:34:29 -08:00
Michael Jumper
6f264f9c31 GUAC-1389: Include frame rendering time in lag calculations. Sleep only if necessary. 2016-03-08 16:21:47 -08:00
James Muehlner
3c572501a9 Merge pull request #119 from glyptodon/fake-merge-screen-sharing-006-rdp
GUAC-1389: Add screen sharing support to RDP.
2016-03-07 21:31:37 -08:00
Michael Jumper
d4d2fe06d9 GUAC-1389: Document RDP frame start timeout. 2016-03-07 21:12:53 -08:00
Michael Jumper
fc5ad6c9cd GUAC-1389: Document static functions. 2016-03-07 16:40:05 -08:00
Michael Jumper
993e8583a6 GUAC-1389: Document enum for RDP args. 2016-03-07 15:42:50 -08:00
Michael Jumper
12f166c0fc GUAC-1389: Update comments to match latest standard. 2016-03-07 15:05:31 -08:00
Michael Jumper
5a6c16ab24 GUAC-1389: Document RDP channel data handler. 2016-03-07 13:10:12 -08:00
Michael Jumper
8ce5e1cab2 GUAC-1389: Correct input.h parameter documention with respect to standards. 2016-03-07 12:43:54 -08:00
Michael Jumper
5a9d68a896 GUAC-1389: Correct documentation surrounding RDPDR callback. 2016-03-07 12:40:53 -08:00
Michael Jumper
c95613f8b7 GUAC-1389: Reference client/user handler types directly. Do not redocument parameters. 2016-03-07 12:37:00 -08:00
Michael Jumper
2f58469f1b GUAC-1389: Do not attempt to free RDP client until client thread finishes. 2016-03-07 11:32:44 -08:00
Michael Jumper
51aaa193f2 GUAC-1389: Allocate sufficient memory for print job close message. 2016-03-07 11:32:44 -08:00
Michael Jumper
eadc3a91a9 GUAC-1389: Two clipboard formats should allocate two cells for said formats. 2016-03-07 11:32:44 -08:00
Michael Jumper
6764196527 GUAC-1389: "any" audio stream, not "an". 2016-03-07 11:32:44 -08:00
Michael Jumper
8ca77c1c78 GUAC-1389: Ensure users that join after a SVC has connected are alerted to its existence. 2016-03-07 11:32:44 -08:00
Michael Jumper
9191e264f8 GUAC-1389: Remove tracking of input pipe (there may be many). 2016-03-07 11:32:44 -08:00
Michael Jumper
d2ca12e88b GUAC-1389: Download only to owner if invoked via the special "Download" folder of the guac drive. 2016-03-07 11:32:44 -08:00
Michael Jumper
e573e59e83 GUAC-1389: Add screen sharing support to RDP. 2016-03-07 11:32:44 -08:00
James Muehlner
21d700f633 Merge pull request #118 from glyptodon/user-validity-race
GUAC-1389: Fix user validity race.
2016-03-04 21:01:01 -08:00
Michael Jumper
70ce9fa96a GUAC-1389: Fix typo in punctuation of documentation for guac_client_for_owner(). 2016-03-04 19:46:21 -08:00
Michael Jumper
432eb57b13 GUAC-1389: Remove guac_common_cursor_remove_user() - no longer needed. 2016-03-04 17:10:49 -08:00
Michael Jumper
9e8790cbba GUAC-1389: Fix race in cursor update when a past user has left the connection. 2016-03-04 17:05:45 -08:00
Michael Jumper
e7ada26f55 GUAC-1389: Provide guac_client_for_user() function which validates user pointers, allowing code to safely store and use guac_user pointers. 2016-03-04 16:44:30 -08:00
James Muehlner
36cabe3d09 Merge pull request #117 from glyptodon/missing-includes
GUAC-1389: Add missing includes for guacd's connection.c
2016-03-04 13:34:18 -08:00
Michael Jumper
4e50603404 GUAC-1389: Add missing includes for guacd's connection.c. 2016-03-04 13:28:52 -08:00
James Muehlner
6da0c0e0b4 Merge pull request #116 from glyptodon/fake-merge-screen-sharing-005-vnc
GUAC-1389: Add screen sharing support to VNC.
2016-03-04 01:02:17 -08:00
Michael Jumper
5f83900ed8 GUAC-1389: Remove dated and incorrect "for now" wording. 2016-03-03 17:56:05 -08:00
Michael Jumper
7f0b0ab1ef GUAC-1389: Document the frame wait timeout (no magic numbers). 2016-03-03 17:39:09 -08:00
Michael Jumper
967affa883 GUAC-1389: guac_vnc_set_pixel_format() is not a callback. 2016-03-03 17:32:51 -08:00
Michael Jumper
551398ae53 GUAC-1389: remote_cursor flag should be a bool. 2016-03-03 17:29:20 -08:00
Michael Jumper
38f1e87334 GUAC-1389: Only free dest_host if repeater is available. 2016-03-03 13:06:31 -08:00
Michael Jumper
05e8bf3195 GUAC-1389: Document settings. Use macros to remove struct members if their settings are not applicable. 2016-03-03 12:58:46 -08:00
Michael Jumper
f6feec8c84 GUAC-1389: Document VNC connection and thread. 2016-03-03 12:36:11 -08:00
Michael Jumper
f5109fe34e GUAC-1389: Document logging functions. 2016-03-03 12:30:31 -08:00
Michael Jumper
c3584c8d04 GUAC-1389: Document graphical functions and handlers. 2016-03-03 12:27:59 -08:00
Michael Jumper
880553bf3e GUAC-1389: Document clipboard handler parameters. 2016-03-03 12:05:41 -08:00
Michael Jumper
58b545293f GUAC-1389: Use function types directly rather than re-documenting the parameters everywhere. 2016-03-03 12:03:47 -08:00
Michael Jumper
4c62b60f71 GUAC-1389: Document VNC password retrieval. 2016-03-03 11:58:21 -08:00
Michael Jumper
d484a98876 GUAC-1389: Add screen sharing support to VNC. 2016-03-03 11:22:32 -08:00
James Muehlner
41a21c9b0c Merge pull request #115 from glyptodon/fix-palette-free
GUAC-1389: Palette must be freed.
2016-03-03 11:15:13 -08:00
James Muehlner
63e9f2bc34 Merge pull request #114 from glyptodon/fix-proc-free
GUAC-1389: Ensure proc is freed and cleaned up, regardless of whether it started properly.
2016-03-03 11:13:59 -08:00
Michael Jumper
e625a7a887 GUAC-1389: Palette must be freed. 2016-03-03 11:06:55 -08:00
Michael Jumper
8e8b632716 GUAC-1389: Ensure proc is freed and cleaned up, regardless of whether it started properly. 2016-03-03 11:00:21 -08:00
James Muehlner
f7b30414fb Merge pull request #113 from glyptodon/fake-merge-screen-sharing-004-guacd
GUAC-1389: Add screen sharing support to guacd.
2016-03-02 21:29:12 -08:00
James Muehlner
4d443efe0f Merge pull request #112 from glyptodon/fix-resource-leaks
GUAC-1389: Fix resource leaks reported by static analysis.
2016-03-02 20:09:47 -08:00
Michael Jumper
b3b5a65923 GUAC-1389: Simply logic surrounding freeaddrinfo(). 2016-03-02 20:09:07 -08:00
Michael Jumper
39fd2c152f GUAC-1389: Document guacd_user_start() and corresponding threads. 2016-03-02 16:37:44 -08:00
Michael Jumper
b169ea0f6e GUAC-1389: Document creation of SSL-wrapped guac_socket. 2016-03-02 16:32:09 -08:00
Michael Jumper
ed44e0c4b0 GUAC-1389: Document process management functions. Remove unnecessary parameter. 2016-03-02 16:26:38 -08:00
Michael Jumper
26bdd9bc38 GUAC-1389: Document client process map manipulation functions. 2016-03-02 15:34:39 -08:00
Michael Jumper
d595d96304 GUAC-1389: Document file descriptor passing functions. 2016-03-02 14:50:34 -08:00
Michael Jumper
1e4a83b3da GUAC-1389: Document daemonization helper functions. 2016-03-02 14:44:15 -08:00
Michael Jumper
cb8fe46328 GUAC-1389: Add missing documentation for connection handling functions. 2016-03-02 14:36:16 -08:00
Michael Jumper
9e7663463f GUAC-1389: Restore guacd within build. Migrate guacd to screen sharing changes. 2016-03-02 12:46:00 -08:00
Michael Jumper
c9346014df GUAC-1389: Release candidate addresses of no connection can be established. 2016-03-02 10:59:03 -08:00
Michael Jumper
e42566816c GUAC-1389: PNG encoder should always release palette storage if an error occurs. 2016-03-02 10:55:37 -08:00
Michael Jumper
15f7fedfea GUAC-1389: Ensure dlopen()'d handle to plugin is released on error. 2016-03-02 10:54:58 -08:00
James Muehlner
873a7a3211 Merge pull request #111 from glyptodon/fake-merge-screen-sharing-003-common-ssh
GUAC-1389: Bring common-ssh up to date with screen sharing changes.
2016-03-01 22:05:41 -08:00
Michael Jumper
48143f6a0a GUAC-1389: Add convenience function for exposing SFTP filesystems to specific users. 2016-03-01 17:28:35 -08:00
Michael Jumper
cb70c6e8b9 GUAC-1389: Bring common-ssh up to date with screen sharing changes. 2016-03-01 17:28:35 -08:00
James Muehlner
0d984f3886 Merge pull request #110 from glyptodon/fake-merge-screen-sharing-002-common
GUAC-1389: Bring common up to date with screen sharing changes.
2016-03-01 17:27:45 -08:00
Michael Jumper
12d5c315bb GUAC-1389: Add missing parameter comments to static functions in common. 2016-03-01 16:46:19 -08:00
Michael Jumper
bbceed5200 GUAC-1389: Bring common headers up-to-date with current style. 2016-03-01 16:40:23 -08:00
Michael Jumper
f393561925 GUAC-1389: Bring common up to date with screen sharing changes. 2016-03-01 16:27:32 -08:00
James Muehlner
03f9cde27c Merge pull request #109 from glyptodon/fake-merge-screen-sharing-001-libguac
GUAC-1389: Refactor libguac to allow screen sharing.
2016-03-01 16:23:44 -08:00
Michael Jumper
14522dab22 GUAC-1389: Add missing documentation for socket handlers. 2016-03-01 13:02:48 -08:00
Michael Jumper
7653fa106e GUAC-1389: Document internal stream management functions. Fix semantics of stream closure. 2016-03-01 12:50:51 -08:00
Michael Jumper
cd006a4066 GUAC-1389: Fix spelling of "markers". 2016-03-01 12:25:04 -08:00
Michael Jumper
1726af0c97 GUAC-1389: Add missing parameter documentation for user-level instruction handlers. 2016-03-01 12:25:04 -08:00
Michael Jumper
dd0cecc7ea GUAC-1389: Add missing parameter comments to user-specific handlers. Clarify purpose of handlers. 2016-03-01 12:25:04 -08:00
Michael Jumper
c3a487f9ec GUAC-1389: Fix spelling of "previously". 2016-03-01 12:25:04 -08:00
Michael Jumper
3734a68a42 GUAC-1389: Fix strange and unnecessary wrapping of line. 2016-03-01 12:25:04 -08:00
Michael Jumper
5ae0da65e1 GUAC-1389: Remove unnecessary blank line. 2016-03-01 12:25:04 -08:00
Michael Jumper
62ccd78122 GUAC-1389: Add missing parameter comments to static handlers of guac_client and the broadcast socket. 2016-03-01 12:25:04 -08:00
Michael Jumper
6d2ddd72a5 GUAC-1389: Add missing parameter comments for client handlers. 2016-03-01 12:25:04 -08:00
Michael Jumper
ea1a34083c GUAC-1389: Explain significance of the type-punning union. 2016-03-01 12:25:04 -08:00
Michael Jumper
76e3b2ebb8 GUAC-1389: Restore libguac's high-level convenience functions for audio streaming. 2016-03-01 12:25:04 -08:00
Michael Jumper
fbe4d53fb1 GUAC-1389: Refactor libguac to allow screen sharing. 2016-03-01 12:24:57 -08:00
James Muehlner
e8cd669be2 Merge pull request #107 from glyptodon/fdset-init
GUAC-1477: Ensure any fd_set used by guac_socket is always properly initialized.
2016-02-01 15:17:29 -08:00
Michael Jumper
c5fd72bb98 GUAC-1477: Ensure any fd_set used by guac_socket is always properly initialized. 2016-02-01 15:14:20 -08:00
James Muehlner
ede0ab1715 Merge pull request #106 from glyptodon/makefile-order
GUAC-1410: Fix keymap ordering in Makefile.am.
2016-02-01 14:56:16 -08:00
Michael Jumper
d0be90e711 GUAC-1410: Fix keymap ordering in Makefile.am. 2016-02-01 14:48:39 -08:00
Mike Jumper
bef52c9496 Merge pull request #98 from moriyoshi/moriyoshi/ja-jp-keymap
GUAC-1410: Add ja-jp keymap
2016-02-01 14:47:46 -08:00
James Muehlner
c42a1dc669 Merge pull request #105 from glyptodon/fix-free-order
GUAC-1451: Fix order of resource release in case typescript creation failure.
2016-01-28 10:52:33 -08:00
Michael Jumper
b35a0c3695 GUAC-1451: Fix order of resource release in case typescript creation failure. 2016-01-28 10:47:04 -08:00
James Muehlner
897ee16e91 Merge pull request #104 from glyptodon/text-recording
GUAC-1452: Implement text recording of terminal sessions.
2016-01-27 13:23:26 -08:00
Michael Jumper
4661f432f0 GUAC-1452: Parse and handle typescript parameters within SSH and telnet. 2016-01-27 12:43:53 -08:00
Michael Jumper
d9dacedbe0 GUAC-1452: Log typescript creation/failure. 2016-01-27 12:43:53 -08:00
Michael Jumper
c68f96741d GUAC-1452: Store filenames within typescript struct. 2016-01-27 12:43:53 -08:00
Michael Jumper
7c7a68975b GUAC-1452: Append .timing to end of basename for timing file. 2016-01-27 12:43:53 -08:00
Michael Jumper
d421bbc075 GUAC-1452: Automatically create directory if requested. 2016-01-27 12:43:53 -08:00
Michael Jumper
e9fb7a67da GUAC-1452: Try and retry the specified filename until success or no further possibilities exist. 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
6297f11724 GUAC-1452: Cap timing entries at a maximum of 24 hours per entry. 2016-01-27 12:43:53 -08:00
Michael Jumper
8a6a2a1156 GUAC-1452: Actually write timestamps to timing file. 2016-01-27 12:43:53 -08:00
Michael Jumper
88a121f81e GUAC-1452: Write required header/footer. 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
cc76f2f4af GUAC-1452: Fix typescript file creation permissions. 2016-01-26 16:42:24 -08:00
Michael Jumper
3f4bac3d04 GUAC-1452: Add base typescript implementation and stubs. 2016-01-25 17:04:15 -08:00
Michael Jumper
ad34aa99b4 GUAC-1452: Add typescript parameters for SSH/telnet. 2016-01-25 13:12:24 -08:00
Moriyoshi Koizumi
d42ac5aca6 GUAC-1410: Add ja-jp keymap 2016-01-19 17:08:34 +09:00
James Muehlner
f49540f436 Merge pull request #103 from glyptodon/terminal-pipe-streams
GUAC-1452: Implement OSC sequence for redirecting output to pipe streams
2016-01-13 21:36:32 -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
01edd8ccd8 GUAC-1452: Implement pipe open/close within OSC. 2016-01-13 10:37:41 -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
528de38359 GUAC-1452: Document terminal char handlers. 2016-01-13 10:37:40 -08:00
Michael Jumper
b869edb0a2 GUAC-1452: Add stub handlers for new pipe OSC codes. 2016-01-13 10:37:40 -08:00
Michael Jumper
97bfcef20d GUAC-1452: Add semicolon to pipe closure terminal code. 2016-01-13 10:37:40 -08:00
Michael Jumper
d03c7452d9 GUAC-1452: Clean up option parsing logic. 2016-01-13 10:37:40 -08:00
Michael Jumper
1200a41bb6 GUAC-1452: Clean up comment style within guacctl. 2016-01-13 10:37:40 -08:00
Michael Jumper
6c0cd22b90 GUAC-1452: Update guacctl defining the terminal codes for controlling pipe streams. 2016-01-13 10:37:40 -08:00
James Muehlner
6c0862e82d Merge pull request #102 from glyptodon/memory-madness
GUAC-1471: Properly calculate heat map dimensions.
2016-01-12 22:54:55 -08:00
Michael Jumper
8b6ca810d9 GUAC-1471: Properly calculate heat map dimensions. 2016-01-12 22:44:28 -08:00
James Muehlner
e2ecdbdcf6 Merge pull request #101 from glyptodon/doxygen-warnings
GUAC-1434: Fix Doxygen warnings.
2015-12-15 16:30:59 -08:00
Michael Jumper
858c4450eb GUAC-1434: Document undocumented function parameters. 2015-12-15 16:14:15 -08:00
Michael Jumper
93c039fbe1 GUAC-1434: Organize Doxyfile and remove all unused/default options. 2015-12-15 15:51:48 -08:00
James Muehlner
23885ba778 Merge pull request #100 from glyptodon/bump-version
GUAC-1392: Bump version to 0.9.9.
2015-12-15 13:16:13 -08:00
Michael Jumper
3e69bc51e7 GUAC-1392: Update libtool version (libguac API has changed and is not 100% compatible with 0.9.8 or older). 2015-12-15 13:11:16 -08:00
Michael Jumper
edd6b9af1c GUAC-1392: Bump version to 0.9.9. 2015-12-15 13:09:42 -08:00
James Muehlner
4d9f1bdef7 Merge pull request #99 from glyptodon/webp-warning
GUAC-1425: Use proper enum constant for WebPConfigPreset().
2015-12-09 13:56:51 -08:00
Michael Jumper
c7c4010306 GUAC-1425: Use proper enum constant for WebPConfigPreset(). 2015-12-09 13:44:54 -08:00
James Muehlner
7e78ac1eb9 Merge pull request #97 from glyptodon/hyper-v
GUAC-363: Add support for the RDP preconnection PDU (and thus Hyper-V)
2015-11-03 20:14:26 -08:00
James Muehlner
b473ce4f95 Merge pull request #96 from glyptodon/load-rdpsnd-with-rdpdr
GUAC-1196: Always load RDPSND with RDPDR.
2015-11-03 20:09:36 -08:00
Michael Jumper
5d608b3500 GUAC-363: Warn of invalid preconnection IDs. 2015-11-03 15:41:28 -08:00
Michael Jumper
b47cff044e GUAC-363: Set preconnection BLOB and ID if supported by FreeRDP and specified within connection parameters. 2015-11-03 13:36:58 -08:00
Michael Jumper
7fdbc45575 GUAC-1196: The close handler should do nothing - it is not a stub. 2015-11-02 17:18:30 -08:00
Michael Jumper
63f3652c54 GUAC-1196: Document RDPSND message handlers. 2015-11-02 17:15:35 -08:00
Michael Jumper
c3e2754ec4 GUAC-1196: Load RDPSND if RDPDR is loaded, but do not actually handle audio unless enabled. 2015-11-02 16:54:37 -08:00
Michael Jumper
0dddf47af0 GUAC-1196: Use guac_client to access guac_audio_stream rather than storing the audio stream directly. 2015-11-02 15:55:52 -08:00
Mike Jumper
f9cc90307b Merge pull request #89 from frenche/listen_once
GUAC-1361: listen() need not be present in main loop
2015-11-02 11:56:00 -08:00
James Muehlner
5c6ad497f4 Merge pull request #95 from glyptodon/ssh-command
GUAC-1038: Add support for running specific commands via SSH
2015-10-20 11:56:17 -07:00
Michael Jumper
e8b98abfc4 GUAC-1038: Add support for running specific commands via SSH (instead of a shell). 2015-10-19 15:58:44 -07:00
James Muehlner
64f47dada0 Merge pull request #94 from glyptodon/keep-alive-init
GUAC-1374: socket->__keep_alive_enabled MUST be initialized
2015-10-19 11:58:47 -07:00
Michael Jumper
364987b159 GUAC-1374: The keep alive ping is disabled by default. 2015-10-19 11:55:18 -07:00
Mike Jumper
8a91965b07 Merge pull request #92 from flangelo/encoding_artifacts
GUAC-1366: Adjust WebP and JPEG image sizes before compressing to avo…
2015-10-19 11:48:39 -07:00
Mike Jumper
0f2041ee5c Merge pull request #91 from flangelo/jpeg_if_bmp_large_enough
GUAC-1365: Don't send JPEG image refreshes if the image size is less …
2015-10-19 11:46:34 -07:00
James Muehlner
3ebd780872 Merge pull request #93 from glyptodon/video-stream
GUAC-1354: Remove duration from video instruction.
2015-10-19 11:42:17 -07:00
Michael Jumper
a1c1fa104b GUAC-1354: Remove duration from video instruction. 2015-10-18 22:08:45 -07:00
Frode Langelo
670c6b766e GUAC-1365: Don't send JPEG image refreshes if the image size is less than 4096 pixels. WebP decision should not include the size check. 2015-10-16 16:46:10 +00:00
Frode Langelo
69a7b8c066 GUAC-1366: Adjust WebP and JPEG image sizes before compressing to avoid artifacts on the edges of the images 2015-10-06 22:31:58 +00:00
James Muehlner
6a7b397110 Merge pull request #88 from glyptodon/copy-mimetypes
GUAC-1305: Copy mimetypes - do not just point instruction storage
2015-10-02 23:47:34 -07:00
James Muehlner
3dddc8c5a4 Merge pull request #90 from glyptodon/new-media-streams
GUAC-1354: Implement raw encoder.
2015-10-02 23:42:39 -07:00
Michael Jumper
e7ab5b50ab GUAC-1354: Remove old Ogg encoder. 2015-10-02 17:16:47 -07:00
Michael Jumper
7cf2005f5b GUAC-1354: Replace WAVE encoder with raw PCM encoder. Partially migrate to new audio streaming (Ogg not yet migrated). 2015-10-02 17:16:47 -07:00
Isaac Boukris
61b01299b2 GUAC-1361: listen() need not be present in main loop
See GUAC-1361.

Signed-off-by: Isaac Boukris <iboukris@gmail.com>
2015-09-28 04:06:39 +03:00
Michael Jumper
653751e2f5 GUAC-1305: Copy mimetypes into client structure. Instruction contents CANNOT be relied upon after new instruction data is read (the argv, etc. buffers are reused and shared). 2015-09-24 12:45:14 -07:00
Michael Jumper
9a3a1bdcde GUAC-1305: Mimetype pointers need not be const. 2015-09-24 12:45:07 -07:00
James Muehlner
602285be35 Merge pull request #87 from glyptodon/webp-lossless
GUAC-1305: Support lossless WebP within encoder.
2015-09-22 12:20:01 -07:00
Michael Jumper
1211c366bf GUAC-1305: Support lossless WebP within encoder. 2015-09-22 12:17:26 -07:00
James Muehlner
e03c51c96a Merge pull request #86 from glyptodon/webp-support
GUAC-1305: Add support for WebP
2015-09-21 09:54:28 -07:00
Michael Jumper
3597a20890 GUAC-1305: Clean up WebP encoder. 2015-09-20 21:06:46 -07:00
Michael Jumper
0dd4d9b9fa GUAC-1305: Send WebP images in preference to JPEG when supported. 2015-09-20 18:58:30 -07:00
Michael Jumper
be64fd23c7 GUAC-1305: Add functions for checking WebP support and streaming WebP images. 2015-09-20 18:53:19 -07:00
Michael Jumper
092d8533db GUAC-1305: Correct informational message regarding WebP support. 2015-09-20 18:24:34 -07:00
Frode Langelo
42dba743eb GUAC-1305: Add support for WebP encoded images. Added optional dependency on libwebp. 2015-09-20 18:12:41 -07:00
James Muehlner
fdc40a9315 Merge pull request #84 from glyptodon/image-handshake
GUAC-1305: Add image mimetypes to Guacamole protocol handshake.
2015-09-20 17:37:30 -07:00
Michael Jumper
c57abf3411 GUAC-1305: Add image mimetypes to Guacamole protocol handshake. 2015-09-20 16:15:13 -07:00
Mike Jumper
24cbf72388 Merge pull request #74 from flangelo/num_keypad_map
GUAC-1314: Add mapping of numeric keypad operators to the base RDP keymap.
2015-09-20 14:22:06 -07:00
James Muehlner
dc9092be94 Merge pull request #83 from glyptodon/fix-false-warning
GUAC-240: Ensure initialization of last_pixel is obvious.
2015-09-18 11:46:32 -07:00
Michael Jumper
7cb632c5c9 GUAC-240: Ensure initialization of last_pixel is obvious. 2015-09-18 11:38:22 -07:00
James Muehlner
f17fbf28ea Merge pull request #82 from glyptodon/experimental
GUAC-240 / GUAC-1290: Merge experimental JPEG streaming changes
2015-09-17 14:57:20 -07:00
Michael Jumper
4e97843ef0 Merge branch 'master' into experimental
Conflicts:
	src/common/guac_surface.c
2015-09-14 14:19:54 -07:00
James Muehlner
5cbd9d2262 Merge pull request #80 from glyptodon/sftp-errors
GUAC-1323: Send proper Guacamole protocol status codes for SFTP errors.
2015-09-06 21:45:55 -07:00
Michael Jumper
ab4af86c7b GUAC-1323: Send proper Guacamole protocol status codes for SFTP errors. 2015-09-06 13:39:08 -07:00
James Muehlner
ee9935bab7 Merge pull request #79 from glyptodon/pulse-latency
GUAC-427: Ensure socket is flushed when audio buffer is flushed.
2015-09-04 19:11:02 -07:00
Michael Jumper
afb671c594 GUAC-427: Ensure socket is flushed when audio buffer is flushed. 2015-09-04 18:58:21 -07:00
James Muehlner
487dc3dc46 Merge pull request #78 from glyptodon/pulseaudio-silence
GUAC-427: Avoid sending silence received from PulseAudio.
2015-09-04 13:49:47 -07:00
Michael Jumper
927ceb99dd GUAC-427: Fix const-ness of pointer. 2015-09-04 13:47:21 -07:00
Michael Jumper
47b060d6eb GUAC-427: Avoid sending silence received from PulseAudio. 2015-09-04 13:40:51 -07:00
James Muehlner
5c4c0378b3 Merge pull request #77 from glyptodon/bump-version
GUAC-1280: Bump version numbers to 0.9.8. Update libtool versioning.
2015-09-04 13:33:43 -07:00
Michael Jumper
037f5bc514 GUAC-1280: Bump version numbers to 0.9.8. Update libtool versioning. 2015-09-04 13:30:51 -07:00
James Muehlner
c02ade76ca Merge pull request #75 from glyptodon/fix-makefile-indent
GUAC-1297: Remove indentation / use tabs where required by Makefile standard.
2015-09-04 13:29:56 -07:00
James Muehlner
a7d57ac3d2 Merge pull request #76 from glyptodon/merge-img-support
GUAC-240 / GUAC-1280: Merge img support
2015-09-04 13:29:27 -07:00
Michael Jumper
3d888c2eb5 GUAC-240: Byte order of pixels is BGR, not BRG. 2015-09-04 13:01:06 -07:00
Michael Jumper
96bae8bd9a GUAC-240: No longer need to test for jpeg_mem_dest(). 2015-09-04 12:59:07 -07:00
Michael Jumper
08cadba16d GUAC-240: Remove guac_protocol_send_png() and guac_protocol_send_jpeg(). 2015-09-04 12:59:00 -07:00
Michael Jumper
59f440209c GUAC-240: Add function for streaming JPEG images via img instruction. 2015-09-04 12:58:47 -07:00
Michael Jumper
7aff3a257a GUAC-240: Move JPEG encoder to own file, writing directly to an img stream. 2015-09-04 12:58:39 -07:00
Michael Jumper
f79c661192 GUAC-240: Add function for streaming PNG images via img instruction. Use for surface. 2015-09-04 12:58:29 -07:00
Michael Jumper
8f2d6f2975 GUAC-240: Force flush at end of PNG write. 2015-09-04 12:58:22 -07:00
Michael Jumper
d07d8ba2d2 GUAC-240: Associate Guacamole client with surface. 2015-09-04 12:58:13 -07:00
Michael Jumper
364d2842ab GUAC-240: Move PNG encoder to own file, writing directly to an img stream. 2015-09-04 12:58:05 -07:00
Michael Jumper
74728d2944 GUAC-1297: Remove indentation / use tabs where required by Makefile standard. 2015-09-04 11:55:30 -07:00
Frode Langelo
9fceb58444 GUAC-1314: Add mapping of numeric keypad operators to base RDP keymap 2015-09-03 15:52:37 +00:00
James Muehlner
2e72d4c9e3 Merge pull request #73 from glyptodon/send-iac-brk
GUAC-1296: Send IAC BRK when Pause, Break, or Ctrl+0 are pressed.
2015-08-23 20:53:41 -07:00
Michael Jumper
3bcb9863e7 GUAC-1296: Send IAC BRK when Pause, Break, or Ctrl+0 are pressed. 2015-08-23 16:21:50 -07:00
Michael Jumper
08cfde7678 GUAC-1296: Stub Pause / Break / Ctrl+0 key handling within telnet client. 2015-08-23 16:10:51 -07:00
James Muehlner
22a307f422 Merge pull request #71 from glyptodon/adaptive-jpeg
GUAC-240: Implement adaptive JPEG encoding
2015-08-18 11:31:53 -07:00
Michael Jumper
5dc5a9dbca GUAC-240: Rename optimality function to match convention used elsewhere in this file. 2015-08-17 16:14:57 -07:00
Michael Jumper
16fd8f6c7d GUAC-240: Fix buffer error in calculation of framerate. Clarify naming. 2015-08-17 16:09:40 -07:00
Michael Jumper
c604777622 GUAC-240: Remove unused macros. 2015-08-17 16:04:07 -07:00
Michael Jumper
62572073b0 GUAC-240: Dynamically allocate heat map. Throw away heat map during resize. 2015-08-17 16:02:19 -07:00
Michael Jumper
cc21092ac2 GUAC-240: Remove unnecessary change to PNG function. 2015-08-17 11:11:30 -07:00
Michael Jumper
2d66ae87f9 GUAC-240: Improve PNG optimality approximation algorithm (count average run length). 2015-08-17 11:02:18 -07:00
Michael Jumper
b0db2c210f GUAC-240: Remove now-unused structure member. 2015-08-17 08:38:41 -07:00
Michael Jumper
b6a2de8a97 GUAC-240: Remove whitespace changes. 2015-08-17 08:37:43 -07:00
Michael Jumper
adcb887efb GUAC-240: Correct PNG optimality calculations. 2015-08-17 08:30:23 -07:00
Michael Jumper
b56afd8bb8 GUAC-240: Approximate whether images will compress well with JPEG vs. PNG. 2015-08-17 06:29:30 -07:00
Michael Jumper
f7cb3d56e9 GUAC-240: Update function documentation. Remove unused macros. 2015-08-17 01:51:03 -07:00
Michael Jumper
dd2e020351 GUAC-240: Move JPEG optimality test into own function. 2015-08-17 01:44:31 -07:00
Michael Jumper
baf01d5524 GUAC-240: Flush to JPEG if dirty rect is hot. 2015-08-17 01:34:32 -07:00
Michael Jumper
26f9070d99 GUAC-240: Restore flush to PNG. Simplify handling of flush. Remove lossy pipeline. 2015-08-17 01:27:09 -07:00
Michael Jumper
807e3a39a5 GUAC-240: Simplify and clarify update history tracking. Remove lossless refresh of previously-lossy updates for now. 2015-08-17 01:13:59 -07:00
Michael Jumper
254a0dded0 GUAC-240: Remove need for forward declarations of static functions. 2015-08-14 10:54:59 -07:00
Frode Langelo
379c4462ca GUAC-240: Implement adaptive encoding. Build a heat map of the screen, and use lossy image compression for areas refreshing frequently. Once refresh frequency is reduced the lossy area is repainted with a lossless image. 2015-08-14 10:54:59 -07:00
Michael Jumper
fde6abe98b GUAC-240: Byte order of pixels is BGR, not BRG. 2015-08-13 16:38:54 -07:00
Frode Langelo
9edf33da2e GUAC-1290: Change GUAC_VNC_FRAME_TIMEOUT to 10 so more VNC messages are handled in each frame. 2015-08-13 16:38:54 -07:00
Michael Jumper
29527509de GUAC-240: No longer need to test for jpeg_mem_dest(). 2015-08-13 16:38:54 -07:00
Michael Jumper
78b7b73e78 GUAC-240: Remove guac_protocol_send_png() and guac_protocol_send_jpeg(). 2015-08-13 16:38:54 -07:00
Michael Jumper
1263965511 GUAC-240: Add function for streaming JPEG images via img instruction. 2015-08-13 16:38:54 -07:00
Michael Jumper
995373e74b GUAC-240: Move JPEG encoder to own file, writing directly to an img stream. 2015-08-13 16:38:54 -07:00
Michael Jumper
9c2d7f56ce GUAC-240: Add function for streaming PNG images via img instruction. Use for surface. 2015-08-13 16:38:54 -07:00
Michael Jumper
56fa7423f3 GUAC-240: Force flush at end of PNG write. 2015-08-13 16:38:53 -07:00
Michael Jumper
859f7d9340 GUAC-240: Associate Guacamole client with surface. 2015-08-13 16:38:53 -07:00
Michael Jumper
e73ef09fdd GUAC-240: Move PNG encoder to own file, writing directly to an img stream. 2015-08-13 16:38:53 -07:00
Michael Jumper
8ff071bf04 Fix botched merge conflict resolution. 2015-08-13 16:38:28 -07:00
Michael Jumper
48bbc6a898 Merge branch 'testing-common-ssh'
Conflicts:
	src/protocols/rdp/client.c
2015-08-13 16:29:22 -07:00
James Muehlner
0bfacb3d55 Merge pull request #70 from glyptodon/sftp-default-directory
GUAC-1292: Use "sftp-directory" for default upload directory, if specified, for both VNC and RDP.
2015-08-13 16:27:29 -07:00
Michael Jumper
d85ed5f85f GUAC-1292: Use "sftp-directory" for default upload directory, if specified, for both VNC and RDP. 2015-08-13 16:21:15 -07:00
Mike Jumper
a64ed2bf72 Merge pull request #64 from flangelo/adaptive_jpeg
GUAC-240: New rectangle helper methods and utilities which will be us…
2015-08-07 23:55:28 -07:00
James Muehlner
f7137f42ad Merge pull request #65 from glyptodon/libjpeg6b-compat
GUAC-1285: Add support for libjpeg6b
2015-08-07 11:06:22 -07:00
Michael Jumper
7bb798e40b GUAC-1285: Implement jpeg_mem_dest() for platforms that lack it. 2015-08-07 17:39:10 +00:00
Michael Jumper
09de5d162f GUAC-1285: Add configure test for jpeg_mem_dest(). 2015-08-07 16:41:33 +00:00
Frode Langelo
385808c7a1 GUAC-240: New rectangle helper methods and utilities which will be used by adaptive encoding. Rectangle helper unit tests. 2015-08-06 17:19:35 -07:00
James Muehlner
0d1396c815 Merge pull request #63 from glyptodon/jpeg-instruction
GUAC-240: Implement support for JPEG instruction.
2015-08-05 22:30:19 -07:00
Michael Jumper
a52b285f45 GUAC-240: Fix typo - should be JPEG, not JOEG. 2015-08-05 22:02:54 -07:00
Frode Langelo
240867a432 GUAC-240: Make JPEG quality a parameter to methods. Reorder JPEG_LIBS in LDFLAGS 2015-08-05 15:16:27 -07:00
Frode Langelo
c27e2997dd GUAC-240: Implement support for JPEG server protocol and image compression. 2015-08-05 15:16:26 -07:00
James Muehlner
498844b4e7 Merge pull request #61 from glyptodon/terminal-palette
GUAC-1195: Add color schemes to SSH and telnet.
2015-07-28 17:41:20 -07:00
Michael Jumper
93c151512f GUAC-1195: Migrate to scrollbar style which works against dark OR light backgrounds. 2015-07-28 16:51:01 -07:00
Michael Jumper
677c3ce6e8 GUAC-1195: Add "color-scheme" parameter to SSH and telnet. 2015-07-28 16:46:32 -07:00
Michael Jumper
fa443249c9 GUAC-1195: Use color scheme constants and names. 2015-07-28 16:43:23 -07:00
Michael Jumper
b2c2779465 GUAC-1195: Define and use color constants for terminal. 2015-07-28 16:20:14 -07:00
Michael Jumper
029b3bdb80 GUAC-1195: Configure default foreground/background when terminal is created. 2015-07-28 15:59:20 -07:00
James Muehlner
8935160c72 Merge pull request #60 from glyptodon/create-drive
GUAC-515: Automatically create RDP drive path if requested.
2015-07-28 14:43:22 -07:00
Michael Jumper
fb8f74d2f0 GUAC-515: Add Daryl Borth to list of authors. 2015-07-28 14:43:12 -07:00
Michael Jumper
e8e39fd862 GUAC-515: Add missing include required by mkdir(). 2015-07-28 14:40:35 -07:00
Michael Jumper
736ec7da23 GUAC-515: Clarify comments and formatting. Use simpler mkdir() logic. 2015-07-28 14:36:08 -07:00
Daryl Borth
52084f4f1f GUAC-515: Add new RDP setting, create-drive-path, to create the drive. 2015-07-28 14:26:27 -07:00
James Muehlner
cf0265ecf7 Merge pull request #59 from glyptodon/vnc-encoding
GUAC-298: Configurable VNC clipboard encoding
2015-07-27 19:44:21 -07:00
Michael Jumper
5e4c7de5c7 GUAC-298: Clarify function documentation and naming. Do not simply silently default to ISO8859-1 if encoding is invalid. 2015-07-27 18:19:50 -07:00
Michael Jumper
7bfd7ce0ca GUAC-298: Add missing comment. Update documentation style. 2015-07-27 17:51:03 -07:00
Michael Jumper
80a4d37173 Merge branch 'vnc_clipboard_encoding' of git://github.com/flangelo/guacamole-server into vnc-encoding
Conflicts:
	src/protocols/vnc/client.h
2015-07-27 17:47:26 -07:00
Michael Jumper
615921108a Merge branch 'testing-common-ssh' 2015-07-24 14:25:22 -07:00
James Muehlner
7147649347 Merge pull request #58 from glyptodon/password-segfault
GUAC-1264: Fix segfault in password handling
2015-07-24 14:24:49 -07:00
Michael Jumper
6f48ebe7fe GUAC-1264: Use proper parameter for SFTP password within RDP. 2015-07-24 13:55:10 -07:00
Michael Jumper
ec595b9cff GUAC-1264: Explicitly free users and sessions within VNC and RDP. 2015-07-24 13:55:05 -07:00
Michael Jumper
49beb7d7fd GUAC-1264: Require explicit free for users and sessions. Ensure SSH client data is zeroed upon allocation. 2015-07-24 13:20:36 -07:00
Michael Jumper
f8f16c44a9 GUAC-1264: Validate provided credentials. Log if anything is missing. 2015-07-23 16:28:48 -07:00
Michael Jumper
6fb5277e95 Merge branch 'testing-common-ssh' 2015-07-14 11:20:00 -07:00
James Muehlner
a9a267290e Merge pull request #57 from glyptodon/always-close-fd
GUAC-1171: Always close socket file descriptor when session creation fails.
2015-07-14 11:16:33 -07:00
Michael Jumper
6ae5b94df3 GUAC-1171: Always close socket file descriptor when session creation fails. 2015-07-14 11:15:21 -07:00
Michael Jumper
0d8dad878c Merge branch 'testing-common-ssh' 2015-07-14 11:08:39 -07:00
James Muehlner
da1f2f2ad3 Merge pull request #56 from glyptodon/clean-resources
GUAC-1171: Ensure user and session objects are automatically free'd, and that this is documented.
2015-07-14 11:06:04 -07:00
Michael Jumper
cdefe52c67 GUAC-1171: Ensure user and session objects are automatically free'd, and that this is documented. 2015-07-14 11:02:48 -07:00
James Muehlner
1ecec68a20 Merge pull request #55 from glyptodon/rdp-null-settings
GUAC-1171: RDP settings values may be NULL.
2015-07-14 10:52:53 -07:00
Michael Jumper
df221e05be GUAC-1171: RDP settings values may be NULL, and should not be used as defaults if NULL. 2015-07-14 10:49:06 -07:00
James Muehlner
6f93872e0e Merge pull request #54 from glyptodon/vnc-rdp-sftp
GUAC-1171: Add support for SFTP file transfer to VNC and RDP.
2015-07-13 17:36:07 -07:00
Michael Jumper
46ce69a8a9 GUAC-1171: Do not attempt to read error strings when there may be no such strings available. 2015-07-12 22:36:08 -07:00
Michael Jumper
4d941545cd GUAC-1171: Ensure directory names are null-terminated. 2015-07-12 22:27:02 -07:00
Michael Jumper
1316743b02 GUAC-1171: Do not fall through to DSA if RSA signature fails. 2015-07-12 22:24:26 -07:00
Michael Jumper
3eac35c158 GUAC-1171: Handle socket() error return values. 2015-07-12 22:22:32 -07:00
Michael Jumper
c6191f4539 GUAC-1171: Fix resource leaks. 2015-07-12 22:19:36 -07:00
Michael Jumper
cc717f4112 GUAC-1171: Fix SFTP file upload comments. 2015-07-10 22:41:02 -07:00
Michael Jumper
b770800eda GUAC-1171: Only include common SSH library if enabled. 2015-07-10 22:26:37 -07:00
Michael Jumper
2e5a3606f3 GUAC-1171: Set up handler for "file" instruction for SFTP filesystem, if no other handler is more appropriate. 2015-07-10 22:13:01 -07:00
Michael Jumper
43a534c98b GUAC-1171: Add SFTP filesystem support to RDP. 2015-07-10 22:13:01 -07:00
Michael Jumper
1500e63050 GUAC-1171: Add SFTP filesystem support to VNC. 2015-07-10 22:13:01 -07:00
Michael Jumper
b26aefd487 GUAC-1171: Expose presence/absence of common SSH core with ENABLE_COMMON_SSH macro. 2015-07-10 22:13:01 -07:00
James Muehlner
7c0858b3cb Merge pull request #53 from glyptodon/common-ssh
GUAC-1171: Migrate to common SSH client base
2015-07-10 21:37:49 -07:00
Michael Jumper
bfe4895408 GUAC-1171: Remove extra trailing spaces from parameter comments. 2015-07-10 21:01:17 -07:00
Michael Jumper
5f547a9974 GUAC-1171: Fix naming of guac_common_ssh_buffer_*() functions. 2015-07-10 17:26:04 -07:00
Michael Jumper
3d1d2ea334 GUAC-1171: Migrate to common SSH for SFTP transfers. 2015-07-10 17:21:58 -07:00
Michael Jumper
a6b46a0ea0 GUAC-1171: Add and document SFTP functionality within common SSH. 2015-07-10 17:21:27 -07:00
Michael Jumper
87be5d43ea GUAC-1171: Add missing comments around static functions. Add param and return annotations to existing comments. 2015-07-10 14:20:16 -07:00
Michael Jumper
0fcea2738b GUAC-1171: Migrate to common SSH within client. 2015-07-10 12:46:11 -07:00
Michael Jumper
98503a9fb7 GUAC-1171: Initial refactor to require that user credentials be provided prior to connect. 2015-07-10 02:00:23 -07:00
Michael Jumper
ff287aee52 GUAC-1171: Separate key/password management from SSH connection. Maintain connection information within session object. 2015-07-10 01:31:15 -07:00
Michael Jumper
0a015b2843 GUAC-1171: Add key and buffer helpers. Partially implement private key auth. 2015-07-09 16:17:47 -07:00
Michael Jumper
5b627ae5cc GUAC-1171: Implement SSH connection (without auth). 2015-07-09 12:28:46 -07:00
Michael Jumper
ed70281766 GUAC-1171: Move SFTP functions to own header. 2015-07-09 12:05:57 -07:00
Michael Jumper
fbcf8a1e0d GUAC-1171: Move initialization of SSH, OpenSSL, etc. to common SSH base. 2015-07-09 12:02:31 -07:00
James Muehlner
99308e7044 Merge pull request #51 from glyptodon/frode-author
GUAC-1274: Add Frode Langelo to list of authors.
2015-07-09 11:19:33 -07:00
Michael Jumper
cc6a56234c GUAC-1171: Stub common SSH API. 2015-07-09 01:29:17 -07:00
Michael Jumper
c199cfc8d7 GUAC-1171: Adopt cleaner style for Makefile.am. 2015-07-08 15:39:25 -07:00
Michael Jumper
77cde6ae4b GUAC-1171: Stub out common SSH client within build. 2015-07-08 14:55:18 -07:00
Frode Langelo
d309842055 GUAC-298: Add configuration option to allow for VNC clipboard text encoding override 2015-07-08 14:28:02 -07:00
Michael Jumper
245961d5f9 GUAC-1274: Add Frode Langelo to list of authors. 2015-07-08 12:34:26 -07:00
Mike Jumper
d3f6af5c49 Merge pull request #50 from flangelo/fix_empty_surface_put
GUAC-1247: Fix case where 1x1 pixel surface put with non-dirty data w…
2015-07-08 12:32:12 -07:00
Frode Langelo
9c8756556a GUAC-1247: Fix case where 1x1 pixel surface put with non-dirty data was not ignored 2015-07-08 11:12:34 -07:00
James Muehlner
31e90bcdf4 Merge pull request #49 from glyptodon/rdp-fs
GUAC-1172: Implement filesystem object support for RDP.
2015-07-06 09:42:38 -07:00
Michael Jumper
5e76e11e6a GUAC-1172: Use FreeRDP to define STATUS_* constants, if possible, before falling back to the rest of rdp_status.h. 2015-07-06 00:43:21 -07:00
Michael Jumper
4d7634da9e GUAC-1172: Remove use of stdbool.h and bool from guac_json - FreeRDP is not compatible with use of the standard bool. 2015-07-06 00:43:21 -07:00
Michael Jumper
8a36358e94 GUAC-1172: Implement directory listing, file upload, and file download. 2015-07-06 00:43:21 -07:00
Michael Jumper
fef6cd212b GUAC-1172: Associate guac_object with RDP filesystem. 2015-07-06 00:43:21 -07:00
James Muehlner
637e5e95f7 Merge pull request #48 from glyptodon/common-json
GUAC-1172: Move JSON functions to common.
2015-07-05 18:51:09 -07:00
Michael Jumper
58621ca42b GUAC-1172: Move JSON functions to common. 2015-07-05 18:08:22 -07:00
James Muehlner
413ad23304 Merge pull request #47 from glyptodon/empty-json
GUAC-1172: Ensure empty directories are valid JSON.
2015-07-05 13:01:14 -07:00
Michael Jumper
ddbbcf032a GUAC-1172: Ensure empty directories are valid JSON. 2015-07-05 12:56:10 -07:00
James Muehlner
a6e9e0cfca Merge pull request #46 from glyptodon/ssh-fs
GUAC-1172: Add filesystem object support to SSH/SFTP.
2015-07-01 11:12:42 -07:00
Michael Jumper
054698a3ad GUAC-1172: Append. Do not appaned. 2015-07-01 11:11:07 -07:00
Michael Jumper
42c36f5b84 GUAC-1172: Properly store/free filesystem object. 2015-07-01 10:48:25 -07:00
Michael Jumper
0bbc958373 GUAC-1172: Implement file upload via filesystem object. 2015-07-01 10:48:25 -07:00
Michael Jumper
5fba93594d GUAC-1172: Implement directory listing and file download via filesystem object. 2015-07-01 10:48:25 -07:00
Michael Jumper
482b3a728c GUAC-1172: Simplify filename validation and manipulation. 2015-07-01 10:48:25 -07:00
James Muehlner
6bfd3e46e0 Merge pull request #45 from glyptodon/object-api
GUAC-1172: Implement libguac side of Guacamole protocol objects.
2015-06-23 19:37:40 -07:00
Michael Jumper
60b3386733 GUAC-1172: Add constants for the root object name and the mimetype of a stream index. 2015-06-20 16:07:55 -07:00
Michael Jumper
9321312fce GUAC-1172: Add missing guac_client_alloc_object() and guac_client_free_object() definitions to client.h. 2015-06-20 12:57:23 -07:00
Michael Jumper
95ede7a91d GUAC-1172: Add object alloc/free. Add object index pool. 2015-06-19 14:41:25 -07:00
Michael Jumper
6e3a12b604 GUAC-1172: Implement filesystem, body, and undefine instructions. 2015-06-19 14:35:30 -07:00
Michael Jumper
f7e6deeaf4 GUAC-1172: Add instruction handlers and storage for Guacamole protocol objects. 2015-06-19 14:12:27 -07:00
James Muehlner
df791b057b Merge pull request #44 from glyptodon/object-api
GUAC-1172: Fix indentation within libguac Makefile.am.
2015-06-19 13:55:25 -07:00
Michael Jumper
ce6050b72a GUAC-1172: Fix indentation within libguac Makefile.am. 2015-06-19 13:51:52 -07:00
James Muehlner
f8c3271e0c Merge pull request #43 from glyptodon/rdp-perf-flags
GUAC-835: Add support for all RDP performance flags.
2015-06-15 10:06:01 -07:00
Michael Jumper
29b76243b9 GUAC-835: Add support for all RDP performance flags. 2015-06-12 16:35:38 -07:00
James Muehlner
95ae50478b Merge pull request #41 from glyptodon/terminal-font-dpi
GUAC-1226: Do not rely on Pango/Cairo for DPI handling - simply scale the font size.
2015-06-11 23:33:10 -07:00
Michael Jumper
77536dd68e GUAC-1226: Do not rely on Pango/Cairo for DPI handling - simply scale the font size. 2015-06-11 15:44:53 -07:00
James Muehlner
2e63b42afa Merge pull request #40 from glyptodon/bump-version
GUAC-1174: Update version numbers of man pages.
2015-06-08 17:28:23 -07:00
Michael Jumper
88ae1a26ff GUAC-1174: Update version numbers of man pages. 2015-06-08 17:27:08 -07:00
James Muehlner
09fd6eeffc Merge pull request #39 from glyptodon/bump-version
GUAC-1174: Bump version numbers to 0.9.7.
2015-06-08 17:00:48 -07:00
Michael Jumper
4b9bd1ec30 GUAC-1174: Bump version numbers to 0.9.7. 2015-06-08 16:58:23 -07:00
James Muehlner
bd22c6e383 Merge pull request #35 from glyptodon/client-name
GUAC-346: Add support for specifying the client hostname.
2015-04-14 14:02:30 -07:00
Michael Jumper
be0e1d9b12 GUAC-346: Add support for specifying the client hostname. 2015-04-14 12:39:08 -07:00
James Muehlner
358d41e277 Merge pull request #34 from glyptodon/vnc-clipboard-hang
GUAC-1056: Do not wait for messages if data is within the RFB client buffer.
2015-04-08 08:35:29 -07:00
Michael Jumper
5cb5be6923 GUAC-1056: Do not wait for messages if data is within the RFB client buffer. 2015-04-07 23:44:13 -07:00
James Muehlner
40fd28f86c Merge pull request #32 from glyptodon/italian-keyboard
GUAC-794: Italian keyboard
2015-03-31 11:39:45 -07:00
Michael Jumper
2144aa4f8f GUAC-794: Add missing hash sign to Italian keymap. 2015-03-31 11:31:52 -07:00
Michael Jumper
8b1ecae77f GUAC-794: Add Denis Bernacci to AUTHORS. 2015-03-31 11:19:39 -07:00
Denis Bernacci
07859aba06 GUAC-794: Add Italian keymap. 2015-03-31 11:18:38 -07:00
James Muehlner
00cceaba75 Merge pull request #31 from glyptodon/bump-version
GUAC-1128: Bump version numbers to 0.9.6.
2015-03-25 18:52:38 -07:00
Michael Jumper
b5d1e5aa80 GUAC-1128: Bump version numbers to 0.9.6. 2015-03-23 11:48:48 -07:00
James Muehlner
9b72370399 Merge pull request #30 from glyptodon/bitmap-memory-leak
GUAC-1095: Free any existing bitmap data prior to overwriting the bitmap data pointer.
2015-02-23 21:05:41 -08:00
Michael Jumper
001b8188e8 GUAC-1095: Free any existing bitmap data prior to overwriting the bitmap data pointer. 2015-02-23 20:36:33 -08:00
James Muehlner
b1d6788292 Merge pull request #29 from glyptodon/rdp-profile-segfault
GUAC-1090: Clip operation by surface size when no clipping rectangle is present.
2015-02-20 17:09:21 -08:00
Michael Jumper
732adf9063 GUAC-1090: Clip operation by surface size when no clipping rectangle is present. 2015-02-20 16:53:24 -08:00
James Muehlner
bc5635269d Merge pull request #28 from glyptodon/release-prep
GUAC-1018: Update guacamole-server for 0.9.5 release.
2015-02-15 18:53:44 -08:00
Michael Jumper
b4165f9773 GUAC-1018: Bump version numbers to 0.9.5. 2015-02-15 17:19:29 -08:00
Michael Jumper
4c1cdeb19f GUAC-1018: Update AUTHORS file. 2015-02-15 17:16:33 -08:00
Mike Jumper
12a1ae10b8 Merge pull request #22 from rvecchio/patch-1
GUAC-570: Solves the issue of blank pages occuring inside generated PDFs having 11 or more pages
2015-02-11 14:43:30 -08:00
James Muehlner
b92d2baa91 Merge pull request #27 from glyptodon/freerdp-dso-compat
GUAC-1005: Include libfreerdp-core in test for freerdp_channels_new()
2015-02-09 17:32:20 -08:00
Michael Jumper
61fde22b41 GUAC-1005: Include libfreerdp-core in test for freerdp_channels_new(). The function is not always included in libfreerdp-client, and its absence can result in libfreerdp-client not being linked in. 2015-02-09 16:24:00 -08:00
rvecchio
efe95748b7 GUAC-570 blank pages inside the generated PDFs 2015-02-09 10:03:05 +01:00
James Muehlner
7b6089481c Merge pull request #26 from glyptodon/terminal-resize-segfault
GUAC-1028: Fix race condition on terminal resize.
2015-02-05 18:23:10 -08:00
Michael Jumper
da367b373f GUAC-1028: Fix race condition on terminal resize. 2015-02-05 17:21:33 -08:00
James Muehlner
348dc9a1ba Merge pull request #25 from glyptodon/terminal-packet
GUAC-803: Make terminal updates more efficient
2015-02-04 19:35:50 -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
James Muehlner
4ab6466226 Merge pull request #24 from glyptodon/terminal-scrollbar
GUAC-803: Add mouse support to scrollbar
2015-02-04 19:21:58 -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
Michael Jumper
0a7f13ab5c GUAC-803: Calculate new scrollbar value based on mouse position. 2015-02-04 00:21:19 -08:00
Michael Jumper
f26c9443dc GUAC-803: Handle mouse events within scrollbar. 2015-02-03 23:51:04 -08:00
James Muehlner
04a11f1343 Merge pull request #21 from glyptodon/terminal-scrollbar
GUAC-803: Add scrollbar to right of terminal display.
2015-01-29 14:32:14 -08:00
Michael Jumper
d5b7baab75 GUAC-803: Restrict display area to left of scrollbar. 2015-01-28 17:06:18 -08:00
Michael Jumper
0f4e45e39d GUAC-803: Separate scrollbar graphical update from state update. 2015-01-28 16:43:03 -08:00
Michael Jumper
1218a18bf4 GUAC-803: It's a handle, not a box. Well, OK, it is a technically also a box... but that's not the point. 2015-01-28 15:41:12 -08:00
Michael Jumper
65e0265fa0 GUAC-803: Improve style of scrollbar. 2015-01-27 16:36:28 -08:00
Michael Jumper
4018f2c40f GUAC-803: Update rendering of scrollbar as terminal display is scrolled or resized. Position and scale inner box of scrollbar appropriately. 2015-01-26 15:51:50 -08:00
Michael Jumper
3529bd7664 GUAC-803: Allocate/free and draw scrollbar. Reposition scrollbar when terminal is resized. 2015-01-26 13:47:02 -08:00
Michael Jumper
0996a6a186 GUAC-803: Stub out terminal scrollbar API. 2015-01-26 12:52:30 -08:00
James Muehlner
f3c732597b Merge pull request #20 from glyptodon/terminal-display-layer
GUAC-803: Move display into separate layer.
2015-01-25 17:51:36 -08:00
Michael Jumper
569f4adbac GUAC-803: Move display into separate layer, always size default layer perfectly. 2015-01-25 16:27:04 -08:00
James Muehlner
37037b6f8b Merge pull request #19 from glyptodon/freerdp-beta-compat
GUAC-994: Fix build against 1.2.0-beta1+android9.
2015-01-23 16:18:14 -08:00
Michael Jumper
959a7a202d GUAC-994: Add support for interleaved_decompress() and planar_decompress() variants in FreeRDP 1.2.0-beta1+android9. Use working color conversion function (old one is present but will not work in 1.2.0). 2015-01-23 15:08:00 -08:00
James Muehlner
1588248d14 Merge pull request #18 from glyptodon/contrib
GUAC-1011: Add CONTRIBUTING file and fix the README.
2015-01-20 21:14:45 -08:00
Michael Jumper
54d21f9cd8 GUAC-1011: Add CONTRIBUTING file describing how to contribute to the Guacamole project. Update README. 2015-01-20 21:12:47 -08:00
James Muehlner
e96020e35c Merge pull request #17 from glyptodon/terminal-regression
GUAC-1008: Properly init clipping rectangle.
2015-01-17 10:05:15 -08:00
Michael Jumper
67ed8c5791 GUAC-1008: Properly init clipping rectangle. 2015-01-15 17:03:26 -08:00
James Muehlner
122de48368 Merge pull request #16 from glyptodon/fix-clip-rect
GUAC-996: Do not reset clip upon resize. Fix copy of surface data.
2015-01-14 16:15:49 -08:00
Michael Jumper
75f0fc7807 GUAC-996: Do not reset clip upon resize. Fix copy of surface data. 2015-01-09 16:00:03 -08:00
James Muehlner
7f892341e5 Merge pull request #14 from glyptodon/bump-version
GUAC-938: Bump version numbers for 0.9.4.
2015-01-06 21:42:47 -08:00
Michael Jumper
065e0fe462 GUAC-938: Bump version numbers for 0.9.4. 2015-01-06 15:23:01 -08:00
James Muehlner
33bfbe53af Merge pull request #13 from glyptodon/fix-key-import
GUAC-974: Add logging and error reporting to avoid key confusion.
2015-01-04 19:59:43 -08:00
Michael Jumper
5fe8917bdc GUAC-974: Log reason for auth key failures. Add debug logging. 2015-01-04 19:56:32 -08:00
Michael Jumper
0b0c2aae93 GUAC-974: Auth key failures should abort as UNAUTHORIZED. 2015-01-04 19:17:40 -08:00
James Muehlner
b35d8dd8b2 Merge pull request #10 from glyptodon/rdp-disp-interval
GUAC-949: Increase display update interval to 500 ms.
2014-12-06 17:56:31 -08:00
Michael Jumper
a5715ae3e0 GUAC-949: Increase display update interval to 500 ms. 2014-12-06 17:32:03 -08:00
James Muehlner
82e26aaca2 Merge pull request #9 from glyptodon/rdp-aspect-ratio
GUAC-947: Maintain aspect ratio when size is adjusted.
2014-12-05 16:57:03 -08:00
Michael Jumper
37276c081b GUAC-947: Maintain aspect ratio when size is adjusted to conform with Display Update specs. 2014-12-05 15:30:51 -08:00
James Muehlner
955dba4498 Merge pull request #7 from glyptodon/swedish-keymap
GUAC-930 - Implement Swedish keymap
2014-12-04 20:49:18 -08:00
James Muehlner
cbab9e2efb Merge pull request #8 from glyptodon/fix-rdp-segfault
GUAC-945: Do not attempt to load drdynvc unless Display Update is in use.
2014-12-03 16:01:36 -08:00
Michael Jumper
ca0107ba54 GUAC-945: Do not attempt to load drdynvc unless Display Update is in use. The interface of drdynvc is too different in versions of FreeRDP lacking Display Update. 2014-12-03 15:43:39 -08:00
James Muehlner
7ef33e5901 Merge pull request #5 from glyptodon/resize-with-dpi
GUAC-936: Use initial resolution for all future resizing of display.
2014-12-01 11:23:43 -08:00
Michael Jumper
05d1b8864c GUAC-930: Add Swedish keymap. 2014-11-28 19:35:30 -08:00
Michael Jumper
6fc1699d86 GUAC-930: Log keysyms which are sent via Unicode. 2014-11-28 19:21:10 -08:00
James Muehlner
f948dd62a8 Merge pull request #6 from glyptodon/improve-logging
GUAC-911: Expand logging within SSH and telnet.
2014-11-28 18:41:54 -08:00
Michael Jumper
4b53f9f3a6 GUAC-911: Expand logging within SSH and telnet. 2014-11-28 17:20:02 -08:00
Michael Jumper
6ea36b5a27 GUAC-936: Use initial resolution for all future resizing of display. Suggest reasonable resolution only if resolution of display is not provided/forced. 2014-11-26 15:35:22 -08:00
James Muehlner
ea64fd51ff Merge pull request #4 from glyptodon/limit-resize-freq
GUAC-935: Only update display size if it's been longer than 250ms.
2014-11-25 22:55:00 -08:00
Michael Jumper
6cd161a02d GUAC-935: Document parameters of newly-added functions. 2014-11-25 22:53:22 -08:00
Michael Jumper
d85a18c24d GUAC-935: Add missing headers. Fix test for PubSub. 2014-11-25 22:11:43 -08:00
Michael Jumper
904fcfe75a GUAC-935: Only update display size if it's been longer than 250ms. 2014-11-25 02:20:54 -08:00
Michael Jumper
eff4644a00 GUAC-888: Init socket last_write_timestamp during alloc, otherwise keep-alive math fails until data has been written, which may result in the keep-alive never being sent. 2014-11-22 17:23:01 -08:00
Michael Jumper
4cbb4001fc GUAC-865: Allow client-requested DPI to be overridden. 2014-11-21 16:45:47 -08:00
Michael Jumper
b812cc19a9 GUAC-865: Establish lock before sending size update. 2014-11-21 15:46:50 -08:00
Michael Jumper
2aec59dd23 GUAC-865: Do not log newline characters. 2014-11-21 14:25:05 -08:00
Michael Jumper
1fc80182a3 GUAC-865: rdpSettings may not have SupportDisplayControl, even if freerdp/client/disp.h is present. 2014-11-21 13:51:01 -08:00
Michael Jumper
a0e1e5f0c6 GUAC-865: Initial support for display update. 2014-11-21 13:30:24 -08:00
Michael Jumper
fdc21d3184 GUAC-865: Check for display update support. 2014-11-21 12:42:50 -08:00
Michael Jumper
7064e12959 GUAC-852: Use rdpContext.codecs as a basis for determining whether FreeRDP uses _aligned_malloc() internally. 2014-11-20 21:41:38 -08:00
Michael Jumper
98195e606a GUAC-852: Abstract away color conversion. 2014-11-20 21:07:22 -08:00
Michael Jumper
f401597f10 GUAC-852: Use old bitmap_decompress if no codecs in context. Restore use of freerdp_image_flip. 2014-11-20 21:07:18 -08:00
Michael Jumper
7fae39b593 GUAC-852: Refactor bitmap_decompress within guac_rdp_bitmap_decompress. 2014-11-20 18:49:47 -08:00
Michael Jumper
7449543461 GUAC-852: Store raw ARGB32 palette internally, for future use in conversions. 2014-11-20 18:35:17 -08:00
Michael Jumper
3171da9e09 GUAC-852: Use freerdp_image_copy instead of freerdp_image_flip. 2014-11-20 18:01:58 -08:00
Michael Jumper
fc6758ffdf GUAC-852: Use freerdp_convert_gdi_order_color() for color conversion. 2014-11-20 18:01:05 -08:00
Michael Jumper
e2c28d9240 GUAC-852: Add bitmap_decompress implementation (partial stub - will not work with older FreeRDP). 2014-11-20 17:56:56 -08:00
Michael Jumper
450db1657e GUAC-852: Make checks for FreeRDP libs non-fatal. Additionally check for libfrerdp + libfreerdp-client (replaces libfreerdp-core on master). 2014-11-20 12:25:26 -08:00
Michael Jumper
f18d9ae831 GUAC-911: Replace old GUAC_RDP_DEBUG with calls to guac_client_log(). 2014-11-12 13:35:25 -08:00
Michael Jumper
c0eb7df97a GUAC-911: Log FreeRDP plugin load failures to warning level. 2014-11-12 12:02:38 -08:00
Michael Jumper
374a43b27a GUAC-923: Rename bounds_rect to clip_rect. Add function which restricts rects to surface bounds, distinct from the previous badly-named function which restricted rects to the clipping rect. 2014-11-10 10:26:00 -08:00
Michael Jumper
3b266b9f05 GUAC-911: Simplify guacd logging. Log to appropriate log levels. 2014-11-10 00:26:21 -08:00
Michael Jumper
24aa865ce2 GUAC-911: Align STDERR log messages at tabs. 2014-11-09 23:39:26 -08:00
Michael Jumper
6081ce6fa4 GUAC-911: Greatly increase available values for guac_error. Remove use of guac_error by non-library code. 2014-11-09 22:59:53 -08:00
Michael Jumper
3c83f61637 GUAC-911: Clean up logging in guacd. 2014-11-09 22:51:40 -08:00
Michael Jumper
f8484c0e1e GUAC-911: Log to STDERR always. 2014-11-09 21:00:59 -08:00
Michael Jumper
661193fcb0 GUAC-911: Add debug messages to common pieces dealing with guac_client. 2014-11-09 20:44:49 -08:00
Michael Jumper
614ba62980 GUAC-911: Removing use of logging from libguac. 2014-11-09 20:32:00 -08:00
Michael Jumper
f865656991 GUAC-911: Add and document log level option for guacd. 2014-11-09 19:47:11 -08:00
Michael Jumper
3ff5d5d690 GUAC-911: Separate parsing of level name into own function. 2014-11-09 19:39:11 -08:00
Michael Jumper
4b92233084 GUAC-911: Use guacd namespace. Replace log_prefix with macro. Use same log name for all. 2014-11-09 17:09:35 -08:00
Michael Jumper
c3f98b388a GUAC-911: Only log up to specified log level. Add comments to log.h. 2014-11-09 17:04:25 -08:00
Michael Jumper
049c366b78 GUAC-911: Add config file option for log levels. 2014-11-09 17:00:16 -08:00
Michael Jumper
f71067b024 GUAC-911: Reduce available log levels to ERROR, WARNING, INFO, and DEBUG. 2014-11-08 20:19:12 -08:00
Michael Jumper
431fd2de6f GUAC-911: Add log levels. Refactor guac_client_log_*() into guac_client_log(). 2014-11-07 16:32:19 -08:00
Michael Jumper
5f308c9f31 GUAC-891: Ensure updates are clipped within surface bounds. 2014-10-16 18:55:43 -07:00
Michael Jumper
0af6c7d22a GUAC-874: Load RDPDR and set device redirection if audio enabled. 2014-10-05 15:16:28 -07:00
Michael Jumper
3b8e2a5528 GUAC-874: Remove detection of FastPath settings. Rely on defaults. 2014-10-05 14:30:55 -07:00
Michael Jumper
b2ab26c727 GUAC-849: Check for presence of AudioPlayback setting in FreeRDP settings struct. 2014-10-04 20:26:01 -07:00
Michael Jumper
5bcd60b3ba GUAC-849: Set AudioPlayback flag if audio is enabled. 2014-10-04 19:47:11 -07:00
Michael Jumper
71674f8b7d Fix release - guacd.conf manpage needs to be included in EXTRA_DIST. 2014-09-30 01:31:54 -07:00
Michael Jumper
243b2658e3 Bump Doxyfile version number. 2014-09-30 00:04:50 -07:00
Michael Jumper
6dc35bcbad GUAC-855: Bump version to 0.9.3. 2014-09-19 11:28:34 -07:00
Michael Jumper
7b83b279d7 GUAC-659: Do not interpret AltGr as Right Alt. 2014-09-19 01:54:28 -07:00
Michael Jumper
ca9f2717d5 GUAC-792: Map Ctrl+2 to Ctrl+@, and Ctrl+3 through Ctrl+7 to the remaining codes, anchored such that Ctrl+6 is Ctrl+^. 2014-09-11 14:20:57 -07:00
Michael Jumper
76d6b04d53 GUAC-792: Implement remaining C0 control codes. 2014-09-11 13:33:34 -07:00
Michael Jumper
c6de459c76 GUAC-848: Fix typos and formatting of new manpage. 2014-09-09 14:23:51 -07:00
Michael Jumper
f5cb3589c9 GUAC-848: Add manpage for guacd.conf. 2014-09-09 14:10:18 -07:00
Michael Jumper
d217e1ee9c GUAC-847: Allow default location of config file to be overridden. 2014-09-08 14:41:49 -07:00
Michael Jumper
29c3aff5e2 GUAC-847: Embrace the pointless initialization. 2014-09-08 12:37:34 -07:00
Michael Jumper
eb39afc68a GUAC-847: Add pointless initialization to satisfy false-positive warnings. 2014-09-08 12:30:09 -07:00
Michael Jumper
4f5760af94 GUAC-847: Handle parse errors in callback. Actually parse config file. 2014-09-08 12:09:17 -07:00
Michael Jumper
318bcff5b5 GUAC-847: Actually read config file. 2014-09-08 11:54:51 -07:00
Michael Jumper
9b8d77891e GUAC-847: Add arbitrary data to callback. 2014-09-08 11:14:54 -07:00
Michael Jumper
9e57d01c99 GUAC-847: Read from file (stub). Override with args. 2014-09-08 11:09:29 -07:00
Michael Jumper
8c78f105cc GUAC-847: Add placeholder for file parsing. 2014-09-08 10:26:49 -07:00
Michael Jumper
4f578a160f GUAC-847: Rename conf-file to conf-parse. 2014-09-08 10:25:23 -07:00
Michael Jumper
6f3fd21232 GUAC-847: Implement recursive descent parser for guacd config files. 2014-09-08 02:12:49 -07:00
Michael Jumper
8420ed7b13 GUAC-745: Fix variable naming - should be have_freerdp. 2014-08-12 15:16:00 -07:00
Michael Jumper
a29f0e8ccd GUAC-745: Add --without-SUPPORT options for vnc/rdp/ssh/etc. 2014-08-12 14:37:48 -07:00
Felipe Weckx
405140cc8f GUAC-775 initialize stream handlers 2014-08-04 12:58:10 -07:00
Michael Jumper
c37e274977 GUAC-772: Bump version numbers to 0.9.2. 2014-07-21 13:32:09 -07:00
Michael Jumper
2fa1468386 GUAC-779: Terminal channel mutex must exist before terminal channel. 2014-07-21 11:23:36 -07:00
Michael Jumper
be9c56f9a3 GUAC-779: Synchronize access to shared libssh2 handles. 2014-07-21 11:15:55 -07:00
Michael Jumper
d608b3a30b GUAC-780: Init OpenSSL for sake of threads. 2014-07-21 10:48:02 -07:00
Michael Jumper
98c6e6496d GUAC-780: Ensure libgcrypt is initialized for pthreads if used by libssh2. OpenSSL should be OK. 2014-07-21 10:27:39 -07:00
Michael Jumper
fd800e6dd7 GUAC-771: Ensure display surface is available during initial connection. 2014-07-21 09:12:17 -07:00
Michael Jumper
c7a65d08cb GUAC-707: Clean version check logic. 2014-07-20 21:31:32 -07:00
Michael Jumper
e687f59834 GUAC-707: Fix check for common vs channels (should be non-fatal to RDP). Fix check for freerdp_channels_global_init(). 2014-07-20 20:29:57 -07:00
Felipe Weckx
8c1a152467 GUAC-707 support for latest FreeRDP release (1.2.0-beta1) 2014-07-17 13:13:21 -07:00
Michael Jumper
0adf16c501 GUAC-763: Fix typo in comment. 2014-07-17 13:06:01 -07:00
Michael Jumper
46faa7ab85 GUAC-493: Coding style changes. 2014-07-17 12:54:40 -07:00
Felipe Weckx
e543d9eeb5 GUAC-493 Add keyboard-interactive ssh authentication method 2014-07-17 12:51:35 -07:00
Michael Jumper
c023edab45 GUAC-763: Add Felipe as author. 2014-07-17 12:41:20 -07:00
Michael Jumper
d5c0c611bf GUAC-763: Fix comments. Do not continue searching for username after password has been found. 2014-07-17 12:39:19 -07:00
Michael Jumper
1e5fbba64e GUAC-763: Do not send mouse during username search either. 2014-07-17 12:34:57 -07:00
Michael Jumper
b2c6bc488b GUAC-763: Remove stripping of non-printable chars. It will break UTF-8, and the signedness of line_buffer makes the comparisons questionable. 2014-07-17 12:33:46 -07:00
Michael Jumper
e01eb6fc10 GUAC-763: Minor fixes for style. Fix username/password regex. 2014-07-17 12:21:53 -07:00
Felipe Weckx
7784ebc8d3 GUAC-763: Adjust telnet login automation to accept a regex for the username parameter 2014-07-17 12:10:00 -07:00
Michael Jumper
8d99c35a86 GUAC-769: Ensure socket output is handled in a threadsafe manner. 2014-07-10 16:49:13 -07:00
Michael Jumper
7be6bbfeae GUAC-764: Fully initialize character structure, to satisfy some C compilers and static analyzers. 2014-07-07 08:39:39 -07:00
Michael Jumper
ceb768e127 GUAC-743: Add missing comments to static functions. 2014-07-05 23:01:29 -07:00
Michael Jumper
d9e7ebde2f GUAC-743: Store and maintain connections within the client map structure. 2014-07-05 13:26:27 -07:00
Michael Jumper
02d493c9e5 GUAC-743: Implement client mapping structure. 2014-07-05 13:24:24 -07:00
Michael Jumper
dfafd021cf GUAC-762: Check for ossp/uuid.h vs uuid.h. 2014-07-02 13:33:47 -07:00
Michael Jumper
633a0fe371 GUAC-757: Also search for OSSP UUID as libuuid. 2014-06-26 16:28:26 -07:00
Michael Jumper
40124c11a6 GUAC-744: Send ready instruction BEFORE guac_client_init. Sending after is just crazy. 2014-06-26 15:32:35 -07:00
Michael Jumper
86a59c43b3 GUAC-744: Send ready instruction after guac_client_init. 2014-06-26 15:23:00 -07:00
Michael Jumper
a44539b108 GUAC-744: Generate and store connection ID within guac_client. 2014-06-26 15:09:44 -07:00
Michael Jumper
8cc6c987a9 GUAC-716: Stop password search if user input is detected. 2014-06-17 12:28:53 -07:00
Michael Jumper
f357197f86 GUAC-716: Add password and password-regex parameters. Search for password prompt if password parameter specified. 2014-06-17 12:24:07 -07:00
Michael Jumper
ad34c254e0 GUAC-748: Add username parameter to telnet. Pass username via NEW-ENVIRONMENT telnet option. 2014-06-16 18:07:13 -07:00
Michael Jumper
c56412f69e GUAC-734: Return to echo after HTS. Return to echo on unexpected characters within OSC. 2014-06-11 15:04:39 -07:00
Michael Jumper
adc15d50eb GUAC-730: Fix headers for VNC. 2014-06-11 11:15:35 -07:00
Michael Jumper
9c6770e016 GUAC-730: Fix headers for telnet. 2014-06-11 11:09:44 -07:00
Michael Jumper
48d1597418 GUAC-730: Fix headers for SSH. 2014-06-11 10:06:18 -07:00
Michael Jumper
1973f42f61 GUAC-730: Add missing rail headers to guac_handlers.c. 2014-06-10 19:37:06 -07:00
Michael Jumper
6f5991c504 GUAC-730: Fix headers for RDP. 2014-06-10 18:45:14 -07:00
Michael Jumper
8bc4864d9a GUAC-730: Add stddef.h to generated keymaps. Fix perl warning while we're at it. 2014-06-10 18:23:21 -07:00
Michael Jumper
fdc886a5fb GUAC-730: Fix headers in src/terminal. 2014-06-10 17:40:58 -07:00
Michael Jumper
cc2f3931a9 GUAC-730: Fix headers for guacd. 2014-06-10 17:25:40 -07:00
Michael Jumper
ea765ba602 GUAC-730: Fix headers for src/common. 2014-06-10 17:20:49 -07:00
Michael Jumper
9c475c3a68 GUAC-730: Fix headers for libguac. 2014-06-10 16:54:08 -07:00
Michael Jumper
d19100ca6b GUAC-728: Take character width into account when displaying (and retrieving) selection. 2014-06-06 14:05:41 -07:00
Michael Jumper
6433115468 GUAC-727: Remove glyph cache from terminal. 2014-06-05 21:00:21 -07:00
Michael Jumper
6473f5029a GUAC-726: Only overwrite invalid portions of adjacent regions to an edge. 2014-06-05 12:31:03 -07:00
Michael Jumper
98a18f45c4 GUAC-726: Fix width calculation math. Do not search for start past column 0. 2014-06-05 12:13:05 -07:00
Michael Jumper
99cef299f1 GUAC-726: Replace overwrite function with much saner function based on character validity checks along column edges. 2014-06-05 11:55:21 -07:00
Michael Jumper
4e16a31600 GUAC-717: Handle each logical subregion of a copy as a separate overwrite. 2014-06-04 16:42:01 -07:00
Michael Jumper
b54e750a31 GUAC-717: Clear up to character end when setting characters. Handle character overwrite as part of copy. 2014-06-04 15:58:52 -07:00
Michael Jumper
8b8b351966 GUAC-717: Clear up to overwritten character start when setting characters. 2014-06-04 14:41:47 -07:00
Michael Jumper
a8ef6f5c40 GUAC-717: Set continuation character for wide chars as necessary. 2014-06-04 14:04:41 -07:00
Michael Jumper
91f1148e8f GUAC-717: Add GUAC_CHAR_CONTINUATION sentinel. Add width property to characters. 2014-06-04 11:24:39 -07:00
Michael Jumper
c84a88d35a GUAC-718: Set locale (for sake of wcwidth()). Warn if locale does not use UTF-8. 2014-06-02 16:01:13 -07:00
Michael Jumper
b106e13bb1 GUAC-718: Scale text layout to fit within ideal size. 2014-06-02 15:34:48 -07:00
Michael Jumper
122a8095e4 GUAC-718: Advance cursor by column width of echo'd characters. 2014-06-02 12:53:40 -07:00
Michael Jumper
b5087a2a6f GUAC-718: Update display to cache and use variable-width glyphs. 2014-06-02 12:52:42 -07:00
Michael Jumper
3bd145a059 GUAC-678: Add missing OpenSSL init. 2014-05-27 12:34:05 -07:00
Michael Jumper
e98d1ad79c GUAC-681: Bump version numbers to 0.9.1. 2014-05-22 12:27:48 -07:00
Michael Jumper
6a93033b97 GUAC-670: Reduce required version of Perl. 2014-05-20 17:01:07 -07:00
Michael Jumper
e0e57b1885 GUAC-658: Add missing include for socket.h 2014-05-20 10:55:38 -07:00
Michael Jumper
dbaca11d68 GUAC-688: Fix segfault on resize. 2014-05-13 10:41:06 -07:00
Michael Jumper
51093201f5 GUAC-675: Document return value of __guac_common_surface_transfer_int(). 2014-05-12 21:46:36 -07:00
Michael Jumper
cad60299e1 GUAC-687: Only update backing surface first if the destination rect cannot intersect the source rect. 2014-05-12 14:43:50 -07:00
Michael Jumper
3e0828d6da GUAC-687: Initialize newly-allocated buffer space to transparent black. 2014-05-12 13:50:51 -07:00
Michael Jumper
9746ea68a4 GUAC-687: Use correct rect when checking for fully clipped updates. 2014-05-12 13:44:51 -07:00
Michael Jumper
89b0a452a5 GUAC-687: Do not allow empty updates to the dirty rect. 2014-05-12 13:27:33 -07:00
Michael Jumper
584ca5f35c GUAC-675: Update comments reflecting new use of guac_common_rect. 2014-05-12 09:20:22 -07:00
Michael Jumper
2bbbda3ca9 GUAC-675: Source coordinates must be updated along with rect. 2014-05-12 02:26:04 -07:00
Michael Jumper
07f6712591 GUAC-675: Optimize copy. 2014-05-12 02:01:09 -07:00
Michael Jumper
573f524dee GUAC-675: Optimize output of rect. 2014-05-12 01:45:55 -07:00
Michael Jumper
c0b955fab0 GUAC-675: Add rect struct. Migrate surface to new rect struct. 2014-05-12 01:39:52 -07:00
Michael Jumper
32474c1114 GUAC-675: Lengthen maximum frame duration. 2014-05-11 23:42:27 -07:00
Michael Jumper
a9ba417891 GUAC-675: Narrow update rect to contain only different pixels. 2014-05-11 12:28:19 -07:00
Michael Jumper
442a520150 GUAC-674: Fix typo in comment. Make __guac_common_surface_flush_to_png() static. 2014-05-11 12:28:07 -07:00
Michael Jumper
0da9df3620 GUAC-674: Add comments for all static functions. 2014-05-09 18:56:16 -07:00
Michael Jumper
78d7c3e9ab GUAC-674: Inspect and re-inspect queue when combining. 2014-05-09 18:45:10 -07:00
Michael Jumper
7fc3fe1fdc GUAC-674: Queue and combine png updates. Lengthen RDP frame timeout to 10ms. 2014-05-09 15:39:00 -07:00
Michael Jumper
d42cd23f87 GUAC-654: Comment guac_handlers.h properly. 2014-05-07 21:29:36 -07:00
Michael Jumper
13e205a0e5 GUAC-654: Add missing comments to telnet_client.c 2014-05-07 21:19:15 -07:00
Michael Jumper
ffb33ccea5 GUAC-654: Telnet support does not require libssl. 2014-05-07 15:39:00 -07:00
Michael Jumper
feda99c325 GUAC-654: Telnet library options variable should be TELNET_LIBS. 2014-05-07 15:36:35 -07:00
Michael Jumper
4a7e5609f5 GUAC-654: Implement local echo. 2014-05-07 15:30:48 -07:00
Michael Jumper
b87d99cc40 GUAC-654: Do NOT block indefinitely while waiting for socket to die. 2014-05-07 15:19:53 -07:00
Michael Jumper
6b33c8eeda GUAC-654: Fix namespace and style. 2014-05-07 14:36:49 -07:00
Michael Jumper
30a31d07cf GUAC-654: Add negotiation and handling of NAWS (window size). 2014-05-07 14:19:27 -07:00
Michael Jumper
a7d1dde24f GUAC-654: Implement simple telnet client. No screen resize yet. 2014-05-07 13:46:25 -07:00
Michael Jumper
7c08593b83 GUAC-653: Restore file upload for SSH. 2014-05-06 17:14:40 -07:00
Michael Jumper
0acd219a88 GUAC-653: Remove unneeded includes. 2014-05-06 16:45:36 -07:00
Michael Jumper
92f0d4b36b GUAC-653: Remove direct reference to internal terminal pipes. 2014-05-06 16:41:48 -07:00
Michael Jumper
470dc67c34 GUAC-653: Implement render_frame function. 2014-05-06 16:12:29 -07:00
Michael Jumper
81229d9fe4 GUAC-653: Separate terminal API into public/internal/low-level pieces (in spirit). 2014-05-06 15:55:30 -07:00
Michael Jumper
f2781ed0cc GUAC-653: Move mouse and key handling into terminal. Move clipboard into terminal. 2014-05-05 19:02:41 -07:00
Michael Jumper
455f2e543a GUAC-653: Update namespace in common terminal code. 2014-05-05 16:36:49 -07:00
Michael Jumper
b4e7f95603 GUAC-653: Move terminal code to common location. 2014-05-05 16:17:59 -07:00
Michael Jumper
f1b75335ae GUAC-669: Remove include which was intended for debugging only. 2014-05-05 11:21:00 -07:00
Michael Jumper
014e245baa GUAC-669: Limit how high the fill pattern heuristic is allowed to increase update cost. 2014-05-05 11:17:38 -07:00
Michael Jumper
c5ada6631c GUAC-667: Draw glyphs directly to surface. 2014-05-05 00:28:07 -07:00
Michael Jumper
3554e88efa GUAC-667: Add masked paint operation. 2014-05-05 00:27:48 -07:00
Michael Jumper
1047c6192c GUAC-667: Implement clipping within common surface. 2014-05-04 23:39:02 -07:00
Michael Jumper
b2d74c92a2 GUAC-667: Remove unnecessary use of Cairo surface within common - just update buffer. 2014-05-04 16:35:09 -07:00
Michael Jumper
dbec5a5957 GUAC-666: Detect left-to-right fill pattern. 2014-05-03 21:11:42 -07:00
Michael Jumper
84fb0d8681 GUAC-665: Narrow cost estimation algorithm. 2014-05-01 19:22:47 -07:00
Michael Jumper
5b2f824097 GUAC-660: Do not send initial size unless layer is visible. Do not dispose unless layer was created. 2014-05-01 12:23:37 -07:00
Michael Jumper
8f1f0907e7 GUAC-662: Migrate VNC to guac_common_surface. 2014-05-01 11:27:26 -07:00
Michael Jumper
25ab9a0134 GUAC-662: Implement resize for guac_common_surface. 2014-05-01 11:27:10 -07:00
Michael Jumper
d4aed54ca4 GUAC-662: Updates to backing surface should happen AFTER possible flushes. 2014-05-01 10:25:54 -07:00
Michael Jumper
25784acc6f GUAC-656: Remove old debug log. 2014-04-30 20:46:26 -07:00
Michael Jumper
8cc932391d GUAC-656: Implement transfer and copy. 2014-04-30 19:55:56 -07:00
Michael Jumper
c786854b63 GUAC-656: Implement rect, clean logic. 2014-04-30 19:09:38 -07:00
Michael Jumper
98a041336a GUAC-656: Implement flush. Implement draw. 2014-04-30 16:45:09 -07:00
Michael Jumper
db96b5f691 GUAC-656: Add logging message noting intent (actual surface not implemented). 2014-04-30 15:58:43 -07:00
Michael Jumper
4a4ced40ed GUAC-656: Remove surface resize - not needed for now. 2014-04-30 14:33:04 -07:00
Michael Jumper
b6e323a7a2 GUAC-656: Flush default surface after handling updates. 2014-04-30 13:54:39 -07:00
Michael Jumper
5f0250fb1f GUAC-656: Free buffer last - surface needs to send dispose. 2014-04-30 12:32:19 -07:00
Michael Jumper
25d8b47bd3 GUAC-656: Send size and dispose when alloc/free surface. 2014-04-30 11:59:43 -07:00
Michael Jumper
f8ac59798f GUAC-656: Migrate RDP to guac_common_surface. 2014-04-30 11:46:04 -07:00
Michael Jumper
f6ccfd1211 GUAC-656: Add instructions to stubs. Match prototype of surface function to that of protocol function. 2014-04-29 19:15:21 -07:00
Michael Jumper
5d6e04171c GUAC-656: Implement alloc/free for surface. 2014-04-29 16:06:44 -07:00
Michael Jumper
3b541f70ee GUAC-656: Add simple surface and stubs. 2014-04-29 15:57:37 -07:00
Michael Jumper
4766970015 GUAC-621: During resize, keep cursor on screen and redraw cursor if necessary. 2014-04-16 14:46:00 -07:00
Michael Jumper
9229457dd4 GUAC-621: Only increase buffer length if real character data was written (not cleared). 2014-04-16 14:31:51 -07:00
Michael Jumper
4d48dc384b GUAC-622: Do not log a pointless error every time the client disconnects properly. Just stop the client - we have a function for that now. 2014-04-14 12:20:08 -07:00
Michael Jumper
e1ac588296 GUAC-622: Just log normal error messages if guac_error not set. Init guac_error before plugin load. 2014-04-14 12:01:36 -07:00
Michael Jumper
3823165d7f GUAC-598: Fix warnings against SSH. 2014-04-11 13:48:06 -07:00
Michael Jumper
5f84cbc5e4 GUAC-598: Use unsigned instead of u_ type. 2014-04-11 13:48:06 -07:00
Michael Jumper
624048d248 GUAC-598: Remove unneeded _BSD_SOURCE define. 2014-04-11 13:48:06 -07:00
Michael Jumper
d24aaeb614 GUAC-598: Bring up to compliance with POSIX standard claimed by source. 2014-04-11 13:48:06 -07:00
Michael Jumper
20222beaed GUAC-598: Fix warning regarding unsigned comparison against zero. 2014-04-11 13:48:06 -07:00
Michael Jumper
15dc035db1 GUAC-597: Remove unnecessary dlopen() test, add automatically generated dlopen() test result to Makefile.am. 2014-04-11 13:48:06 -07:00
Michael Jumper
dc9bf7dff3 GUAC-597: Add new autoconf files to .gitignore. 2014-04-11 13:48:06 -07:00
Michael Jumper
26147afff0 GUAC-613: Fix header annotation in Doxygen comment in pool-types.h (wrong filename). 2014-04-10 15:54:02 -07:00
Michael Jumper
de8c64a03a GUAC-614: Remove old prototypes from RDP guac handlers. 2014-04-10 15:42:46 -07:00
Michael Jumper
7be9a87fae GUAC-614: Remove old prototype. 2014-04-10 15:40:40 -07:00
Michael Jumper
0096cf677c GUAC-614: Migrate RDP to simpler stream API. Add missing linkage to RDP build. Fix last character truncation bug. 2014-04-10 14:53:32 -07:00
Michael Jumper
83093f1bd3 GUAC-614: Migrate SSH to simpler stream API. 2014-04-10 13:47:36 -07:00
Michael Jumper
18407fdc37 GUAC-614: Migrate VNC to simpler stream API. 2014-04-10 13:40:22 -07:00
Michael Jumper
1dd2982f06 GUAC-611: Fix initialization of stream. 2014-04-09 22:13:49 -07:00
Michael Jumper
479800c711 GUAC-608: Add missing Doxygen annotation. 2014-04-09 22:08:31 -07:00
Michael Jumper
7d0497f287 GUAC-611: Add missing includes to tests. 2014-04-09 19:21:20 -07:00
Michael Jumper
78b4ad56a1 GUAC-611: Add missing headers. 2014-04-09 19:09:41 -07:00
Michael Jumper
205f85dafd GUAC-611: Add per-stream handlers for ack/blob/end. Simplify ack/blob/end contents. Reorganize headers to eliminate circular dependencies. 2014-04-09 18:42:29 -07:00
Michael Jumper
2c4ae68da0 GUAC-608: Add support for outbound clipboard for SSH. Partial inbound support. 2014-04-09 11:40:09 -07:00
Michael Jumper
3c70e87aef GUAC-608: Add inbound clipboard. Remove use of iconv(). 2014-04-08 17:08:29 -07:00
Michael Jumper
c9b077af4c GUAC-608: Convert VNC outbound clipboard to common code. Stub inbound clipboard. 2014-04-08 16:42:10 -07:00
Michael Jumper
d5fa14c0c7 GUAC-608: Migrate test to non-clipboard instruction. 2014-04-08 16:35:35 -07:00
Michael Jumper
c95e2fd056 GUAC-608: Make guac_iconv input const. 2014-04-08 16:33:43 -07:00
Michael Jumper
6743795a68 GUAC-608: Migrate RDP to common clipboard code for inbound data. 2014-04-08 15:31:56 -07:00
Michael Jumper
3cf644009f GUAC-608: Migrate RDP to common clipboard code for outbound data. 2014-04-08 15:06:54 -07:00
Michael Jumper
855e32c7a5 GUAC-608: Add common clipboard code. 2014-04-08 14:56:37 -07:00
Michael Jumper
2aa7252d1b GUAC-608: Implement outbound clipboard streaming. Stub out inbound. 2014-04-07 19:22:53 -07:00
Michael Jumper
85cde821a4 GUAC-608: Change semantics of clipboard instruction within libguac. 2014-04-07 17:08:16 -07:00
Michael Jumper
e5c34f8661 GUAC-594: Update man page regarding certificate chains. 2014-04-07 15:31:24 -07:00
Michael Jumper
3b372da120 GUAC-593: Allow certificate chain import. 2014-04-07 15:16:25 -07:00
Michael Jumper
c180de9444 GUAC-447: Implement paste of Unicode text. 2014-04-02 15:35:09 -07:00
Michael Jumper
3f19e2b2bb GUAC-584: Name of constant should be CP1252, not ISO-8859-1. 2014-04-02 14:22:22 -07:00
Michael Jumper
49ffaf0826 GUAC-584: Use CP1252 for RDP copy of non-unicode text. 2014-04-02 14:10:45 -07:00
Michael Jumper
da5404f612 GUAC-584: Add support for CP1252 and ISO-8859-1. 2014-04-02 14:08:41 -07:00
Michael Jumper
b203cf1fd2 GUAC-584: Remove old free() - no longer necessary as buffer is static. 2014-04-01 23:40:00 -07:00
Michael Jumper
7cf5d02019 GUAC-584: Simplify copy logic. Store clipboard in static 256K buffer. Convert from UTF16 properly. 2014-04-01 18:41:55 -07:00
Michael Jumper
04ac42811f GUAC-584: Implement UTF16. Clean up tests. 2014-04-01 17:42:04 -07:00
Michael Jumper
ccc2526282 GUAC-584: Implement UTF8 read and write. Add basic identity test. 2014-04-01 16:46:29 -07:00
Michael Jumper
dfc18e14a4 GUAC-584: Add iconv-style function in common. Stub implementation and test. 2014-04-01 16:25:14 -07:00
Michael Jumper
bbf451a552 GUAC-584: Handle Unicode data (STUB). Need real conversion code with actual length calculations. 2014-03-31 16:33:23 -07:00
Michael Jumper
0b414ed9b5 GUAC-584: Add basic handling for Unicode text - just stubs, no converting to UTF-8 yet. 2014-03-31 15:46:49 -07:00
Michael Jumper
16757aebec GUAC-573: Add common lib to dist. 2014-03-26 11:59:33 -07:00
Michael Jumper
19e194a3ce GUAC-573: Fix include path for common lib. 2014-03-26 11:55:17 -07:00
Michael Jumper
60f408e378 GUAC-573: Add guacctl to EXTRA_DIST. 2014-03-26 11:37:49 -07:00
Michael Jumper
78d998a076 GUAC-573: Add new keymaps and generator.pl to EXTRA_DIST. 2014-03-26 11:07:45 -07:00
Michael Jumper
d1a66f5616 GUAC-552: If resolution is above 96 DPI, try to find a reasonable screen size at 96 DPI or 120 DPI, using native resolution as a last resort. 2014-03-25 14:25:34 -07:00
Michael Jumper
60d4e90c4b GUAC-569: Bump version numbers of guacamole-server components to 0.9.0. Update libtool version info for libguac. 2014-03-25 11:08:36 -07:00
Michael Jumper
59607c6013 GUAC-556: Remove unnecessary guac_socket_flush(). 2014-03-24 00:31:15 -07:00
Michael Jumper
894229ded2 GUAC-561: Send CLIENT_TIMEOUT if client is not responding. 2014-03-22 15:14:46 -07:00
Michael Jumper
26b5a0c21e GUAC-556: Abort at higher level in RDP message wait function. 2014-03-22 14:56:09 -07:00
Michael Jumper
81d7731e8a GUAC-556: Use guac_client_abort() for VNC errors. Use appropriate error codes. 2014-03-22 14:51:21 -07:00
Michael Jumper
22b2618562 GUAC-556: Use guac_client_abort() for RDP errors. 2014-03-22 14:42:22 -07:00
Michael Jumper
6e6af91cfa GUAC-556: Send proper errors for SSH. 2014-03-21 19:47:42 -07:00
Michael Jumper
d0dadf6a9c GUAC-556: Add guac_client_abort() function for convenience. 2014-03-21 19:47:19 -07:00
Michael Jumper
bd40dd30b2 GUAC-556: Send UPSTREAM_ERROR for unexpected disconnect and failure to connect in RDP. 2014-03-19 22:16:35 -07:00
Michael Jumper
fdf2036cfe GUAC-548: Migrate to new error codes throughout protocol support. 2014-03-18 12:26:01 -07:00
Michael Jumper
3105cfbb48 GUAC-548: Rename and expand error codes. 2014-03-18 12:25:19 -07:00
Michael Jumper
680b3cc147 Analogous legacy macro for Stream_Length() is stream_get_size(), not stream_get_length(). 2014-03-11 17:01:13 -07:00
Michael Jumper
91d381d055 Include winpr-compat in main build. 2014-03-11 16:42:41 -07:00
Michael Jumper
cdc532e8ba Use fixed-size SVC name buffer. Validate length. 2014-03-06 11:48:52 -08:00
Michael Jumper
bccc1c7c76 Clean up streaming code - migrate to separate rdp_stream.[ch] 2014-03-03 16:18:14 -08:00
Michael Jumper
243f24722c Fix typo in comment. 2014-03-03 15:31:00 -08:00
Michael Jumper
86d2266580 Handle pipe receive, write to SVC. 2014-03-02 12:38:28 -08:00
Michael Jumper
ed367824a6 Add receive stub for inbound pipes. 2014-03-02 12:15:17 -08:00
Michael Jumper
e26c0122fd Properly associate inbound pipes. 2014-03-02 12:06:08 -08:00
Michael Jumper
e37c5c462f Add typing to stream data. 2014-03-02 11:53:21 -08:00
Michael Jumper
38e4c9afba Implement SVC remove. Rely on terminate for SVC cleanup. 2014-03-02 11:24:06 -08:00
Michael Jumper
2d885fdec2 Send any received data to pipe. 2014-03-02 11:12:27 -08:00
Michael Jumper
38aa467233 Create outbound pipes for SVC. 2014-03-02 10:51:52 -08:00
Michael Jumper
d630d66c8b Implement get for SVC. 2014-03-02 10:46:38 -08:00
Michael Jumper
67a647b88d Fix bug in list. 2014-03-02 10:39:36 -08:00
Michael Jumper
912cc4d0cf Maintain SVC list. 2014-03-02 10:38:31 -08:00
Michael Jumper
4b1c8ec7ff Actually load guacsvc plugin for each static channel. 2014-03-02 10:09:32 -08:00
Michael Jumper
cc5793a39b Move SVC data into own structure. Add stubs for management. 2014-03-02 09:56:47 -08:00
Michael Jumper
b835299898 Store channel names as NULL-terminated list. Stub out init. 2014-03-01 22:48:15 -08:00
Michael Jumper
464c94501d Add string utility functions and unit tests. 2014-03-01 21:31:52 -08:00
Michael Jumper
b88e23a7d2 Add static-channels and corresponding storage. 2014-03-01 16:43:55 -08:00
Michael Jumper
aa4896da07 Add guacsvc plugin. 2014-03-01 16:42:39 -08:00
Michael Jumper
d0d34a63b9 Implement pipe instruction and handlers. 2014-02-28 18:46:09 -08:00
Michael Jumper
a6a72d950c Rename parameters more sanely. Add support for working dir. 2014-01-30 00:42:37 -08:00
Michael Jumper
007cb2c66c Fix args. 2014-01-30 00:30:29 -08:00
Michael Jumper
59abfadbd1 Compatibility with legacy FreeRDP. 2014-01-30 00:17:23 -08:00
Michael Jumper
10d987a0c3 Working RemoteApp with current FreeRDP. 2014-01-30 00:04:31 -08:00
Michael Jumper
47407a5b3d Acknowledge Tom Sealy. 2014-01-29 16:29:58 -08:00
Michael Jumper
68879cc2ec Init RemoteApp settings. Load RAIL plugin. 2014-01-29 16:25:30 -08:00
Michael Jumper
56c8c4f740 Add arguments for RemoteApp name and command. 2014-01-29 15:58:04 -08:00
Michael Jumper
8bf6f47b7e Add log instruction, for inserting debug information into the protocol stream. 2014-01-19 16:59:52 -08:00
Michael Jumper
a83cd54cf1 Fix linking of VNC library (missing common objects). 2014-01-08 18:43:16 -08:00
Michael Jumper
0994c61736 Fix tabs. 2014-01-06 16:49:16 -08:00
Michael Jumper
0522077963 Migrate RDP to common pointer code. 2014-01-06 16:21:23 -08:00
Michael Jumper
93639cbf12 Move VNC pointers to common. 2014-01-06 16:18:54 -08:00
Michael Jumper
50bb5d132f Migrate to guac_* namespace. 2014-01-06 16:01:51 -08:00
Michael Jumper
da3bef2119 Add common utility sources. 2014-01-06 15:53:22 -08:00
Michael Jumper
678becb267 Ensure ENABLE_SSH_AGENT conditional is always defined within automake. 2014-01-04 21:30:19 -08:00
Michael Jumper
5afe6daac9 Fix logic error in keymap find proc. 2014-01-03 12:06:19 -08:00
Michael Jumper
be90a449e7 Add French keymap. 2014-01-03 02:08:06 -08:00
Michael Jumper
371715d058 Add German keymap. 2014-01-03 01:55:51 -08:00
Michael Jumper
d041c1aaab Fix Unicode support in generator. 2014-01-03 01:03:57 -08:00
Michael Jumper
6027084b05 Add failsafe keymap. 2014-01-02 23:54:15 -08:00
Michael Jumper
4e47154aff Remove unneeded .gitignore. 2014-01-02 23:43:54 -08:00
Michael Jumper
3a922355e3 Implement keymap find. 2014-01-02 23:41:16 -08:00
Michael Jumper
54a570e0d3 Remove keymaps. 2014-01-02 22:34:42 -08:00
Michael Jumper
4d684d7166 Rename generated file. 2014-01-02 22:30:14 -08:00
Michael Jumper
8e3c512256 Add keymap generation to build. 2014-01-02 22:24:02 -08:00
Michael Jumper
b840935530 Generate one file. 2014-01-02 21:54:17 -08:00
Michael Jumper
b805e35ca7 Also generate main header and source. 2014-01-02 21:23:31 -08:00
Michael Jumper
a0531ca152 Add keymap parsing script and corresponding keymap for en-us. 2014-01-02 17:17:35 -08:00
Michael Jumper
54b16f2db4 Send pointer cursor by default, until overridden by VNC server. 2014-01-02 12:32:25 -08:00
Michael Jumper
7643d61c7e Add pointer cursor. 2014-01-02 12:17:08 -08:00
Michael Jumper
c4518c7781 Rename default pointer. 2014-01-02 11:41:32 -08:00
Michael Jumper
735c5778db Ensure read errors result in the client closing. 2014-01-01 20:18:43 -08:00
Michael Jumper
442ed427a0 Clean up includes, clean up build. 2014-01-01 14:52:01 -08:00
Michael Jumper
0303c4e24b Relicense everything (except French keymap) as MIT. Status of French keymap is TBD. 2014-01-01 14:46:18 -08:00
Michael Jumper
57f7149786 Clean up handling of event flags. 2013-12-28 18:20:51 -08:00
Michael Jumper
c81be87790 Scale back resolution assuming 96 DPI on the desktop side. 2013-12-27 00:34:37 -08:00
Michael Jumper
78202d25ba Pay attention to DPI when rendering terminal. 2013-12-27 00:28:23 -08:00
Michael Jumper
ee1731cf9b Add resolution member to client info struct. Interpret new third parameter for screen size. 2013-12-27 00:07:17 -08:00
Michael Jumper
6479d0e8fa Start download if file moved to Download folder. 2013-12-17 22:47:00 -08:00
Michael Jumper
88f9f883b4 Move download logic into own function. 2013-12-17 22:46:15 -08:00
Michael Jumper
a1d4e2d2e6 Add maximum buffer size. 2013-12-17 14:28:20 -08:00
Michael Jumper
7ee813bbfd Allocate buffer to allow large reads, rather than force all reads down to 4K. 2013-12-17 14:17:56 -08:00
Michael Jumper
c38b687ab6 Add namespace to DEBUG variable, add missing UINT64 type to compat. 2013-12-11 22:27:35 -08:00
Michael Jumper
478235be70 Check path lengths. 2013-12-11 15:00:00 -08:00
Michael Jumper
89b55ecab5 Explicitly do not support locks or setting label. 2013-12-11 14:40:08 -08:00
Michael Jumper
866ba2a7b9 Handle device info. 2013-12-11 14:21:59 -08:00
Michael Jumper
5e87949e31 Implement rest of dir info. 2013-12-11 14:11:16 -08:00
Michael Jumper
672e20c051 Add HIDDEN and ARCHIVE attributes. 2013-12-11 13:49:02 -08:00
Michael Jumper
e0450d0dc5 Remove unnecessary alloc. 2013-12-11 13:48:41 -08:00
Michael Jumper
56bb0b3740 Fix size and full size info. 2013-12-11 01:25:54 -08:00
Michael Jumper
338b83a3a7 Ignore write access request if file is a directory. 2013-12-11 01:25:40 -08:00
Michael Jumper
6d88bec136 Implement directory deletion. 2013-12-10 23:12:13 -08:00
Michael Jumper
647850c8ce Tighten scope, fix initialization. 2013-12-10 23:12:01 -08:00
Michael Jumper
7d0e8093eb Improve logging. 2013-12-09 00:41:27 -08:00
Michael Jumper
f17cd33aa4 Implement size info. 2013-12-09 00:41:27 -08:00
Michael Jumper
efc7477ef5 Free stream data. Delete file after opening for download. 2013-12-09 00:41:27 -08:00
Michael Jumper
ee20114c67 Ignore acks for non-download streams. 2013-12-09 00:41:27 -08:00
Michael Jumper
d30ade6bef Implement file download. 2013-12-09 00:41:27 -08:00
Michael Jumper
b262440ba5 Move download-specific logic to rdpdr. 2013-12-09 00:41:27 -08:00
Michael Jumper
f4ff04ab30 Initiate download whenever file written within Download folder. 2013-12-09 00:41:27 -08:00
Michael Jumper
ef8d8e3bc1 Remove check for download from open. Add tracking of file writes. 2013-12-09 00:41:26 -08:00
Michael Jumper
847f9451c1 RemoveSent and Outbox special dirs - use only Download. 2013-12-09 00:41:26 -08:00
Michael Jumper
3a7c9bbc5d Add flag and stub for download. 2013-12-09 00:41:26 -08:00
Michael Jumper
1570072b46 Only complain about EEXIST for mkdir() if O_EXCL is set. Directory creation open should use ACCESS_GENERIC_READ (anything with WRITE will fail). 2013-12-09 00:41:26 -08:00
Michael Jumper
96637b5d19 Create Sent as necessary. 2013-12-09 00:41:26 -08:00
Michael Jumper
e5f919f75c Reroute files from Outbox to Sent. 2013-12-09 00:41:26 -08:00
Michael Jumper
296836f65d Implement file truncation. 2013-12-09 00:41:26 -08:00
Michael Jumper
3ebed6a85c Fix handling of append. 2013-12-09 00:41:26 -08:00
Michael Jumper
52e65e043a Implement deletion. 2013-12-09 00:41:26 -08:00
Michael Jumper
9d85704f03 Additional debugging. Advertise case sensitivity in vol info. 2013-12-09 00:41:26 -08:00
Michael Jumper
742452b1d4 IMPLEMENT UPLOAD!!! 2013-12-09 00:41:26 -08:00
Michael Jumper
aacb726b66 Separate RDP filesystem operations from RDPDR. 2013-12-09 00:41:26 -08:00
Michael Jumper
28c3c7d926 Move read/write to rdpdr_fs. 2013-12-09 00:41:26 -08:00
Michael Jumper
77db391a12 Implement rename. 2013-12-09 00:41:26 -08:00
Michael Jumper
a72fbe5745 Add debug messages, stub basic info set, implement attribute tag query. 2013-12-09 00:41:26 -08:00
Michael Jumper
b5af07aee2 Fix directory creation. 2013-12-09 00:41:26 -08:00
Michael Jumper
dfd55f0ba4 Add debug/trace logging. 2013-12-09 00:41:25 -08:00
Michael Jumper
caea2d4acd Add debug header. 2013-12-09 00:41:25 -08:00
Michael Jumper
70b361b8b6 Handle mkdir() return code. 2013-12-09 00:41:25 -08:00
Michael Jumper
39c31faa9b Add error codes and better handling. 2013-12-09 00:41:25 -08:00
Michael Jumper
3400e9b122 Create directory if necessary. 2013-12-09 00:41:25 -08:00
Michael Jumper
655cb8e9f2 Implement attribute info query. 2013-12-09 00:41:25 -08:00
Michael Jumper
22d0e496f5 Move to IOCOMPLETION function rather that duplicating header everywhere. 2013-12-09 00:41:25 -08:00
Michael Jumper
911746ae24 Add options for file attributes and create options to open. Fix create disposition of files in directory list. 2013-12-09 00:41:25 -08:00
Michael Jumper
67c461be40 Use constants for file mode. 2013-12-09 00:41:25 -08:00
Michael Jumper
da7168e161 Correct (theoretically) semantics of open create disposition. 2013-12-09 00:41:25 -08:00
Michael Jumper
f9cf524993 Ignore set end-of-file and set allocation. 2013-12-09 00:41:25 -08:00
Michael Jumper
683e8c24c0 Add stubs for file information set operations. 2013-12-09 00:41:25 -08:00
Michael Jumper
f7acfbb1a0 Fix use of mode within open(). 2013-12-09 00:41:25 -08:00
Michael Jumper
c07d8dd950 Only register drive if enabled. 2013-12-09 00:41:25 -08:00
Michael Jumper
a41752aead Remove stub logging of bytes received. 2013-12-09 00:41:25 -08:00
Michael Jumper
5004986563 Add file upload stubs. 2013-12-09 00:41:25 -08:00
Michael Jumper
c70efcea4d Handle other write flags, log and handler read/write errors. 2013-12-09 00:41:24 -08:00
Michael Jumper
582e1a60b3 Implement write. 2013-12-09 00:41:24 -08:00
Michael Jumper
7a1b76881f Implement pattern matching in dir search. 2013-12-09 00:41:24 -08:00
Michael Jumper
c2e1065ea2 Remove STATUS_NO_MORE_FILES log message. 2013-12-09 00:41:24 -08:00
Michael Jumper
d0ee38f7c6 Remove and cleanup logging. 2013-12-09 00:41:24 -08:00
Michael Jumper
f50529dac0 Fix buffer size. 2013-12-09 00:41:24 -08:00
Michael Jumper
65c5ed379e Implement read. 2013-12-09 00:41:24 -08:00
Michael Jumper
3217b97f26 Add ffunction for retrieving a file by file ID safely. Migrate to new function. 2013-12-09 00:41:24 -08:00
Michael Jumper
dd1761790a Fix query directory response (missing final null byte). 2013-12-09 00:41:24 -08:00
Michael Jumper
98a1a494cd Modify output to match rdesktop packets more closely. Still doesn't work. 2013-12-09 00:41:24 -08:00
Michael Jumper
aec6c167e3 Do not send information for open. 2013-12-09 00:41:24 -08:00
Michael Jumper
1c3d0ba741 Add missing length to dir query response. 2013-12-09 00:41:24 -08:00
Michael Jumper
dfa30fbef6 Fill output with zeroes for short name. 2013-12-09 00:41:24 -08:00
Michael Jumper
353b6316ac Stub device control (always succeed). 2013-12-09 00:41:24 -08:00
Michael Jumper
b6fb2b850b Implement standard info. 2013-12-09 00:41:24 -08:00
Michael Jumper
634eb17b20 Remove reserved fields, fix packet lengths. 2013-12-09 00:41:24 -08:00
Michael Jumper
95230ae901 Use generic access, default to read-only. 2013-12-09 00:41:24 -08:00
Michael Jumper
cf3196d8ca Properly calculate remaining length of path. 2013-12-09 00:41:23 -08:00
Michael Jumper
34586265da Stubbed dir info. Remove name from file struct. Fix read_dir. 2013-12-09 00:41:23 -08:00
Michael Jumper
f00cb33619 Implement UTF-8 to UTF-16 conversion function. 2013-12-09 00:41:23 -08:00
Michael Jumper
94888d1f47 Move to libguac unicode functions in RDP. 2013-12-09 00:41:23 -08:00
Michael Jumper
439cd7c903 Move to attributes rather than type. 2013-12-09 00:41:23 -08:00
Michael Jumper
32fdcdc660 Fix path conversion. Convert path in dir info. 2013-12-09 00:41:23 -08:00
Michael Jumper
69d636860d Add path normalization. 2013-12-09 00:41:23 -08:00
Michael Jumper
52f9bac805 Add guac_rdpdr_fs_read_dir(). Bump _POSIX_C_SOURCE value as necessary for fdopendir(). 2013-12-09 00:41:23 -08:00
Michael Jumper
9773f348e2 Actually close in close. 2013-12-09 00:41:23 -08:00
Michael Jumper
06c2dfd8d2 Add file_id to volume queries, send real times and attributes back. 2013-12-09 00:41:23 -08:00
Michael Jumper
117e9053f4 Pull file type during open. 2013-12-09 00:41:23 -08:00
Michael Jumper
06a18f6766 Pull info from stat() during file open. 2013-12-09 00:41:23 -08:00
Michael Jumper
2f662257d9 Remove unused header. Fix header file macros. Add comments. 2013-12-09 00:41:23 -08:00
Michael Jumper
1263d261f4 Add stubs for dir information handlers 2013-12-09 00:41:23 -08:00
Michael Jumper
e238df9581 Comply with naming convention of message processors. 2013-12-09 00:41:23 -08:00
Michael Jumper
d877e1f236 Add stubs for FS message functions. 2013-12-09 00:41:23 -08:00
Michael Jumper
85b754f2b7 Fix path translation function. 2013-12-09 00:41:23 -08:00
Michael Jumper
9fcb3e3678 Actually resolve and open files. 2013-12-09 00:41:22 -08:00
Michael Jumper
f24d4b58fa Add error codes for open. 2013-12-09 00:41:22 -08:00
Michael Jumper
f3ef451527 Add stubs for minor functions. 2013-12-09 00:41:22 -08:00
Michael Jumper
4bdbaceccc Fix logic in file open (should NOT allocate new ID if open fails. 2013-12-09 00:41:22 -08:00
Michael Jumper
c31e3b38ad Add drive-path parameter. 2013-12-09 00:41:22 -08:00
Michael Jumper
7b843a806f Split rdpdr_fs up into logical files. 2013-12-09 00:41:22 -08:00
Michael Jumper
bc662975ce For now, return no-such-file for the '' file... will migrate to actual file path parsing. 2013-12-09 00:41:22 -08:00
Michael Jumper
adf45ab79e Add file time macros and more attribute constants. Stub volume and basic file info. 2013-12-09 00:41:22 -08:00
Michael Jumper
2e4a67200c Add constants. More open() implementation. Handle case where no file IDs are available. 2013-12-09 00:41:22 -08:00
Michael Jumper
d9cae3d361 Add unicode conversion functions. Partially handle incoming parameters for open. 2013-12-09 00:41:22 -08:00
Michael Jumper
8731f282cc Initial stubs for open/close. 2013-12-09 00:41:22 -08:00
Michael Jumper
061de84422 Add 64-bit operations to stream. 2013-12-09 00:41:22 -08:00
Michael Jumper
5efda4d328 Send drive capability. 2013-12-09 00:41:22 -08:00
Michael Jumper
f07cd58707 Add drive-enabled option. 2013-12-09 00:41:22 -08:00
Michael Jumper
08eb5625fc Add filesystem device. 2013-12-09 00:41:22 -08:00
Michael Jumper
497996c48e Only read from agent if agent enabled. 2013-12-03 09:21:47 -08:00
Michael Jumper
9aed54d33a Remove unnecessary include. 2013-12-03 02:23:12 -08:00
Michael Jumper
1baaa6ddee Use non-blocking I/O on non-SFTP session to avoid unnecessary waiting for data during reads. With multiple threads, libssh2 reads will call poll() to wait for available data, one read will handle ALL data, while the other read comes up dry. 2013-12-03 02:22:46 -08:00
Michael Jumper
9738197653 Differentiate between connection attempts. 2013-12-02 09:28:46 -08:00
Michael Jumper
d2fd406c75 Free alloc'd memory. 2013-12-02 09:23:31 -08:00
Michael Jumper
74e1f57a1d Fix DSA signature algorithm. 2013-12-02 08:47:21 -08:00
Michael Jumper
f1236a9ca1 Use ssh-dss, not ssh-dsa. 2013-12-02 02:18:43 -08:00
Michael Jumper
84c484aa72 Add missing license comments. 2013-12-02 02:07:17 -08:00
Michael Jumper
a2921825b7 Initiate agent forwarding if supported. 2013-12-02 02:00:37 -08:00
Michael Jumper
755c677304 Add ssh_agent source from test. 2013-12-02 01:49:07 -08:00
Michael Jumper
66b5e704b7 Init libssh2 and libssl. Log success. 2013-12-01 16:56:36 -08:00
Michael Jumper
18d9cae183 Authenticat with key if present. 2013-12-01 16:31:11 -08:00
Michael Jumper
dc490a714e Remove old options code. 2013-12-01 16:27:19 -08:00
Michael Jumper
3f686db40c Lookup hosts, etc. for connect. 2013-12-01 16:26:41 -08:00
Michael Jumper
150e645383 Working migration to libssh2 (hard-coded host). 2013-12-01 16:09:48 -08:00
Michael Jumper
d32018cf87 Partial migration, including SFTP. 2013-12-01 15:39:29 -08:00
Michael Jumper
602571400d Switch from libssh to libssh2 in configure.ac, add dependency on libssl. 2013-12-01 15:08:42 -08:00
Michael Jumper
ddec2ad12f Ticket #456: Add missing quotes to guacctl script. 2013-11-12 09:52:56 -08:00
Michael Jumper
9a8363e0ba Test for fastpath settings. 2013-11-05 12:34:36 -08:00
Michael Jumper
7547b4b5bd Ticket #452: Fix segfault related to FastPath and pointer checks. 2013-11-05 02:02:34 -08:00
Michael Jumper
1af28eb820 Prompt for passphrase if needed. 2013-10-30 23:19:11 -07:00
Michael Jumper
678ec69ebe Read private key, if any. 2013-10-30 15:46:13 -07:00
Michael Jumper
15796cbc4d Set ENABLE_SSH_PUBLIC_KEY if support for in-memory keys found in libssh. 2013-10-30 15:05:37 -07:00
Michael Jumper
93a7576312 Finish functionality+docs for guacctl. Add guacget symbolic link. 2013-10-28 14:28:37 -07:00
Michael Jumper
1ba575d3aa Implement directory set. 2013-10-28 14:11:04 -07:00
Michael Jumper
6d62b4bd60 Add license block to guacctl. 2013-10-28 09:38:10 -07:00
Michael Jumper
ebc1a10066 Resolve full path in guacctl. 2013-10-28 09:28:23 -07:00
Michael Jumper
6e8549edd1 Implement file download. 2013-10-28 09:28:06 -07:00
Michael Jumper
8ee92c0e1c Track number of active pool integers. Track output streams. 2013-10-28 09:11:45 -07:00
Michael Jumper
50fbd5dabb Add stub ack handler. Call SFTP functions when download code received. 2013-10-28 08:40:19 -07:00
Michael Jumper
1dad3dc0d7 Add initial guacctl implementation. 2013-10-27 23:16:49 -07:00
Michael Jumper
0c86f52ed5 Move SFTP functions to own file. Stub out download function. 2013-10-27 23:16:49 -07:00
Michael Jumper
273c6a8503 Stub out guac OSC handling. 2013-10-27 23:16:49 -07:00
Michael Jumper
4381485051 Validate filenames. 2013-10-27 23:16:49 -07:00
Michael Jumper
f133cb4caa Fix permissions of upload. 2013-10-27 23:16:49 -07:00
Michael Jumper
b9d9a9d324 Move SFTP to own SSH session - does not work when combined with terminal session. 2013-10-27 23:16:48 -07:00
Michael Jumper
b7e1e898c9 Initial stab at SFTP file upload. 2013-10-27 23:16:48 -07:00
Michael Jumper
02fece0a29 Add enable-sftp option, init/free SFTP as needed. 2013-10-27 23:16:48 -07:00
Michael Jumper
271f7fbb2f Add ack instruction handler. 2013-10-27 19:53:34 -07:00
Michael Jumper
3a28534232 Ticket #429: Detect listenForIncomingConnectionsNoFork() function, conditionally compile listen support. 2013-10-25 17:49:22 -07:00
Michael Jumper
9e1ebb8362 Add subdir-objects option, ignore .dirstamp files. 2013-10-25 17:21:54 -07:00
Michael Jumper
ffb64e856f Ticket #432: Handle encodings parameter. 2013-10-25 17:12:17 -07:00
Michael Jumper
3cf001116b Migrate to ack, remove abort. 2013-10-15 11:23:07 -07:00
Michael Jumper
b88749aedd Store data alongside streams. Validate stream indices and close state. 2013-10-10 14:47:12 -07:00
Michael Jumper
6ce71aa160 Send error responses via abort. 2013-10-10 14:47:12 -07:00
Michael Jumper
cec58edef3 Add abort instruction. Add status codes to abort and error. 2013-10-10 14:47:12 -07:00
Michael Jumper
72d29f18fd Fix build - unused variable. 2013-10-10 10:26:11 -07:00
Michael Jumper
926b681e38 No need for keep-alive in output thread anymore. 2013-10-09 16:09:01 -07:00
Michael Jumper
bc3c8a31c5 Require keep-alive on VNC protocol support socket. 2013-10-09 16:01:57 -07:00
Michael Jumper
eac99e0ce1 Add support for keep-alive thread. 2013-10-09 15:57:16 -07:00
Michael Jumper
4ebafa0482 Add support for NOP. 2013-10-09 11:54:33 -07:00
Michael Jumper
8a8ad23312 Do not restart parse - just shift everything as necessary. 2013-10-03 17:45:31 -07:00
Michael Jumper
ef8a9a29e8 Allow continuous parsing of length, rather than restarting if unfinished. 2013-10-03 17:35:00 -07:00
Michael Jumper
9910bedb4b If length parse fails, return need for more data. 2013-10-03 17:34:54 -07:00
Michael Jumper
e7c81cd9b3 Shift buffer to gain space if necessary. 2013-10-03 16:48:01 -07:00
Michael Jumper
e66a64be26 Handle Unicode characters in input. 2013-10-03 15:38:22 -07:00
Michael Jumper
1915b107ea Fully init allocated instructions. 2013-10-02 11:42:08 -07:00
Michael Jumper
0a09ed21fa Use simpler pointer arithmetic to determine buffer regions for reading and parsing. 2013-10-02 11:10:21 -07:00
Michael Jumper
1a598db7a1 Partial re-implementation of parse. 2013-10-01 23:21:49 -07:00
Michael Jumper
abc676ef13 Fix test's assumptions regarding contract of parser. 2013-10-01 20:58:15 -07:00
Michael Jumper
1128038d0f Implement rest of parser. 2013-10-01 20:57:54 -07:00
Michael Jumper
4485771df9 Implement length parse. 2013-10-01 20:23:20 -07:00
Michael Jumper
aff1252ff7 Implement basic parser test. 2013-10-01 18:33:50 -07:00
Michael Jumper
1cc94b403b Add test stub for instruction parser. 2013-10-01 18:12:15 -07:00
Michael Jumper
81768daba9 Stub out independent instruction parser. 2013-10-01 18:06:19 -07:00
Michael Jumper
fb105b2047 Handle blob properly (decode base64). 2013-09-27 15:56:22 -07:00
Michael Jumper
74fc3f732e Fix unit test. 2013-09-27 15:53:27 -07:00
Michael Jumper
b2b16c05b4 Add base64 decode unit test. 2013-09-27 15:51:45 -07:00
Michael Jumper
30ec019512 Implement base64 decoder. 2013-09-27 15:39:44 -07:00
Michael Jumper
321e24c417 Add actual handlers for file/blob/end. 2013-09-26 22:49:45 -07:00
Michael Jumper
a6bd9200e1 Add stubs for file/blob/end handling. 2013-09-26 22:27:18 -07:00
Michael Jumper
daa10be990 Remove old use of blob. Use new file semantics. 2013-09-24 12:58:58 -07:00
Michael Jumper
e1798ee3db Restore channel parameter. Abuse stream index as channel index. 2013-09-24 12:13:38 -07:00
Michael Jumper
fbdb6876d9 Migrate to libguac audio. Migrate to improved stream protocol. 2013-09-24 12:01:02 -07:00
Michael Jumper
157828ef18 Implement listen mode (ticket #25). 2013-09-19 14:41:28 -07:00
Michael Jumper
9c4adf60a2 Add additional quoting around nested AC_CHECK_HEADERS. 2013-09-10 14:50:04 -07:00
Michael Jumper
23e4e43722 Round screen width down, rather than up. 2013-09-03 14:09:33 -07:00
Michael Jumper
3ea5af4754 Bump project version. Will need to rebump prior to next release. 2013-09-02 17:56:55 -07:00
Michael Jumper
cf05203992 Restore parsing of color depth 2013-08-28 16:39:23 -07:00
Michael Jumper
2216d23bee Implement connection retry. 2013-08-28 16:39:23 -07:00
James Muehlner
49b3965018 Ticket #33: Fixed contributor lines in license block. 2013-08-27 10:36:30 -07:00
James Muehlner
5516fc395b Ticket #33: Fixed handling of cursor. 2013-08-27 10:36:30 -07:00
James Muehlner
775668ad37 Ticket #33: Allow parameter for setting remote or local cursor. 2013-08-27 10:36:30 -07:00
Michael Jumper
c6a6c5b681 Add ifdef around pulse-specific code. 2013-08-27 09:47:45 -07:00
Michael Jumper
73df645ce6 Change RDP default security to RDP. 2013-08-26 21:26:38 -07:00
Michael Jumper
9d47ae0a50 Add missing winpr-wtypes.h header. 2013-08-26 17:07:46 -07:00
Michael Jumper
17752733fe Update changelog, bump version. 2013-08-26 14:11:36 -07:00
Michael Jumper
9903d3d0d9 Switch from enable-auth to disable-auth, enabling auth by default. Use ANY security mode by default. Warn if authentication is required but credentials were not given. 2013-08-25 11:35:31 -07:00
Michael Jumper
da016d5153 Log chosen security method. 2013-08-24 12:37:43 -07:00
Michael Jumper
ac2bf524d9 Shorten parameter names, combine enable-tls and enable-nla into a single security parameter. 2013-08-24 12:30:38 -07:00
Michael Jumper
d2cdb055f8 Add options for controlling TLS and NLA security, as well as authentication and bad certs. 2013-08-24 01:17:27 -07:00
Michael Jumper
21b704690b Handle NULL conditions of display and terminal allocation. 2013-08-23 14:10:51 -07:00
Michael Jumper
92c42ca959 Add syncs where we're expecting guac_socket_flush to flush a frame. 2013-08-22 17:42:59 -07:00
Michael Jumper
44d0e08a3c Drop frame timeout to 0ms 2013-08-22 15:27:01 -07:00
Michael Jumper
1f0ae7b4ba Do not use pExtendedData beyond connect handler. NULL out pExtendedData once done. 2013-08-22 14:52:09 -07:00
Michael Jumper
f70333a65a Remove MALLOC/REALLOC macros from configura.ac as they cause trouble with memory debugging AND compilation. 2013-08-22 14:52:09 -07:00
Michael Jumper
1887102505 Add frame timeout. Reduce frame max duration to 40ms. 2013-08-20 21:13:26 -07:00
Michael Jumper
280622c027 Bump max frame duration to 80 ms (12.5 FPS). 2013-08-20 11:38:12 -07:00
Michael Jumper
21420aaf5c Stay in handle_messages for 30ms max (per frame). 2013-08-20 11:32:47 -07:00
Michael Jumper
dfe454f484 Adjust buffer size to around 48K, rename and reuse old buffer size macro accordingly. 2013-08-10 12:30:46 -07:00
Michael Jumper
3bb4c8fec5 Increase buffer size to around 24K. 2013-08-10 01:50:42 -07:00
Michael Jumper
5df7f34ee8 Add constants. Tweak latency. 2013-08-09 18:21:32 -07:00
Michael Jumper
fa3dcea44b Working sound 2013-08-09 17:01:06 -07:00
Michael Jumper
6e3bbe38d5 Make audio buffers const. 2013-08-09 16:52:25 -07:00
Michael Jumper
bfbebe3c16 Set stream options, force channel format. 2013-08-09 16:46:23 -07:00
Michael Jumper
83a575d7b9 Actually receive data. 2013-08-09 16:43:30 -07:00
Michael Jumper
8bbd28d9c9 Handler server and sink info. 2013-08-09 16:04:58 -07:00
Michael Jumper
3e1744a566 Initialize PulseAudio properly. Handle state changes. 2013-08-09 15:47:59 -07:00
Michael Jumper
307c6be945 Switch from libpulse-simple to libpulse. 2013-08-09 15:16:59 -07:00
Michael Jumper
88f62df0f3 Switch to normal PulseAudio API. 2013-08-09 15:11:31 -07:00
Michael Jumper
6cc6808eb7 Actually connect and read. 2013-08-09 13:03:01 -07:00
Michael Jumper
832e4d3d16 Add stub PulseAudio handling code, replace old usage with new read thread. 2013-08-09 11:58:29 -07:00
Michael Jumper
daa7823aed Remove old PulseAudio handling code. 2013-08-09 11:58:03 -07:00
Michael Jumper
27d56df073 Removal of more buffer-related code. 2013-08-09 11:18:47 -07:00
Michael Jumper
ec73bc2e12 Remove buffer functions from PA code. 2013-08-09 11:18:46 -07:00
Michael Jumper
b681e0d9f1 Remove audio args. 2013-08-09 11:18:46 -07:00
Michael Jumper
7146ba5792 Remove buffer from client. 2013-08-09 11:18:46 -07:00
Michael Jumper
0870eaa32c Remove buffer and queue. 2013-08-09 11:18:46 -07:00
Michael Jumper
3d2427d441 Fix compilation of PulseAudio handlers. 2013-08-09 10:48:41 -07:00
Michael Jumper
0b743fa68b Add missing wav_encoder.c in Makefile.am 2013-08-09 10:48:41 -07:00
Michael Jumper
2a18630718 Move files to proper location. Get rid of unnecessary lock. Remove wrongly-committed file. 2013-08-09 10:48:41 -07:00
Michael Jumper
9f167cc26a Add documentation, fix namespace. 2013-08-09 10:48:40 -07:00
Michael Jumper
58148884a1 Auto-detect audio encoding if not specified. 2013-08-09 10:48:40 -07:00
Michael Jumper
8bd70053be Initial support for audio in libguac. 2013-08-09 10:48:40 -07:00
Michael Jumper
8e732ed2ab Conditionally compile audio support. 2013-08-09 10:48:00 -07:00
Michael Jumper
8c0e0e019b Add check for PulseAudio. 2013-08-09 10:48:00 -07:00
sionc
d114c79e43 Created a generic queue implementation for the audio buffer used by the pulse audio handlers 2013-08-09 10:48:00 -07:00
Sion Chaudhuri
e30c769728 Fixing newline issues on files modified to support audio 2013-08-09 10:48:00 -07:00
Sion Chaudhuri
a9957e7926 Adding lock around send cursor 2013-08-09 10:48:00 -07:00
Sion Chaudhuri
bbe552e847 Adding locks around guac send instructions to resolve client disconnect issue 2013-08-09 10:48:00 -07:00
Sion Chaudhuri
ea8feac587 Free up resources allocated for audio when client connection is closed 2013-08-09 10:48:00 -07:00
Sion Chaudhuri
b63e14c274 Trigger audio read and send threads if audio is enabled by client 2013-08-09 10:48:00 -07:00
Sion Chaudhuri
57c0f7ed04 Added support for audio files in configure and make 2013-08-09 10:48:00 -07:00
Sion Chaudhuri
78d73d25de Added handlers for reading raw audio data from PulseAudio and sending encoded audio stream to Guacamole 2013-08-09 10:48:00 -07:00
Sion Chaudhuri
5bc4a01a5e Added generic buffer and queue implementation for audio buffering 2013-08-09 10:48:00 -07:00
Sion Chaudhuri
89679e710a Added audio dependencies to continuous integration configuration file 2013-08-09 10:48:00 -07:00
Sion Chaudhuri
8d03ca8b67 [Setup] Fixed CI Script 2013-08-09 10:48:00 -07:00
Sion Chaudhuri
60fa74a91e [Setup] Added continuous integration settings file 2013-08-09 10:48:00 -07:00
Michael Jumper
b4ffc87033 Comment util_suite.h thoroughly. 2013-08-06 12:13:47 -07:00
Michael Jumper
b6581e98d7 Implement read. 2013-08-05 20:15:41 -07:00
Michael Jumper
286f9c75b9 Byte reads should be unsigned. 2013-08-05 20:12:38 -07:00
Michael Jumper
bd84933b6b Implement read/write tests for Unicode. 2013-08-05 20:06:31 -07:00
Michael Jumper
8e08a72eda Fix Unicode tests. 2013-08-05 19:26:47 -07:00
Michael Jumper
3137f54178 Add unicode.h to distribution. Add actual tests for old Unicode functions. 2013-08-05 15:05:52 -07:00
Michael Jumper
ec22bb9010 Add stub Unicode test. 2013-08-05 14:00:32 -07:00
Michael Jumper
070f199916 Implement additional UTF-8 read/write functions for convenience. 2013-08-05 14:00:16 -07:00
Michael Jumper
8099a57fc6 Switch to VNC-style wait. 2013-07-28 19:43:20 -07:00
Michael Jumper
acf5abe355 Stay in handle_messages as long as possible for VNC as well. 2013-07-28 19:43:20 -07:00
Michael Jumper
4b6aa01517 Unlock lock properly. 2013-07-28 19:43:20 -07:00
Michael Jumper
ce759ccbe6 Flush only automatically. Stay in handle_messages as long as data is available. 2013-07-28 19:43:20 -07:00
Michael Jumper
a52a13584b Initialize devices_registered. 2013-07-24 23:51:49 -07:00
Michael Jumper
1e521a1696 Call free handler on devices. Only add printer if enabled. 2013-07-24 22:49:24 -07:00
Michael Jumper
6b4deb703a Finish dynamic device implementation. 2013-07-24 22:20:29 -07:00
Michael Jumper
d65a23349d Add announce handlers. 2013-07-24 18:28:20 -07:00
Michael Jumper
1138df74be Initial migration to dynamic device registration. 2013-07-24 15:52:46 -07:00
Michael Jumper
7661f465e5 Remove STUB, add notes. 2013-07-22 20:26:16 -07:00
Michael Jumper
9b9481d072 Push/pull settings properly before and after connect. 2013-07-22 20:26:16 -07:00
Michael Jumper
82f1fb2bad Fix plugin names - sound and printing were not loading properly. 2013-07-22 20:26:16 -07:00
Michael Jumper
8d7784a45f Output for custom tests. 2013-07-22 20:26:16 -07:00
Michael Jumper
733c008f9b Add missing comma. 2013-07-22 20:26:15 -07:00
Michael Jumper
9d2b0e1f95 FALSE should be false. 2013-07-22 20:26:15 -07:00
Michael Jumper
f9bd8eb22b Fix build on 1.0 again. 2013-07-22 20:26:15 -07:00
Michael Jumper
5c4a468264 Fix and improve tests. 2013-07-22 20:26:15 -07:00
Michael Jumper
07538d1b10 Do not commit settings until actually set. 2013-07-22 20:26:15 -07:00
Michael Jumper
59e90b7c63 Implement settings. 2013-07-22 20:26:15 -07:00
Michael Jumper
ddeab9a435 Fix install path. Fix rdpdr plugin naming. 2013-07-22 20:26:15 -07:00
Michael Jumper
14fedacfc7 Finally working compile. 2013-07-22 20:26:15 -07:00
Michael Jumper
0e4dcff4f5 More fixes for cliprdr, fix color_depth. 2013-07-22 20:26:15 -07:00
Michael Jumper
3e9f551c4e Fix cliprdr portability handling. 2013-07-22 20:26:15 -07:00
Michael Jumper
f3f0900de9 Detect event interface, fix cliprdr. 2013-07-22 20:26:15 -07:00
Michael Jumper
c0f681066e Add test for change in type of rdpBitmap.Decompress. Fix cliprdr header. 2013-07-22 20:26:15 -07:00
Michael Jumper
daa1e18355 Check for addin registration headers and function, use if available. 2013-07-22 20:26:15 -07:00
Michael Jumper
c2fe48f00c Much more robust testing. Initial migration to own settings structure. 2013-07-22 20:26:15 -07:00
Michael Jumper
2b09098346 Fix erroneously uppercased TRUE value. 2013-07-22 20:26:15 -07:00
Michael Jumper
324d13853f Switch to UINT* and BOOL types. 2013-07-22 20:26:15 -07:00
Michael Jumper
9ad3b18f77 Fix build of RDPDR. 2013-07-22 20:26:15 -07:00
Michael Jumper
df01ba66ea Detect extension format. 2013-07-22 20:26:15 -07:00
Michael Jumper
450017a6bd Register add-in provider. 2013-07-22 20:26:15 -07:00
Michael Jumper
45b8d29a4f Check for interval_ms. 2013-07-22 20:26:15 -07:00
Michael Jumper
f43591068f Change plugin name to guacsnd, remove use of DEFINE_SVC_PLUGIN. 2013-07-22 20:26:14 -07:00
Michael Jumper
1bbf2b21d9 Add BYTE type. 2013-07-22 20:26:14 -07:00
Michael Jumper
aeea99a87f Detect types availability. 2013-07-22 20:26:14 -07:00
Michael Jumper
b72c99cea5 Move compat to generic, add winpr-stream.c. 2013-07-22 20:26:14 -07:00
Michael Jumper
da2bd88791 More migration and compatibility. 2013-07-22 20:26:14 -07:00
Michael Jumper
678d21cd36 More winpr compat, fix include test. 2013-07-22 20:26:14 -07:00
Michael Jumper
bdc5d862db Partial conversion to WinPR + compat. 2013-07-22 20:26:14 -07:00
Michael Jumper
20ca4ef6f6 Add C macro for WinPR detection. 2013-07-22 20:26:14 -07:00
Michael Jumper
4eccb8c4d5 Check for support for streams via winpr. 2013-07-22 20:26:14 -07:00
Michael Jumper
873493a2de Remove use of xnew. 2013-07-22 20:26:14 -07:00
Michael Jumper
64b0ab84b5 Remove usage of xrealloc/xmalloc. 2013-07-22 20:26:14 -07:00
Michael Jumper
bffa28a7de Remove usage of xfree(). 2013-07-22 20:26:14 -07:00
Michael Jumper
7907b2f34a Remove now-unnecessary memory.h. 2013-07-22 20:26:14 -07:00
Michael Jumper
db4f3f190d Check for libfreerdp-client (newer), then libfreerdp-channels (legacy, common). 2013-07-22 20:26:14 -07:00
Michael Jumper
6d89578f05 Remove unnecessary AC_SUBST. 2013-07-22 16:22:02 -07:00
Michael Jumper
e049d35583 Clean up error handling. 2013-07-22 16:12:39 -07:00
Michael Jumper
98dd9d2c69 Remove unimplemented -A option. 2013-07-22 15:47:13 -07:00
Michael Jumper
9b89c2a3b5 Update documentation. 2013-07-22 15:45:40 -07:00
Michael Jumper
7b7227aefb Properly handle key and cert files. Better logging. 2013-07-22 15:42:11 -07:00
Michael Jumper
def887868a Add option for private key. 2013-07-22 14:49:28 -07:00
Michael Jumper
3140dbb20b Actually use SSL for I/O. 2013-07-22 14:24:37 -07:00
Michael Jumper
cdbb345d28 Fix usage instructions. 2013-07-22 13:39:37 -07:00
Michael Jumper
6792b65d4c Add options to guacd. Update docs. 2013-07-22 13:37:30 -07:00
Michael Jumper
bb74730629 Add stub SSL socket. 2013-07-21 20:10:37 -07:00
Michael Jumper
aa68f2df21 Check for libssh. 2013-07-21 19:56:03 -07:00
Michael Jumper
4a3a530fde Fix guac_rdp_clip_rect() handling of completely clipped rects. 2013-07-19 12:23:28 -07:00
Michael Jumper
77999e6371 Fix library function tests in configure.ac (AC_CHECK_FUNCS provides no means of specifying the library to check). 2013-07-16 14:28:03 -07:00
Michael Jumper
3596436c27 Bump version properly. 2013-07-15 23:31:24 -07:00
Michael Jumper
473ad8e464 Bump version to 0.8.2. 2013-07-13 17:33:23 -07:00
Michael Jumper
c99b257dac Should also link libogg. 2013-07-09 01:14:29 -07:00
Michael Jumper
3646bdbbbf Also check for (and link with) libvorbis. 2013-07-09 00:58:14 -07:00
Michael Jumper
edf9762667 Fix linking flag for libdl. 2013-07-08 19:05:06 -07:00
Michael Jumper
c3bbf97d22 libdl is actually used by libguac, not guacd. 2013-07-08 18:52:30 -07:00
Michael Jumper
2b93deaac6 Do not unnecessarily link libraries. 2013-07-08 17:40:20 -07:00
Michael Jumper
0f609cb666 Test for VNC repeater support and cairo_format_stride_for_width(). 2013-07-08 13:03:04 -07:00
Michael Jumper
e6ec853edb Ticket #366: Restore --with-init-dir option for configure. 2013-07-08 10:35:56 -07:00
Michael Jumper
2d3cf15243 Ticket #365: Add missing PTHREAD_LIBS to guacd_LDFLAGS. 2013-07-07 15:03:30 -07:00
Michael Jumper
73b70ec072 Make audio streams threadsafe. 2013-07-07 00:23:18 -07:00
Michael Jumper
09588f53e5 Add ChangeLog. 2013-07-02 17:13:20 -07:00
Michael Jumper
73fb45bbd5 Restore AC_DEFINE from old configure.in for ENABLE_OGG macro. 2013-07-02 12:14:19 -07:00
Michael Jumper
030eaec09e Remove unused print format option (require GhostScript). 2013-07-01 17:54:28 -07:00
Michael Jumper
54d3b160d7 Fix threading issues regarding flush DURING write not being blocked. Set process-shared attribute on mutexes in socket. 2013-07-01 15:03:47 -07:00
Michael Jumper
59b058be3d Ensure complete writes, define buffer size. 2013-07-01 15:03:47 -07:00
Michael Jumper
a08180acfe Remove unnecessary update lock, use threadsafe socket instead. 2013-07-01 15:03:46 -07:00
Michael Jumper
90697e35ba Use int instead of bool ... libraries sometimes redefine bool in headers. 2013-07-01 15:03:46 -07:00
Michael Jumper
976e3af24b Convert protocol functions to threadsafe versions. 2013-07-01 15:03:46 -07:00
Michael Jumper
51c00755ac Add optional locks to socket. 2013-07-01 15:03:46 -07:00
Michael Jumper
400920b3bb Convert PS to PDF using gs as filter. 2013-07-01 15:03:46 -07:00
Michael Jumper
62258c9278 Revert "Add libgs dependency, only compile guac_rdpdr if libgs found."
This reverts commit b77a7e0bffdcc44cc5488663d780c1a2c31ef781.
2013-07-01 15:03:46 -07:00
Michael Jumper
5bf67ce442 Change disable-printing to enable-printing. 2013-07-01 15:03:46 -07:00
Michael Jumper
ad050208b9 Add libgs dependency, only compile guac_rdpdr if libgs found. 2013-07-01 15:03:46 -07:00
Michael Jumper
2df35e6f2e Attempt to extract a good filename from the %%Title comment in the .ps 2013-07-01 15:03:46 -07:00
Michael Jumper
6c5525a162 Swap mimetype/filename parameters. 2013-07-01 15:03:46 -07:00
Michael Jumper
a8b5c9fc5b Swap mimetype/filename parameters. 2013-07-01 15:03:46 -07:00
Michael Jumper
8920bc0c76 Send printed document via blobs. 2013-07-01 15:03:46 -07:00
Michael Jumper
9e88ae4f60 Implement file/blob/end subprotocol. 2013-07-01 15:03:46 -07:00
Michael Jumper
06ef43bd2c Actually read print job data. 2013-07-01 15:03:46 -07:00
Michael Jumper
c07eb9c063 Send driver name as UTF-16 (apparently required, and ASCII flag is ignored). 2013-07-01 15:03:46 -07:00
Michael Jumper
dc1fc6132f Fix shifting of error codes. 2013-07-01 15:03:46 -07:00
Michael Jumper
4953f02b13 Do not send devices after confirmed ID - only after logon. 2013-07-01 15:03:46 -07:00
Michael Jumper
9aef54fe87 Seed random numbers. 2013-07-01 15:03:46 -07:00
Michael Jumper
933dec8602 Send printer device, handle errors. 2013-07-01 15:03:46 -07:00
Michael Jumper
8c8779937c Cleanup, add constants. 2013-07-01 15:03:46 -07:00
Michael Jumper
c066763ec4 Implement name request and client cap. Ignore server cap for now. 2013-07-01 15:03:45 -07:00
Michael Jumper
49711709a7 Stub most handlers, fix signedness, reply to server announce. 2013-07-01 15:03:45 -07:00
Michael Jumper
48c27d74ce Move message handlers to appropriate location. 2013-07-01 15:03:45 -07:00
Michael Jumper
f295b09987 Actually parse server announce, add defines for other packets and components. 2013-07-01 15:03:45 -07:00
Michael Jumper
11deb82bcb Associated client with RDPDR, add logging to stubs. 2013-07-01 15:03:45 -07:00
Michael Jumper
6d9ff1e5ee Add RDPDR plugin stub. Add namespace to existing RDPSND filenames. 2013-07-01 15:03:45 -07:00
James Muehlner
b94b84956b Ticket #241: Added server-side support for vnc repeaters. 2013-07-01 10:46:30 -07:00
Michael Jumper
bfe28460a7 Move __guac_rdp_clip_rect() to public guac_rdp_clip_rect(). Clip glyph draws. 2013-06-14 22:16:25 -07:00
Michael Jumper
d9a310292d Merge branch 'unstable' of git://github.com/glyptodon/guacamole-server into unstable 2013-06-13 23:41:02 -07:00
James Muehlner
6730ba9620 Merge branch 'unstable' of git://github.com/glyptodon/guacamole-server into unstable 2013-06-13 23:50:07 -07:00
James Muehlner
227afb3793 Ticket #261: Handled NULL bitmaps in guac_rdp_bitmap_setsurface and guac_rdp_gdi_memblt functions. 2013-06-13 23:38:20 -07:00
Michael Jumper
96cc46313a Implement guac_socket_write(), fix constness. 2013-06-12 11:49:00 -07:00
Michael Jumper
e7c70111ef Fix build process such that pango is properly detected. 2013-06-12 11:47:44 -07:00
Michael Jumper
602e0045b6 Substitute values properly, fix linking flags. 2013-06-11 22:41:23 -07:00
Michael Jumper
760506da3d Remove SPICE - will move to branch off unstable. 2013-06-06 10:24:21 -07:00
Michael Jumper
27af176bbd Add doc/Doxyfile and tests to distribution. Reorder build. 2013-06-06 09:35:27 -07:00
Michael Jumper
9d27b6cce9 Build wasn't working just because of trailing slash... 2013-06-05 15:58:22 -07:00
Michael Jumper
02258ff5b1 Moved and updated help text displayed at end of configure. 2013-06-05 15:18:53 -07:00
Michael Jumper
3456fc0418 Reword docs (as no longer guacd-specific). 2013-06-05 14:59:57 -07:00
Michael Jumper
99c5a76d1e Remove accidentally-committed binary file. 2013-06-05 14:36:06 -07:00
Michael Jumper
80688b2a2f Fix doxyfile, update .gitignore's 2013-06-05 14:33:43 -07:00
Michael Jumper
effedda762 Update tests to use new include path. 2013-06-05 12:12:32 -07:00
Michael Jumper
e9e2d628b6 Add remaining protocols, fix client.h in RDP. 2013-06-05 12:05:39 -07:00
Michael Jumper
1d3fa12747 Build guacd and libguac. 2013-06-05 11:50:48 -07:00
Michael Jumper
4c089caeb9 Massively reorganize source tree. 2013-06-05 11:00:28 -07:00
Michael Jumper
82b4d27566 One configure.ac to rule them all. 2013-06-05 10:45:07 -07:00
Michael Jumper
e750d1aabb Convert SSH and SPICE to new system. Add options for disabling packages. 2013-06-04 23:39:15 -07:00
Michael Jumper
e0d09d4be8 Convert RDP and VNC to new build system. 2013-06-04 20:19:33 -07:00
Michael Jumper
7f1eb77c8f Move libguac headers to a location others can pull. Modify guacd to use bundled libguac if present. 2013-06-04 19:50:26 -07:00
Michael Jumper
8a18afeb1d Fix configure.ac for guacd and libguac. 2013-06-04 16:55:23 -07:00
Michael Jumper
ecb1508ecf Add m4/README and .gitignore. 2013-06-04 16:31:14 -07:00
Michael Jumper
e6a1521e75 Improved build scripts for guacd and libguac, added parent build scripts. 2013-06-04 16:29:31 -07:00
Michael Jumper
2754cfbcdc Merge libguac-client-spice. 2013-06-04 15:53:32 -07:00
Michael Jumper
d9cfd35647 Merge libguac-client-ssh. 2013-06-04 15:52:49 -07:00
Michael Jumper
aaf8a0829d Merge libguac-client-rdp. 2013-06-04 15:52:33 -07:00
Michael Jumper
2c8aa7f8d1 Merge libguac-client-vnc. 2013-06-04 15:52:18 -07:00
Michael Jumper
801338b06b Merge libguac project. 2013-06-04 15:51:58 -07:00
Michael Jumper
897010cd23 Initial highly-stubbed guac_client_init(). 2013-05-31 16:10:34 -07:00
Michael Jumper
d07830ea33 Implement compatibility with older libssh. 2013-05-31 09:54:06 -07:00
Michael Jumper
b3bf7bd700 Actually link with libspice-client-glib. 2013-05-30 17:11:04 -07:00
Michael Jumper
05a9a7524a Fix includes. Add handlers. 2013-05-30 16:35:23 -07:00
Michael Jumper
365c314705 Initial stub commit. 2013-05-30 16:33:02 -07:00
Michael Jumper
fc8eae8d2a Bump version, update ChangeLog and AUTHORS. 2013-05-29 11:37:27 -07:00
Michael Jumper
48bd214868 Remove unnecessary logging. 2013-05-26 02:03:54 -07:00
Michael Jumper
8f0be20b35 Implement tab setting/resetting. 2013-05-26 01:49:47 -07:00
Michael Jumper
8019063214 Fix home/end and function keys. 2013-05-26 00:49:06 -07:00
Michael Jumper
d583dbb990 Add keyboard shortcuts for paste and scrolling. Allow middle click for paste. 2013-05-26 00:17:31 -07:00
Michael Jumper
417642eb8e Implement insert mode. 2013-05-26 00:01:47 -07:00
Michael Jumper
2f7e0eec41 Add comments to client data. 2013-05-25 23:56:59 -07:00
Michael Jumper
2a6de3aaed Add port and font options. 2013-05-25 23:50:13 -07:00
Michael Jumper
6d33be152c Fix prompt() handling of backspace/enter. Format name based on username and hostname. Add port parameter (not yet used). Determine parameter indices based on enum. 2013-05-25 23:15:55 -07:00
Michael Jumper
cf8ec8dbc2 Properly cleanup SSH sessions. 2013-05-25 23:05:58 -07:00
Michael Jumper
763ed37179 Add remaining keys, fix backspace. Add insert flag. 2013-05-25 22:45:26 -07:00
Michael Jumper
88ca59a5b3 Implement terminal reporting features. 2013-05-25 20:24:44 -07:00
Michael Jumper
3a14c864a6 Only send DA response if no private mode. 2013-05-25 18:20:35 -07:00
Michael Jumper
f2520ca91c Send 0x0D for return. 2013-05-25 16:09:28 -07:00
Michael Jumper
b823192f03 Ignore unhandled control codes. Implement ENQ. 2013-05-24 22:54:56 -07:00
Michael Jumper
8967afefb6 Only send response to ESC[0c. 2013-05-24 22:26:24 -07:00
Michael Jumper
43eddc14c0 Implement G0/G1 switching. 2013-05-24 21:28:14 -07:00
Michael Jumper
0f5b5d39b4 Initial support for G0/G1 character sets. 2013-05-24 21:18:47 -07:00
Michael Jumper
94ee3c87fc Implement ESC-Z identify and ESC-c reset. 2013-05-24 16:29:43 -07:00
Michael Jumper
7216f734b5 Add some Linux-specific missing codes, reorder SGR. Add explicit ignores for unapplicable features. 2013-05-24 15:00:54 -07:00
Michael Jumper
e0c46a41a2 Interpret ESC[3J as if ESC[2J 2013-05-24 13:44:51 -07:00
Michael Jumper
b513e4ba93 Add LF/NL mode. 2013-05-24 13:33:32 -07:00
Michael Jumper
e3f89052e5 Specify terminal type. 2013-05-23 23:43:35 -07:00
Michael Jumper
f4475b4f00 Move flags to generic function, add charset handler stubs. 2013-05-23 23:12:01 -07:00
James Muehlner
8f1b5ae769 Ticket #313: Fixed styling. 2013-05-23 00:02:42 -07:00
James Muehlner
fb74c87e23 Ticket #313: Return whatever is converted so far if EILSEQ detected. Furthermore, if NULL returned from convert(), just send an empty string. Finally, use //TRANSLIT as an option for iconv_open if the library version supports it. 2013-05-22 21:53:30 -07:00
Michael Jumper
ae7959c6a4 Clear screen after prompts. 2013-05-22 11:54:28 -07:00
Michael Jumper
88dfb1517d Preserve cursor attribute when cursor row is touched. 2013-05-22 11:51:01 -07:00
Michael Jumper
c2f507a00a Fix handling of CSI sequences. 2013-05-22 11:38:39 -07:00
Michael Jumper
b1622413a9 Implement mode set/reset. Implement DECCKM mode. 2013-05-22 11:08:38 -07:00
Michael Jumper
334d6cb08b Fix background filling algorithm. 2013-05-22 03:26:51 -07:00
Michael Jumper
b66d8f2e9a Implement CSI 'a' 2013-05-21 23:57:55 -07:00
Michael Jumper
266f4e8d1b Implement DECALGN (fill screen with E's) 2013-05-21 23:38:35 -07:00
Michael Jumper
dd936b4873 Implement CSI e and f. 2013-05-21 23:27:34 -07:00
Michael Jumper
af700542b0 Implement CSI E and F. 2013-05-21 23:20:13 -07:00
Michael Jumper
c62bba9e15 Fix scroll region set CSI (no parameters should reset region) 2013-05-21 22:37:53 -07:00
Michael Jumper
142b526a97 Move write_all convenience function to common. 2013-05-21 22:09:42 -07:00
Michael Jumper
5a0b8b2ea7 Move pipes to terminal scope. 2013-05-21 22:02:11 -07:00
Michael Jumper
225377f197 Fix VT/FF. Implement DEL and CSI. 2013-05-21 00:57:44 -07:00
Michael Jumper
438ac8e9bb VT and FF should behave exactly as LF. 2013-05-21 00:55:46 -07:00
Michael Jumper
4763f029a4 ACTUALLY alphabetize... 2013-05-21 00:47:55 -07:00
Michael Jumper
c1b0e3bb3b Alphabetize CSI handlers. 2013-05-21 00:35:18 -07:00
Michael Jumper
7894346285 Implement Index and Next Line. 2013-05-21 00:29:19 -07:00
Michael Jumper
b38412fd3d Implement save/restore cursor. 2013-05-21 00:19:53 -07:00
Michael Jumper
c220a4875c Properly close pipe file descriptors. Wait for input thread to close in SSH thread. 2013-05-20 10:52:47 -07:00
Michael Jumper
639389ced8 Fix error when no data received (read returns SSH_AGAIN). 2013-05-20 10:44:43 -07:00
Michael Jumper
5fd14b3b4d Handle resize when SSH not connected. Update visible cursor row in resize. 2013-05-20 10:27:53 -07:00
Michael Jumper
80825072fe Reinstate SSH client. 2013-05-20 01:23:21 -07:00
Michael Jumper
0f978393a6 Implement prompts, do not actually redirect real STDIN/STDOUT. 2013-05-20 00:33:17 -07:00
Michael Jumper
0057460c44 Add echo flag. 2013-05-18 22:24:09 -07:00
Michael Jumper
a53a5e2e1b Working input/output. 2013-05-17 22:53:13 -07:00
Michael Jumper
5009d1c280 Revert "Use input/output threads for SSH client."
Should actually have one main thread, which then spawns an input thread after connection successful.

This reverts commit 6a099b4176fb732b7281128100fe66bb0a72da1a.
2013-05-17 20:58:47 -07:00
Michael Jumper
8f0c2f3723 Use input/output threads for SSH client. 2013-05-17 20:53:16 -07:00
Michael Jumper
96edfad7c0 Add stub client thread. 2013-05-17 20:47:05 -07:00
Michael Jumper
0dbcdabe40 General naming cleanup. 2013-05-17 20:28:26 -07:00
Michael Jumper
ec845a812a Remove core SSH client code. Refactor message handler to handle pipe for STDOUT. Refactor key and clipboard handlers to handle pipe for STDIN. 2013-05-17 20:20:51 -07:00
Michael Jumper
791da3dc81 Properly update visible cursor row when terminal scrolled. 2013-05-15 13:55:40 -07:00
Michael Jumper
9b0a210c12 Improve cursor rendering, ensure display not affected if cursor does not move. Repurpose unused "selected" attribute for marking the cursor. 2013-05-15 12:46:26 -07:00
Michael Jumper
337d79721e Do not start selection until mouse moves. 2013-05-15 12:08:05 -07:00
Michael Jumper
b5e3c2e721 Clear with NULL character. Do not include NULLs in copied text. 2013-05-15 10:11:47 -07:00
Michael Jumper
ce21f2c883 Implement range check, fix parameters. 2013-05-14 17:19:08 -07:00
Michael Jumper
d89453e342 Keep highlight displayed until text beneath highlight is touched (low-level logic is stubbed). 2013-05-14 13:26:22 -07:00
Michael Jumper
f73ece4e12 Dead grave and dead acute are not actually wrong here. 2013-05-13 22:03:28 -07:00
Michael Jumper
7d0dfd4425 #250: Implement DSTBLT. 2013-05-13 17:58:19 -07:00
Michael Jumper
8698cfc1cc Fix memblt/scrblt source coordinates. 2013-05-13 17:50:14 -07:00
Michael Jumper
b20aa53843 Wrong coordinate being stored in Y. 2013-05-13 14:40:54 -07:00
Michael Jumper
3af39503c0 Fix clipping calculations. 2013-05-13 14:37:48 -07:00
Michael Jumper
00e44007f5 Do not modify input, initialize bounded flag. 2013-05-13 14:34:24 -07:00
Michael Jumper
960c3e1e4a Implement clipping in software. 2013-05-13 14:27:15 -07:00
Michael Jumper
14bf8dd843 Handle typing of Unicode properly. 2013-05-13 01:51:16 -07:00
Michael Jumper
a7ba3f085f Username parameter should be "username", not "user". 2013-05-09 21:43:46 -07:00
Michael Jumper
c40a9b8994 Actually implement AltGr as a separate code, rather than Ctrl+Alt. 2013-05-09 20:44:56 -07:00
Michael Jumper
03ae1481ea Bump version. 2013-05-09 00:24:04 -07:00
Michael Jumper
af3fafcbd9 Add superscript 2 and 3 to German mapping. 2013-05-09 00:20:09 -07:00
Michael Jumper
5a5a02f99b Fix French keyboard mapping. 2013-05-09 00:19:55 -07:00
Michael Jumper
9557ca05ab Have to not clear both CTRL_ALT as that would prohibit CTRL+ combinations (and ALT+). 2013-05-08 23:09:42 -07:00
Michael Jumper
6241ebcbb2 If clearing SHIFT, should clear ALL_SHIFT. 2013-05-08 23:06:13 -07:00
Michael Jumper
8e5dde0cd8 Remove ALL_MODIFIERS clear for most keys. 2013-05-08 23:03:40 -07:00
Michael Jumper
eb4ab6d383 Fix bar symbol. 2013-05-08 18:28:43 -07:00
Michael Jumper
7fa531cc2e Allow storage of keysyms in the 0x0100xxxx space. Map AltGr to Ctrl+Alt. 2013-05-08 18:24:46 -07:00
Michael Jumper
4cb9b67a6f Allow ctrl/alt on Q/E/M. 2013-05-08 14:32:13 -07:00
Michael Jumper
5427c152ba Fix German keymap, add right/left ctrl/alt keysyms. 2013-05-08 14:21:04 -07:00
Michael Jumper
0d41f4ecde Restore password prompt. 2013-05-06 16:12:37 -07:00
Michael Jumper
547966b63d Add missing newline before last line of copied text. Add Unicode support to copied text. 2013-05-06 12:18:56 -07:00
Michael Jumper
3d1ca93b3a Initial actual support for copying of text. 2013-05-06 11:06:21 -07:00
Michael Jumper
c29c43e056 Initial selection support. 2013-05-06 01:02:23 -07:00
Michael Jumper
cb21322745 Fix wrong location value for collisions. 2013-05-03 12:45:15 -07:00
Michael Jumper
95810fbb76 Clear glyph region before sending PNG. 2013-05-03 12:10:38 -07:00
Michael Jumper
5df2f66fae Remove FIXME status. 2013-05-03 11:53:06 -07:00
Michael Jumper
857498fc19 Fix buffer copy_rows logic. 2013-05-03 11:49:08 -07:00
Michael Jumper
3a32e7084c Implement more console codes and reverse linefeed, de-stub buffer functions. 2013-05-03 02:50:05 -07:00
Michael Jumper
edc4c223bb Restore scroll down. 2013-05-02 22:50:33 -07:00
Michael Jumper
5e51f361ee Fix unicode support (wrong lengths). 2013-05-02 15:06:21 -07:00
Michael Jumper
356e3945e9 Unicode support. 2013-05-02 14:56:20 -07:00
Michael Jumper
de5b945f73 Redraw from buffer as necessary during resize (finish resize support). 2013-05-02 12:35:20 -07:00
Michael Jumper
ac52c8fb64 Proper handling of new rows and removed rows. 2013-05-02 03:18:10 -07:00
Michael Jumper
22ee486019 Remove more FIXME and STUB status. 2013-05-02 01:28:31 -07:00
Michael Jumper
ed777d0a76 Remove stub status - no longer stubs. 2013-05-02 01:22:50 -07:00
Michael Jumper
8c81cae871 Initial screen resize support. 2013-05-01 16:54:29 -07:00
Michael Jumper
ca17560328 Limit display updates to visible area. 2013-04-30 00:20:21 -07:00
Michael Jumper
1af2aa2f03 Probably about time the title changed from SSH TEST. 2013-04-28 01:33:42 -07:00
Michael Jumper
0c99978160 Fix handling of length in buffer. 2013-04-28 01:28:49 -07:00
Michael Jumper
3a50c9572d Clear cells when resizing or scrolling. 2013-04-26 14:52:51 -07:00
Michael Jumper
6092badb3b Handle display size properly, start out empty. 2013-04-26 14:14:19 -07:00
Michael Jumper
dd4862f59a Implement basic terminal scroll. 2013-04-26 10:55:55 -07:00
Michael Jumper
e1b45733a3 Remove old functions, implement display copies. 2013-04-26 10:36:02 -07:00
Michael Jumper
b64aaa72ee Partial restoration of display functionality. Modify get_row to expand row as necessary. 2013-04-26 02:29:30 -07:00
Michael Jumper
d3db89d3b9 Fix compile errors. Add logs to stubs. 2013-04-26 01:53:19 -07:00
Michael Jumper
bed877c2fe Add get_row function. 2013-04-25 12:10:01 -07:00
Michael Jumper
32e6a07f59 Rename delta to display. 2013-04-25 11:55:50 -07:00
Michael Jumper
396bba6ea3 Initial stab at rearchitecting - will not compile as is. Partial. 2013-04-25 11:54:00 -07:00
Michael Jumper
cb4abb9115 Assume UTF-8 for incoming bytes. 2013-04-15 15:24:21 -07:00
Michael Jumper
0dabb97f01 Initial selection support - does not yet affect clipboard, nor work properly when scrolled. 2013-04-15 01:22:05 -07:00
Michael Jumper
2eeb9263c5 Start with blank pointer, show pointer when moving mouse, hide pointer when typing. 2013-04-09 14:09:41 -07:00
Michael Jumper
d3efaeee6e Add blank cursor. 2013-04-09 14:02:52 -07:00
Michael Jumper
a855af8608 Free cursors when done. 2013-04-09 13:58:55 -07:00
Michael Jumper
21f109fdeb Migrate to cacheable cursors. 2013-04-09 13:54:23 -07:00
Michael Jumper
f74c4b851d Implement CSI command 'X', clean up a bit. 2013-04-08 02:14:58 -07:00
Michael Jumper
c20fe79ace Remove scroll logging, reset scroll upon typing. 2013-04-08 00:47:08 -07:00
Michael Jumper
7897be9316 Check write location on rect operations (copy, etc.) 2013-04-08 00:14:25 -07:00
Michael Jumper
342824914a Exclude simultaneous access to the terminal structure by the input and output threads. 2013-04-07 16:55:06 -07:00
Michael Jumper
43f42cbb4c Use pre-allocated scratch area, rather than constantly-reallocated scratch area. 2013-04-05 13:15:19 -07:00
Michael Jumper
b8ec48d179 Offset by scroll amount. 2013-04-05 13:12:18 -07:00
Michael Jumper
77b427a2f0 Pull from buffer if row non-negative. 2013-04-05 12:54:59 -07:00
Michael Jumper
84d45097d0 Simplify scrolling logic. 2013-04-05 11:31:46 -07:00
Michael Jumper
f7143be78b Initial scrollback implementation (missing buffer redraw and several necessary graphical ops). 2013-04-05 01:32:33 -07:00
Michael Jumper
06fb3b5a2e Stub out scroll wheel handling. 2013-04-01 01:59:15 -07:00
Michael Jumper
320255ade1 Partially implement copy for buffers, add logging to simulate scrollback push. 2013-04-01 01:10:47 -07:00
Michael Jumper
3e4199f90a Add missing AUTHORS (apologies to Alex DEVELY for mispelling his last name in his commit), clean up German keymap. 2013-03-29 22:04:46 -07:00
Michael Jumper
80f0b7e1e1 Remove Unicode translation warnings, as the functionality is intentional. 2013-03-29 18:27:27 -07:00
Michael Jumper
1ce5e85939 Rename "layout" to "server-layout" to help reduce confusion. 2013-03-29 13:34:45 -07:00
Michael Jumper
6bf9a0a9e0 Fix comments. 2013-03-29 13:19:25 -07:00
Michael Jumper
7ba047f5a8 Add French and German keymaps to build, add failsafe keymap, parse layout parameter, cleanup contributed keymaps, add missing declarations. 2013-03-29 13:08:14 -07:00
Michael Jumper
b6effd3d4f Merge branch 'french-keymap' into more-keymaps 2013-03-29 12:46:52 -07:00
Michael Jumper
bd45a8e5f6 Hotspot in middle, halve width of I-bar, clean up edges, shade. 2013-03-29 03:20:35 -07:00
Michael Jumper
8140a5cc3d Initial I-bar cursor. 2013-03-29 03:14:08 -07:00
Michael Jumper
c95c51a9c1 Clear with current attributes (not just background color), use real cursor (not layer). 2013-03-29 02:51:31 -07:00
Michael Jumper
95923b2752 Add terminal character buffer, update buffer with each operation. 2013-03-29 01:56:27 -07:00
Michael Jumper
38794ed94b Revert "Refactor delta to display."
This reverts commit 4b34bbbf3feb2c0053a64f978e9890824b2e8320.

Conflicts:
	src/ssh_handlers.c
2013-03-27 12:44:40 -07:00
Michael Jumper
fa0522503b Revert "Keep current character status updated."
This reverts commit 449637998c1fa4dfcddc1ed0a88562bb0a81d14a.
2013-03-27 12:43:21 -07:00
Michael Jumper
c2e80bda81 Restore cursor redraw function. 2013-03-27 04:11:56 -07:00
Michael Jumper
f1844ec555 Revert "Remove cursor layer."
This reverts commit 16a77db63bcc1455b2ec3b9939f50a70b7e03c21.
2013-03-27 04:03:54 -07:00
Michael Jumper
436387edae Keep current character status updated. 2013-03-27 03:49:40 -07:00
Michael Jumper
2c78613821 Refactor delta to display. 2013-03-27 03:06:45 -07:00
Michael Jumper
b736f13d32 Merge keymap source provided by Trac use on #141. 2013-03-26 13:22:56 -07:00
Michael Jumper
9b00ce9f28 German keyboard stub. 2013-03-26 13:19:40 -07:00
Michael Jumper
87c36ca2a5 Increate font size (needs to be arg). 2013-03-25 03:04:14 -07:00
Michael Jumper
17a4d141de Remove cursor layer. 2013-03-25 03:01:51 -07:00
Michael Jumper
7ea73559be Partial implementation of copy. 2013-03-25 02:56:59 -07:00
Michael Jumper
06fee87073 Unstub set_rect, properly handle reverse color in clear. 2013-03-25 02:32:23 -07:00
Michael Jumper
91bf5e7e3b Implement clear. 2013-03-25 01:54:44 -07:00
Michael Jumper
1408248282 Partial implementation of flush (set only). 2013-03-24 18:46:47 -07:00
Michael Jumper
3e21d1c3c7 Implement delta set. 2013-03-24 18:16:04 -07:00
Michael Jumper
a102ba4a86 Add set_rect, use it in clear. 2013-03-24 18:05:15 -07:00
Michael Jumper
96b12c7722 Replace drawing with calls to delta functions, document terminal functions. 2013-03-24 16:56:17 -07:00
Michael Jumper
73d1cb4285 Remove cursor redraw function. 2013-03-23 18:39:23 -07:00
Michael Jumper
10cac18b41 Implement delta alloc and free. 2013-03-23 17:43:35 -07:00
Michael Jumper
38907abc1e Move delta.* into terminal.* (interdependent). 2013-03-23 17:06:02 -07:00
Alexandre Duvaly
e6414039a3 Added French keymap (not yet used). 2013-03-23 01:43:16 -07:00
Michael Jumper
b7af1d45f5 Initial conversion to new architecture, stub out deltas. 2013-03-19 22:48:43 -07:00
Michael Jumper
e8d8d60485 Bump version. 2013-03-17 22:05:16 -07:00
Michael Jumper
15a0e44474 Ensure m4/ directory is present. 2013-03-15 13:19:27 -07:00
James Muehlner
83d8630f84 Ticket #255: Changed input param of convert() to const char*. 2013-03-10 16:38:56 -07:00
James Muehlner
b1c13e1fa6 Ticket #255: Added comments about the functionality of convert() 2013-03-09 15:56:01 -08:00
James Muehlner
0494fba58f Ticket #255: Replaced tabs with spaces. 2013-03-09 15:39:15 -08:00
James Muehlner
5a1266abbc Ticket #255: Now converting ascii->utf8 when recieving clipboard text from vnc, and converting utf8->ascii when sending clipboard text to vnc. This should fix the tunnel disconnecting problem. 2013-03-08 21:47:02 -08:00
Michael Jumper
80a56bc9fd Clean up code ... rename ssh_guac_terminal to guac_terminal (preparing for generic). 2013-03-06 01:54:14 -08:00
Michael Jumper
808b8ed405 Bump version number. 2013-02-09 17:55:40 -08:00
Michael Jumper
db4a1ed85e Update AUTHORS and ChangeLog. 2013-02-09 17:51:52 -08:00
Michael Jumper
7fbd425610 Fix formatting issues introduced through previous commit (cf630f). 2013-02-09 16:46:29 -08:00
Saul Gio Perez
50ed651c1f Implement #272. 2013-02-09 16:39:31 -08:00
Michael Jumper
9faf4b0bf2 Ensure width is divisible by 4 (fixes #262) 2013-01-23 01:34:51 -08:00
Michael Jumper
40954430dc Use enum to determine arg length. 2013-01-15 20:57:45 -08:00
Michael Jumper
89fa8f1680 Fixed strcmp() logic around console and console-audio parameters. 2012-12-26 15:29:54 -08:00
Michael Jumper
411c21adbc Fix AUTHORS. 2012-12-25 20:50:35 -08:00
Michael Jumper
e675088842 Update email addresses. 2012-12-25 20:49:57 -08:00
Michael Jumper
0bff3ac8d1 Bump version number. 2012-12-25 19:36:40 -08:00
Michael Jumper
00401147ba Implement console arguments (fixes #227) 2012-12-25 19:36:19 -08:00
Michael Jumper
baa6d98724 Ignore unknown keys (fixes #162). 2012-12-16 17:51:49 -08:00
Michael Jumper
7a2a9a3e64 Update changelog, bump version. 2012-12-13 16:12:47 -08:00
Michael Jumper
e0a08b5461 Ignore ROP, assume invert unless ROP an easy operation. 2012-12-13 15:01:11 -08:00
Michael Jumper
e0f4ed892b Implement PAT ops. 2012-12-13 14:56:45 -08:00
Michael Jumper
cf71ae25a0 Implement PATBLT fallback (pay attention to ROP, ignore brush). Fixes #238. 2012-12-13 14:35:00 -08:00
Michael Jumper
315a5f9b0a Remove docbook stylesheet. 2012-12-02 11:32:07 -08:00
Michael Jumper
bd4a440957 Add config.h hackery header to distributed headers. 2012-12-02 01:14:02 -08:00
Michael Jumper
a9132dac57 Fix version number in Doxyfile. 2012-12-01 20:11:36 -08:00
Michael Jumper
4badb9a89b Fix documentation. 2012-12-01 20:11:14 -08:00
Michael Jumper
ce32b03171 Remove include files from doc. 2012-12-01 20:04:05 -08:00
Michael Jumper
5232056a1b Mark internal structs as private. 2012-12-01 19:39:22 -08:00
Michael Jumper
df06d1a354 Fixed guac_pool comments. 2012-12-01 19:02:02 -08:00
Michael Jumper
17c755dde4 Removed experimental structures. 2012-12-01 19:01:27 -08:00
Michael Jumper
e5decbed9e Bump version. 2012-12-01 13:08:26 -08:00
Michael Jumper
58a0422008 Bump version nuber representing compatibility. 2012-12-01 13:04:54 -08:00
Michael Jumper
825e3da0a2 Fix leaky pools. 2012-11-29 20:02:58 -08:00
Michael Jumper
6f34f71f09 Free instructions in handshake. 2012-11-29 20:02:39 -08:00
Michael Jumper
3e209e1983 Update stylesheet. 2012-11-29 19:36:13 -08:00
Michael Jumper
2f75ff7018 Fix leak in stream pool. 2012-11-29 19:35:17 -08:00
Michael Jumper
51c11ca572 Fix threading issues with FreeRDP. 2012-11-27 10:51:26 -08:00
Michael Jumper
b606aa2f7b Update ChangeLog 2012-11-22 19:10:10 -08:00
Michael Jumper
dceda44d67 Add disable-audio option. 2012-11-22 19:07:03 -08:00
Michael Jumper
0459299569 Rearrange test for libvorbis. 2012-11-22 18:55:11 -08:00
Michael Jumper
9e9ecca022 Make vorbis support conditional. 2012-11-22 18:42:27 -08:00
Michael Jumper
c25683783e Output 16 digits after decimal for doubles in protocol. 2012-11-13 11:46:34 -08:00
Michael Jumper
6e3f04536b Completely rewrite guac_rdpsnd based on knowledge gained from inspection and modification of the FreeRDP rdpsnd plugin (plus reading MS docs), update license. 2012-11-02 03:14:25 -07:00
Michael Jumper
fccec2e5e4 Use double for calculating duration. 2012-11-02 00:21:59 -07:00
Michael Jumper
60fbdf148b Use double durations for audio and video. 2012-11-01 20:52:50 -07:00
Michael Jumper
19de4b2187 Fix comments. 2012-11-01 14:29:25 -07:00
Michael Jumper
3163825568 Add check+load for wav encoder. 2012-11-01 14:26:36 -07:00
Michael Jumper
c1a4951363 Implement wav encoder. 2012-11-01 14:25:34 -07:00
Michael Jumper
ef0eace8c5 Remove hard-coded mimetype. 2012-11-01 12:55:00 -07:00
Michael Jumper
8f1b86586a Add RDP message lock. 2012-10-31 21:52:16 -07:00
Michael Jumper
c5e4dcabf2 Remove hard-coded values. 2012-10-31 17:44:23 -07:00
Michael Jumper
9207d7c89e Lock output with mutex (otherwise, instructions collide and break the stream). 2012-10-31 01:05:43 -07:00
Michael Jumper
ab2c10ef51 Actually handle audio/video part of preamble. 2012-10-30 16:16:59 -07:00
Michael Jumper
cf16398927 Fix bytes-written calculation. 2012-10-29 23:11:33 -07:00
Michael Jumper
5886074bc0 Fix conversion. 2012-10-29 13:47:55 -07:00
Michael Jumper
face237d8d Actually output sound. 2012-10-29 12:48:33 -07:00
Michael Jumper
e14265ab46 Implement part of vorbis encoder. 2012-10-29 11:53:08 -07:00
Michael Jumper
5ea7f5589d Check for libvorbisenc. 2012-10-29 11:26:38 -07:00
Michael Jumper
65752f689c Actually send audio messages. 2012-10-29 11:12:49 -07:00
Michael Jumper
4daa2123ba Add encoded data to audio_stream. 2012-10-29 10:56:13 -07:00
Michael Jumper
7346817669 Refactored audio API. 2012-10-29 10:51:56 -07:00
Michael Jumper
bcde14d270 Fix realloc, add convenience buffer to audio stream. 2012-10-28 01:14:19 -07:00
Michael Jumper
0114621de3 Set client in audio_stream. 2012-10-28 00:33:58 -07:00
Michael Jumper
2960331884 Pass stream to guac_rdpsnd. 2012-10-28 00:23:44 -07:00
Michael Jumper
f417f37f5f Add audio encoding API. 2012-10-27 20:52:48 -07:00
Michael Jumper
a1ed00728c Regroup source. 2012-10-27 20:03:18 -07:00
Michael Jumper
c440cd21a0 Removed useless Makefile.am 2012-10-27 19:50:20 -07:00
Michael Jumper
41b4a30042 Added client parameter. 2012-10-27 19:46:07 -07:00
Michael Jumper
45e083985e Add guac_rdpsnd freerdp plugin. 2012-10-27 18:36:21 -07:00
Michael Jumper
237e7c98dd Fix mimetype types. 2012-10-25 19:50:43 -07:00
Michael Jumper
882d50790b Implemented file instruction and chunked file writing functions. 2012-10-25 18:00:33 -07:00
Michael Jumper
36f04a87d2 Update ChangeLog 2012-10-25 11:57:06 -07:00
Michael Jumper
6d47cbc795 Implement chunked write instructions. 2012-10-25 11:56:11 -07:00
Michael Jumper
264a7f232b Prototypes for functions for chunked writes of audio/video instructions over a guac_socket. 2012-10-25 11:37:21 -07:00
Michael Jumper
ef9914cfdf Add video instruction. 2012-10-25 10:54:30 -07:00
Michael Jumper
872bb16872 Updated ChangeLog 2012-10-24 12:01:21 -07:00
Michael Jumper
601e75b4f4 Add audio instruction. 2012-10-24 09:57:06 -07:00
Michael Jumper
ebdc70058e Remove audio/video event (use handshake instead) 2012-10-23 11:17:25 -07:00
Michael Jumper
4d007e7e78 Automatically fit to screen. 2012-10-23 01:38:10 -07:00
Michael Jumper
0ffeb7b819 Updated ChangeLog 2012-10-22 15:52:53 -07:00
Michael Jumper
a5142f4e38 Updated ChangeLog 2012-10-22 15:50:26 -07:00
Michael Jumper
eca4245566 Updated ChangeLog 2012-10-22 15:49:43 -07:00
Michael Jumper
f0de5cb6f0 Revert "Add begin instruction, to be sent after connection succeeds."
This reverts commit 19c8d7ec283abd8f8dffe2690aa3973009552304.
2012-10-22 15:45:22 -07:00
Michael Jumper
e836983517 Add size/audio/video preamble to handshake. 2012-10-22 15:06:07 -07:00
Michael Jumper
6e5422b0e3 Fix error message ordering. 2012-10-22 15:05:01 -07:00
Michael Jumper
4758595e23 Use width/height from client if not specified in args. 2012-10-22 15:02:58 -07:00
Michael Jumper
f021858d94 Add guac_client_info structure. 2012-10-22 14:37:41 -07:00
Michael Jumper
fbf61fe81d Add begin instruction, to be sent after connection succeeds. 2012-10-21 23:06:54 -07:00
Michael Jumper
875c2108e8 Add size/video/audio instruction handlers. 2012-10-21 14:52:00 -07:00
Michael Jumper
7c96d13d0d Fix includes. 2012-10-20 21:05:36 -07:00
Michael Jumper
880b971b79 Use guac_socket_free (was guac_socket_close) 2012-10-19 18:48:04 -07:00
Michael Jumper
57acd9d5da Migrate to renamed functions of 0.7.0 2012-10-19 18:40:34 -07:00
Michael Jumper
621b1caf1d Renamed init function in 0.7.0. 2012-10-19 18:40:33 -07:00
Michael Jumper
578f676b2f Move to 0.7.0 client init. 2012-10-19 18:40:33 -07:00
Michael Jumper
fe30cd3073 Handle nested socket within stream alloc/free. 2012-10-19 14:24:03 -07:00
Michael Jumper
9d8d0650f5 Fix expected string for nest test. 2012-10-19 14:21:15 -07:00
Michael Jumper
4ae92fa62d Implement test for nested sockets. 2012-10-19 14:18:09 -07:00
Michael Jumper
e04533c299 Add missing declaration for guac_socket_nest. 2012-10-19 14:17:57 -07:00
Michael Jumper
014fc579ca Add nested protocol socket. 2012-10-19 14:06:39 -07:00
Michael Jumper
112360c4b1 Move fd info struct to socket-fd.c 2012-10-19 13:46:16 -07:00
Michael Jumper
518903483d Add nest instruction. 2012-10-19 13:45:06 -07:00
Michael Jumper
ffc6b389b8 Move fd-specific code to socket-fd.c 2012-10-19 12:42:46 -07:00
Michael Jumper
563726174a Remove fixme. 2012-10-19 12:26:17 -07:00
Michael Jumper
f3384e8eb7 Update read/write tests to match API changes. 2012-10-19 12:09:01 -07:00
Michael Jumper
d44ec4b2c1 Add read handler, call free handler when needed, add guac_socket_read. 2012-10-19 12:07:49 -07:00
Michael Jumper
208649306a Add select handler - still need read and free. 2012-10-19 00:46:08 -07:00
Michael Jumper
9444fdb234 Call select handler as needed, implement FD-based socket. 2012-10-19 00:45:29 -07:00
Michael Jumper
b092137091 Add select handler, partial refactor. 2012-10-19 00:34:04 -07:00
Michael Jumper
2f169b2b69 Use handlers rather than hard file descriptor. Allow explicit alloc/free of socket. 2012-10-19 00:19:54 -07:00
Michael Jumper
31729bf62d Add pool and stream alloc/free. 2012-10-18 20:57:11 -07:00
Michael Jumper
cd23eac4ee Add stream structure. 2012-10-18 20:46:17 -07:00
Michael Jumper
657b83808c Removed resource subprotocol (in favor of protocol nesting). 2012-10-18 01:34:25 -07:00
Michael Jumper
db373e876b Update ChangeLog, bump version. 2012-10-15 10:33:50 -07:00
Michael Jumper
f6764487c8 Update ChangeLog, bump version. 2012-10-15 10:29:30 -07:00
Michael Jumper
34f2347316 Bump version number to 0.6.2 2012-10-15 10:25:47 -07:00
Michael Jumper
178ae68b12 Log version on start. 2012-10-03 10:15:20 -07:00
Michael Jumper
a0fde0a4e8 Log PID changes. 2012-10-03 10:03:20 -07:00
Michael Jumper
d75bbb528f Update contributors. 2012-10-03 09:22:35 -07:00
Michael Jumper
63de8ba2ae Merge patch from Alex Bligh, clean up, update ChangeLog, general reformatting. 2012-10-03 09:21:39 -07:00
Michael Jumper
94c8076f5c Add Laurent Meunier as contributor. 2012-10-02 14:11:39 -07:00
Michael Jumper
3fd9323a94 Add macros for constants, clean up validation. 2012-10-02 14:09:57 -07:00
Michael Jumper
99ec71dcde Fix comment formatting. 2012-09-27 22:04:33 -07:00
Laurent Meunier
c45ff69dca Use the configured color-depth
The 'color-depth' parameter is now used to define the color depth for
the RDP session.
2012-09-27 21:38:04 -07:00
Michael Jumper
eabd17df64 Add parent client to resource. 2012-09-20 23:56:25 -07:00
Michael Jumper
ddf705ad26 Fix newlines. 2012-09-20 21:08:33 -07:00
Michael Jumper
f4f4e04e0e Call accept/reject handler of associated resource if resource is valid. 2012-09-06 20:37:16 -07:00
Michael Jumper
c95931e687 Add accept/reject instruction handler stubs. 2012-09-06 20:30:03 -07:00
Michael Jumper
a38d59451d Properly free pools in guac_client_free 2012-09-06 20:23:03 -07:00
Michael Jumper
54ef3f48fa Add unit test for resource pool. 2012-09-06 20:20:34 -07:00
Michael Jumper
a114698854 Implement alloc/free for guac_resource. 2012-09-06 20:08:15 -07:00
Michael Jumper
5403bf7c3a Add resource pool to client. 2012-09-06 19:57:19 -07:00
Michael Jumper
ac0d98518b pool.h must be installed (included by client.h which is installed) 2012-09-06 17:56:50 -07:00
Michael Jumper
6adce8bab0 Migrate to guac_pool for layer and buffer pools. 2012-09-06 17:55:24 -07:00
Michael Jumper
d0bc7f2d7e Bounds checks in tests should be fatal assertions. 2012-09-06 17:54:58 -07:00
Michael Jumper
91d73c850f Fix test. 2012-09-06 16:52:39 -07:00
Michael Jumper
9843607202 Add test for guac_pool. 2012-09-06 16:51:56 -07:00
Michael Jumper
eb450a6b3f Prototyped out part of indexed image support, added docs. 2012-09-06 12:06:06 -07:00
Michael Jumper
d7ae188564 Add magic number to hash (prevent all pure-black or similarly-black images from hashing to same value universally). 2012-09-06 12:06:06 -07:00
Michael Jumper
88445c5cb8 Add surface compare. 2012-09-06 12:06:06 -07:00
Michael Jumper
b35947daea Fix signedness, fix hash size. 2012-09-06 12:06:06 -07:00
Michael Jumper
97ac78c1e5 Added hash.c and hash.h, including a basic image hash function. 2012-09-06 12:06:06 -07:00
Michael Jumper
e02b3e3a0e Implement all pool functions. 2012-09-06 11:53:37 -07:00
Michael Jumper
b9bbf0ae7b Implemented guac_pool_free_int. 2012-09-06 11:29:31 -07:00
Michael Jumper
4444690400 Implement guac_pool alloc and free. 2012-09-06 11:24:01 -07:00
Michael Jumper
0e63f8667d Added stubbed pool.c, fixed typo in pool.h. 2012-09-06 11:20:18 -07:00
Michael Jumper
fba2c37b6b Add prototypes and structs for generic integer pool (to ultimately replace the individually-implemented layer and buffer pools, and for use in implementing the resource pool). 2012-09-06 11:15:23 -07:00
Michael Jumper
866d067bba Add forward declaration for guac_resource 2012-09-06 10:22:17 -07:00
Michael Jumper
9493dc10f3 Added resource handlers to guac_resource. 2012-09-05 18:11:48 -07:00
Michael Jumper
dc1be17935 Refactored plugin functions into plugin.c 2012-09-05 17:23:24 -07:00
Michael Jumper
2af32ece37 Refactored timestamp functions into timestamp.c 2012-09-05 17:17:18 -07:00
Michael Jumper
df2ab8384f Refactored instruction functions into instruction.c. 2012-09-05 17:13:05 -07:00
Michael Jumper
9a812c6732 Fixed typo. 2012-09-05 17:03:56 -07:00
Michael Jumper
c57a61122b Add missing includes to tests, fix function naming in protocol.c 2012-09-05 01:02:52 -07:00
Michael Jumper
9c53b85393 Fix includes, renamed time.h to timestamp.h 2012-09-05 00:47:21 -07:00
Michael Jumper
63e39befef Fixed includes, update Makefile.am 2012-09-04 23:28:58 -07:00
Michael Jumper
8807914668 Add missing includes. 2012-09-04 19:06:14 -07:00
Michael Jumper
0f4ca62eed Refactor plugin functions into plugin.h 2012-09-03 18:16:16 -07:00
Michael Jumper
d2eed69635 Refactor time functions into time.h 2012-09-03 18:07:13 -07:00
Michael Jumper
19cc6ccc01 Refactor functions into instruction.h - beware of renaming. 2012-09-03 18:03:24 -07:00
Michael Jumper
373cab0be6 Refactor layer struct and functions into layer.h 2012-09-03 17:58:43 -07:00
Michael Jumper
f8fdc3f35a Refactor guac_resource functions into resource.h 2012-09-03 17:54:30 -07:00
Michael Jumper
a959dff6f6 Only output parameter if it has a name. 2012-09-02 23:27:19 -07:00
Michael Jumper
23f799fa33 Added XSLT for translating Doxygen XML to DocBook. 2012-09-02 20:50:50 -07:00
Michael Jumper
78e51759cb Output xml for docs. 2012-09-02 18:08:17 -07:00
Michael Jumper
a02befb6bf Rename plugin init. 2012-08-29 11:36:32 -07:00
Michael Jumper
4af8d80653 Bump version numbers. 2012-08-29 11:23:19 -07:00
Michael Jumper
68e3d1507b Add resource free stub. 2012-08-29 10:00:14 -07:00
Michael Jumper
7806fdf56c Add buffer pool test. 2012-08-28 11:25:21 -07:00
Michael Jumper
1bcc1e7d5a Ensure buffers do not hurt layer pool. 2012-08-27 15:10:27 -07:00
Michael Jumper
af490aafbe Implementations of server-side streaming instructions. 2012-08-27 15:06:32 -07:00
Michael Jumper
5f1b67fb02 New resource API and corresponding stubs. 2012-08-27 15:06:32 -07:00
Michael Jumper
9e2e1e4994 Define guac_resource, remove rel, use URI instead of rel. 2012-08-27 15:06:31 -07:00
Michael Jumper
376fbe64ab Added handlers. 2012-08-27 15:06:31 -07:00
Michael Jumper
4ed87ecab5 Update select instruction semantics. 2012-08-27 15:06:31 -07:00
Michael Jumper
3249d068d3 Prototypes for streaming inructions. 2012-08-27 15:06:31 -07:00
Michael Jumper
35ff248687 Fix pool bounds. 2012-08-27 15:06:06 -07:00
Michael Jumper
77a752a2ee Fix test. 2012-08-27 15:05:55 -07:00
Michael Jumper
3e96b85b22 Implement pool test. 2012-08-27 15:02:13 -07:00
Michael Jumper
bc5065cda4 Combined tests into single executable. 2012-08-27 14:44:17 -07:00
Michael Jumper
114ac20f25 Layer pool test stub. 2012-08-27 14:41:23 -07:00
Michael Jumper
6d5c9b6dde Refactor creation of client to NOT require plugin. 2012-08-27 14:28:56 -07:00
Michael Jumper
928f3c5457 Bump version numbers. 2012-08-26 11:30:42 -07:00
Michael Jumper
b0240f02ab Define library prefix/suffix with macros, explicitly define and enforce limit on protocol name length, and overall library name length. 2012-08-23 11:50:06 -07:00
Michael Jumper
aaa463ec9f Assert return values. 2012-08-12 23:14:14 -07:00
Michael Jumper
fbca4e8b9a Ensure suite.h is included in source tarball. 2012-08-12 23:12:59 -07:00
Michael Jumper
014a627d13 Update version information. 2012-08-11 13:50:13 -07:00
Michael Jumper
905c6039f4 Update ChangeLog. 2012-08-11 13:47:50 -07:00
Michael Jumper
32065f5fae Bump to version 0.6.1 2012-08-11 13:35:57 -07:00
Michael Jumper
734cfb4217 Ensure m4/ directory exists, while automatically-added files are not included in commits. 2012-08-11 13:25:32 -07:00
Michael Jumper
5ec7f6970d Ensure m4/ directory exists, while automatically-added files are not included in commits. 2012-08-11 13:24:06 -07:00
Michael Jumper
cf6c232054 Ensure m4/ directory exists, while automatically-added files are not included in commits. 2012-08-11 13:22:27 -07:00
Michael Jumper
f22469ef31 Ignore gcov files. 2012-07-23 20:08:14 -07:00
Michael Jumper
a46e4f40ed Define better set of UTF8 test strings, use instead of dog. 2012-07-23 15:50:58 -07:00
Michael Jumper
f8eb590ea3 Split test_protocol.c into multiple files, one per test. 2012-07-23 15:37:36 -07:00
Michael Jumper
af4cb160cb Add instruction writing test. 2012-07-23 12:38:53 -07:00
Michael Jumper
4170f781a5 More renaming. 2012-07-23 02:25:06 -07:00
Michael Jumper
24c7898ffe Rename test function. 2012-07-23 02:20:12 -07:00
Michael Jumper
e1715cc40c Actual unit test of unicode use. 2012-07-23 01:42:15 -07:00
Michael Jumper
5bd42295ca Use read() instead of recv() such that non-sockets can be used for reads. 2012-07-23 01:41:50 -07:00
Michael Jumper
3cca318f8e Protocol test stub. 2012-07-22 22:08:01 -07:00
Michael Jumper
caf2349a64 Renamed test. 2012-07-22 19:40:11 -07:00
Michael Jumper
2650f1e4a5 Add license comment to unit test source. 2012-07-22 18:00:59 -07:00
Michael Jumper
2f0d2f37e6 Use Check for unit tests, add unit test stub. 2012-07-22 17:57:31 -07:00
Michael Jumper
c21604e2cd Cleaned up Makefile.am's 2012-07-22 15:34:36 -07:00
Michael Jumper
2c66cc4a40 Separate Makefile.am for src 2012-07-22 15:21:10 -07:00
Michael Jumper
a365f0813b Fix element walk. Reset all char counters. 2012-07-22 13:57:13 -07:00
Michael Jumper
a7843cc30f Fix makefile and includes. 2012-07-21 12:15:59 -07:00
Michael Jumper
b76a53fe62 Walk element content to determine character length (NOTE: need to save state between walks to avoid rewalking old characters and turning a linear-time parse into quadratic-time). 2012-07-21 10:00:00 -07:00
Michael Jumper
466fb36fd4 Split unicode functions into own files. 2012-07-19 23:32:49 -07:00
Michael Jumper
6b7fd03503 Measure string output in UTF-8 characters. 2012-07-19 20:03:28 -07:00
Michael Jumper
fb5b4af5ef client-handlers.h should not be installed. 2012-06-20 13:21:05 -07:00
Michael Jumper
f04bb18169 Updated changelog 2012-06-09 21:34:38 -07:00
Michael Jumper
5128165cd1 Updated changelog. 2012-06-09 21:16:30 -07:00
Michael Jumper
a775ab8d77 Bumping version to 0.6.1 2012-06-09 20:37:49 -07:00
Michael Jumper
31a5c8b486 Marking default/null handlers as stubs. 2012-06-09 20:36:34 -07:00
Michael Jumper
79185d52f5 Update version info. 2012-06-03 20:52:11 -07:00
Michael Jumper
7382bacc81 Bump version to 0.6.1 2012-06-03 20:47:45 -07:00
Michael Jumper
675dec46d3 Updated/fixed ChangeLog. 2012-06-03 20:42:04 -07:00
Michael Jumper
36def67dfd Test for SetDefault and SetNull before using them (not present in FreeRDP 1.0.1), fix naming conflict with default pointer setting functions. 2012-05-25 00:21:00 -07:00
Michael Jumper
e710287196 Fixed license list of contributors. 2012-05-25 00:02:35 -07:00
David PHAM-VAN
4239a4e690 Add SetNull and SetDefault functions to pointer managment to avoyd segfault with windows 2008r2
Signed-off-by: Michael Jumper <zhangmaike@users.sourceforge.net>
2012-05-25 00:00:37 -07:00
Michael Jumper
8f9eac1d33 Updated contributors. 2012-05-24 23:57:30 -07:00
David PHAM-VAN
6259381d92 Corrected padding in base64 encoding
Signed-off-by: Michael Jumper <zhangmaike@users.sourceforge.net>
2012-05-24 23:55:32 -07:00
Michael Jumper
9fd75a7b69 Update options in README. 2012-05-24 23:53:41 -07:00
Michael Jumper
340285a864 Update manpage, fix usage string printf. 2012-05-24 23:49:40 -07:00
Michael Jumper
0de6990d53 Style fixes, fix usage string. 2012-05-24 23:44:50 -07:00
David PHAM-VAN
d39b2e8208 Add foreground option to daemon
Signed-off-by: Michael Jumper <zhangmaike@users.sourceforge.net>
2012-05-24 23:39:42 -07:00
Michael Jumper
9549a19ab5 Do not init username with default static string - cannot be free'd later (see ticket #137) 2012-05-17 22:51:57 -07:00
Michael Jumper
7328ee303f Embed format information along with default cursor image data. Refactor default cursor set function out of rdp_pointer.h and into default_pointer.h. Add documentation. 2012-05-17 13:04:38 -07:00
Michael Jumper
bb5f4d61d9 Undef not needed as define is within .c, not header. 2012-05-17 11:57:54 -07:00
Michael Jumper
2807b6dea9 Using embedded bitmap rather than raster-drawn cursor. 2012-05-17 00:48:05 -07:00
Michael Jumper
d7c5ec5ed0 Implement default pointer (currently drawn with draw instructions - not an embedded bitmap). 2012-05-16 19:52:43 -07:00
Michael Jumper
2056ab9619 Log when no equivalence between keysym and Unicode. Remove debug log. 2012-05-16 10:29:43 -07:00
Michael Jumper
13415ebcdb Remove now unused altcode function. 2012-05-16 01:33:34 -07:00
Michael Jumper
6da3c29606 Use direct translation between keysym and Unicode, rather than table (see http://www.x.org/wiki/KeySyms, same translation used from Unicode to keysym by the Guacmole JS client). Remove related files. 2012-05-16 01:26:18 -07:00
Michael Jumper
8a8924dc7d Check for freerdp/locale/keyboard.h before using it, default to old freerdp/kbd/layouts.h if missing. 2012-05-16 00:40:07 -07:00
Jocelyn DELALANDE
156422c473 licensing fix
Signed-off-by: Michael Jumper <zhangmaike@users.sourceforge.net>
2012-05-15 14:41:28 -07:00
Jocelyn DELALANDE
bf15e05cb8 cosmetic and comments for guacamole integration
Signed-off-by: Michael Jumper <zhangmaike@users.sourceforge.net>
2012-05-15 14:41:28 -07:00
Jocelyn DELALANDE
8978181316 fixed include path for freerdp >= 1.0
Signed-off-by: Michael Jumper <zhangmaike@users.sourceforge.net>
2012-05-15 14:41:28 -07:00
Jocelyn DELALANDE
7736e8f7aa Added support for all keysyms, even over 0xFFFF
Signed-off-by: Michael Jumper <zhangmaike@users.sourceforge.net>
2012-05-15 14:41:28 -07:00
Jocelyn DELALANDE
4d0ed19243 First working implementation with special characters handled by unicodekeyboardevents.
Signed-off-by: Michael Jumper <zhangmaike@users.sourceforge.net>
2012-05-15 14:41:28 -07:00
Jocelyn DELALANDE
12d7353fb7 Added keysym to unicode translation mechanisms.
Signed-off-by: Michael Jumper <zhangmaike@users.sourceforge.net>
2012-05-15 14:41:28 -07:00
Michael Jumper
ae9f20b896 Fix documentation version, add palette to excludes. 2012-05-11 14:35:38 -07:00
Michael Jumper
fb93af4ce6 Fixed ChangeLog 2012-05-04 19:27:32 -07:00
Michael Jumper
35c21a598f Bumping to version 0.6.0 2012-05-04 19:19:52 -07:00
Michael Jumper
a15dc071c0 Updated ChangeLog 2012-05-04 19:14:28 -07:00
Michael Jumper
d37484bbfe Updated ChangeLog 2012-05-04 19:10:14 -07:00
Michael Jumper
75d3a3e15c Updated ChangeLog 2012-05-04 19:07:29 -07:00
Michael Jumper
007b1d44ef Fixed site URL. 2012-04-29 21:38:30 -07:00
Michael Jumper
7bc4c199b6 Add error handling to png. 2012-04-19 21:05:07 -07:00
Michael Jumper
844afb6478 Fix segfault in layer/buffer alloc. 2012-04-10 16:12:03 -07:00
Michael Jumper
6a9c959da0 Properly add layers/buffers to available layer/buffer pool. 2012-04-10 11:08:52 -07:00
Michael Jumper
ecec3a1099 Fix size of palette hash table (should be 0x1000, not 0xFFF), don't free palette until AFTER done... 2012-04-02 13:27:28 -07:00
Michael Jumper
71de5606bf Should not install palette.h 2012-04-01 23:27:57 -07:00
Michael Jumper
d2523c062c Restore Cairo PNG support. 2012-04-01 23:16:58 -07:00
Michael Jumper
b4ad24ccd6 Use appropriate BPP and packing. 2012-04-01 23:10:52 -07:00
Michael Jumper
d300688a5b Fix palette find. 2012-04-01 23:01:53 -07:00
Michael Jumper
e8833857b9 Removed debug fprintf. 2012-04-01 22:37:25 -07:00
Michael Jumper
ec652af924 Store palette in libpng format, add PLTE section. 2012-04-01 22:36:55 -07:00
Michael Jumper
969f96f1b7 Use libpng if palette possible, otherwise use Cairo (stub). 2012-04-01 22:28:45 -07:00
Michael Jumper
1489ae902d Store sequential array of colors in palette. 2012-04-01 22:06:34 -07:00
Michael Jumper
314e8c9222 Add palette find function. 2012-04-01 21:57:19 -07:00
Michael Jumper
e22323c4d9 Function rename + palette alloc test. 2012-04-01 21:54:03 -07:00
Michael Jumper
859395022f Move palette functions into own files. 2012-04-01 21:49:15 -07:00
Michael Jumper
4974f5a082 Handle formats, basic palette mapping implementation. 2012-04-01 21:20:08 -07:00
Michael Jumper
3cae4f016f Use libpng for writing of PNGs (currently only works with RGB/RGBA surfaces, and only writes RGB) 2012-04-01 20:19:12 -07:00
Michael Jumper
bd864f3f8f Check for pngstruct.h 2012-04-01 19:25:33 -07:00
Michael Jumper
9118f593b3 Restore checks for libpng. 2012-04-01 19:22:26 -07:00
Michael Jumper
6373580830 Pull logging prefix from program name from argv[0] 2012-03-15 22:23:55 -07:00
Michael Jumper
a1397c53dc Changed non-errors to info. 2012-03-15 19:29:02 -07:00
Michael Jumper
ab061e1417 Remove unnecessary newline from log messages. 2012-03-15 19:25:46 -07:00
Michael Jumper
8ff25f503a Use args list only once. Probably better to use an intermediate buffer anyway. 2012-03-15 19:24:16 -07:00
Michael Jumper
86bc39b65a Use guacd_log_*() for all logging. Replace use of syslog. Only use fprintf() for usage information. 2012-03-15 19:11:51 -07:00
Michael Jumper
9f24a3f377 New logging functions which log to both syslog and STDERR. 2012-03-15 19:08:12 -07:00
Michael Jumper
1aa594bd8b __guac_fill_instructionbuf() should report errors. 2012-03-15 11:30:52 -07:00
Michael Jumper
eb73b52e69 Fix output of arc instruction. 2012-03-13 19:12:37 -07:00
Michael Jumper
b71eca8183 Add new negative parameter to arc. 2012-03-13 19:07:24 -07:00
Michael Jumper
a5fdb711c5 Fix documentation of log handlers. 2012-03-13 15:54:55 -07:00
Michael Jumper
82694ec45f Use new form of guac_client_plugin_get_client(). 2012-03-13 15:53:08 -07:00
Michael Jumper
7f293df34c Modify guac_client_plugin_get_client() to allow logging to be set up before guac_client_init is called (fixes ticket #85). 2012-03-13 15:45:22 -07:00
Michael Jumper
fa27d7b11e Added layer to set instruction. 2012-03-13 12:06:11 -07:00
Michael Jumper
e3c3eea764 Refactored path into curve, added line, arc, and start instructions. Added close instruction. Added identity instruction. 2012-03-12 17:22:04 -07:00
Michael Jumper
39c0977b9d Corrected spelling of miter. 2012-03-11 23:17:16 -07:00
Michael Jumper
3251976799 Convert to new instruction set. 2012-03-11 21:46:43 -07:00
Michael Jumper
fbe43e917e Refactored rstroke/rfill to lstroke/lfill. 2012-03-11 21:05:34 -07:00
Michael Jumper
eee3fc4fd7 Removed commas at end of last entries in enums. 2012-03-11 19:19:42 -07:00
Michael Jumper
0479d71563 Added all remaining new instructions (and old client-only instructions) 2012-03-11 13:15:45 -07:00
Michael Jumper
55ac0eee0b Implemented around 1/3 of all new instructions. 2012-03-11 12:57:15 -07:00
Michael Jumper
d93108767b Reorganized functions, alphabetized. 2012-03-10 21:34:42 -08:00
Michael Jumper
1a9521074c Added prototypes for TODO functions. 2012-03-10 20:56:00 -08:00
Michael Jumper
4595ed51f3 Alphabetized and organized instruction functions, reformatted and fixed comments. 2012-03-10 12:56:59 -08:00
Michael Jumper
878d8a406c Add line cap and join styles. 2012-03-06 12:42:38 -08:00
Michael Jumper
aecd6347e3 Restrict addresses returned for bind, improve logging. 2012-03-01 14:05:12 -08:00
Michael Jumper
33e028f1f4 Refactored guac_client_alloc_layer(), implement guac_client_free_layer(). 2012-02-27 22:56:38 -08:00
Michael Jumper
ee324aed69 Fixed merge of unstable, refactored rect and clip. 2012-02-27 16:01:02 -08:00
Michael Jumper
f6659c5264 Merge branch 'unstable' into drawing-instructions 2012-02-27 15:56:48 -08:00
Michael Jumper
c55bef0c41 Fix transfer function indices. 2012-02-27 13:14:19 -08:00
Michael Jumper
554d6e1ec1 Implemented transfer instruction, initial transfer function definitions. 2012-02-27 12:28:12 -08:00
Michael Jumper
54cc87093a Removed execute permissions from source. 2012-02-27 10:36:46 -08:00
Michael Jumper
13db6307b6 Changed tabs to spaces. 2012-02-27 10:27:46 -08:00
Michael Jumper
3942cabfd0 Improved comments for raster ops. 2012-02-27 10:26:58 -08:00
Michael Jumper
f77e0dbcc8 Fully enumerate raster operations. 2012-02-27 01:02:04 -08:00
Michael Jumper
3a047ea465 Merge branch 'MBH' into raster 2012-02-26 18:57:28 -08:00
Michael Jumper
5122386c81 Bumped version number to 0.6.0. Added LICENSE to dist tarball. 2012-02-23 14:49:45 -08:00
Michael Jumper
80d270ab00 Bumped version number to 0.6.0 2012-02-23 14:48:07 -08:00
Michael Jumper
2def995074 LICENSE should be included in source. 2012-02-23 14:47:46 -08:00
Michael Jumper
fcf37ecd11 LICENSE should be included in source. 2012-02-23 14:46:21 -08:00
Michael Jumper
e110b9ce92 LICENSE and Doxyfile should be present in source tarball (fixes ticket #84). 2012-02-23 14:44:48 -08:00
Michael Jumper
8348900db9 Prototypes for new instruction functions. 2012-02-23 14:41:33 -08:00
Michael Jumper
72d7e44420 Implement red/blue swap. 2012-02-21 10:22:55 -08:00
Michael Jumper
6595c91864 Add arg and flag for swapping red and blue. 2012-02-21 10:15:11 -08:00
Matt Hortman
7d7a0260bf added constants for raster operations 2012-02-21 11:20:32 -05:00
Michael Jumper
28e2d41e16 Added dispose instruction. 2012-02-20 12:41:23 -08:00
Michael Jumper
19564cd133 Move cursor layer rather than redraw. 2012-02-20 11:04:08 -08:00
Michael Jumper
546e352374 Refactor supporting buffered cursor instruction. 2012-02-15 10:04:51 -08:00
Michael Jumper
124460b5d9 New cursor instruction format (allowing buffering of cursors). 2012-02-15 10:04:31 -08:00
Michael Jumper
cdae593fc5 Migrate to 0.6.0 libguac API. 2012-02-11 19:12:40 -08:00
Michael Jumper
a17cd6202b Modified size to be layer-specific, adding layer move instruction. 2012-02-11 19:00:55 -08:00
Michael Jumper
c339b1299b Move private struct members to bottom such that public interface is not distrubed when internal changes are made (avoid being forced to increment version, as done now). 2012-01-12 10:11:45 -08:00
Michael Jumper
da27927a3f Require a minimum number of buffers before old free'd buffers are reused, implement LRU strategy for reuse of buffers (oldest free'd buffer). 2012-01-12 09:57:34 -08:00
James Muehlner
2ea9718167 removed debug lines 2012-01-03 09:09:50 -08:00
Michael Jumper
180216159f Use dlerror() for errors opening client plugin. 2012-01-03 00:03:24 -08:00
James Muehlner
e6a6780591 implemented clipboard paste and free handlers 2011-12-30 14:34:04 -08:00
Michael Jumper
5c91834998 Clarified flag nature of GUAC_CLIENT_MOUSE_* 2011-12-29 16:40:00 -08:00
Michael Jumper
27ba5e3122 Migrated to namespaced RUNNING state. 2011-12-24 22:51:31 -08:00
Michael Jumper
549c6d4515 Fixed broken rename. 2011-12-24 22:49:27 -08:00
Michael Jumper
27c4e62756 Renamed RUNNING and STOPPING to GUAC_CLIENT_RUNNING and GUAC_CLIENT_STOPPING. Added GUAC_CLIENT_MOUSE_* masks. 2011-12-24 22:48:15 -08:00
Michael Jumper
9c60a7a2a5 Added man/guacd.8 to EXTRA_DIST 2011-12-21 20:58:24 -08:00
Michael Jumper
6741c3c92f Fixed headers, removed unused. 2011-12-21 18:54:38 -08:00
Michael Jumper
cda03dc6db Cleaned up hierarchy. 2011-12-21 18:35:42 -08:00
Michael Jumper
a7b00aa79f Renaming and regrouping. 2011-12-21 18:18:25 -08:00
Michael Jumper
bd15a65398 Renaming and regrouping. 2011-12-21 18:18:17 -08:00
Michael Jumper
966cdd7271 Fixed memory leak in guac_client_plugin_close() 2011-12-21 01:44:30 -08:00
Michael Jumper
05b0a09a8a Fixed memory leak in guac_instruction_free() 2011-12-21 01:35:16 -08:00
Michael Jumper
6bf341ddb3 Bumped version numbers to 0.5.0. 2011-12-20 20:08:19 -08:00
Michael Jumper
a1b93e0802 Bumped version numbers to 0.5.0. 2011-12-20 20:07:31 -08:00
Michael Jumper
155138bc2d Updated changelog. 2011-12-11 15:20:18 -08:00
Michael Jumper
8bf37453de Updated changelog. 2011-12-11 15:16:56 -08:00
Michael Jumper
c8d2f232d6 Update changelog 2011-12-11 15:00:19 -08:00
Michael Jumper
7724b34b7f Updated README to point to new Trac. 2011-12-11 14:51:54 -08:00
Michael Jumper
4b0bbd8f4d Updated README to point to new Trac. 2011-12-11 14:51:05 -08:00
Michael Jumper
99103e8eae Updated README to point to new Trac. 2011-12-11 14:49:59 -08:00
Michael Jumper
1f041e9cee Updated README to point to new Trac. 2011-12-11 14:49:34 -08:00
Michael Jumper
e6fe9e7008 Added manpage. 2011-12-10 23:45:09 -08:00
Michael Jumper
3e06b326d9 Added -b option to specify bind address, using getaddrinfo() for address and port + getnameinfo() for logging name and port used. 2011-12-10 23:17:25 -08:00
Michael Jumper
55f00483e2 Should check for cairo/cairo.h, not cairo.h 2011-12-06 12:52:18 -08:00
Michael Jumper
ac43e37399 Renamed function, removed now unnecessary thread data and prototyping. 2011-12-06 00:53:18 -08:00
Michael Jumper
fb74c24ec1 Removed thread.*, using pthreads directly. More renaming of guac to guacd. 2011-12-06 00:41:08 -08:00
Michael Jumper
7a18b397de Moved guac_client_stop() back into libguac 2011-12-05 20:43:07 -08:00
Michael Jumper
3c5a54e303 Restored guac_client_stop. 2011-12-01 22:57:34 -08:00
Michael Jumper
5401ffd8e4 Log PID, remove support for lack-of-fork, update #define naming. 2011-11-30 12:03:27 -08:00
Michael Jumper
c9388ee536 Removing forced sleep between message handling. Can cause excess delays if handle_messages handles only one message and there are multiple messages waiting / piling up independent of handle frequency. 2011-11-28 02:29:05 -08:00
Michael Jumper
81bea52e4d Reset position in buffer each reparse (otherwise, stream will be read corrupt as parser is in wrong state). 2011-11-27 23:38:38 -08:00
Michael Jumper
d1b4ce00e1 Set guac_error* before calling client handlers 2011-11-27 16:39:46 -08:00
Michael Jumper
0daf07a742 More logging 2011-11-27 16:29:42 -08:00
Michael Jumper
f9f864815c Using guac_error_message 2011-11-27 16:07:04 -08:00
Michael Jumper
f935075aec Added guac_error_message. Added error messages to all functions. 2011-11-27 15:57:43 -08:00
Michael Jumper
2d7b398c72 Init logging handlers in client. 2011-11-27 14:26:59 -08:00
Michael Jumper
9c5f1da646 Additional logging, moderate cleanup. 2011-11-26 22:26:39 -08:00
Michael Jumper
76e55c5a51 Corrected includes 2011-11-26 22:08:25 -08:00
Michael Jumper
2d02a0f3bd Removed guac_instruction_free_data() 2011-11-26 20:10:52 -08:00
Michael Jumper
29d42d0012 Improved doc layout 2011-11-26 17:28:12 -08:00
Michael Jumper
7fdb236001 Exclude client-handlers.h from generated doc. 2011-11-26 16:11:00 -08:00
Michael Jumper
3515ec9021 Conversion to new libguac API. 2011-11-26 15:35:45 -08:00
Michael Jumper
7b9fad668c Bumped version to 0.5.0 2011-11-26 15:00:33 -08:00
Michael Jumper
80df0efa62 Using new function for libguac check. 2011-11-26 14:57:35 -08:00
Michael Jumper
989f24be2b Do not call free handler for client if init does not complete. 2011-11-26 14:50:03 -08:00
Michael Jumper
07a40605cb Fixed double free (free'd wrong pointer) 2011-11-26 12:18:57 -08:00
Michael Jumper
aa7be62488 Changed libguac check function to one that still exists. 2011-11-26 01:09:55 -08:00
Michael Jumper
61579bd9b7 Fix library name generation, fix instruction parsing. 2011-11-26 00:28:43 -08:00
Michael Jumper
7bca78c7a8 Reject invalid instructions. 2011-11-25 23:48:45 -08:00
Michael Jumper
4cf9f6b0ab Added logging to daemon. 2011-11-25 23:28:49 -08:00
Michael Jumper
8df489129a Documentation 2011-11-25 22:15:53 -08:00
Michael Jumper
e99b470f71 Stripping include from file paths. 2011-11-25 17:51:15 -08:00
Michael Jumper
f86c06684e Flush args instruction. 2011-11-25 16:42:46 -08:00
Michael Jumper
9835dde90e Brought up to date with latest libguac changes. 2011-11-25 16:40:56 -08:00
Michael Jumper
d8697631d0 Renamed io to socket (in vars) 2011-11-25 16:35:50 -08:00
Michael Jumper
24a2ad6d12 Renamed io to socket (in vars) 2011-11-25 16:34:43 -08:00
Michael Jumper
c5ec3a71a3 Partial conversion to new logging, API, and naming conventions. 2011-11-25 16:30:17 -08:00
Michael Jumper
059ddc0448 Added version number to Doxyfile 2011-11-25 15:15:22 -08:00
Michael Jumper
8cffca4f13 Removed guac_sleep 2011-11-25 13:20:41 -08:00
Michael Jumper
c4c30af6a4 Migrated guac_parse_int to __guac_parse_int, out of socket.h 2011-11-25 13:18:00 -08:00
Michael Jumper
6bd9c00fae Prototypes and docs for plugin functions 2011-11-25 13:13:32 -08:00
Michael Jumper
ae33a4ca48 Converted to new guac_client_plugin API 2011-11-25 13:04:59 -08:00
Michael Jumper
5428aef912 Implemented logging functions. 2011-11-25 12:22:12 -08:00
Michael Jumper
682344f778 Conversion to new naming conventions, partial logging. 2011-11-25 12:17:20 -08:00
Michael Jumper
0a39a5d63d Added logging to client threads 2011-11-24 18:51:05 -08:00
Michael Jumper
c6d1916afa Properly check errno if guac_error is GUAC_STATUS_SEE_ERRNO 2011-11-24 18:46:06 -08:00
Michael Jumper
66a0ff52ee Migration to new guac_read_instruction(), remove use of guac_free_instruction_data(). 2011-11-24 18:25:33 -08:00
Michael Jumper
857c2e03c9 Refactor of guac_read_instruction, migrate to new guac_read_instruction 2011-11-24 18:18:03 -08:00
Michael Jumper
5214b1538d Set guac_error in guac_select() 2011-11-23 16:25:25 -08:00
Michael Jumper
97f7249e60 Renamed private members, adding __ (double underscore) prefix. 2011-11-23 16:08:33 -08:00
Michael Jumper
eb11efc67e Removed unused defines. 2011-11-23 15:49:46 -08:00
Michael Jumper
2abc6d19b5 Exclude private symbols from generated docs. 2011-11-23 15:03:40 -08:00
Michael Jumper
0db81b73ac Migrated to new function defs with timeouts. 2011-11-23 00:45:43 -08:00
Michael Jumper
087ed54fc2 Removed GUAC_*_TIMEOUT, added usec_timeout parameters to functions which need them, updated docs. 2011-11-23 00:43:30 -08:00
Michael Jumper
d4d2ba3af3 Moved thread API from libguac. 2011-11-23 00:23:53 -08:00
Michael Jumper
a932c2f1a0 Removed out-of-scope threads API. 2011-11-23 00:22:12 -08:00
Michael Jumper
e4cbb8b4e8 Moved daemon functions from libguac 2011-11-23 00:01:27 -08:00
Michael Jumper
84254cfddf Removed daemon-specific functions 2011-11-22 23:51:43 -08:00
Michael Jumper
dd356d4fe2 Updated documentation of protocol.h 2011-11-21 02:05:05 -08:00
Michael Jumper
1b42db58e9 Added warning for non-threadsafe impl 2011-11-21 01:42:16 -08:00
Michael Jumper
40f773e733 Added documentation for guac_error 2011-11-21 01:37:16 -08:00
Michael Jumper
797c30de75 Added guac_error usage to guacio 2011-11-21 01:32:04 -08:00
Michael Jumper
d7b0c5085e Revert changes to client.h (mockup of guac_status refactor) 2011-11-20 23:14:20 -08:00
Michael Jumper
b50d89d830 Revert "Refactor of prototypes, partial continuation of refactor into client."
This reverts commit a7a4a126c2a670c78bef4bc34d8823f98754bc5c.
2011-11-20 23:09:02 -08:00
Michael Jumper
ca34a2f4a2 Added guac_error (thread-local) 2011-11-20 22:59:34 -08:00
Michael Jumper
8ef7d724bb Refactor of prototypes, partial continuation of refactor into client. 2011-11-19 14:34:08 -08:00
Michael Jumper
4d6218560f Removed inconsistent _t suffix from types. 2011-11-16 15:43:28 -08:00
Michael Jumper
d61335b187 guac_status_t -> guac_status, mockup in client.h 2011-11-16 15:11:48 -08:00
Michael Jumper
af5f610e76 Added error.h and error.c to Makefile.am, implemented string conversion function. 2011-11-16 00:23:38 -08:00
Michael Jumper
cd82b43b5f Added base error.h definitions of status codes and prototype of string conversion function. 2011-11-16 00:11:05 -08:00
Michael Jumper
6cec48c20d Moved badly positioned include. 2011-11-12 16:51:42 -08:00
Michael Jumper
b69ab3a27a Reverted queue migration. 2011-11-04 11:37:01 -07:00
Michael Jumper
df02126676 Removed guac_client_queue_*() and associated structures (out of scope). 2011-11-03 13:48:05 -07:00
Michael Jumper
c07170e05d Migrated to new client-level queue. 2011-10-25 22:10:48 -07:00
Michael Jumper
a48f43ef6b Removed old guac_layer_* queue functions. 2011-10-25 22:07:30 -07:00
Michael Jumper
185d23fb5e Migrated queue from layer to client, restored GUAC_DEFAULT_LAYER. 2011-10-25 22:01:53 -07:00
Michael Jumper
820a4b1fff Removed accidentally-committed test file 2011-10-23 23:19:49 -07:00
Michael Jumper
7183b43d1d Migrated to layer instruction queue. 2011-10-23 23:12:00 -07:00
Michael Jumper
44a456aece Implemented naiive update condensing for PNGs in the simplest case. Added queue tail. Now adding to tail of queue. 2011-10-23 23:11:29 -07:00
Michael Jumper
35fedc1eb6 Implemented guac_layer_flush(). 2011-10-23 16:12:31 -07:00
Michael Jumper
c721a94b6e Implemented guac_layer_* queue updates. 2011-10-23 15:53:22 -07:00
Michael Jumper
7da95aa6cf Removed guac_client_free_layer (doesn't make sense), added free() for update queue, added update queue structures. 2011-10-23 15:35:23 -07:00
Michael Jumper
70e150e2e9 Bumped libtool version-info (API changes) 2011-10-23 14:48:26 -07:00
Michael Jumper
665f907a18 Fixed comments, added prototypes for guac_layer_* instruction queueing functions and guac_layer_flush(). 2011-10-23 14:43:26 -07:00
Michael Jumper
076b749225 Implemented support for new instruction format (inbound), simplified instruction parsing. 2011-10-19 01:28:18 -07:00
Michael Jumper
197029c3d8 Fixed rect instruction. 2011-09-11 15:56:34 -07:00
Michael Jumper
7c91f7d66c Working png/cursor instructions. 2011-09-10 00:40:22 -07:00
Michael Jumper
12649bd657 Removed use of escape/unescape pending parsing of new instruction format. 2011-09-10 00:37:16 -07:00
Michael Jumper
e19c636bdb Fix guac_write_base64 to match documented return values. 2011-09-10 00:36:51 -07:00
Michael Jumper
f5b44c97ad Removed unescape/escape functions, switched to new instruction format. 2011-09-09 23:59:07 -07:00
Michael Jumper
ff8e245028 Using safe composite ops. 2011-09-06 00:01:37 -07:00
Michael Jumper
621f369130 More improvements to channel mask documentation. 2011-08-30 10:22:39 -07:00
Michael Jumper
e5cc6eb7ca Improved documentation of channel masks and composite operations. 2011-08-29 22:24:45 -07:00
Michael Jumper
e7607b1e9b Ctrl button 2011-08-21 23:24:40 -07:00
Michael Jumper
7b09948842 Much faster drawing method (complete). 2011-08-18 18:09:20 -07:00
Michael Jumper
e5619531a6 Improved palette (more contrast). Started move to more efficient drawing. 2011-08-17 12:30:53 -07:00
Michael Jumper
6f27f97289 Removed unused file. 2011-08-10 15:13:40 -07:00
Michael Jumper
485616045e Removed unused file. 2011-08-10 15:13:22 -07:00
Michael Jumper
eea2e03545 Removed unused file. 2011-08-10 15:13:04 -07:00
Michael Jumper
31e8e8432a More CSI, moving to faster drawing technique. 2011-08-10 11:03:38 -07:00
Michael Jumper
52e14322a3 Handler for CSI P (delete characters at cursor) 2011-08-10 09:31:12 -07:00
Michael Jumper
f9d42c7182 Handle CSI M (delete lines) 2011-08-10 00:16:50 -07:00
Michael Jumper
15ae8d79a2 Using ssh_select (works) instead of channel_select (doesn't work). 2011-08-10 00:02:06 -07:00
Michael Jumper
f695f5c629 Support for downward scrolling and CSI operation L 2011-08-09 18:32:54 -07:00
Michael Jumper
d57bdb06e4 Added scrollback buffer storage. 2011-08-09 12:31:03 -07:00
Michael Jumper
93d93a64eb More CSI, scroll region 2011-08-05 22:59:42 -07:00
Michael Jumper
9de0e18d11 More CSI handlers. 2011-08-05 17:09:44 -07:00
Michael Jumper
57bb593ea8 Only scroll when DISPLAYING a character. 2011-08-05 14:46:35 -07:00
Michael Jumper
adb59fe341 Proper handling of cursor reset. Clear argv[] when done. 2011-08-05 14:39:11 -07:00
Michael Jumper
8892c018e0 Handle bold, underscore. Proper handling of reverse video (should not be in *_set()) 2011-08-05 14:30:10 -07:00
Michael Jumper
e0f38ded99 Reverse video 2011-08-05 13:49:47 -07:00
Michael Jumper
18cdf2808d Working colors in CSI 2011-08-05 12:41:21 -07:00
Michael Jumper
5f59ccf5c1 Color palette 2011-08-05 12:14:15 -07:00
Michael Jumper
fc1683da30 Removed unnecessary includes from term handlers. 2011-08-05 00:22:26 -07:00
Michael Jumper
638776e700 Added more abstract terminal functions, refactored away use of guac_send_* in terminial handlers, simplified code. 2011-08-05 00:20:09 -07:00
Michael Jumper
f2732acc5a Switching to per-state static variables rather than per-terminal instance variables (states need not be thread safe) 2011-08-04 19:36:04 -07:00
Michael Jumper
e3d1a3f023 Switching to handler functions rather than state values. 2011-08-04 19:17:44 -07:00
Michael Jumper
974aa93e90 Moved terminal code into ssh-independent implementation, separated handlers from client auth and init. 2011-08-04 11:46:21 -07:00
Michael Jumper
4f7c8c98e7 Actual SSH connection and terminal emulation (testing) 2011-08-01 13:31:48 -07:00
Michael Jumper
69dbead349 Pango + working print() function 2011-07-31 20:51:19 -07:00
Michael Jumper
0195a6ad1c Initial commit (stubs) 2011-07-30 15:12:28 -07:00
Michael Jumper
a829018238 Fixed segfault in free layer/buffer (was using wrong next pointer). 2011-07-25 15:57:48 -07:00
Michael Jumper
3828702b64 Clip instruction. 2011-07-21 15:15:58 -07:00
Michael Jumper
4dc9e81f93 Using new guac_layer instead of integer index. 2011-07-20 12:37:35 -07:00
Michael Jumper
6341346cb7 Using C99, POSIX, and BSD. Added guac_layer and layer/buffer alloc/free. 2011-07-20 12:36:02 -07:00
Michael Jumper
208ff61edd Added missing stdint.h include. 2011-07-20 08:45:23 -07:00
Michael Jumper
f55ba6ff4e Ping with last sync, not new sync. Don't want to update the last update timestamp unnecessarily. 2011-07-14 09:57:14 -07:00
Michael Jumper
68855b795c Removing win32 from guacd. Too heavy. 2011-07-14 01:13:20 -07:00
Michael Jumper
66c1144d4e If fork()ing, parent process must close child's socket fd. Child close() is not sufficient as both parent and child have a reference to the same socket fd, and fd will never be free'd if close() is not called from both processes. 2011-07-12 14:43:57 -07:00
Michael Jumper
71013a5a1b Added Default-Start/Stop to init.d script. 2011-06-03 00:07:23 -07:00
Michael Jumper
b412f1c16d Added missing include file to Makefile.am 2011-06-02 11:22:20 -07:00
Michael Jumper
c4c84a1e44 Updated version numbers to 0.4.0 2011-05-27 13:47:09 -07:00
Michael Jumper
20927307d2 Updated version numbers to 0.4.0 2011-05-27 13:46:38 -07:00
Michael Jumper
532ad2137b Added guac_parse_int, which handles 64-bit integers regardless of native arch. 2011-04-29 01:35:17 -07:00
Michael Jumper
8242c37f11 64-bit timestamps and output 2011-04-29 00:45:38 -07:00
Michael Jumper
d1759acca9 Fixed pointer warnings on POSIX and win32 2011-04-21 23:49:14 -07:00
Michael Jumper
3239f032ae Fixed thread implementation for win32 2011-04-21 23:48:44 -07:00
Michael Jumper
e98ee250bd Converted to new composite enums 2011-04-21 16:30:59 -07:00
Michael Jumper
4e1e693c2d Working win32 port 2011-04-21 15:54:29 -07:00
Michael Jumper
9d8594fb7e Bumped version numbers. 2011-04-21 15:30:37 -07:00
Michael Jumper
881d49278d Changed enum names (collision with windows-defined macros), fixed thread call. 2011-04-21 15:23:53 -07:00
Michael Jumper
bd8d314c29 Converted to new thread API. 2011-04-21 15:07:36 -07:00
Michael Jumper
c97875d5c8 Cross-platform thread functions. 2011-04-21 15:04:15 -07:00
Michael Jumper
2aa5805048 Fixed guac_write_int - var should have been a long. 2011-04-03 00:43:13 -07:00
Michael Jumper
693fe2a1f5 Support for negative numbers in guac_write_int 2011-04-01 00:53:53 -07:00
Michael Jumper
ab3f09dfb0 Fixed integer overflow in guac_sleep. 2011-04-01 00:30:40 -07:00
Michael Jumper
6579eea3f1 Marked unimplemented masks as such. 2011-03-30 00:31:32 -07:00
Michael Jumper
797cff31f2 Added composite mode. 2011-03-30 00:05:28 -07:00
Michael Jumper
ba323a7a20 Added composite mode. 2011-03-30 00:03:32 -07:00
Michael Jumper
e0e6a5e50e Fixed leak in update handler. 2011-03-27 22:48:15 -07:00
Michael Jumper
846c42c1cb Working cairo VNC client. 2011-03-27 18:58:51 -07:00
Michael Jumper
be731b5900 Full conversion of old libpng-based methods. 2011-03-27 18:40:38 -07:00
Michael Jumper
e49798364b Switching to cairo, partial translation. 2011-03-27 18:28:10 -07:00
Michael Jumper
f95f264747 Using cairo instead of libpng. 2011-03-27 16:32:49 -07:00
Michael Jumper
feff9f5138 Added -Werror -Wall -pedantic 2011-03-24 23:14:20 -07:00
Michael Jumper
56c3b04e9e Added -pedantic 2011-03-24 23:12:43 -07:00
Michael Jumper
bb994d5c90 Added -pedantic, fixed warning. 2011-03-24 23:11:46 -07:00
Michael Jumper
1e33435c22 Merge branch 'unstable' of ssh://guacamole.git.sourceforge.net/gitroot/guacamole/libguac into unstable 2011-03-20 23:02:36 -07:00
Michael Jumper
18e01ee74c Added ifdef to force fast (less compressed) PNG rendering only when asked. 2011-03-20 23:02:28 -07:00
Michael Jumper
a2b0729953 Wait for output thread if input thread does not start, fixed typo in error. 2011-03-20 21:38:58 -07:00
Michael Jumper
b16eda0d48 Fixed missing include 2011-03-20 19:38:36 -07:00
Michael Jumper
d6a5d70278 Experimental speed options for PNG encoding (less compression, no filtering) 2011-03-20 19:34:45 -07:00
Michael Jumper
8c3fa0c54e Use guac log functions for VNC log. 2011-03-20 00:22:22 -07:00
Michael Jumper
220035746b Add va_list variants of the guac_log_* functions 2011-03-20 00:21:56 -07:00
Michael Jumper
03bbc76145 Use fork for connection handlers (preferrably), fix memory leak 2011-03-20 00:21:33 -07:00
Michael Jumper
ec2d9f6918 Using new log functions 2011-03-19 17:13:33 -07:00
Michael Jumper
149185f49e Using new log functions 2011-03-19 17:13:24 -07:00
Michael Jumper
97a63fae3e Fixed log.c and Makefile.am 2011-03-19 17:13:02 -07:00
Michael Jumper
1f4afa6c47 Documentation (doxygen) 2011-03-19 17:06:25 -07:00
Michael Jumper
06dad71273 Using function rather than variadic macro 2011-03-19 17:02:30 -07:00
Michael Jumper
b52a49d7b0 Ignore SIGPIPE (force checking of EPIPE instead). 2011-03-19 16:50:18 -07:00
Michael Jumper
a72df19449 Error handling in guac_start_client. 2011-03-19 16:44:06 -07:00
Michael Jumper
71d59845e9 More error handling, style fix. 2011-03-19 16:39:18 -07:00
Michael Jumper
6300c7c56a Return values and error handling for guac_send_* functions in protocol. 2011-03-19 16:32:35 -07:00
Michael Jumper
adfd2d3089 Fix memory leak due to extra alloc of png buffers, add workarounds for leaks in libvncclient. 2011-03-19 01:02:29 -07:00
Michael Jumper
5a2a629225 Fixed guac_client_free_handler definition. 2011-03-19 01:00:40 -07:00
Michael Jumper
1b326b9cfb Detach main thread. 2011-03-19 00:59:14 -07:00
Michael Jumper
195ad0e251 More documentation. 2011-03-18 00:55:14 -07:00
Michael Jumper
599c7ff58a Documentation for new client functions and structures. 2011-03-18 00:42:34 -07:00
Michael Jumper
e20e877d45 Moved sleep and timestamp functions, fixed header ifndefs 2011-03-17 21:16:29 -07:00
Michael Jumper
df7fa4c88d Increased wait time for messages (as libguac now uses I/O threads) 2011-03-17 14:05:24 -07:00
Michael Jumper
0a3a23f26e Temporary fix for spinning while waiting for sync 2011-03-17 14:04:23 -07:00
Michael Jumper
1b2c27ba96 Removed debug fprintf. 2011-03-17 00:25:55 -07:00
Michael Jumper
a08cd5b8b7 Changed semantics of guac_read_instruction, fixed timeout. 2011-03-17 00:25:35 -07:00
Michael Jumper
3e14b52b1c Improved instruction handling, working I/O threads. 2011-03-16 23:46:02 -07:00
Michael Jumper
3c878e1d59 Added input and output threads 2011-03-16 01:24:17 -07:00
Michael Jumper
a9f702ed27 Initial implementation of timeout. 2011-03-15 23:02:47 -07:00
Michael Jumper
7f106c663c Updated changelog 2011-03-15 22:23:21 -07:00
Michael Jumper
5a46330332 Updated changelog 2011-03-15 22:21:25 -07:00
Michael Jumper
8569803cd5 Init total_written in open. 2011-03-14 11:00:48 -07:00
Michael Jumper
bbc373c1b9 Fixed lack of initialization of now-used pointers. 2011-03-14 10:59:47 -07:00
Michael Jumper
82fcbe98e5 Support for encodings as an option. 2011-03-13 18:58:31 -07:00
Michael Jumper
555c7b9a97 Experimental support for resized framebuffer. 2011-03-13 18:34:58 -07:00
Michael Jumper
3e90251cb8 Automatic sleep on message handle 2011-03-13 14:52:19 -07:00
Michael Jumper
74150f373e Removed sleep - libguac now handles sleeping automatically 2011-03-13 14:52:06 -07:00
Michael Jumper
12d497ca3f Working sync control. 2011-03-11 19:35:44 -08:00
Michael Jumper
e463360aad Sync message support. 2011-03-11 18:57:53 -08:00
Michael Jumper
4044b61f56 Revert "Removed delay and check for nanosleep (replaced by ready message in libguac)"
This reverts commit a9ea3ac383de3f92e5b0d29449f1daa618b60624.
2011-03-06 17:01:00 -08:00
Michael Jumper
90993d5d75 Revert "Reinstated ready instruction"
This reverts commit 283c1f5ecbbfa06da5ed1300fc0243c2afcadfeb.
2011-03-06 16:57:13 -08:00
Michael Jumper
b46c5187be Removed delay and check for nanosleep (replaced by ready message in libguac) 2011-03-05 14:47:24 -08:00
Michael Jumper
47762889cf Reinstated ready instruction 2011-03-05 14:47:02 -08:00
Michael Jumper
cd4205caf6 Added ldconfig instructions 2011-03-02 01:42:30 -08:00
Michael Jumper
34188366a9 Added README for libguac-client-vnc 2011-03-02 01:42:18 -08:00
Michael Jumper
1e1ef6f950 Added README for libguac 2011-03-02 01:38:01 -08:00
Michael Jumper
436c4295dc Added license block to Makefile.am and configure.in 2011-03-02 01:22:32 -08:00
Michael Jumper
a6bfd481c8 Added license block to Makefile.am 2011-03-02 01:21:34 -08:00
Michael Jumper
4477ef6669 Added license block to Makefile.am and configure.in 2011-03-02 01:20:56 -08:00
Michael Jumper
b6cceaa7f9 Added license block to configure.in 2011-03-02 01:19:24 -08:00
Michael Jumper
17c649704a Actual docs in README 2011-03-01 10:58:25 -08:00
Michael Jumper
90168a9877 Added ChangeLog, removed unused files, switched to foreign over GNU 2011-03-01 01:05:09 -08:00
Michael Jumper
e9d52be8d5 Added ChangeLog, removed unused files, switched to foreign over GNU 2011-03-01 01:04:29 -08:00
Michael Jumper
b5891c779c Removed unused files, switched to foreign over GNU 2011-03-01 01:03:35 -08:00
Michael Jumper
3873b726b6 Added entry to ChangeLog 2011-03-01 00:58:39 -08:00
Michael Jumper
a1f65ce659 Using dashes instead of underscores for client lib prefix 2011-02-28 14:51:18 -08:00
Michael Jumper
2f594d3de7 Renamed libguac_client_vnc to libguac-client-vnc 2011-02-28 14:49:16 -08:00
Michael Jumper
077bf9e20c Removed dependency on LSB - script should now work on generic UNIX and Linux distros without LSB 2011-02-28 14:36:40 -08:00
Michael Jumper
dd69712dc2 Adding guacd.in to EXTRA_DIST 2011-02-27 21:04:49 -08:00
Michael Jumper
15cc47f2af Adding support for LSB try-restart 2011-02-27 21:01:16 -08:00
Michael Jumper
bb4070925c Removed reference to sysconfig 2011-02-27 20:28:22 -08:00
Michael Jumper
5d13535fb4 Working LSB startup script. 2011-02-27 20:27:12 -08:00
Michael Jumper
0d4e4ceb15 Merge branch 'unstable' of ssh://guacamole.git.sourceforge.net/gitroot/guacamole/libguac-client-vnc into unstable 2011-02-21 22:38:13 -08:00
Michael Jumper
23bc28253a Migrating to new version number system 2011-02-21 22:36:54 -08:00
Michael Jumper
122cbeff15 Migrating to new version number system 2011-02-21 22:36:34 -08:00
Michael Jumper
f6b137d1b5 Migrating to new version number system 2011-02-21 22:35:18 -08:00
Michael Jumper
bdaf1db86c Making version number match lib version info 2011-02-21 00:13:44 -08:00
Michael Jumper
78fa8ebbd7 Removed one nanosleep() check - same change made twice 2011-02-17 02:18:44 -08:00
Michael Jumper
d73a0af709 Merge branch 'unstable' of ssh://guacamole.git.sourceforge.net/gitroot/guacamole/libguac-client-vnc into unstable 2011-02-17 02:07:45 -08:00
Michael Jumper
48bc7a6596 Fixed performance issues with too many updates (nanosleep detection was broken) 2011-02-16 18:37:28 -08:00
Michael Jumper
efcfa12fe6 Changing to MPL/GPL/LGPL tri-license 2011-02-15 18:48:02 -08:00
Michael Jumper
8d0c3ac46b Changing to MPL/GPL/LGPL tri-license 2011-02-15 18:47:51 -08:00
Michael Jumper
5cdfad50e6 Detect and use png_get_io_ptr if provided 2011-02-15 18:07:19 -08:00
Michael Jumper
d32b26ffa8 Changing to MPL/GPL/LGPL tri-license 2011-02-15 18:04:36 -08:00
Michael Jumper
4a3df25b5a Merge branch 'unstable' of ssh://guacamole.git.sourceforge.net/gitroot/guacamole/libguac-client-vnc into unstable 2011-02-13 01:18:12 -08:00
Michael Jumper
5a3eb36e2c Migrated to newer libguac (layer support) 2011-02-11 23:19:35 -08:00
Michael Jumper
903104af20 Merge branch 'unstable' of ssh://guacamole.git.sourceforge.net/gitroot/guacamole/libguac into unstable 2011-02-11 23:17:05 -08:00
Michael Jumper
3e6b22b071 Layer/buffer support in png and copy instructions 2011-02-11 23:16:46 -08:00
Michael Jumper
d9682409f7 Fixed detection of nanosleep. 2011-02-11 00:21:54 -08:00
Michael Jumper
1c84d1aecf Fixed fork() detection 2011-02-10 23:57:38 -08:00
Michael Jumper
a0cb37295f Fixed pngstruct.h detection 2011-02-10 23:53:11 -08:00
Michael Jumper
5458ba05b5 Cleaned up daemon.c 2011-02-10 23:47:46 -08:00
Michael Jumper
6355be0f36 Read-only mode 2011-02-10 22:56:47 -08:00
Michael Jumper
7d1215e8c4 Thread support for MinGW32 2011-02-10 01:17:31 -08:00
Michael Jumper
e5074c2c58 Cross-platform close socket macro, init winsock if MINGW32, MINGW32 support(ish) for strerror 2011-02-10 00:27:31 -08:00
Michael Jumper
0cb6ad1502 Use send() instead of write() if MINGW32. 2011-02-10 00:24:17 -08:00
Michael Jumper
935d18ba01 Using new header 2011-02-09 01:40:46 -08:00
Michael Jumper
60897fc7f8 Renamed guaclog.h, added newline to macro 2011-02-09 01:39:27 -08:00
Michael Jumper
d7b1bc8dae Allow compile even if fork() and pthreads not present. 2011-02-08 19:58:26 -08:00
Michael Jumper
320b1e7f54 Added cross-platform sleep 2011-02-08 19:42:40 -08:00
Michael Jumper
e37507d312 Added check for wsock32 2011-02-08 18:39:08 -08:00
Michael Jumper
9c7c09cd7f Removed transfer limit, improved cross-platform logging, added check for png_structp. 2011-02-08 18:23:10 -08:00
Michael Jumper
fd1485e220 Added cross-platform logging. 2011-02-08 18:02:27 -08:00
Michael Jumper
f60824686f Removed experimental ready instruction 2011-01-21 20:00:14 -08:00
Michael Jumper
55f5755fc3 Calling setsockopt to allow reuse of socket. 2011-01-21 10:01:49 -08:00
Michael Jumper
84d79fc2ba Reverting (partially) ready message change - seems slower 2011-01-21 09:39:49 -08:00
Michael Jumper
859e739dae Support for "ready" message (both client and server) 2011-01-21 03:11:13 -08:00
Michael Jumper
081df9339b Added args, shifted left one now that protocol isn't passed as args to connect 2011-01-01 13:23:53 -08:00
Michael Jumper
455c340318 Implemented select message, allowing args definition. 2011-01-01 13:22:17 -08:00
Michael Jumper
46a9529aa4 Fixed leak of instruction buffer - missing free in guac_close 2010-12-22 22:31:20 -08:00
Michael Jumper
62a886d258 Fixing leak in client init - GUACIO must be closed (and thus free'd) on init error 2010-12-22 02:04:09 -08:00
Michael Jumper
fbba21feac Fixing memory leak of client data struct 2010-12-22 02:00:13 -08:00
Michael Jumper
e45c8be4da guacd should fork self into background, like any self-respecting daemon. 2010-12-17 17:26:57 -08:00
Michael Jumper
866e8fa7c7 Moving to sbin 2010-12-17 17:02:19 -08:00
Michael Jumper
c3e4df73f1 Adding package descriptor for build system 2010-12-17 15:16:34 -08:00
Michael Jumper
4390b65a98 Adding package descriptor for build system 2010-12-17 15:14:18 -08:00
Michael Jumper
c9c2295dbd Adding package descriptor for build system 2010-12-17 15:10:00 -08:00
Michael Jumper
e55280d308 configure.in should specify errors for missing libs 2010-12-15 11:41:21 -08:00
Michael Jumper
36728eb34e configure.in should specify errors for missing libs 2010-12-15 11:41:03 -08:00
Michael Jumper
d1f20b04d2 Adding .gitignore 2010-12-14 01:34:54 -08:00
Michael Jumper
7018560c4d Updated .gitignore 2010-12-14 01:34:10 -08:00
Michael Jumper
7cab7d0d2f Adding .gitignore 2010-12-14 01:27:28 -08:00
Michael Jumper
c1e6b2c7f3 Renamed package 2010-12-13 23:09:10 -08:00
Michael Jumper
7e5d3276c0 More renaming 2010-12-08 13:14:04 -08:00
Michael Jumper
91c4ef665a More renaming 2010-12-08 13:14:04 -08:00
Michael Jumper
857030249a More renaming 2010-12-08 13:14:04 -08:00
555 changed files with 95046 additions and 4013 deletions

60
.dockerignore Normal file
View File

@ -0,0 +1,60 @@
# Docker build spec
Dockerfile
# Git repository metadata
.git
**/.gitignore
# Object code
**/*.o
**/*.so
**/*.lo
**/*.la
# gcov files
**/*.gcda
**/*.gcov
**/*.gcno
# Backup files
**/*~
# Release files
**/*.tar.gz
# Files currently being edited by vim or vi
**/*.swp
# automake/autoconf
**/.deps/
**/.dirstamp
**/.libs/
**/Makefile
**/Makefile.in
aclocal.m4
autom4te.cache/
m4/*
**/!README
compile
config.guess
config.h
config.h.in
config.log
config.status
config.sub
configure
depcomp
install-sh
libtool
ltmain.sh
missing
stamp-h1
test-driver
# Test binaries
tests/test_*
!tests/test_*.[ch]
# Generated docs
doc/*/doxygen-output

View File

@ -5,6 +5,15 @@
*.lo
*.la
# gcov files
*.gcda
*.gcov
*.gcno
# Test suite output
*.log
*.trs
# Backup files
*~
@ -16,20 +25,26 @@
# automake/autoconf
.deps/
.dirstamp
.libs/
Doxyfile
Makefile
Makefile.in
aclocal.m4
autom4te.cache/
m4/
config.guess
build-aux/
libtool
m4/*
!README
config.h
config.h.in
config.log
config.status
config.sub
configure
depcomp
install-sh
libtool
ltmain.sh
missing
stamp-h1
# Generated docs
doc/*/doxygen-output
# IDE metadata
nbproject/

52
CONTRIBUTING Normal file
View File

@ -0,0 +1,52 @@
------------------------------------------------------------
Contributing to Apache Guacamole
------------------------------------------------------------
Thank you for contributing to the Apache Guacamole project!
There are certain procedures that must be followed for all contributions. These
procedures are necessary to allow us to allocate resources for reviewing and
testing your contribution, as well as communicate effectively with you during
the review process.
1) Create an issue in our JIRA
All changes to Guacamole must have corresponding issues in JIRA so the
change can be properly tracked:
https://issues.apache.org/jira/browse/GUACAMOLE/
If you do not already have an account on the Apache Software Foundation's
JIRA, you will need to create one before creating your new issue.
2) Make and test your changes locally
The Guacamole source is maintained in git repositories hosted on GitHub:
https://github.com/apache/guacamole-client
https://github.com/apache/guacamole-manual
https://github.com/apache/guacamole-server
https://github.com/apache/guacamole-website
To make your changes, fork the applicable repositories and make commits
to a topic branch in your fork. Commits should be made in logical units
and must reference the JIRA issue number:
$ git commit -m "GUACAMOLE-123: High-level message describing the changes."
Avoid commits which cover multiple, distinct goals that could (and should)
be handled separately.
If you do not already have an account on GitHub, you will need to create
one before making your changes.
3) Submit your changes via a pull request on GitHub
Once your changes are ready, submit them by creating a pull request for
the corresponding topic branch you created when you began working on your
changes.
The Guacamole team will then review your changes and, if they pass review,
your changes will be merged.

201
Dockerfile Normal file
View File

@ -0,0 +1,201 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
#
# Dockerfile for guacamole-server
#
# The Alpine Linux image that should be used as the basis for the guacd image
ARG ALPINE_BASE_IMAGE=latest
FROM alpine:${ALPINE_BASE_IMAGE} AS builder
# Install build dependencies
RUN apk add --no-cache \
autoconf \
automake \
build-base \
cairo-dev \
cmake \
git \
grep \
libjpeg-turbo-dev \
libpng-dev \
libtool \
libwebp-dev \
make \
openssl-dev \
pango-dev \
pulseaudio-dev \
util-linux-dev
# Copy source to container for sake of build
ARG BUILD_DIR=/tmp/guacamole-server
COPY . ${BUILD_DIR}
#
# Base directory for installed build artifacts.
#
# NOTE: Due to limitations of the Docker image build process, this value is
# duplicated in an ARG in the second stage of the build.
#
ARG PREFIX_DIR=/opt/guacamole
#
# Automatically select the latest versions of each core protocol support
# library (these can be overridden at build time if a specific version is
# needed)
#
ARG WITH_FREERDP='2(\.\d+)+'
ARG WITH_LIBSSH2='libssh2-\d+(\.\d+)+'
ARG WITH_LIBTELNET='\d+(\.\d+)+'
ARG WITH_LIBVNCCLIENT='LibVNCServer-\d+(\.\d+)+'
ARG WITH_LIBWEBSOCKETS='v\d+(\.\d+)+'
#
# Default build options for each core protocol support library, as well as
# guacamole-server itself (these can be overridden at build time if different
# options are needed)
#
ARG FREERDP_OPTS="\
-DBUILTIN_CHANNELS=OFF \
-DCHANNEL_URBDRC=OFF \
-DWITH_ALSA=OFF \
-DWITH_CAIRO=ON \
-DWITH_CHANNELS=ON \
-DWITH_CLIENT=ON \
-DWITH_CUPS=OFF \
-DWITH_DIRECTFB=OFF \
-DWITH_FFMPEG=OFF \
-DWITH_GSM=OFF \
-DWITH_GSSAPI=OFF \
-DWITH_IPP=OFF \
-DWITH_JPEG=ON \
-DWITH_LIBSYSTEMD=OFF \
-DWITH_MANPAGES=OFF \
-DWITH_OPENH264=OFF \
-DWITH_OPENSSL=ON \
-DWITH_OSS=OFF \
-DWITH_PCSC=OFF \
-DWITH_PULSE=OFF \
-DWITH_SERVER=OFF \
-DWITH_SERVER_INTERFACE=OFF \
-DWITH_SHADOW_MAC=OFF \
-DWITH_SHADOW_X11=OFF \
-DWITH_SSE2=ON \
-DWITH_WAYLAND=OFF \
-DWITH_X11=OFF \
-DWITH_X264=OFF \
-DWITH_XCURSOR=ON \
-DWITH_XEXT=ON \
-DWITH_XI=OFF \
-DWITH_XINERAMA=OFF \
-DWITH_XKBFILE=ON \
-DWITH_XRENDER=OFF \
-DWITH_XTEST=OFF \
-DWITH_XV=OFF \
-DWITH_ZLIB=ON"
ARG GUACAMOLE_SERVER_OPTS="\
--disable-guaclog"
ARG LIBSSH2_OPTS="\
-DBUILD_EXAMPLES=OFF \
-DBUILD_SHARED_LIBS=ON"
ARG LIBTELNET_OPTS="\
--disable-static \
--disable-util"
ARG LIBVNCCLIENT_OPTS=""
ARG LIBWEBSOCKETS_OPTS="\
-DDISABLE_WERROR=ON \
-DLWS_WITHOUT_SERVER=ON \
-DLWS_WITHOUT_TESTAPPS=ON \
-DLWS_WITHOUT_TEST_CLIENT=ON \
-DLWS_WITHOUT_TEST_PING=ON \
-DLWS_WITHOUT_TEST_SERVER=ON \
-DLWS_WITHOUT_TEST_SERVER_EXTPOLL=ON \
-DLWS_WITH_STATIC=OFF"
# Build guacamole-server and its core protocol library dependencies
RUN ${BUILD_DIR}/src/guacd-docker/bin/build-all.sh
# Record the packages of all runtime library dependencies
RUN ${BUILD_DIR}/src/guacd-docker/bin/list-dependencies.sh \
${PREFIX_DIR}/sbin/guacd \
${PREFIX_DIR}/lib/libguac-client-*.so \
${PREFIX_DIR}/lib/freerdp2/*guac*.so \
> ${PREFIX_DIR}/DEPENDENCIES
# Use same Alpine version as the base for the runtime image
FROM alpine:${ALPINE_BASE_IMAGE}
#
# Base directory for installed build artifacts. See also the
# CMD directive at the end of this build stage.
#
# NOTE: Due to limitations of the Docker image build process, this value is
# duplicated in an ARG in the first stage of the build.
#
ARG PREFIX_DIR=/opt/guacamole
# Runtime environment
ENV LC_ALL=C.UTF-8
ENV LD_LIBRARY_PATH=${PREFIX_DIR}/lib
ENV GUACD_LOG_LEVEL=info
# Copy build artifacts into this stage
COPY --from=builder ${PREFIX_DIR} ${PREFIX_DIR}
# Bring runtime environment up to date and install runtime dependencies
RUN apk add --no-cache \
ca-certificates \
ghostscript \
netcat-openbsd \
shadow \
terminus-font \
ttf-dejavu \
ttf-liberation \
util-linux-login && \
xargs apk add --no-cache < ${PREFIX_DIR}/DEPENDENCIES
# Checks the operating status every 5 minutes with a timeout of 5 seconds
HEALTHCHECK --interval=5m --timeout=5s CMD nc -z 127.0.0.1 4822 || exit 1
# Create a new user guacd
ARG UID=1000
ARG GID=1000
RUN groupadd --gid $GID guacd
RUN useradd --system --create-home --shell /sbin/nologin --uid $UID --gid $GID guacd
# Run with user guacd
USER guacd
# Expose the default listener port
EXPOSE 4822
# Start guacd, listening on port 0.0.0.0:4822
#
# Note the path here MUST correspond to the value specified in the
# PREFIX_DIR build argument.
#
CMD /opt/guacamole/sbin/guacd -b 0.0.0.0 -L $GUACD_LOG_LEVEL -f

202
LICENSE Normal file
View File

@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

103
Makefile.am Normal file
View File

@ -0,0 +1,103 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# NOTE: Parts of this file (Makefile.am) are automatically transcluded verbatim
# into Makefile.in. Though the build system (GNU Autotools) automatically adds
# its own license boilerplate to the generated Makefile.in, that boilerplate
# does not apply to the transcluded portions of Makefile.am which are licensed
# to you by the ASF under the Apache License, Version 2.0, as described above.
#
ACLOCAL_AMFLAGS = -I m4
# Subprojects
DIST_SUBDIRS = \
src/libguac \
src/common \
src/common-ssh \
src/terminal \
src/guacd \
src/guacenc \
src/guaclog \
src/pulse \
src/protocols/kubernetes \
src/protocols/rdp \
src/protocols/ssh \
src/protocols/telnet \
src/protocols/vnc
SUBDIRS = \
src/libguac \
src/common
if ENABLE_COMMON_SSH
SUBDIRS += src/common-ssh
endif
if ENABLE_TERMINAL
SUBDIRS += src/terminal
endif
if ENABLE_PULSE
SUBDIRS += src/pulse
endif
if ENABLE_KUBERNETES
SUBDIRS += src/protocols/kubernetes
endif
if ENABLE_RDP
SUBDIRS += src/protocols/rdp
endif
if ENABLE_SSH
SUBDIRS += src/protocols/ssh
endif
if ENABLE_TELNET
SUBDIRS += src/protocols/telnet
endif
if ENABLE_VNC
SUBDIRS += src/protocols/vnc
endif
if ENABLE_GUACD
SUBDIRS += src/guacd
endif
if ENABLE_GUACENC
SUBDIRS += src/guacenc
endif
if ENABLE_GUACLOG
SUBDIRS += src/guaclog
endif
EXTRA_DIST = \
.dockerignore \
CONTRIBUTING \
Dockerfile \
LICENSE \
NOTICE \
bin/guacctl \
doc/libguac/Doxyfile.in \
doc/libguac-terminal/Doxyfile.in \
src/guacd-docker \
util/generate-test-runner.pl

5
NOTICE Normal file
View File

@ -0,0 +1,5 @@
Apache Guacamole
Copyright 2020 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).

185
README Normal file
View File

@ -0,0 +1,185 @@
------------------------------------------------------------
About this README
------------------------------------------------------------
This README is intended to provide quick and to-the-point documentation for
technical users intending to compile parts of Apache Guacamole themselves.
Source archives are available from the downloads section of the project website:
http://guacamole.apache.org/
A full manual is available as well:
http://guacamole.apache.org/doc/gug/
------------------------------------------------------------
What is guacamole-server?
------------------------------------------------------------
The guacamole-server package is a set of software which forms the basis of the
Guacamole stack. It consists of guacd, libguac, and several protocol support
libraries.
guacd is the Guacamole proxy daemon used by the Guacamole web application and
framework. As JavaScript cannot handle binary protocols (like VNC and remote
desktop) efficiently, a new text-based protocol was developed which would
contain a common superset of the operations needed for efficient remote desktop
access, but would be easy for JavaScript programs to process. guacd is the
proxy which translates between arbitrary protocols and the Guacamole protocol.
------------------------------------------------------------
Required dependencies
------------------------------------------------------------
All software within guacamole-server is built using the popular GNU Automake,
and thus provides the standard configure script. Before compiling, at least
the following required dependencies must already be installed:
1) Cairo (http://cairographics.org/)
2) libjpeg-turbo (http://libjpeg-turbo.virtualgl.org/)
OR libjpeg (http://www.ijg.org/)
3) libpng (http://www.libpng.org/pub/png/libpng.html)
4) OSSP UUID (http://www.ossp.org/pkg/lib/uuid/)
------------------------------------------------------------
Optional dependencies
------------------------------------------------------------
In addition, the following optional dependencies may be installed in order to
enable optional features of Guacamole. Note that while the various supported
protocols are technically optional, you will no doubt wish to install the
dependencies of at least ONE supported protocol, as Guacamole would be useless
otherwise.
RDP:
* FreeRDP (http://www.freerdp.com/)
SSH:
* libssh2 (http://www.libssh2.org/)
* OpenSSL (https://www.openssl.org/)
* Pango (http://www.pango.org/)
Telnet:
* libtelnet (https://github.com/seanmiddleditch/libtelnet)
* Pango (http://www.pango.org/)
VNC:
* libVNCserver (http://libvnc.github.io/)
Support for audio within VNC:
* PulseAudio (http://www.freedesktop.org/wiki/Software/PulseAudio/)
Support for SFTP file transfer for VNC or RDP:
* libssh2 (http://www.libssh2.org/)
* OpenSSL (https://www.openssl.org/)
Support for WebP image compression:
* libwebp (https://developers.google.com/speed/webp/)
"guacenc" video encoding utility:
* FFmpeg (https://ffmpeg.org/)
------------------------------------------------------------
Compiling and installing guacd, libguac, etc.
------------------------------------------------------------
All software within guacamole-server is built using the popular GNU Automake,
and thus provides the standard configure script.
1) Run configure
$ ./configure
Assuming all dependencies have been installed, this should succeed without
errors. If you wish to install the init script as well, you need to specify
the location where your system init scripts are located (typically
/etc/init.d):
$ ./configure --with-init-dir=/etc/init.d
Running configure in this manner will cause the "make install" step to
install an init script to the specified directory, which you can then
activate using the service management mechanism provided by your
distribution).
2) Run make
$ make
guacd, libguac, and any available protocol support libraries will now
compile.
3) Install (as root)
# make install
All software that was just built, including documentation, will be
installed.
guacd will install to your /usr/local/sbin directory by default. You can
change the install location by using the --prefix option for configure.
------------------------------------------------------------
Running guacd
------------------------------------------------------------
If you installed the init script during compile and install, you should be
able to start guacd through the service management utilities provided by
your distribution (if any) or by running the init script directly (as root):
# /etc/init.d/guacd start
Root access is needed to write the pidfile /var/run/guacd.pid. You can also run
guacd itself directly without the init script (as any user):
$ guacd
guacd currently takes several command-line options:
-b HOST
Changes the host or address that guacd listens on.
-l PORT
Changes the port that guacd listens on (the default is port 4822).
-p PIDFILE
Causes guacd to write the PID of the daemon process to the specified
file. This is useful for init scripts and is used by the provided init
script.
-L LEVEL
Sets the maximum level at which guacd will log messages to syslog and,
if running in the foreground, the console. Legal values are debug,
info, warning, and error. The default value is info.
-f
Causes guacd to run in the foreground, rather than automatically
forking into the background.
Additional information can be found in the guacd man page:
$ man guacd
------------------------------------------------------------
Reporting problems
------------------------------------------------------------
Please report any bugs encountered by opening a new issue in the JIRA system
hosted at:
https://issues.apache.org/jira/browse/GUACAMOLE

89
README-unit-testing.md Normal file
View File

@ -0,0 +1,89 @@
Unit testing and guacamole-server
=================================
Unit tests within guacamole-server are implemented using the following:
* automake, which allows arbitrary tests to be declared within `Makefile.am`
and uses `make check` to run those tests.
* CUnit (libcunit), a unit testing framework.
* `util/generate-test-runner.pl`, a Perl script which generates a test runner
written in C which leverages CUnit, running the unit tests declared in each
of the given `.c` files. The generated test runner produces output in [TAP
format](https://testanything.org/) which is consumed by the TAP test driver
provided by automake.
Writing unit tests
------------------
All unit tests should be within reasonably-isolated C source files, with each
logical test having its own function of the form:
void test_SUITENAME__TESTNAME() {
...
}
where `TESTNAME` is the arbitrary name of the test and `SUITENAME` is the
arbitrary name of the test suite that this test belongs to.
**This naming convention is required by `generate-test-runner.pl`.** Absolutely
all tests MUST follow the above convention if they are to be picked up and
organized by the test runner generation script. Functions which are not tests
MUST NOT follow the above convention so that they are _not_ picked up mistakenly
by the test runner generator as if they were tests.
The `Makefile.am` for a subproject which contains such tests is typically
modified to contain a sections like the following:
#
# Unit tests for myproj
#
check_PROGRAMS = test_myproj
TESTS = $(check_PROGRAMS)
test_myproj_SOURCES = \
...all source files...
test_myproj_CFLAGS = \
-Werror -Wall -pedantic \
...other flags...
test_myproj_LDADD = \
...libraries...
#
# Autogenerate test runner
#
GEN_RUNNER = $(top_srcdir)/util/generate-test-runner.pl
CLEANFILES = _generated_runner.c
_generated_runner.c: $(test_myproj_SOURCES)
$(AM_V_GEN) $(GEN_RUNNER) $(test_myproj_SOURCES) > $@
nodist_test_libguac_SOURCES = \
_generated_runner.c
# Use automake's TAP test driver for running any tests
LOG_DRIVER = \
env AM_TAP_AWK='$(AWK)' \
$(SHELL) $(top_srcdir)/build-aux/tap-driver.sh
The above declares ...
* ... that a binary, `test_myproj` should be built from the given sources.
Note that `test_myproj_SOURCES` contains only the source which was actually
written by hand while `nodist_test_myproj_SOURCES` contains only the source
which was generated by `generate-test-runner.pl`.
* ... that this `test_myproj` binary should be run to test this project when
`make check` is run, and that automake's TAP driver should be used to
consume its output.
* ... that the `_generated_runner.c` source file is generated dynamically
(through running `generate-test-runner.pl` on all non-generated test source)
and should not be distributed as part of the source archive.
With tests following the above naming convention in place, and with the
necessary changes made to the applicable `Makefile.am`, all tests will be
run automatically when `make check` is run.

368
bin/guacctl Executable file
View File

@ -0,0 +1,368 @@
#!/bin/sh
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
#
# guacctl
# -------
#
# Utility for sending Guacamole-specific console codes for controlling a
# terminal session, such as:
#
# * Downloading files (SSH only)
# * Setting the destination directory for uploads (SSH only)
# * Redirecting output to a named pipe stream (SSH or telnet)
#
# This script may also be run as "guacget", in which case the script accepts
# no options and assumes anything given on the commandline is a file to be
# downloaded.
#
##
## Given the name of a file, which may be a relative path, produce the full,
## real, non-relative path for that same file.
##
## @param FILENAME
## The name of the file to produce the full path of.
##
fullpath() {
FILENAME="$1"
DIR=`dirname "$FILENAME"`
FILE=`basename "$FILENAME"`
(cd "$DIR" && echo "$PWD/$FILE")
}
##
## Sends the Guacamole-specific console code for initiating a download.
##
## @param FILENAME
## The full path of the file to download.
##
send_download_file() {
FILENAME="$1"
printf "\033]482200;%s\007" "$FILENAME"
}
##
## Sends the Guacamole-specific console code for setting the upload directory.
##
## @param FILENAME
## The full path to the directory which should receive uploads.
##
send_set_directory() {
FILENAME="$1"
printf "\033]482201;%s\007" "$FILENAME"
}
##
## Sends the Guacamole-specific console code for redirecting output to a named
## pipe stream (instead of the terminal emulator)
##
## @param NAME
## The name of the pipe stream to open.
##
send_open_pipe_stream() {
NAME="$1"
printf "\033]482202;%s\007" "$NAME"
}
##
## Sends the Guacamole-specific console code for redirecting output back to the
## terminal emulator
##
send_close_pipe_stream() {
printf "\033]482203;\007"
}
##
## Sends the Guacamole-specific console code for resizing the scrollback
## buffer.
##
## @param ROWS
## The number of rows that the scrollback buffer should contain.
##
send_resize_scrollback() {
ROWS="$1"
printf "\033]482204;%s\007" "$ROWS"
}
##
## Prints the given error text to STDERR.
##
## @param ...
## The text to print as an error message.
##
error() {
echo "$NAME:" "$@" >&2
}
##
## Prints usage documentation for this script.
##
usage() {
cat >&2 <<END
guacctl 1.5.0, Apache Guacamole terminal session control utility.
Usage: guacctl [OPTION] [FILE or NAME]...
-d, --download download each of the files listed.
-s, --set-directory set the destination directory for future uploaded
files.
-o, --open-pipe redirect output to a new pipe stream with the given
name.
-c, --close-pipe close any existing pipe stream and redirect output
back to the terminal emulator.
-S, --scrollback request that the scrollback buffer be limited to the
given number of rows.
END
}
##
## Initiates a download for each of the specified files.
##
## @param ...
## The name of each file that should be downloaded, as originally
## provided to guacctl.
##
download_files() {
#
# Validate arguments
#
if [ $# -lt 1 ]; then
error "No files specified."
return;
fi
#
# Send download code for each file given
#
for FILENAME in "$@"; do
if [ -e "$FILENAME" ]; then
send_download_file "`fullpath "$FILENAME"`"
else
error "$FILENAME: File does not exist."
fi
done
}
##
## Changes the upload path for future uploads to the given directory.
##
## @param ...
## The name of the directory to use for uploads, as provided to guacctl.
##
set_directory() {
#
# Validate arguments
#
if [ $# -lt 1 ]; then
error "No destination directory specified."
return;
fi
if [ $# -gt 1 ]; then
error "Only one destination directory may be given."
return;
fi
#
# Send code for setting the upload directory
#
FILENAME="$1"
if [ -d "$FILENAME" ]; then
send_set_directory "`fullpath "$FILENAME"`"
else
error "$FILENAME: File does not exist or is not a directory."
fi
}
##
## Opens a new pipe stream having the given name and redirects terminal output
## to that stream.
##
## @param ...
## The name of the pipe stream to open, as provided to guacctl.
##
open_pipe_stream() {
#
# Validate arguments
#
if [ $# -lt 1 ]; then
error "No pipe name specified."
return;
fi
if [ $# -gt 1 ]; then
error "Only one pipe name may be given."
return;
fi
#
# Send code for opening the named pipe stream
#
NAME="$1"
send_open_pipe_stream "$NAME"
}
##
## Closes the currently-open pipe stream and redirects terminal output back to
## the terminal emulator
##
## @param ...
## The arguments provided to guacctl, which should be empty.
##
close_pipe_stream() {
#
# Validate arguments
#
if [ $# -gt 0 ]; then
error "Closing an open pipe stream does not require any arguments."
return;
fi
#
# Send code for closing the currently-open named pipe stream
#
send_close_pipe_stream
}
##
## Resizes the scrollback buffer to the given number of rows.
##
## @param ...
## The number of rows that should be contained within the scrollback
## buffer, as provided to guacctl.
##
resize_scrollback() {
#
# Validate arguments
#
if [ $# -lt 1 ]; then
error "No row count specified."
return;
fi
if [ $# -gt 1 ]; then
error "Only one row count may be given."
return;
fi
#
# Send code for resizing scrollback
#
ROWS="$1"
send_resize_scrollback "$ROWS"
}
#
# Get script name
#
NAME=`basename "$0"`
#
# Handle downloads directly if invoked as "guacget"
#
if [ "x$NAME" = "xguacget" ]; then
download_files "$@"
exit 0;
fi
#
# Parse options
#
case "$1" in
#
# Download files
#
"--download"|"-d")
shift
download_files "$@"
;;
#
# Set upload directory
#
"--set-directory"|"-s")
shift
set_directory "$@"
;;
#
# Redirect to pipe
#
"--open-pipe"|"-o")
shift
open_pipe_stream "$@"
;;
#
# Redirect back to terminal
#
"--close-pipe"|"-c")
shift
close_pipe_stream "$@"
;;
#
# Resize scrollback
#
"--scrollback"|"-S")
shift
resize_scrollback "$@"
;;
#
# Show usage info if options are invalid
#
*)
usage
exit 1
;;
esac

1
bin/guacget Symbolic link
View File

@ -0,0 +1 @@
guacctl

1279
configure.ac Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,58 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
#
# Project name / version
#
PROJECT_NAME = libguac-terminal
PROJECT_NUMBER = @PACKAGE_VERSION@
#
# Warn about undocumented parameters and return values, but do not fill output
# with verbose progress info.
#
QUIET = YES
WARN_NO_PARAMDOC = YES
#
# Output format
#
ALPHABETICAL_INDEX = YES
GENERATE_HTML = YES
GENERATE_LATEX = NO
OPTIMIZE_OUTPUT_FOR_C = YES
OUTPUT_DIRECTORY = doxygen-output
RECURSIVE = YES
SHOW_INCLUDE_FILES = NO
#
# Input format
#
CASE_SENSE_NAMES = YES
FILE_PATTERNS = *.h
STRIP_FROM_PATH = ../../src/terminal
INPUT = ../../src/terminal/terminal/terminal.h
JAVADOC_AUTOBRIEF = YES
TAB_SIZE = 4
TYPEDEF_HIDES_STRUCT = YES

60
doc/libguac/Doxyfile.in Normal file
View File

@ -0,0 +1,60 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
#
# Project name / version
#
PROJECT_NAME = libguac
PROJECT_NUMBER = @PACKAGE_VERSION@
#
# Warn about undocumented parameters and return values, but do not fill output
# with verbose progress info.
#
QUIET = YES
WARN_NO_PARAMDOC = YES
#
# Output format
#
ALPHABETICAL_INDEX = YES
GENERATE_HTML = YES
GENERATE_LATEX = NO
IGNORE_PREFIX = guac_ vguac_
OPTIMIZE_OUTPUT_FOR_C = YES
OUTPUT_DIRECTORY = doxygen-output
RECURSIVE = YES
SHOW_INCLUDE_FILES = NO
#
# Input format
#
CASE_SENSE_NAMES = YES
EXCLUDE_SYMBOLS = __* guac_palette*
FILE_PATTERNS = *.h
INPUT = ../../src/libguac/guacamole
JAVADOC_AUTOBRIEF = YES
STRIP_FROM_PATH = ../../src/libguac
TAB_SIZE = 4
TYPEDEF_HIDES_STRUCT = YES

12
m4/README Normal file
View File

@ -0,0 +1,12 @@
This file exists such that the m4/ directory will be created when cloning the
git repository.
The m4/ directory is not directly used by this project, but libtoolize
populates this directory with files, recommending that the directory be
included in the macro search path for aclocal.
Because autoreconf runs aclocal before libtoolize, this directory will not
exist when autoreconf is run, triggering an error from aclocal.
Creating this directory (and keeping this file in it as a placeholder)
prevents this error.

View File

@ -1,2 +0,0 @@
Michael Jumper <zhangmaike@users.sourceforge.net>
Matt Hortman <matt@FlintRiverSystems.com>

View File

@ -1,4 +0,0 @@
2012-05-04 Michael Jumper <zhangmaike@users.sourceforge.net>
* Initial release

View File

@ -1,470 +0,0 @@
MOZILLA PUBLIC LICENSE
Version 1.1
---------------
1. Definitions.
1.0.1. "Commercial Use" means distribution or otherwise making the
Covered Code available to a third party.
1.1. "Contributor" means each entity that creates or contributes to
the creation of Modifications.
1.2. "Contributor Version" means the combination of the Original
Code, prior Modifications used by a Contributor, and the Modifications
made by that particular Contributor.
1.3. "Covered Code" means the Original Code or Modifications or the
combination of the Original Code and Modifications, in each case
including portions thereof.
1.4. "Electronic Distribution Mechanism" means a mechanism generally
accepted in the software development community for the electronic
transfer of data.
1.5. "Executable" means Covered Code in any form other than Source
Code.
1.6. "Initial Developer" means the individual or entity identified
as the Initial Developer in the Source Code notice required by Exhibit
A.
1.7. "Larger Work" means a work which combines Covered Code or
portions thereof with code not governed by the terms of this License.
1.8. "License" means this document.
1.8.1. "Licensable" means having the right to grant, to the maximum
extent possible, whether at the time of the initial grant or
subsequently acquired, any and all of the rights conveyed herein.
1.9. "Modifications" means any addition to or deletion from the
substance or structure of either the Original Code or any previous
Modifications. When Covered Code is released as a series of files, a
Modification is:
A. Any addition to or deletion from the contents of a file
containing Original Code or previous Modifications.
B. Any new file that contains any part of the Original Code or
previous Modifications.
1.10. "Original Code" means Source Code of computer software code
which is described in the Source Code notice required by Exhibit A as
Original Code, and which, at the time of its release under this
License is not already Covered Code governed by this License.
1.10.1. "Patent Claims" means any patent claim(s), now owned or
hereafter acquired, including without limitation, method, process,
and apparatus claims, in any patent Licensable by grantor.
1.11. "Source Code" means the preferred form of the Covered Code for
making modifications to it, including all modules it contains, plus
any associated interface definition files, scripts used to control
compilation and installation of an Executable, or source code
differential comparisons against either the Original Code or another
well known, available Covered Code of the Contributor's choice. The
Source Code can be in a compressed or archival form, provided the
appropriate decompression or de-archiving software is widely available
for no charge.
1.12. "You" (or "Your") means an individual or a legal entity
exercising rights under, and complying with all of the terms of, this
License or a future version of this License issued under Section 6.1.
For legal entities, "You" includes any entity which controls, is
controlled by, or is under common control with You. For purposes of
this definition, "control" means (a) the power, direct or indirect,
to cause the direction or management of such entity, whether by
contract or otherwise, or (b) ownership of more than fifty percent
(50%) of the outstanding shares or beneficial ownership of such
entity.
2. Source Code License.
2.1. The Initial Developer Grant.
The Initial Developer hereby grants You a world-wide, royalty-free,
non-exclusive license, subject to third party intellectual property
claims:
(a) under intellectual property rights (other than patent or
trademark) Licensable by Initial Developer to use, reproduce,
modify, display, perform, sublicense and distribute the Original
Code (or portions thereof) with or without Modifications, and/or
as part of a Larger Work; and
(b) under Patents Claims infringed by the making, using or
selling of Original Code, to make, have made, use, practice,
sell, and offer for sale, and/or otherwise dispose of the
Original Code (or portions thereof).
(c) the licenses granted in this Section 2.1(a) and (b) are
effective on the date Initial Developer first distributes
Original Code under the terms of this License.
(d) Notwithstanding Section 2.1(b) above, no patent license is
granted: 1) for code that You delete from the Original Code; 2)
separate from the Original Code; or 3) for infringements caused
by: i) the modification of the Original Code or ii) the
combination of the Original Code with other software or devices.
2.2. Contributor Grant.
Subject to third party intellectual property claims, each Contributor
hereby grants You a world-wide, royalty-free, non-exclusive license
(a) under intellectual property rights (other than patent or
trademark) Licensable by Contributor, to use, reproduce, modify,
display, perform, sublicense and distribute the Modifications
created by such Contributor (or portions thereof) either on an
unmodified basis, with other Modifications, as Covered Code
and/or as part of a Larger Work; and
(b) under Patent Claims infringed by the making, using, or
selling of Modifications made by that Contributor either alone
and/or in combination with its Contributor Version (or portions
of such combination), to make, use, sell, offer for sale, have
made, and/or otherwise dispose of: 1) Modifications made by that
Contributor (or portions thereof); and 2) the combination of
Modifications made by that Contributor with its Contributor
Version (or portions of such combination).
(c) the licenses granted in Sections 2.2(a) and 2.2(b) are
effective on the date Contributor first makes Commercial Use of
the Covered Code.
(d) Notwithstanding Section 2.2(b) above, no patent license is
granted: 1) for any code that Contributor has deleted from the
Contributor Version; 2) separate from the Contributor Version;
3) for infringements caused by: i) third party modifications of
Contributor Version or ii) the combination of Modifications made
by that Contributor with other software (except as part of the
Contributor Version) or other devices; or 4) under Patent Claims
infringed by Covered Code in the absence of Modifications made by
that Contributor.
3. Distribution Obligations.
3.1. Application of License.
The Modifications which You create or to which You contribute are
governed by the terms of this License, including without limitation
Section 2.2. The Source Code version of Covered Code may be
distributed only under the terms of this License or a future version
of this License released under Section 6.1, and You must include a
copy of this License with every copy of the Source Code You
distribute. You may not offer or impose any terms on any Source Code
version that alters or restricts the applicable version of this
License or the recipients' rights hereunder. However, You may include
an additional document offering the additional rights described in
Section 3.5.
3.2. Availability of Source Code.
Any Modification which You create or to which You contribute must be
made available in Source Code form under the terms of this License
either on the same media as an Executable version or via an accepted
Electronic Distribution Mechanism to anyone to whom you made an
Executable version available; and if made available via Electronic
Distribution Mechanism, must remain available for at least twelve (12)
months after the date it initially became available, or at least six
(6) months after a subsequent version of that particular Modification
has been made available to such recipients. You are responsible for
ensuring that the Source Code version remains available even if the
Electronic Distribution Mechanism is maintained by a third party.
3.3. Description of Modifications.
You must cause all Covered Code to which You contribute to contain a
file documenting the changes You made to create that Covered Code and
the date of any change. You must include a prominent statement that
the Modification is derived, directly or indirectly, from Original
Code provided by the Initial Developer and including the name of the
Initial Developer in (a) the Source Code, and (b) in any notice in an
Executable version or related documentation in which You describe the
origin or ownership of the Covered Code.
3.4. Intellectual Property Matters
(a) Third Party Claims.
If Contributor has knowledge that a license under a third party's
intellectual property rights is required to exercise the rights
granted by such Contributor under Sections 2.1 or 2.2,
Contributor must include a text file with the Source Code
distribution titled "LEGAL" which describes the claim and the
party making the claim in sufficient detail that a recipient will
know whom to contact. If Contributor obtains such knowledge after
the Modification is made available as described in Section 3.2,
Contributor shall promptly modify the LEGAL file in all copies
Contributor makes available thereafter and shall take other steps
(such as notifying appropriate mailing lists or newsgroups)
reasonably calculated to inform those who received the Covered
Code that new knowledge has been obtained.
(b) Contributor APIs.
If Contributor's Modifications include an application programming
interface and Contributor has knowledge of patent licenses which
are reasonably necessary to implement that API, Contributor must
also include this information in the LEGAL file.
(c) Representations.
Contributor represents that, except as disclosed pursuant to
Section 3.4(a) above, Contributor believes that Contributor's
Modifications are Contributor's original creation(s) and/or
Contributor has sufficient rights to grant the rights conveyed by
this License.
3.5. Required Notices.
You must duplicate the notice in Exhibit A in each file of the Source
Code. If it is not possible to put such notice in a particular Source
Code file due to its structure, then You must include such notice in a
location (such as a relevant directory) where a user would be likely
to look for such a notice. If You created one or more Modification(s)
You may add your name as a Contributor to the notice described in
Exhibit A. You must also duplicate this License in any documentation
for the Source Code where You describe recipients' rights or ownership
rights relating to Covered Code. You may choose to offer, and to
charge a fee for, warranty, support, indemnity or liability
obligations to one or more recipients of Covered Code. However, You
may do so only on Your own behalf, and not on behalf of the Initial
Developer or any Contributor. You must make it absolutely clear than
any such warranty, support, indemnity or liability obligation is
offered by You alone, and You hereby agree to indemnify the Initial
Developer and every Contributor for any liability incurred by the
Initial Developer or such Contributor as a result of warranty,
support, indemnity or liability terms You offer.
3.6. Distribution of Executable Versions.
You may distribute Covered Code in Executable form only if the
requirements of Section 3.1-3.5 have been met for that Covered Code,
and if You include a notice stating that the Source Code version of
the Covered Code is available under the terms of this License,
including a description of how and where You have fulfilled the
obligations of Section 3.2. The notice must be conspicuously included
in any notice in an Executable version, related documentation or
collateral in which You describe recipients' rights relating to the
Covered Code. You may distribute the Executable version of Covered
Code or ownership rights under a license of Your choice, which may
contain terms different from this License, provided that You are in
compliance with the terms of this License and that the license for the
Executable version does not attempt to limit or alter the recipient's
rights in the Source Code version from the rights set forth in this
License. If You distribute the Executable version under a different
license You must make it absolutely clear that any terms which differ
from this License are offered by You alone, not by the Initial
Developer or any Contributor. You hereby agree to indemnify the
Initial Developer and every Contributor for any liability incurred by
the Initial Developer or such Contributor as a result of any such
terms You offer.
3.7. Larger Works.
You may create a Larger Work by combining Covered Code with other code
not governed by the terms of this License and distribute the Larger
Work as a single product. In such a case, You must make sure the
requirements of this License are fulfilled for the Covered Code.
4. Inability to Comply Due to Statute or Regulation.
If it is impossible for You to comply with any of the terms of this
License with respect to some or all of the Covered Code due to
statute, judicial order, or regulation then You must: (a) comply with
the terms of this License to the maximum extent possible; and (b)
describe the limitations and the code they affect. Such description
must be included in the LEGAL file described in Section 3.4 and must
be included with all distributions of the Source Code. Except to the
extent prohibited by statute or regulation, such description must be
sufficiently detailed for a recipient of ordinary skill to be able to
understand it.
5. Application of this License.
This License applies to code to which the Initial Developer has
attached the notice in Exhibit A and to related Covered Code.
6. Versions of the License.
6.1. New Versions.
Netscape Communications Corporation ("Netscape") may publish revised
and/or new versions of the License from time to time. Each version
will be given a distinguishing version number.
6.2. Effect of New Versions.
Once Covered Code has been published under a particular version of the
License, You may always continue to use it under the terms of that
version. You may also choose to use such Covered Code under the terms
of any subsequent version of the License published by Netscape. No one
other than Netscape has the right to modify the terms applicable to
Covered Code created under this License.
6.3. Derivative Works.
If You create or use a modified version of this License (which you may
only do in order to apply it to code which is not already Covered Code
governed by this License), You must (a) rename Your license so that
the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape",
"MPL", "NPL" or any confusingly similar phrase do not appear in your
license (except to note that your license differs from this License)
and (b) otherwise make it clear that Your version of the license
contains terms which differ from the Mozilla Public License and
Netscape Public License. (Filling in the name of the Initial
Developer, Original Code or Contributor in the notice described in
Exhibit A shall not of themselves be deemed to be modifications of
this License.)
7. DISCLAIMER OF WARRANTY.
COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
8. TERMINATION.
8.1. This License and the rights granted hereunder will terminate
automatically if You fail to comply with terms herein and fail to cure
such breach within 30 days of becoming aware of the breach. All
sublicenses to the Covered Code which are properly granted shall
survive any termination of this License. Provisions which, by their
nature, must remain in effect beyond the termination of this License
shall survive.
8.2. If You initiate litigation by asserting a patent infringement
claim (excluding declatory judgment actions) against Initial Developer
or a Contributor (the Initial Developer or Contributor against whom
You file such action is referred to as "Participant") alleging that:
(a) such Participant's Contributor Version directly or indirectly
infringes any patent, then any and all rights granted by such
Participant to You under Sections 2.1 and/or 2.2 of this License
shall, upon 60 days notice from Participant terminate prospectively,
unless if within 60 days after receipt of notice You either: (i)
agree in writing to pay Participant a mutually agreeable reasonable
royalty for Your past and future use of Modifications made by such
Participant, or (ii) withdraw Your litigation claim with respect to
the Contributor Version against such Participant. If within 60 days
of notice, a reasonable royalty and payment arrangement are not
mutually agreed upon in writing by the parties or the litigation claim
is not withdrawn, the rights granted by Participant to You under
Sections 2.1 and/or 2.2 automatically terminate at the expiration of
the 60 day notice period specified above.
(b) any software, hardware, or device, other than such Participant's
Contributor Version, directly or indirectly infringes any patent, then
any rights granted to You by such Participant under Sections 2.1(b)
and 2.2(b) are revoked effective as of the date You first made, used,
sold, distributed, or had made, Modifications made by that
Participant.
8.3. If You assert a patent infringement claim against Participant
alleging that such Participant's Contributor Version directly or
indirectly infringes any patent where such claim is resolved (such as
by license or settlement) prior to the initiation of patent
infringement litigation, then the reasonable value of the licenses
granted by such Participant under Sections 2.1 or 2.2 shall be taken
into account in determining the amount or value of any payment or
license.
8.4. In the event of termination under Sections 8.1 or 8.2 above,
all end user license agreements (excluding distributors and resellers)
which have been validly granted by You or any distributor hereunder
prior to termination shall survive termination.
9. LIMITATION OF LIABILITY.
UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
(INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR
ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL,
WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO
THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
10. U.S. GOVERNMENT END USERS.
The Covered Code is a "commercial item," as that term is defined in
48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
software" and "commercial computer software documentation," as such
terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
all U.S. Government End Users acquire Covered Code with only those
rights set forth herein.
11. MISCELLANEOUS.
This License represents the complete agreement concerning subject
matter hereof. If any provision of this License is held to be
unenforceable, such provision shall be reformed only to the extent
necessary to make it enforceable. This License shall be governed by
California law provisions (except to the extent applicable law, if
any, provides otherwise), excluding its conflict-of-law provisions.
With respect to disputes in which at least one party is a citizen of,
or an entity chartered or registered to do business in the United
States of America, any litigation relating to this License shall be
subject to the jurisdiction of the Federal Courts of the Northern
District of California, with venue lying in Santa Clara County,
California, with the losing party responsible for costs, including
without limitation, court costs and reasonable attorneys' fees and
expenses. The application of the United Nations Convention on
Contracts for the International Sale of Goods is expressly excluded.
Any law or regulation which provides that the language of a contract
shall be construed against the drafter shall not apply to this
License.
12. RESPONSIBILITY FOR CLAIMS.
As between Initial Developer and the Contributors, each party is
responsible for claims and damages arising, directly or indirectly,
out of its utilization of rights under this License and You agree to
work with Initial Developer and Contributors to distribute such
responsibility on an equitable basis. Nothing herein is intended or
shall be deemed to constitute any admission of liability.
13. MULTIPLE-LICENSED CODE.
Initial Developer may designate portions of the Covered Code as
"Multiple-Licensed". "Multiple-Licensed" means that the Initial
Developer permits you to utilize portions of the Covered Code under
Your choice of the NPL or the alternative licenses, if any, specified
by the Initial Developer in the file described in Exhibit A.
EXHIBIT A -Mozilla Public License.
``The contents of this file are subject to the Mozilla Public License
Version 1.1 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
License for the specific language governing rights and limitations
under the License.
The Original Code is ______________________________________.
The Initial Developer of the Original Code is ________________________.
Portions created by ______________________ are Copyright (C) ______
_______________________. All Rights Reserved.
Contributor(s): ______________________________________.
Alternatively, the contents of this file may be used under the terms
of the _____ license (the "[___] License"), in which case the
provisions of [______] License are applicable instead of those
above. If you wish to allow use of your version of this file only
under the terms of the [____] License and not to allow others to use
your version of this file under the MPL, indicate your decision by
deleting the provisions above and replace them with the notice and
other provisions required by the [___] License. If you do not delete
the provisions above, a recipient may use your version of this file
under either the MPL or the [___] License."
[NOTE: The text of this Exhibit A may differ slightly from the text of
the notices in the Source Code files of the Original Code. You should
use the text of this Exhibit A rather than the text found in the
Original Code Source Code for Your Modifications.]

View File

@ -1,62 +0,0 @@
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is libguac-client-rdp.
#
# The Initial Developer of the Original Code is
# Michael Jumper.
# Portions created by the Initial Developer are Copyright (C) 2011
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I m4
AM_CFLAGS = -Werror -Wall -pedantic -Iinclude
lib_LTLIBRARIES = libguac-client-rdp.la
libguac_client_rdp_la_SOURCES = src/client.c src/rdp_bitmap.c src/rdp_glyph.c src/rdp_pointer.c src/rdp_gdi.c src/guac_handlers.c src/rdp_cliprdr.c \
src/rdp_keymap.c \
src/rdp_keymap_base.c \
src/rdp_keymap_en_us.c
noinst_HEADERS = \
include/client.h \
include/guac_handlers.h \
include/rdp_bitmap.h \
include/rdp_cliprdr.h \
include/rdp_gdi.h \
include/rdp_glyph.h \
include/rdp_keymap.h \
include/rdp_pointer.h
libguac_client_rdp_la_LDFLAGS = -version-info 0:0:0
EXTRA_DIST = LICENSE

View File

@ -1,75 +0,0 @@
------------------------------------------------------------
About this README
------------------------------------------------------------
This README is intended to provide quick and to-the-point documentation for
technical users intending to compile parts of Guacamole themselves.
Distribution-specific packages are available from the files section of the main
project page:
http://sourceforge.net/projects/guacamole/files/
Distribution-specific documentation is provided on the Guacamole wiki:
http://guac-dev.org/
------------------------------------------------------------
What is libguac-client-rdp?
------------------------------------------------------------
libguac-client-rdp is a protocol support plugin for the Guacamole proxy (guacd)
which provides support for RDP, the proprietary remote desktop protocol used
by Windows Remote Deskop / Terminal Services, via the libfreerdp library.
------------------------------------------------------------
Compiling and installing libguac-client-rdp
------------------------------------------------------------
Please note that distribution-specific pre-compiled packages are available from
the files section of the main project site:
http://sourceforge.net/projects/guacamole/files/
libguac-client-rdp is built using the popular GNU Automake, and thus provides
the standard configure script.
1) Run configure
$ ./configure
Assuming all dependencies have been installed, this should succeed without
errors.
2) Run make
$ make
libguac-client-rdp will now compile.
3) Install (as root)
# make install
libguac-client-rdp will install to your /usr/local/lib directory by default.
You can change the install location by using the --prefix option for
configure.
You will need to run ldconfig (as root) so that guacd can find the library
when needed:
# ldconfig
------------------------------------------------------------
Reporting problems
------------------------------------------------------------
Please report any bugs encountered by opening a new ticket at the Trac system
hosted at:
http://guac-dev.org/trac/

View File

@ -1,62 +0,0 @@
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is libguac-client-rdp.
#
# The Initial Developer of the Original Code is
# Michael Jumper.
# Portions created by the Initial Developer are Copyright (C) 2011
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
AC_INIT(src/client.c)
AM_INIT_AUTOMAKE([libguac-client-rdp], 0.6.0)
AC_CONFIG_MACRO_DIR([m4])
# Checks for programs.
AC_PROG_CC
AC_PROG_CC_C99
AC_PROG_LIBTOOL
# Checks for libraries.
AC_CHECK_LIB([guac], [guac_client_plugin_open],, AC_MSG_ERROR("libguac must be installed first"))
AC_CHECK_LIB([cairo], [cairo_create],, AC_MSG_ERROR("cairo is required for drawing instructions"))
AC_CHECK_LIB([freerdp-cache], [glyph_cache_register_callbacks],, AC_MSG_ERROR("libfreerdp-cache is required (part of FreeRDP)"))
AC_CHECK_LIB([freerdp-core], [freerdp_new],, AC_MSG_ERROR("libfreerdp-core is required (part of FreeRDP)"))
AC_CHECK_LIB([freerdp-channels], [freerdp_channels_new],, AC_MSG_ERROR("libfreerdp-channels is required (part of FreeRDP)"))
AC_CHECK_LIB([freerdp-utils], [xzalloc],, AC_MSG_ERROR("libfreerdp-utils is required (part of FreeRDP)"))
AC_CHECK_LIB([freerdp-codec], [freerdp_image_convert],, AC_MSG_ERROR("libfreerdp-codec is required (part of FreeRDP)"))
# Checks for header files.
AC_CHECK_HEADERS([guacamole/client.h guacamole/guacio.h guacamole/protocol.h])
# Checks for library functions.
AC_FUNC_MALLOC
AC_CONFIG_FILES([Makefile])
AC_OUTPUT

View File

@ -1,151 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is libguac-client-rdp.
*
* The Initial Developer of the Original Code is
* Michael Jumper.
* Portions created by the Initial Developer are Copyright (C) 2011
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _GUAC_RDP_CLIENT_H
#define _GUAC_RDP_CLIENT_H
#include <freerdp/freerdp.h>
#include <freerdp/codec/color.h>
#include <guacamole/client.h>
#include "rdp_keymap.h"
/**
* The default RDP port.
*/
#define RDP_DEFAULT_PORT 3389
/**
* Client data that will remain accessible through the guac_client.
* This should generally include data commonly used by Guacamole handlers.
*/
typedef struct rdp_guac_client_data {
/**
* Pointer to the FreeRDP client instance handling the current connection.
*/
freerdp* rdp_inst;
/**
* The settings structure associated with the FreeRDP client instance
* handling the current connection.
*/
rdpSettings* settings;
/**
* Button mask containing the OR'd value of all currently pressed buttons.
*/
int mouse_button_mask;
/**
* Cairo surface which will receive all TRANSPARENT glyphs.
*/
cairo_surface_t* trans_glyph_surface;
/**
* Cairo surface which will receive all OPAQUE glyphs.
*/
cairo_surface_t* opaque_glyph_surface;
/**
* The current Cairo surface which will receive all drawn glyphs,
* depending on whether we are currently drawing transparent or
* opaque glyphs.
*/
cairo_surface_t* glyph_surface;
/**
* Cairo instance for drawing to the current glyph surface.
*/
cairo_t* glyph_cairo;
/**
* The Guacamole layer that GDI operations should draw to. RDP messages
* exist which change this surface to allow drawing to occur off-screen.
*/
const guac_layer* current_surface;
/**
* The keymap to use when translating keysyms into scancodes or sequences
* of scancodes for RDP.
*/
guac_rdp_static_keymap keymap;
/**
* The state of all keys, based on whether events for pressing/releasing
* particular keysyms have been received. This is necessary in order to
* determine which keys must be released/pressed when a particular
* keysym can only be typed through a sequence of scancodes (such as
* an Alt-code) because the server-side keymap does not support that
* keysym.
*/
guac_rdp_keysym_state_map keysym_state;
/**
* The current text (NOT Unicode) clipboard contents.
*/
char* clipboard;
} rdp_guac_client_data;
/**
* Client data that will remain accessible through the RDP context.
* This should generally include data commonly used by FreeRDP handlers.
*/
typedef struct rdp_freerdp_context {
/**
* The parent context. THIS MUST BE THE FIRST ELEMENT.
*/
rdpContext _p;
/**
* Pointer to the guac_client instance handling the RDP connection with
* this context.
*/
guac_client* client;
/**
* Color conversion structure to be used to convert RDP images to PNGs.
*/
CLRCONV* clrconv;
} rdp_freerdp_context;
#endif

View File

@ -1,50 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is libguac-client-rdp.
*
* The Initial Developer of the Original Code is
* Michael Jumper.
* Portions created by the Initial Developer are Copyright (C) 2011
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _GUAC_RDP_GUAC_HANDLERS_H
#define _GUAC_RDP_GUAC_HANDLERS_H
#include <guacamole/client.h>
int rdp_guac_client_free_handler(guac_client* client);
int rdp_guac_client_handle_messages(guac_client* client);
int rdp_guac_client_mouse_handler(guac_client* client, int x, int y, int mask);
int rdp_guac_client_key_handler(guac_client* client, int keysym, int pressed);
int rdp_guac_client_clipboard_handler(guac_client* client, char* data);
#endif

View File

@ -1,71 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is libguac-client-rdp.
*
* The Initial Developer of the Original Code is
* Michael Jumper.
* Portions created by the Initial Developer are Copyright (C) 2011
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _GUAC_RDP_RDP_BITMAP_H
#define _GUAC_RDP_RDP_BITMAP_H
#include <freerdp/freerdp.h>
#include <guacamole/protocol.h>
typedef struct guac_rdp_bitmap {
/**
* FreeRDP bitmap data - MUST GO FIRST.
*/
rdpBitmap bitmap;
/**
* Guacamole layer containing cached image data.
*/
guac_layer* layer;
/**
* The number of times a bitmap has been used.
*/
int used;
} guac_rdp_bitmap;
void guac_rdp_cache_bitmap(rdpContext* context, rdpBitmap* bitmap);
void guac_rdp_bitmap_new(rdpContext* context, rdpBitmap* bitmap);
void guac_rdp_bitmap_decompress(rdpContext* context, rdpBitmap* bitmap, uint8* data, int width, int height, int bpp, int length, boolean compressed);
void guac_rdp_bitmap_paint(rdpContext* context, rdpBitmap* bitmap);
void guac_rdp_bitmap_free(rdpContext* context, rdpBitmap* bitmap);
void guac_rdp_bitmap_setsurface(rdpContext* context, rdpBitmap* bitmap, boolean primary);
#endif

View File

@ -1,56 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is libguac-client-rdp.
*
* The Initial Developer of the Original Code is
* Michael Jumper.
* Portions created by the Initial Developer are Copyright (C) 2011
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef __GUAC_RDP_RDP_CLIPRDR_H
#define __GUAC_RDP_RDP_CLIPRDR_H
#include <freerdp/freerdp.h>
void guac_rdp_process_cliprdr_event(guac_client* client, RDP_EVENT* event);
void guac_rdp_process_cb_monitor_ready(guac_client* client, RDP_EVENT* event);
void guac_rdp_process_cb_format_list(guac_client* client,
RDP_CB_FORMAT_LIST_EVENT* event);
void guac_rdp_process_cb_data_request(guac_client* client,
RDP_CB_DATA_REQUEST_EVENT* event);
void guac_rdp_process_cb_data_response(guac_client* client,
RDP_CB_DATA_RESPONSE_EVENT* event);
#endif

View File

@ -1,56 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is libguac-client-rdp.
*
* The Initial Developer of the Original Code is
* Michael Jumper.
* Portions created by the Initial Developer are Copyright (C) 2011
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _GUAC_RDP_RDP_GDI_H
#define _GUAC_RDP_RDP_GDI_H
#include <guacamole/protocol.h>
#include <freerdp/freerdp.h>
guac_composite_mode guac_rdp_rop3_transfer_function(guac_client* client,
int rop3);
void guac_rdp_gdi_dstblt(rdpContext* context, DSTBLT_ORDER* dstblt);
void guac_rdp_gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt);
void guac_rdp_gdi_scrblt(rdpContext* context, SCRBLT_ORDER* scrblt);
void guac_rdp_gdi_memblt(rdpContext* context, MEMBLT_ORDER* memblt);
void guac_rdp_gdi_opaquerect(rdpContext* context, OPAQUE_RECT_ORDER* opaque_rect);
void guac_rdp_gdi_palette_update(rdpContext* context, PALETTE_UPDATE* palette);
void guac_rdp_gdi_set_bounds(rdpContext* context, rdpBounds* bounds);
void guac_rdp_gdi_end_paint(rdpContext* context);
#endif

View File

@ -1,67 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is libguac-client-rdp.
*
* The Initial Developer of the Original Code is
* Michael Jumper.
* Portions created by the Initial Developer are Copyright (C) 2011
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _GUAC_RDP_RDP_GLYPH_H
#define _GUAC_RDP_RDP_GLYPH_H
#include <freerdp/freerdp.h>
#include <guacamole/protocol.h>
typedef struct guac_rdp_glyph {
/**
* FreeRDP glyph data - MUST GO FIRST.
*/
rdpGlyph glyph;
/**
* Cairo surface layer containing cached image data.
*/
cairo_surface_t* surface;
} guac_rdp_glyph;
void guac_rdp_glyph_new(rdpContext* context, rdpGlyph* glyph);
void guac_rdp_glyph_draw(rdpContext* context, rdpGlyph* glyph, int x, int y);
void guac_rdp_glyph_free(rdpContext* context, rdpGlyph* glyph);
void guac_rdp_glyph_begindraw(rdpContext* context,
int x, int y, int width, int height, uint32 fgcolor, uint32 bgcolor);
void guac_rdp_glyph_enddraw(rdpContext* context,
int x, int y, int width, int height, uint32 fgcolor, uint32 bgcolor);
#endif

View File

@ -1,171 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is libguac-client-rdp.
*
* The Initial Developer of the Original Code is
* Michael Jumper.
* Portions created by the Initial Developer are Copyright (C) 2011
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _GUAC_RDP_RDP_KEYMAP_H
#define _GUAC_RDP_RDP_KEYMAP_H
#include <freerdp/kbd/layouts.h>
/**
* Represents a keysym-to-scancode mapping for RDP, with extra information
* about the state of prerequisite keysyms.
*/
typedef struct guac_rdp_keysym_desc {
/**
* The keysym being mapped.
*/
int keysym;
/**
* The scancode this keysym maps to.
*/
int scancode;
/**
* Required RDP-specific flags.
*/
int flags;
/**
* Null-terminated list of keysyms which must be down for this keysym
* to be properly typed.
*/
const int* set_keysyms;
/**
* Null-terminated list of keysyms which must be up for this keysym
* to be properly typed.
*/
const int* clear_keysyms;
} guac_rdp_keysym_desc;
/**
* Hierarchical keysym mapping
*/
typedef struct guac_rdp_keymap guac_rdp_keymap;
struct guac_rdp_keymap {
/**
* The parent mapping this map will inherit its initial mapping from.
* Any other mapping information will add to or override the mapping
* inherited from the parent.
*/
const guac_rdp_keymap* parent;
/**
* Descriptive name of this keymap
*/
const char* name;
/**
* Null-terminated array of scancode mappings.
*/
const guac_rdp_keysym_desc* mapping;
/**
* FreeRDP keyboard layout associated with this
* keymap. If this keymap is selected, this layout
* will be requested from the server.
*/
const uint32 freerdp_keyboard_layout;
};
/**
* Static mapping from keysyms to scancodes.
*/
typedef guac_rdp_keysym_desc guac_rdp_static_keymap[256][256];
/**
* Mapping from keysym to current state
*/
typedef int guac_rdp_keysym_state_map[256][256];
/**
* Map of X11 keysyms to RDP scancodes (US English).
*/
extern const guac_rdp_keymap guac_rdp_keymap_en_us;
/**
* Map of X11 keysyms to RDP scancodes (common non-printable keys).
*/
extern const guac_rdp_keymap guac_rdp_keymap_base;
/**
* Simple macro for referencing the mapped value of an altcode or scancode for a given keysym.
*/
#define GUAC_RDP_KEYSYM_LOOKUP(keysym_mapping, keysym) ((keysym_mapping)[((keysym) & 0xFF00) >> 8][(keysym) & 0xFF])
/**
* Keysym string containing only the left "shift" key.
*/
extern const int GUAC_KEYSYMS_SHIFT[];
/**
* Keysym string containing both "shift" keys.
*/
extern const int GUAC_KEYSYMS_ALL_SHIFT[];
/**
* Keysym string containing only the left "ctrl" key.
*/
extern const int GUAC_KEYSYMS_CTRL[];
/**
* Keysym string containing both "ctrl" keys.
*/
extern const int GUAC_KEYSYMS_ALL_CTRL[];
/**
* Keysym string containing only the left "alt" key.
*/
extern const int GUAC_KEYSYMS_ALT[];
/**
* Keysym string containing both "alt" keys.
*/
extern const int GUAC_KEYSYMS_ALL_ALT[];
/**
* Keysym string containing all modifier keys.
*/
extern const int GUAC_KEYSYMS_ALL_MODIFIERS[];
#endif

View File

@ -1,63 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is libguac-client-rdp.
*
* The Initial Developer of the Original Code is
* Michael Jumper.
* Portions created by the Initial Developer are Copyright (C) 2011
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _GUAC_RDP_RDP_POINTER_H
#define _GUAC_RDP_RDP_POINTER_H
#include <freerdp/freerdp.h>
#include <guacamole/protocol.h>
typedef struct guac_rdp_pointer {
/**
* FreeRDP pointer data - MUST GO FIRST.
*/
rdpPointer pointer;
/**
* Guacamole layer containing cached image data.
*/
guac_layer* layer;
} guac_rdp_pointer;
void guac_rdp_pointer_new(rdpContext* context, rdpPointer* pointer);
void guac_rdp_pointer_set(rdpContext* context, rdpPointer* pointer);
void guac_rdp_pointer_free(rdpContext* context, rdpPointer* pointer);
#endif

View File

@ -1,436 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is libguac-client-rdp.
*
* The Initial Developer of the Original Code is
* Michael Jumper.
* Portions created by the Initial Developer are Copyright (C) 2011
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Matt Hortman
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include <stdlib.h>
#include <string.h>
#include <sys/select.h>
#include <errno.h>
#include <freerdp/freerdp.h>
#include <freerdp/utils/memory.h>
#include <freerdp/cache/bitmap.h>
#include <freerdp/cache/brush.h>
#include <freerdp/cache/glyph.h>
#include <freerdp/cache/palette.h>
#include <freerdp/cache/pointer.h>
#include <freerdp/cache/offscreen.h>
#include <freerdp/channels/channels.h>
#include <freerdp/input.h>
#include <freerdp/constants.h>
#include <guacamole/socket.h>
#include <guacamole/protocol.h>
#include <guacamole/client.h>
#include <guacamole/error.h>
#include "client.h"
#include "guac_handlers.h"
#include "rdp_keymap.h"
#include "rdp_bitmap.h"
#include "rdp_glyph.h"
#include "rdp_pointer.h"
#include "rdp_gdi.h"
/* Client plugin arguments */
const char* GUAC_CLIENT_ARGS[] = {
"hostname",
"port",
"domain",
"username",
"password",
"width",
"height",
"initial-program",
"color-depth",
NULL
};
enum ARGS_IDX {
IDX_HOSTNAME,
IDX_PORT,
IDX_DOMAIN,
IDX_USERNAME,
IDX_PASSWORD,
IDX_WIDTH,
IDX_HEIGHT,
IDX_INITIAL_PROGRAM,
IDX_COLOR_DEPTH
};
int __guac_receive_channel_data(freerdp* rdp_inst, int channelId, uint8* data, int size, int flags, int total_size) {
return freerdp_channels_data(rdp_inst, channelId, data, size, flags, total_size);
}
boolean rdp_freerdp_pre_connect(freerdp* instance) {
rdpContext* context = instance->context;
guac_client* client = ((rdp_freerdp_context*) context)->client;
rdpChannels* channels = context->channels;
rdpBitmap* bitmap;
rdpGlyph* glyph;
rdpPointer* pointer;
rdpPrimaryUpdate* primary;
CLRCONV* clrconv;
/* Load clipboard plugin */
freerdp_channels_load_plugin(channels, instance->settings, "cliprdr", NULL);
/* Init color conversion structure */
clrconv = xnew(CLRCONV);
clrconv->alpha = 1;
clrconv->invert = 0;
clrconv->rgb555 = 0;
clrconv->palette = xnew(rdpPalette);
((rdp_freerdp_context*) context)->clrconv = clrconv;
/* Init FreeRDP cache */
instance->context->cache = cache_new(instance->settings);
/* Set up bitmap handling */
bitmap = xnew(rdpBitmap);
bitmap->size = sizeof(guac_rdp_bitmap);
bitmap->New = guac_rdp_bitmap_new;
bitmap->Free = guac_rdp_bitmap_free;
bitmap->Paint = guac_rdp_bitmap_paint;
bitmap->Decompress = guac_rdp_bitmap_decompress;
bitmap->SetSurface = guac_rdp_bitmap_setsurface;
graphics_register_bitmap(context->graphics, bitmap);
xfree(bitmap);
/* Set up glyph handling */
glyph = xnew(rdpGlyph);
glyph->size = sizeof(guac_rdp_glyph);
glyph->New = guac_rdp_glyph_new;
glyph->Free = guac_rdp_glyph_free;
glyph->Draw = guac_rdp_glyph_draw;
glyph->BeginDraw = guac_rdp_glyph_begindraw;
glyph->EndDraw = guac_rdp_glyph_enddraw;
graphics_register_glyph(context->graphics, glyph);
xfree(glyph);
/* Set up pointer handling */
pointer = xnew(rdpPointer);
pointer->size = sizeof(guac_rdp_pointer);
pointer->New = guac_rdp_pointer_new;
pointer->Free = guac_rdp_pointer_free;
pointer->Set = guac_rdp_pointer_set;
graphics_register_pointer(context->graphics, pointer);
xfree(pointer);
/* Set up GDI */
instance->update->EndPaint = guac_rdp_gdi_end_paint;
instance->update->Palette = guac_rdp_gdi_palette_update;
instance->update->SetBounds = guac_rdp_gdi_set_bounds;
primary = instance->update->primary;
primary->DstBlt = guac_rdp_gdi_dstblt;
primary->PatBlt = guac_rdp_gdi_patblt;
primary->ScrBlt = guac_rdp_gdi_scrblt;
primary->MemBlt = guac_rdp_gdi_memblt;
primary->OpaqueRect = guac_rdp_gdi_opaquerect;
pointer_cache_register_callbacks(instance->update);
glyph_cache_register_callbacks(instance->update);
brush_cache_register_callbacks(instance->update);
bitmap_cache_register_callbacks(instance->update);
offscreen_cache_register_callbacks(instance->update);
palette_cache_register_callbacks(instance->update);
/* Init channels (pre-connect) */
if (freerdp_channels_pre_connect(channels, instance)) {
guac_protocol_send_error(client->socket, "Error initializing RDP client channel manager");
guac_socket_flush(client->socket);
return false;
}
return true;
}
boolean rdp_freerdp_post_connect(freerdp* instance) {
rdpContext* context = instance->context;
guac_client* client = ((rdp_freerdp_context*) context)->client;
rdpChannels* channels = instance->context->channels;
/* Init channels (post-connect) */
if (freerdp_channels_post_connect(channels, instance)) {
guac_protocol_send_error(client->socket, "Error initializing RDP client channel manager");
guac_socket_flush(client->socket);
return false;
}
/* Client handlers */
client->free_handler = rdp_guac_client_free_handler;
client->handle_messages = rdp_guac_client_handle_messages;
client->mouse_handler = rdp_guac_client_mouse_handler;
client->key_handler = rdp_guac_client_key_handler;
client->clipboard_handler = rdp_guac_client_clipboard_handler;
return true;
}
void rdp_freerdp_context_new(freerdp* instance, rdpContext* context) {
context->channels = freerdp_channels_new();
}
void rdp_freerdp_context_free(freerdp* instance, rdpContext* context) {
/* EMPTY */
}
void __guac_rdp_client_load_keymap(guac_client* client,
const guac_rdp_keymap* keymap) {
rdp_guac_client_data* guac_client_data =
(rdp_guac_client_data*) client->data;
/* Get mapping */
const guac_rdp_keysym_desc* mapping = keymap->mapping;
/* If parent exists, load parent first */
if (keymap->parent != NULL)
__guac_rdp_client_load_keymap(client, keymap->parent);
/* Log load */
guac_client_log_info(client, "Loading keymap \"%s\"", keymap->name);
/* Load mapping into keymap */
while (mapping->keysym != 0) {
/* Copy mapping */
GUAC_RDP_KEYSYM_LOOKUP(guac_client_data->keymap, mapping->keysym) =
*mapping;
/* Next keysym */
mapping++;
}
}
int guac_client_init(guac_client* client, int argc, char** argv) {
rdp_guac_client_data* guac_client_data;
freerdp* rdp_inst;
rdpSettings* settings;
char* hostname;
int port = RDP_DEFAULT_PORT;
boolean bitmap_cache;
/**
* Selected server-side keymap. Client will be assumed to also use this
* keymap. Keys will be sent to server based on client input on a
* best-effort basis.
*
* Currently hard-coded to en-us-qwerty.
*/
const guac_rdp_keymap* chosen_keymap = &guac_rdp_keymap_en_us;
if (argc < 9) {
guac_protocol_send_error(client->socket,
"Wrong argument count received.");
guac_socket_flush(client->socket);
guac_error = GUAC_STATUS_BAD_ARGUMENT;
guac_error_message = "Wrong argument count received";
return 1;
}
/* If port specified, use it */
if (argv[IDX_PORT][0] != '\0')
port = atoi(argv[IDX_PORT]);
hostname = argv[IDX_HOSTNAME];
/* Allocate client data */
guac_client_data = malloc(sizeof(rdp_guac_client_data));
/* Init client */
freerdp_channels_global_init();
rdp_inst = freerdp_new();
rdp_inst->PreConnect = rdp_freerdp_pre_connect;
rdp_inst->PostConnect = rdp_freerdp_post_connect;
rdp_inst->ReceiveChannelData = __guac_receive_channel_data;
/* Allocate FreeRDP context */
rdp_inst->context_size = sizeof(rdp_freerdp_context);
rdp_inst->ContextNew = (pContextNew) rdp_freerdp_context_new;
rdp_inst->ContextFree = (pContextFree) rdp_freerdp_context_free;
freerdp_context_new(rdp_inst);
/* Set settings */
settings = rdp_inst->settings;
/* --no-auth */
settings->authentication = false;
/* --sec rdp */
settings->rdp_security = true;
settings->tls_security = false;
settings->nla_security = false;
settings->encryption = true;
settings->encryption_method = ENCRYPTION_METHOD_40BIT | ENCRYPTION_METHOD_128BIT | ENCRYPTION_METHOD_FIPS;
settings->encryption_level = ENCRYPTION_LEVEL_CLIENT_COMPATIBLE;
/* session width */
settings->width = 1024;
if (argv[IDX_WIDTH][0] != '\0')
settings->width = atoi(argv[IDX_WIDTH]);
if (settings->width == 0)
settings->width = 1024;
/* session height */
settings->height = 768;
if (argv[IDX_HEIGHT][0] != '\0')
settings->height = atoi(argv[IDX_HEIGHT]);
if (settings->height == 0)
settings->height = 768;
/* Set hostname */
settings->hostname = strdup(hostname);
settings->port = port;
settings->window_title = strdup(hostname);
/* Domain */
if (argv[IDX_DOMAIN][0] != '\0')
settings->domain = strdup(argv[IDX_DOMAIN]);
/* Username */
settings->username = "guest";
if (argv[IDX_USERNAME][0] != '\0')
settings->username = strdup(argv[IDX_USERNAME]);
/* Password */
if (argv[IDX_PASSWORD][0] != '\0') {
settings->password = strdup(argv[IDX_PASSWORD]);
settings->autologon = 1;
}
/* Initial program */
if (argv[IDX_INITIAL_PROGRAM][0] != '\0')
settings->shell = strdup(argv[IDX_INITIAL_PROGRAM]);
/* Order support */
bitmap_cache = settings->bitmap_cache;
settings->os_major_type = OSMAJORTYPE_UNSPECIFIED;
settings->os_minor_type = OSMINORTYPE_UNSPECIFIED;
settings->order_support[NEG_DSTBLT_INDEX] = true;
settings->order_support[NEG_PATBLT_INDEX] = false; /* PATBLT not yet supported */
settings->order_support[NEG_SCRBLT_INDEX] = true;
settings->order_support[NEG_OPAQUE_RECT_INDEX] = true;
settings->order_support[NEG_DRAWNINEGRID_INDEX] = false;
settings->order_support[NEG_MULTIDSTBLT_INDEX] = false;
settings->order_support[NEG_MULTIPATBLT_INDEX] = false;
settings->order_support[NEG_MULTISCRBLT_INDEX] = false;
settings->order_support[NEG_MULTIOPAQUERECT_INDEX] = false;
settings->order_support[NEG_MULTI_DRAWNINEGRID_INDEX] = false;
settings->order_support[NEG_LINETO_INDEX] = false;
settings->order_support[NEG_POLYLINE_INDEX] = false;
settings->order_support[NEG_MEMBLT_INDEX] = bitmap_cache;
settings->order_support[NEG_MEM3BLT_INDEX] = false;
settings->order_support[NEG_MEMBLT_V2_INDEX] = bitmap_cache;
settings->order_support[NEG_MEM3BLT_V2_INDEX] = false;
settings->order_support[NEG_SAVEBITMAP_INDEX] = false;
settings->order_support[NEG_GLYPH_INDEX_INDEX] = true;
settings->order_support[NEG_FAST_INDEX_INDEX] = true;
settings->order_support[NEG_FAST_GLYPH_INDEX] = true;
settings->order_support[NEG_POLYGON_SC_INDEX] = false;
settings->order_support[NEG_POLYGON_CB_INDEX] = false;
settings->order_support[NEG_ELLIPSE_SC_INDEX] = false;
settings->order_support[NEG_ELLIPSE_CB_INDEX] = false;
/* Store client data */
guac_client_data->rdp_inst = rdp_inst;
guac_client_data->mouse_button_mask = 0;
guac_client_data->current_surface = GUAC_DEFAULT_LAYER;
guac_client_data->clipboard = NULL;
/* Clear keysym state mapping and keymap */
memset(guac_client_data->keysym_state, 0,
sizeof(guac_rdp_keysym_state_map));
memset(guac_client_data->keymap, 0,
sizeof(guac_rdp_static_keymap));
client->data = guac_client_data;
((rdp_freerdp_context*) rdp_inst->context)->client = client;
/* Load keymap into client */
__guac_rdp_client_load_keymap(client, chosen_keymap);
/* Set server-side keymap */
settings->kbd_layout = chosen_keymap->freerdp_keyboard_layout;
/* Connect to RDP server */
if (!freerdp_connect(rdp_inst)) {
guac_protocol_send_error(client->socket,
"Error connecting to RDP server");
guac_socket_flush(client->socket);
guac_error = GUAC_STATUS_BAD_STATE;
guac_error_message = "Error connecting to RDP server";
return 1;
}
/* Send connection name */
guac_protocol_send_name(client->socket, settings->window_title);
/* Send size */
guac_protocol_send_size(client->socket, GUAC_DEFAULT_LAYER,
settings->width, settings->height);
/* Create glyph surfaces */
guac_client_data->opaque_glyph_surface = cairo_image_surface_create(
CAIRO_FORMAT_RGB24, settings->width, settings->height);
guac_client_data->trans_glyph_surface = cairo_image_surface_create(
CAIRO_FORMAT_ARGB32, settings->width, settings->height);
/* Success */
return 0;
}

View File

@ -1,442 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is libguac-client-rdp.
*
* The Initial Developer of the Original Code is
* Michael Jumper.
* Portions created by the Initial Developer are Copyright (C) 2011
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Matt Hortman
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include <stdlib.h>
#include <string.h>
#include <sys/select.h>
#include <errno.h>
#include <freerdp/freerdp.h>
#include <freerdp/channels/channels.h>
#include <freerdp/input.h>
#include <freerdp/codec/color.h>
#include <freerdp/cache/cache.h>
#include <freerdp/utils/event.h>
#include <freerdp/plugins/cliprdr.h>
#include <guacamole/socket.h>
#include <guacamole/protocol.h>
#include <guacamole/client.h>
#include <guacamole/error.h>
#include "client.h"
#include "rdp_keymap.h"
#include "rdp_cliprdr.h"
#include "guac_handlers.h"
void __guac_rdp_update_keysyms(guac_client* client, const int* keysym_string, int from, int to);
int __guac_rdp_send_keysym(guac_client* client, int keysym, int pressed);
void __guac_rdp_send_altcode(guac_client* client, int altcode);
int rdp_guac_client_free_handler(guac_client* client) {
rdp_guac_client_data* guac_client_data =
(rdp_guac_client_data*) client->data;
freerdp* rdp_inst = guac_client_data->rdp_inst;
rdpChannels* channels = rdp_inst->context->channels;
/* Clean up RDP client */
freerdp_channels_close(channels, rdp_inst);
freerdp_channels_free(channels);
freerdp_disconnect(rdp_inst);
freerdp_clrconv_free(((rdp_freerdp_context*) rdp_inst->context)->clrconv);
cache_free(rdp_inst->context->cache);
freerdp_free(rdp_inst);
/* Free client data */
cairo_surface_destroy(guac_client_data->opaque_glyph_surface);
cairo_surface_destroy(guac_client_data->trans_glyph_surface);
free(guac_client_data->clipboard);
free(guac_client_data);
return 0;
}
int rdp_guac_client_handle_messages(guac_client* client) {
rdp_guac_client_data* guac_client_data = (rdp_guac_client_data*) client->data;
freerdp* rdp_inst = guac_client_data->rdp_inst;
rdpChannels* channels = rdp_inst->context->channels;
int index;
int max_fd, fd;
void* read_fds[32];
void* write_fds[32];
int read_count = 0;
int write_count = 0;
fd_set rfds, wfds;
RDP_EVENT* event;
struct timeval timeout = {
.tv_sec = 0,
.tv_usec = 250000
};
/* get rdp fds */
if (!freerdp_get_fds(rdp_inst, read_fds, &read_count, write_fds, &write_count)) {
guac_error = GUAC_STATUS_BAD_STATE;
guac_error_message = "Unable to read RDP file descriptors";
return 1;
}
/* get channel fds */
if (!freerdp_channels_get_fds(channels, rdp_inst, read_fds, &read_count, write_fds, &write_count)) {
guac_error = GUAC_STATUS_BAD_STATE;
guac_error_message = "Unable to read RDP channel file descriptors";
return 1;
}
/* Construct read fd_set */
max_fd = 0;
FD_ZERO(&rfds);
for (index = 0; index < read_count; index++) {
fd = (int)(long) (read_fds[index]);
if (fd > max_fd)
max_fd = fd;
FD_SET(fd, &rfds);
}
/* Construct write fd_set */
FD_ZERO(&wfds);
for (index = 0; index < write_count; index++) {
fd = (int)(long) (write_fds[index]);
if (fd > max_fd)
max_fd = fd;
FD_SET(fd, &wfds);
}
/* If no file descriptors, error */
if (max_fd == 0) {
guac_error = GUAC_STATUS_BAD_STATE;
guac_error_message = "No file descriptors";
return 1;
}
/* Otherwise, wait for file descriptors given */
if (select(max_fd + 1, &rfds, &wfds, NULL, &timeout) == -1) {
/* these are not really errors */
if (!((errno == EAGAIN) ||
(errno == EWOULDBLOCK) ||
(errno == EINPROGRESS) ||
(errno == EINTR))) /* signal occurred */
{
guac_error = GUAC_STATUS_SEE_ERRNO;
guac_error_message = "Error waiting for file descriptor";
return 1;
}
}
/* Check the libfreerdp fds */
if (!freerdp_check_fds(rdp_inst)) {
guac_error = GUAC_STATUS_BAD_STATE;
guac_error_message = "Error handling RDP file descriptors";
return 1;
}
/* Check channel fds */
if (!freerdp_channels_check_fds(channels, rdp_inst)) {
guac_error = GUAC_STATUS_BAD_STATE;
guac_error_message = "Error handling RDP channel file descriptors";
return 1;
}
/* Check for channel events */
event = freerdp_channels_pop_event(channels);
if (event) {
/* Handle clipboard events */
if (event->event_class == RDP_EVENT_CLASS_CLIPRDR)
guac_rdp_process_cliprdr_event(client, event);
freerdp_event_free(event);
}
/* Handle RDP disconnect */
if (freerdp_shall_disconnect(rdp_inst)) {
guac_error = GUAC_STATUS_NO_INPUT;
guac_error_message = "RDP server closed connection";
return 1;
}
/* Success */
return 0;
}
int rdp_guac_client_mouse_handler(guac_client* client, int x, int y, int mask) {
rdp_guac_client_data* guac_client_data = (rdp_guac_client_data*) client->data;
freerdp* rdp_inst = guac_client_data->rdp_inst;
/* If button mask unchanged, just send move event */
if (mask == guac_client_data->mouse_button_mask)
rdp_inst->input->MouseEvent(rdp_inst->input, PTR_FLAGS_MOVE, x, y);
/* Otherwise, send events describing button change */
else {
/* Mouse buttons which have JUST become released */
int released_mask = guac_client_data->mouse_button_mask & ~mask;
/* Mouse buttons which have JUST become pressed */
int pressed_mask = ~guac_client_data->mouse_button_mask & mask;
/* Release event */
if (released_mask & 0x07) {
/* Calculate flags */
int flags = 0;
if (released_mask & 0x01) flags |= PTR_FLAGS_BUTTON1;
if (released_mask & 0x02) flags |= PTR_FLAGS_BUTTON3;
if (released_mask & 0x04) flags |= PTR_FLAGS_BUTTON2;
rdp_inst->input->MouseEvent(rdp_inst->input, flags, x, y);
}
/* Press event */
if (pressed_mask & 0x07) {
/* Calculate flags */
int flags = PTR_FLAGS_DOWN;
if (pressed_mask & 0x01) flags |= PTR_FLAGS_BUTTON1;
if (pressed_mask & 0x02) flags |= PTR_FLAGS_BUTTON3;
if (pressed_mask & 0x04) flags |= PTR_FLAGS_BUTTON2;
if (pressed_mask & 0x08) flags |= PTR_FLAGS_WHEEL | 0x78;
if (pressed_mask & 0x10) flags |= PTR_FLAGS_WHEEL | PTR_FLAGS_WHEEL_NEGATIVE | 0x88;
/* Send event */
rdp_inst->input->MouseEvent(rdp_inst->input, flags, x, y);
}
/* Scroll event */
if (pressed_mask & 0x18) {
/* Down */
if (pressed_mask & 0x08)
rdp_inst->input->MouseEvent(
rdp_inst->input,
PTR_FLAGS_WHEEL | 0x78,
x, y);
/* Up */
if (pressed_mask & 0x10)
rdp_inst->input->MouseEvent(
rdp_inst->input,
PTR_FLAGS_WHEEL | PTR_FLAGS_WHEEL_NEGATIVE | 0x88,
x, y);
}
guac_client_data->mouse_button_mask = mask;
}
return 0;
}
void __guac_rdp_send_altcode(guac_client* client, int altcode) {
rdp_guac_client_data* guac_client_data = (rdp_guac_client_data*) client->data;
freerdp* rdp_inst = guac_client_data->rdp_inst;
int i;
/* Lookup scancode for Alt */
int alt = GUAC_RDP_KEYSYM_LOOKUP(
guac_client_data->keymap,
0xFFE9 /* Alt_L */).scancode;
/* Release all pressed modifiers */
__guac_rdp_update_keysyms(client, GUAC_KEYSYMS_ALL_MODIFIERS, 1, 0);
/* Press Alt */
rdp_inst->input->KeyboardEvent(rdp_inst->input, KBD_FLAGS_DOWN, alt);
/* For each character in four-digit Alt-code ... */
for (i=0; i<4; i++) {
/* Get scancode of keypad digit */
int scancode = GUAC_RDP_KEYSYM_LOOKUP(
guac_client_data->keymap,
0xFFB0 + (altcode / 1000)
).scancode;
/* Press and release digit */
rdp_inst->input->KeyboardEvent(rdp_inst->input, KBD_FLAGS_DOWN, scancode);
rdp_inst->input->KeyboardEvent(rdp_inst->input, KBD_FLAGS_RELEASE, scancode);
/* Shift digits left by one place */
altcode = (altcode * 10) % 10000;
}
/* Release Alt */
rdp_inst->input->KeyboardEvent(rdp_inst->input, KBD_FLAGS_RELEASE, alt);
/* Press all originally pressed modifiers */
__guac_rdp_update_keysyms(client, GUAC_KEYSYMS_ALL_MODIFIERS, 1, 1);
}
int __guac_rdp_send_keysym(guac_client* client, int keysym, int pressed) {
rdp_guac_client_data* guac_client_data = (rdp_guac_client_data*) client->data;
freerdp* rdp_inst = guac_client_data->rdp_inst;
/* If keysym can be in lookup table */
if (keysym <= 0xFFFF) {
/* Look up scancode mapping */
const guac_rdp_keysym_desc* keysym_desc =
&GUAC_RDP_KEYSYM_LOOKUP(guac_client_data->keymap, keysym);
/* If defined, send event */
if (keysym_desc->scancode != 0) {
/* If defined, send any prerequesite keys that must be set */
if (keysym_desc->set_keysyms != NULL)
__guac_rdp_update_keysyms(client, keysym_desc->set_keysyms, 0, 1);
/* If defined, release any keys that must be cleared */
if (keysym_desc->clear_keysyms != NULL)
__guac_rdp_update_keysyms(client, keysym_desc->clear_keysyms, 1, 0);
/* Send actual key */
rdp_inst->input->KeyboardEvent(
rdp_inst->input,
keysym_desc->flags
| (pressed ? KBD_FLAGS_DOWN : KBD_FLAGS_RELEASE),
keysym_desc->scancode);
/* If defined, release any keys that were originally released */
if (keysym_desc->set_keysyms != NULL)
__guac_rdp_update_keysyms(client, keysym_desc->set_keysyms, 0, 0);
/* If defined, send any keys that were originally set */
if (keysym_desc->clear_keysyms != NULL)
__guac_rdp_update_keysyms(client, keysym_desc->clear_keysyms, 1, 1);
}
/* If undefined but has Alt-code, use Alt-Code */
else if (keysym <= 0xFF) {
/* NOTE: The Alt-codes are conveniently identical to keysyms. */
/* Only send Alt-code on press */
if (pressed)
__guac_rdp_send_altcode(client, keysym);
}
/* If no defined Alt-code, log warning */
else
guac_client_log_info(client, "unmapped keysym: 0x%x", keysym);
}
return 0;
}
void __guac_rdp_update_keysyms(guac_client* client, const int* keysym_string, int from, int to) {
rdp_guac_client_data* guac_client_data = (rdp_guac_client_data*) client->data;
int keysym;
/* Send all keysyms in string, NULL terminated */
while ((keysym = *keysym_string) != 0) {
/* Get current keysym state */
int current_state = GUAC_RDP_KEYSYM_LOOKUP(guac_client_data->keysym_state, keysym);
/* If key is currently in given state, send event for changing it to specified "to" state */
if (current_state == from)
__guac_rdp_send_keysym(client, *keysym_string, to);
/* Next keysym */
keysym_string++;
}
}
int rdp_guac_client_key_handler(guac_client* client, int keysym, int pressed) {
rdp_guac_client_data* guac_client_data = (rdp_guac_client_data*) client->data;
/* Update keysym state */
GUAC_RDP_KEYSYM_LOOKUP(guac_client_data->keysym_state, keysym) = pressed;
return __guac_rdp_send_keysym(client, keysym, pressed);
}
int rdp_guac_client_clipboard_handler(guac_client* client, char* data) {
rdpChannels* channels =
((rdp_guac_client_data*) client->data)->rdp_inst->context->channels;
RDP_CB_FORMAT_LIST_EVENT* format_list =
(RDP_CB_FORMAT_LIST_EVENT*) freerdp_event_new(
RDP_EVENT_CLASS_CLIPRDR,
RDP_EVENT_TYPE_CB_FORMAT_LIST,
NULL, NULL);
/* Free existing data */
free(((rdp_guac_client_data*) client->data)->clipboard);
/* Store data in client */
((rdp_guac_client_data*) client->data)->clipboard = strdup(data);
/* Notify server that text data is now available */
format_list->formats = (uint32*) malloc(sizeof(uint32));
format_list->formats[0] = CB_FORMAT_TEXT;
format_list->num_formats = 1;
freerdp_channels_send_event(channels, (RDP_EVENT*) format_list);
return 0;
}

View File

@ -1,207 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is libguac-client-rdp.
*
* The Initial Developer of the Original Code is
* Michael Jumper.
* Portions created by the Initial Developer are Copyright (C) 2011
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Matt Hortman
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include <stdio.h>
#include <stdlib.h>
#include <cairo/cairo.h>
#include <guacamole/socket.h>
#include <guacamole/client.h>
#include <guacamole/protocol.h>
#include <freerdp/freerdp.h>
#include <freerdp/utils/memory.h>
#include <freerdp/codec/color.h>
#include <freerdp/codec/bitmap.h>
#include "client.h"
#include "rdp_bitmap.h"
void guac_rdp_cache_bitmap(rdpContext* context, rdpBitmap* bitmap) {
guac_client* client = ((rdp_freerdp_context*) context)->client;
guac_socket* socket = client->socket;
/* Allocate buffer */
guac_layer* buffer = guac_client_alloc_buffer(client);
/* Cache image data if present */
if (bitmap->data != NULL) {
/* Create surface from image data */
cairo_surface_t* surface = cairo_image_surface_create_for_data(
bitmap->data, CAIRO_FORMAT_RGB24,
bitmap->width, bitmap->height, 4*bitmap->width);
/* Send surface to buffer */
guac_protocol_send_png(socket,
GUAC_COMP_SRC, buffer, 0, 0, surface);
/* Free surface */
cairo_surface_destroy(surface);
}
/* Store buffer reference in bitmap */
((guac_rdp_bitmap*) bitmap)->layer = buffer;
}
void guac_rdp_bitmap_new(rdpContext* context, rdpBitmap* bitmap) {
/* Convert image data if present */
if (bitmap->data != NULL) {
/* Convert image data to 32-bit RGB */
unsigned char* image_buffer = freerdp_image_convert(bitmap->data, NULL,
bitmap->width, bitmap->height,
context->instance->settings->color_depth,
32, ((rdp_freerdp_context*) context)->clrconv);
/* Free existing image, if any */
if (image_buffer != bitmap->data)
free(bitmap->data);
/* Store converted image in bitmap */
bitmap->data = image_buffer;
}
/* No corresponding layer yet - caching is deferred. */
((guac_rdp_bitmap*) bitmap)->layer = NULL;
/* Start at zero usage */
((guac_rdp_bitmap*) bitmap)->used = 0;
}
void guac_rdp_bitmap_paint(rdpContext* context, rdpBitmap* bitmap) {
guac_client* client = ((rdp_freerdp_context*) context)->client;
guac_socket* socket = client->socket;
int width = bitmap->right - bitmap->left + 1;
int height = bitmap->bottom - bitmap->top + 1;
/* If not cached, cache if necessary */
if (((guac_rdp_bitmap*) bitmap)->layer == NULL
&& ((guac_rdp_bitmap*) bitmap)->used >= 1)
guac_rdp_cache_bitmap(context, bitmap);
/* If cached, retrieve from cache */
if (((guac_rdp_bitmap*) bitmap)->layer != NULL)
guac_protocol_send_copy(socket,
((guac_rdp_bitmap*) bitmap)->layer,
0, 0, width, height,
GUAC_COMP_OVER,
GUAC_DEFAULT_LAYER, bitmap->left, bitmap->top);
/* Otherwise, draw with stored image data */
else if (bitmap->data != NULL) {
/* Create surface from image data */
cairo_surface_t* surface = cairo_image_surface_create_for_data(
bitmap->data, CAIRO_FORMAT_RGB24,
width, height, 4*bitmap->width);
/* Send surface to buffer */
guac_protocol_send_png(socket,
GUAC_COMP_OVER, GUAC_DEFAULT_LAYER,
bitmap->left, bitmap->top, surface);
/* Free surface */
cairo_surface_destroy(surface);
}
/* Increment usage counter */
((guac_rdp_bitmap*) bitmap)->used++;
}
void guac_rdp_bitmap_free(rdpContext* context, rdpBitmap* bitmap) {
guac_client* client = ((rdp_freerdp_context*) context)->client;
/* If cached, free buffer */
if (((guac_rdp_bitmap*) bitmap)->layer != NULL)
guac_client_free_buffer(client, ((guac_rdp_bitmap*) bitmap)->layer);
}
void guac_rdp_bitmap_setsurface(rdpContext* context, rdpBitmap* bitmap, boolean primary) {
guac_client* client = ((rdp_freerdp_context*) context)->client;
if (primary)
((rdp_guac_client_data*) client->data)->current_surface
= GUAC_DEFAULT_LAYER;
else {
/* If not available as a surface, make available. */
if (((guac_rdp_bitmap*) bitmap)->layer == NULL)
guac_rdp_cache_bitmap(context, bitmap);
((rdp_guac_client_data*) client->data)->current_surface
= ((guac_rdp_bitmap*) bitmap)->layer;
}
}
void guac_rdp_bitmap_decompress(rdpContext* context, rdpBitmap* bitmap, uint8* data, int width, int height, int bpp, int length, boolean compressed) {
int size = width * height * (bpp + 7) / 8;
if (bitmap->data == NULL)
bitmap->data = (uint8*) xmalloc(size);
else
bitmap->data = (uint8*) xrealloc(bitmap->data, size);
if (compressed)
bitmap_decompress(data, bitmap->data, width, height, length, bpp, bpp);
else
freerdp_image_flip(data, bitmap->data, width, height, bpp);
bitmap->compressed = false;
bitmap->length = size;
bitmap->bpp = bpp;
}

View File

@ -1,203 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is libguac-client-rdp.
*
* The Initial Developer of the Original Code is
* Michael Jumper.
* Portions created by the Initial Developer are Copyright (C) 2011
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include <freerdp/freerdp.h>
#include <freerdp/channels/channels.h>
#include <freerdp/utils/event.h>
#include <freerdp/plugins/cliprdr.h>
#include <guacamole/client.h>
#include "client.h"
#include "rdp_cliprdr.h"
void guac_rdp_process_cliprdr_event(guac_client* client, RDP_EVENT* event) {
switch (event->event_type) {
case RDP_EVENT_TYPE_CB_MONITOR_READY:
guac_rdp_process_cb_monitor_ready(client, event);
break;
case RDP_EVENT_TYPE_CB_FORMAT_LIST:
guac_rdp_process_cb_format_list(client,
(RDP_CB_FORMAT_LIST_EVENT*) event);
break;
case RDP_EVENT_TYPE_CB_DATA_REQUEST:
guac_rdp_process_cb_data_request(client,
(RDP_CB_DATA_REQUEST_EVENT*) event);
break;
case RDP_EVENT_TYPE_CB_DATA_RESPONSE:
guac_rdp_process_cb_data_response(client,
(RDP_CB_DATA_RESPONSE_EVENT*) event);
break;
default:
guac_client_log_info(client,
"Unknown cliprdr event type: 0x%x",
event->event_type);
}
}
void guac_rdp_process_cb_monitor_ready(guac_client* client, RDP_EVENT* event) {
rdpChannels* channels =
((rdp_guac_client_data*) client->data)->rdp_inst->context->channels;
RDP_CB_FORMAT_LIST_EVENT* format_list =
(RDP_CB_FORMAT_LIST_EVENT*) freerdp_event_new(
RDP_EVENT_CLASS_CLIPRDR,
RDP_EVENT_TYPE_CB_FORMAT_LIST,
NULL, NULL);
/* Received notification of clipboard support. */
/* Respond with supported format list */
format_list->formats = (uint32*) malloc(sizeof(uint32));
format_list->formats[0] = CB_FORMAT_TEXT;
format_list->num_formats = 1;
freerdp_channels_send_event(channels, (RDP_EVENT*) format_list);
}
void guac_rdp_process_cb_format_list(guac_client* client,
RDP_CB_FORMAT_LIST_EVENT* event) {
rdpChannels* channels =
((rdp_guac_client_data*) client->data)->rdp_inst->context->channels;
/* Received notification of available data */
int i;
for (i=0; i<event->num_formats; i++) {
/* If plain text available, request it */
if (event->formats[i] == CB_FORMAT_TEXT) {
/* Create new data request */
RDP_CB_DATA_REQUEST_EVENT* data_request =
(RDP_CB_DATA_REQUEST_EVENT*) freerdp_event_new(
RDP_EVENT_CLASS_CLIPRDR,
RDP_EVENT_TYPE_CB_DATA_REQUEST,
NULL, NULL);
/* We want plain text */
data_request->format = CB_FORMAT_TEXT;
/* Send request */
freerdp_channels_send_event(channels, (RDP_EVENT*) data_request);
return;
}
}
/* Otherwise, no supported data available */
guac_client_log_info(client, "Ignoring unsupported clipboard data");
}
void guac_rdp_process_cb_data_request(guac_client* client,
RDP_CB_DATA_REQUEST_EVENT* event) {
rdpChannels* channels =
((rdp_guac_client_data*) client->data)->rdp_inst->context->channels;
/* If text requested, send clipboard text contents */
if (event->format == CB_FORMAT_TEXT) {
/* Get clipboard data */
const char* clipboard =
((rdp_guac_client_data*) client->data)->clipboard;
/* Create new data response */
RDP_CB_DATA_RESPONSE_EVENT* data_response =
(RDP_CB_DATA_RESPONSE_EVENT*) freerdp_event_new(
RDP_EVENT_CLASS_CLIPRDR,
RDP_EVENT_TYPE_CB_DATA_RESPONSE,
NULL, NULL);
/* Set data and length */
if (clipboard != NULL) {
data_response->data = (uint8*) strdup(clipboard);
data_response->size = strlen(clipboard) + 1;
}
else {
data_response->data = (uint8*) strdup("");
data_response->size = 1;
}
/* Send response */
freerdp_channels_send_event(channels, (RDP_EVENT*) data_response);
}
/* Otherwise ... failure */
else
guac_client_log_error(client,
"Server requested unsupported clipboard data type");
}
void guac_rdp_process_cb_data_response(guac_client* client,
RDP_CB_DATA_RESPONSE_EVENT* event) {
/* Received clipboard data */
if (event->data[event->size - 1] == '\0') {
/* Free existing data */
free(((rdp_guac_client_data*) client->data)->clipboard);
/* Store clipboard data */
((rdp_guac_client_data*) client->data)->clipboard =
strdup((char*) event->data);
/* Send clipboard data */
guac_protocol_send_clipboard(client->socket, (char*) event->data);
}
else
guac_client_log_error(client,
"Clipboard data missing null terminator");
}

View File

@ -1,309 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is libguac-client-rdp.
*
* The Initial Developer of the Original Code is
* Michael Jumper.
* Portions created by the Initial Developer are Copyright (C) 2011
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Matt Hortman
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include <freerdp/freerdp.h>
#include <guacamole/client.h>
#include "client.h"
#include "rdp_bitmap.h"
guac_transfer_function guac_rdp_rop3_transfer_function(guac_client* client,
int rop3) {
/* Translate supported ROP3 opcodes into composite modes */
switch (rop3) {
/* "DSon" !(src | dest) */
case 0x11: return GUAC_TRANSFER_BINARY_NOR;
/* "DSna" !src & dest */
case 0x22: return GUAC_TRANSFER_BINARY_NSRC_AND;
/* "Sn" !src */
case 0x33: return GUAC_TRANSFER_BINARY_NSRC;
/* "SDna" (src & !dest) */
case 0x44: return GUAC_TRANSFER_BINARY_NDEST_AND;
/* "Dn" !dest */
case 0x55: return GUAC_TRANSFER_BINARY_NDEST;
/* "SRCINVERT" (src ^ dest) */
case 0x66: return GUAC_TRANSFER_BINARY_XOR;
/* "DSan" !(src & dest) */
case 0x77: return GUAC_TRANSFER_BINARY_NAND;
/* "SRCAND" (src & dest) */
case 0x88: return GUAC_TRANSFER_BINARY_AND;
/* "DSxn" !(src ^ dest) */
case 0x99: return GUAC_TRANSFER_BINARY_XNOR;
/* "MERGEPAINT" (!src | dest)*/
case 0xBB: return GUAC_TRANSFER_BINARY_NSRC_OR;
/* "SDno" (src | !dest) */
case 0xDD: return GUAC_TRANSFER_BINARY_NDEST_OR;
/* "SRCPAINT" (src | dest) */
case 0xEE: return GUAC_TRANSFER_BINARY_OR;
/* 0x00 = "BLACKNESS" (0) */
/* 0xAA = "NOP" (dest) */
/* 0xCC = "SRCCOPY" (src) */
/* 0xFF = "WHITENESS" (1) */
}
/* Log warning if ROP3 opcode not supported */
guac_client_log_info (client, "guac_rdp_rop3_transfer_function: "
"UNSUPPORTED opcode = 0x%02X", rop3);
/* Default to BINARY_SRC */
return GUAC_TRANSFER_BINARY_SRC;
}
void guac_rdp_gdi_dstblt(rdpContext* context, DSTBLT_ORDER* dstblt) {
guac_client* client = ((rdp_freerdp_context*) context)->client;
const guac_layer* current_layer = ((rdp_guac_client_data*) client->data)->current_surface;
switch (dstblt->bRop) {
/* Blackness */
case 0:
/* Send black rectangle */
guac_protocol_send_rect(client->socket, current_layer,
dstblt->nLeftRect, dstblt->nTopRect,
dstblt->nWidth, dstblt->nHeight);
guac_protocol_send_cfill(client->socket,
GUAC_COMP_OVER, current_layer,
0, 0, 0, 255);
break;
/* Unsupported ROP3 */
default:
guac_client_log_info(client,
"guac_rdp_gdi_dstblt(rop3=%i)", dstblt->bRop);
}
}
void guac_rdp_gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt) {
guac_client* client = ((rdp_freerdp_context*) context)->client;
guac_client_log_info(client, "guac_rdp_gdi_patblt()");
}
void guac_rdp_gdi_scrblt(rdpContext* context, SCRBLT_ORDER* scrblt) {
guac_client* client = ((rdp_freerdp_context*) context)->client;
const guac_layer* current_layer = ((rdp_guac_client_data*) client->data)->current_surface;
/* Copy screen rect to current surface */
guac_protocol_send_copy(client->socket,
GUAC_DEFAULT_LAYER,
scrblt->nXSrc, scrblt->nYSrc, scrblt->nWidth, scrblt->nHeight,
GUAC_COMP_OVER, current_layer,
scrblt->nLeftRect, scrblt->nTopRect);
}
void guac_rdp_gdi_memblt(rdpContext* context, MEMBLT_ORDER* memblt) {
guac_client* client = ((rdp_freerdp_context*) context)->client;
const guac_layer* current_layer = ((rdp_guac_client_data*) client->data)->current_surface;
guac_socket* socket = client->socket;
guac_rdp_bitmap* bitmap = (guac_rdp_bitmap*) memblt->bitmap;
switch (memblt->bRop) {
/* If blackness, send black rectangle */
case 0x00:
guac_protocol_send_rect(client->socket, current_layer,
memblt->nLeftRect, memblt->nTopRect,
memblt->nWidth, memblt->nHeight);
guac_protocol_send_cfill(client->socket,
GUAC_COMP_OVER, current_layer,
0x00, 0x00, 0x00, 0xFF);
break;
/* If NOP, do nothing */
case 0xAA:
break;
/* If operation is just SRC, simply copy */
case 0xCC:
/* If not cached, cache if necessary */
if (((guac_rdp_bitmap*) bitmap)->layer == NULL
&& ((guac_rdp_bitmap*) bitmap)->used >= 1)
guac_rdp_cache_bitmap(context, memblt->bitmap);
/* If not cached, send as PNG */
if (bitmap->layer == NULL) {
if (memblt->bitmap->data != NULL) {
/* Create surface from image data */
cairo_surface_t* surface = cairo_image_surface_create_for_data(
memblt->bitmap->data + 4*(memblt->nXSrc + memblt->nYSrc*memblt->bitmap->width),
CAIRO_FORMAT_RGB24,
memblt->nWidth, memblt->nHeight,
4*memblt->bitmap->width);
/* Send surface to buffer */
guac_protocol_send_png(socket,
GUAC_COMP_OVER, current_layer,
memblt->nLeftRect, memblt->nTopRect, surface);
/* Free surface */
cairo_surface_destroy(surface);
}
}
/* Otherwise, copy */
else
guac_protocol_send_copy(socket,
bitmap->layer,
memblt->nXSrc, memblt->nYSrc,
memblt->nWidth, memblt->nHeight,
GUAC_COMP_OVER,
current_layer, memblt->nLeftRect, memblt->nTopRect);
/* Increment usage counter */
((guac_rdp_bitmap*) bitmap)->used++;
break;
/* If whiteness, send white rectangle */
case 0xFF:
guac_protocol_send_rect(client->socket, current_layer,
memblt->nLeftRect, memblt->nTopRect,
memblt->nWidth, memblt->nHeight);
guac_protocol_send_cfill(client->socket,
GUAC_COMP_OVER, current_layer,
0xFF, 0xFF, 0xFF, 0xFF);
break;
/* Otherwise, use transfer */
default:
/* If not available as a surface, make available. */
if (bitmap->layer == NULL)
guac_rdp_cache_bitmap(context, memblt->bitmap);
guac_protocol_send_transfer(socket,
bitmap->layer,
memblt->nXSrc, memblt->nYSrc,
memblt->nWidth, memblt->nHeight,
guac_rdp_rop3_transfer_function(client, memblt->bRop),
current_layer, memblt->nLeftRect, memblt->nTopRect);
/* Increment usage counter */
((guac_rdp_bitmap*) bitmap)->used++;
}
}
void guac_rdp_gdi_opaquerect(rdpContext* context, OPAQUE_RECT_ORDER* opaque_rect) {
guac_client* client = ((rdp_freerdp_context*) context)->client;
uint32 color = freerdp_color_convert_var(opaque_rect->color,
context->instance->settings->color_depth, 32,
((rdp_freerdp_context*) context)->clrconv);
const guac_layer* current_layer = ((rdp_guac_client_data*) client->data)->current_surface;
guac_protocol_send_rect(client->socket, current_layer,
opaque_rect->nLeftRect, opaque_rect->nTopRect,
opaque_rect->nWidth, opaque_rect->nHeight);
guac_protocol_send_cfill(client->socket,
GUAC_COMP_OVER, current_layer,
(color >> 16) & 0xFF,
(color >> 8 ) & 0xFF,
(color ) & 0xFF,
255);
}
void guac_rdp_gdi_palette_update(rdpContext* context, PALETTE_UPDATE* palette) {
CLRCONV* clrconv = ((rdp_freerdp_context*) context)->clrconv;
clrconv->palette->count = palette->number;
clrconv->palette->entries = palette->entries;
}
void guac_rdp_gdi_set_bounds(rdpContext* context, rdpBounds* bounds) {
guac_client* client = ((rdp_freerdp_context*) context)->client;
const guac_layer* current_layer = ((rdp_guac_client_data*) client->data)->current_surface;
/* Reset clip */
guac_protocol_send_reset(client->socket, current_layer);
/* Set clip if specified */
if (bounds != NULL) {
guac_protocol_send_rect(client->socket, current_layer,
bounds->left, bounds->top,
bounds->right - bounds->left + 1,
bounds->bottom - bounds->top + 1);
guac_protocol_send_clip(client->socket, current_layer);
}
}
void guac_rdp_gdi_end_paint(rdpContext* context) {
guac_client* client = ((rdp_freerdp_context*) context)->client;
guac_socket_flush(client->socket);
}

View File

@ -1,239 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is libguac-client-rdp.
*
* The Initial Developer of the Original Code is
* Michael Jumper.
* Portions created by the Initial Developer are Copyright (C) 2011
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Matt Hortman
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include <freerdp/freerdp.h>
#include <guacamole/client.h>
#include <guacamole/error.h>
#include "client.h"
#include "rdp_glyph.h"
void guac_rdp_glyph_new(rdpContext* context, rdpGlyph* glyph) {
int x, y, i;
int stride;
unsigned char* image_buffer;
unsigned char* image_buffer_row;
unsigned char* data = glyph->aj;
int width = glyph->cx;
int height = glyph->cy;
/* Init Cairo buffer */
stride = cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, width);
image_buffer = malloc(height*stride);
image_buffer_row = image_buffer;
/* Copy image data from image data to buffer */
for (y = 0; y<height; y++) {
unsigned int* image_buffer_current;
/* Get current buffer row, advance to next */
image_buffer_current = (unsigned int*) image_buffer_row;
image_buffer_row += stride;
for (x = 0; x<width;) {
/* Get byte from image data */
unsigned int v = *(data++);
/* Read bits, write pixels */
for (i = 0; i<8 && x<width; i++, x++) {
/* Output RGB */
if (v & 0x80)
*(image_buffer_current++) = 0xFF000000;
else
*(image_buffer_current++) = 0x00000000;
/* Next bit */
v <<= 1;
}
}
}
/* Store glyph surface */
((guac_rdp_glyph*) glyph)->surface = cairo_image_surface_create_for_data(
image_buffer, CAIRO_FORMAT_ARGB32, width, height, stride);
}
void guac_rdp_glyph_draw(rdpContext* context, rdpGlyph* glyph, int x, int y) {
guac_client* client = ((rdp_freerdp_context*) context)->client;
rdp_guac_client_data* guac_client_data = (rdp_guac_client_data*) client->data;
/* Do not attempt to draw glyphs if glyph drawing is not begun */
if (guac_client_data->glyph_cairo == NULL)
return;
/* Use glyph as mask */
cairo_mask_surface(
guac_client_data->glyph_cairo,
((guac_rdp_glyph*) glyph)->surface, x, y);
}
void guac_rdp_glyph_free(rdpContext* context, rdpGlyph* glyph) {
unsigned char* image_buffer = cairo_image_surface_get_data(
((guac_rdp_glyph*) glyph)->surface);
/* Free surface */
cairo_surface_destroy(((guac_rdp_glyph*) glyph)->surface);
free(image_buffer);
}
void guac_rdp_glyph_begindraw(rdpContext* context,
int x, int y, int width, int height, uint32 fgcolor, uint32 bgcolor) {
guac_client* client = ((rdp_freerdp_context*) context)->client;
rdp_guac_client_data* guac_client_data =
(rdp_guac_client_data*) client->data;
/* Convert foreground color */
fgcolor = freerdp_color_convert_var(fgcolor,
context->instance->settings->color_depth, 32,
((rdp_freerdp_context*) context)->clrconv);
/* Fill background with color if specified */
if (width != 0 && height != 0) {
/* Prepare for opaque glyphs */
guac_client_data->glyph_surface =
guac_client_data->opaque_glyph_surface;
/* Create cairo instance */
guac_client_data->glyph_cairo = cairo_create(
guac_client_data->glyph_surface);
/* Convert background color */
bgcolor = freerdp_color_convert_var(bgcolor,
context->instance->settings->color_depth, 32,
((rdp_freerdp_context*) context)->clrconv);
/* Fill background */
cairo_rectangle(guac_client_data->glyph_cairo,
x, y, width, height);
cairo_set_source_rgb(guac_client_data->glyph_cairo,
((bgcolor & 0xFF0000) >> 16) / 255.0,
((bgcolor & 0x00FF00) >> 8 ) / 255.0,
( bgcolor & 0x0000FF ) / 255.0);
cairo_fill(guac_client_data->glyph_cairo);
}
/* Otherwise, prepare for transparent glyphs */
else {
/* Select transparent glyph surface */
guac_client_data->glyph_surface =
guac_client_data->trans_glyph_surface;
guac_client_data->glyph_cairo = cairo_create(
guac_client_data->glyph_surface);
/* Clear surface */
cairo_set_operator(guac_client_data->glyph_cairo,
CAIRO_OPERATOR_SOURCE);
cairo_set_source_rgba(guac_client_data->glyph_cairo, 0, 0, 0, 0);
cairo_paint(guac_client_data->glyph_cairo);
/* Restore operator */
cairo_set_operator(guac_client_data->glyph_cairo,
CAIRO_OPERATOR_OVER);
}
/* Prepare for glyph drawing */
cairo_set_source_rgb(guac_client_data->glyph_cairo,
((fgcolor & 0xFF0000) >> 16) / 255.0,
((fgcolor & 0x00FF00) >> 8 ) / 255.0,
( fgcolor & 0x0000FF ) / 255.0);
}
void guac_rdp_glyph_enddraw(rdpContext* context,
int x, int y, int width, int height, uint32 fgcolor, uint32 bgcolor) {
guac_client* client = ((rdp_freerdp_context*) context)->client;
rdp_guac_client_data* guac_client_data = (rdp_guac_client_data*) client->data;
const guac_layer* current_layer = ((rdp_guac_client_data*) client->data)->current_surface;
/* Use glyph surface to provide image data for glyph rectangle */
cairo_surface_t* glyph_surface = guac_client_data->glyph_surface;
int stride = cairo_image_surface_get_stride(glyph_surface);
/* Calculate bounds */
int max_width = cairo_image_surface_get_width(glyph_surface) - x;
int max_height = cairo_image_surface_get_height(glyph_surface) - y;
/* Ensure dimensions of glyph do not exceed bounds */
if (width > max_width) width = max_width;
if (height > max_height) height = max_height;
/* Ensure data is ready */
cairo_surface_flush(glyph_surface);
/* Create surface for subsection with text */
cairo_surface_t* surface = cairo_image_surface_create_for_data(
cairo_image_surface_get_data(glyph_surface) + 4*x + y*stride,
cairo_image_surface_get_format(glyph_surface),
width, height, stride);
/* Send surface with all glyphs to layer */
guac_protocol_send_png(client->socket,
GUAC_COMP_OVER, current_layer, x, y,
surface);
/* Destroy surface */
cairo_surface_destroy(surface);
/* Destroy cairo instance */
cairo_destroy(guac_client_data->glyph_cairo);
}

View File

@ -1,55 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is libguac-client-rdp.
*
* The Initial Developer of the Original Code is
* Michael Jumper.
* Portions created by the Initial Developer are Copyright (C) 2011
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "rdp_keymap.h"
const int GUAC_KEYSYMS_SHIFT[] = {0xFFE1, 0};
const int GUAC_KEYSYMS_ALL_SHIFT[] = {0xFFE1, 0xFFE2, 0};
const int GUAC_KEYSYMS_CTRL[] = {0xFFE3, 0};
const int GUAC_KEYSYMS_ALL_CTRL[] = {0xFFE3, 0xFFE4, 0};
const int GUAC_KEYSYMS_ALT[] = {0xFFE9, 0};
const int GUAC_KEYSYMS_ALL_ALT[] = {0xFFE9, 0xFFEA, 0};
const int GUAC_KEYSYMS_ALL_MODIFIERS[] = {
0xFFE1, 0xFFE2, /* Left and right shift */
0xFFE3, 0xFFE4, /* Left and right control */
0xFFE9, 0xFFEA, /* Left and right alt */
0
};

View File

@ -1,215 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is libguac-client-rdp.
*
* The Initial Developer of the Original Code is
* Michael Jumper.
* Portions created by the Initial Developer are Copyright (C) 2011
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Matt Hortman
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include <freerdp/input.h>
#include "rdp_keymap.h"
static guac_rdp_keysym_desc __guac_rdp_keymap_mapping[] = {
/* BackSpace */
{ .keysym = 0xff08, .scancode = 0x0E },
/* Tab */
{ .keysym = 0xff09, .scancode = 0x0F },
/* Return */
{ .keysym = 0xff0d, .scancode = 0x1C },
/* Scroll_Lock */
{ .keysym = 0xff14, .scancode = 0x46 },
/* Escape */
{ .keysym = 0xff1b, .scancode = 0x01 },
/* Home */
{ .keysym = 0xff50, .scancode = 0x47,
.flags = KBD_FLAGS_EXTENDED },
/* Left */
{ .keysym = 0xff51, .scancode = 0x4B,
.flags = KBD_FLAGS_EXTENDED },
/* Up */
{ .keysym = 0xff52, .scancode = 0x48,
.flags = KBD_FLAGS_EXTENDED },
/* Right */
{ .keysym = 0xff53, .scancode = 0x4D,
.flags = KBD_FLAGS_EXTENDED },
/* Down */
{ .keysym = 0xff54, .scancode = 0x50,
.flags = KBD_FLAGS_EXTENDED },
/* Page_Up */
{ .keysym = 0xff55, .scancode = 0x49,
.flags = KBD_FLAGS_EXTENDED },
/* Menu */
{ .keysym = 0xff67, .scancode = 0x5D,
.flags = KBD_FLAGS_EXTENDED },
/* Page_Down */
{ .keysym = 0xff56, .scancode = 0x51,
.flags = KBD_FLAGS_EXTENDED },
/* End */
{ .keysym = 0xff57, .scancode = 0x4F,
.flags = KBD_FLAGS_EXTENDED },
/* Insert */
{ .keysym = 0xff63, .scancode = 0x52,
.flags = KBD_FLAGS_EXTENDED },
/* Num_Lock */
{ .keysym = 0xff7f, .scancode = 0x45 },
/* KP_0 */
{ .keysym = 0xffb0, .scancode = 0x52 },
/* KP_1 */
{ .keysym = 0xffb1, .scancode = 0x4F },
/* KP_2 */
{ .keysym = 0xffb2, .scancode = 0x50 },
/* KP_3 */
{ .keysym = 0xffb3, .scancode = 0x51 },
/* KP_4 */
{ .keysym = 0xffb4, .scancode = 0x4B },
/* KP_5 */
{ .keysym = 0xffb5, .scancode = 0x4C },
/* KP_6 */
{ .keysym = 0xffb6, .scancode = 0x4D },
/* KP_7 */
{ .keysym = 0xffb7, .scancode = 0x47 },
/* KP_8 */
{ .keysym = 0xffb8, .scancode = 0x48 },
/* KP_9 */
{ .keysym = 0xffb9, .scancode = 0x49 },
/* F1 */
{ .keysym = 0xffbe, .scancode = 0x3B },
/* F2 */
{ .keysym = 0xffbf, .scancode = 0x3C },
/* F3 */
{ .keysym = 0xffc0, .scancode = 0x3D },
/* F4 */
{ .keysym = 0xffc1, .scancode = 0x3E },
/* F5 */
{ .keysym = 0xffc2, .scancode = 0x3F },
/* F6 */
{ .keysym = 0xffc3, .scancode = 0x40 },
/* F7 */
{ .keysym = 0xffc4, .scancode = 0x41 },
/* F8 */
{ .keysym = 0xffc5, .scancode = 0x42 },
/* F9 */
{ .keysym = 0xffc6, .scancode = 0x43 },
/* F10 */
{ .keysym = 0xffc7, .scancode = 0x44 },
/* F11 */
{ .keysym = 0xffc8, .scancode = 0x57 },
/* F12 */
{ .keysym = 0xffc9, .scancode = 0x58 },
/* Shift_L */
{ .keysym = 0xffe1, .scancode = 0x2A },
/* Shift_R */
{ .keysym = 0xffe2, .scancode = 0x36 },
/* Control_L */
{ .keysym = 0xffe3, .scancode = 0x1D },
/* Control_R */
{ .keysym = 0xffe4, .scancode = 0x1D },
/* Caps_Lock */
{ .keysym = 0xffe5, .scancode = 0x3A,
.flags = KBD_FLAGS_EXTENDED },
/* Alt_L */
{ .keysym = 0xffe9, .scancode = 0x38 },
/* Alt_R */
{ .keysym = 0xffea, .scancode = 0x38 },
/* Super_L */
{ .keysym = 0xffeb, .scancode = 0x5B,
.flags = KBD_FLAGS_EXTENDED },
/* Super_R */
{ .keysym = 0xffec, .scancode = 0x5C,
.flags = KBD_FLAGS_EXTENDED },
/* Delete */
{ .keysym = 0xffff, .scancode = 0x53,
.flags = KBD_FLAGS_EXTENDED },
{0}
};
const guac_rdp_keymap guac_rdp_keymap_base = {
.name = "base",
.parent = NULL,
.mapping = __guac_rdp_keymap_mapping
};

View File

@ -1,437 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is libguac-client-rdp.
*
* The Initial Developer of the Original Code is
* Michael Jumper.
* Portions created by the Initial Developer are Copyright (C) 2011
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Matt Hortman
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include <freerdp/input.h>
#include <freerdp/kbd/layouts.h>
#include "rdp_keymap.h"
static guac_rdp_keysym_desc __guac_rdp_keymap_mapping[] = {
/* space */
{ .keysym = 0x0020, .scancode = 0x39 },
/* exclam */
{ .keysym = 0x0021, .scancode = 0x02,
.set_keysyms = GUAC_KEYSYMS_SHIFT },
/* quotedbl */
{ .keysym = 0x0022, .scancode = 0x28,
.set_keysyms = GUAC_KEYSYMS_SHIFT },
/* numbersign */
{ .keysym = 0x0023, .scancode = 0x04,
.set_keysyms = GUAC_KEYSYMS_SHIFT },
/* dollar */
{ .keysym = 0x0024, .scancode = 0x05,
.set_keysyms = GUAC_KEYSYMS_SHIFT },
/* percent */
{ .keysym = 0x0025, .scancode = 0x06,
.set_keysyms = GUAC_KEYSYMS_SHIFT },
/* ampersand */
{ .keysym = 0x0026, .scancode = 0x08,
.set_keysyms = GUAC_KEYSYMS_SHIFT },
/* quoteright */
{ .keysym = 0x0027, .scancode = 0x28 },
/* parenleft */
{ .keysym = 0x0028, .scancode = 0x0A,
.set_keysyms = GUAC_KEYSYMS_SHIFT },
/* parenright */
{ .keysym = 0x0029, .scancode = 0x0B,
.set_keysyms = GUAC_KEYSYMS_SHIFT },
/* asterisk */
{ .keysym = 0x002a, .scancode = 0x09,
.set_keysyms = GUAC_KEYSYMS_SHIFT },
/* plus */
{ .keysym = 0x002b, .scancode = 0x0D,
.set_keysyms = GUAC_KEYSYMS_SHIFT },
/* comma */
{ .keysym = 0x002c, .scancode = 0x33,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* minus */
{ .keysym = 0x002d, .scancode = 0x0C,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* period */
{ .keysym = 0x002e, .scancode = 0x34,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* slash */
{ .keysym = 0x002f, .scancode = 0x35,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* 0 */
{ .keysym = 0x0030, .scancode = 0x0B,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* 1 */
{ .keysym = 0x0031, .scancode = 0x02,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* 2 */
{ .keysym = 0x0032, .scancode = 0x03,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* 3 */
{ .keysym = 0x0033, .scancode = 0x04,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* 4 */
{ .keysym = 0x0034, .scancode = 0x05,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* 5 */
{ .keysym = 0x0035, .scancode = 0x06,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* 6 */
{ .keysym = 0x0036, .scancode = 0x07,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* 7 */
{ .keysym = 0x0037, .scancode = 0x08,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* 8 */
{ .keysym = 0x0038, .scancode = 0x09,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* 9 */
{ .keysym = 0x0039, .scancode = 0x0A,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* colon */
{ .keysym = 0x003a, .scancode = 0x27,
.set_keysyms = GUAC_KEYSYMS_SHIFT },
/* semicolon */
{ .keysym = 0x003b, .scancode = 0x27,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* less */
{ .keysym = 0x003c, .scancode = 0x33,
.set_keysyms = GUAC_KEYSYMS_SHIFT },
/* equal */
{ .keysym = 0x003d, .scancode = 0x0D,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* greater */
{ .keysym = 0x003e, .scancode = 0x34,
.set_keysyms = GUAC_KEYSYMS_SHIFT },
/* question */
{ .keysym = 0x003f, .scancode = 0x35,
.set_keysyms = GUAC_KEYSYMS_SHIFT },
/* at */
{ .keysym = 0x0040, .scancode = 0x03,
.set_keysyms = GUAC_KEYSYMS_SHIFT },
/* A */
{ .keysym = 0x0041, .scancode = 0x1E,
.set_keysyms = GUAC_KEYSYMS_SHIFT },
/* B */
{ .keysym = 0x0042, .scancode = 0x30,
.set_keysyms = GUAC_KEYSYMS_SHIFT },
/* C */
{ .keysym = 0x0043, .scancode = 0x2E,
.set_keysyms = GUAC_KEYSYMS_SHIFT },
/* D */
{ .keysym = 0x0044, .scancode = 0x20,
.set_keysyms = GUAC_KEYSYMS_SHIFT },
/* E */
{ .keysym = 0x0045, .scancode = 0x12,
.set_keysyms = GUAC_KEYSYMS_SHIFT },
/* F */
{ .keysym = 0x0046, .scancode = 0x21,
.set_keysyms = GUAC_KEYSYMS_SHIFT },
/* G */
{ .keysym = 0x0047, .scancode = 0x22,
.set_keysyms = GUAC_KEYSYMS_SHIFT },
/* H */
{ .keysym = 0x0048, .scancode = 0x23,
.set_keysyms = GUAC_KEYSYMS_SHIFT },
/* I */
{ .keysym = 0x0049, .scancode = 0x17,
.set_keysyms = GUAC_KEYSYMS_SHIFT },
/* J */
{ .keysym = 0x004a, .scancode = 0x24,
.set_keysyms = GUAC_KEYSYMS_SHIFT },
/* K */
{ .keysym = 0x004b, .scancode = 0x25,
.set_keysyms = GUAC_KEYSYMS_SHIFT },
/* L */
{ .keysym = 0x004c, .scancode = 0x26,
.set_keysyms = GUAC_KEYSYMS_SHIFT },
/* M */
{ .keysym = 0x004d, .scancode = 0x32,
.set_keysyms = GUAC_KEYSYMS_SHIFT },
/* N */
{ .keysym = 0x004e, .scancode = 0x31,
.set_keysyms = GUAC_KEYSYMS_SHIFT },
/* O */
{ .keysym = 0x004f, .scancode = 0x18,
.set_keysyms = GUAC_KEYSYMS_SHIFT },
/* P */
{ .keysym = 0x0050, .scancode = 0x19,
.set_keysyms = GUAC_KEYSYMS_SHIFT },
/* Q */
{ .keysym = 0x0051, .scancode = 0x10,
.set_keysyms = GUAC_KEYSYMS_SHIFT },
/* R */
{ .keysym = 0x0052, .scancode = 0x13,
.set_keysyms = GUAC_KEYSYMS_SHIFT },
/* S */
{ .keysym = 0x0053, .scancode = 0x1F,
.set_keysyms = GUAC_KEYSYMS_SHIFT },
/* T */
{ .keysym = 0x0054, .scancode = 0x14,
.set_keysyms = GUAC_KEYSYMS_SHIFT },
/* U */
{ .keysym = 0x0055, .scancode = 0x16,
.set_keysyms = GUAC_KEYSYMS_SHIFT },
/* V */
{ .keysym = 0x0056, .scancode = 0x2F,
.set_keysyms = GUAC_KEYSYMS_SHIFT },
/* W */
{ .keysym = 0x0057, .scancode = 0x11,
.set_keysyms = GUAC_KEYSYMS_SHIFT },
/* X */
{ .keysym = 0x0058, .scancode = 0x2D,
.set_keysyms = GUAC_KEYSYMS_SHIFT },
/* Y */
{ .keysym = 0x0059, .scancode = 0x15,
.set_keysyms = GUAC_KEYSYMS_SHIFT },
/* Z */
{ .keysym = 0x005a, .scancode = 0x2C,
.set_keysyms = GUAC_KEYSYMS_SHIFT },
/* bracketleft */
{ .keysym = 0x005b, .scancode = 0x1A,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* backslash */
{ .keysym = 0x005c, .scancode = 0x2B,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* bracketright */
{ .keysym = 0x005d, .scancode = 0x1B,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* asciicircum */
{ .keysym = 0x005e, .scancode = 0x07,
.set_keysyms = GUAC_KEYSYMS_SHIFT },
/* underscore */
{ .keysym = 0x005f, .scancode = 0x0C,
.set_keysyms = GUAC_KEYSYMS_SHIFT },
/* quoteleft */
{ .keysym = 0x0060, .scancode = 0x29,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* a */
{ .keysym = 0x0061, .scancode = 0x1E,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* b */
{ .keysym = 0x0062, .scancode = 0x30,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* c */
{ .keysym = 0x0063, .scancode = 0x2E,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* d */
{ .keysym = 0x0064, .scancode = 0x20,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* e */
{ .keysym = 0x0065, .scancode = 0x12,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* f */
{ .keysym = 0x0066, .scancode = 0x21,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* g */
{ .keysym = 0x0067, .scancode = 0x22,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* h */
{ .keysym = 0x0068, .scancode = 0x23,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* i */
{ .keysym = 0x0069, .scancode = 0x17,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* j */
{ .keysym = 0x006a, .scancode = 0x24,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* k */
{ .keysym = 0x006b, .scancode = 0x25,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* l */
{ .keysym = 0x006c, .scancode = 0x26,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* m */
{ .keysym = 0x006d, .scancode = 0x32,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* n */
{ .keysym = 0x006e, .scancode = 0x31,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* o */
{ .keysym = 0x006f, .scancode = 0x18,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* p */
{ .keysym = 0x0070, .scancode = 0x19,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* q */
{ .keysym = 0x0071, .scancode = 0x10,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* r */
{ .keysym = 0x0072, .scancode = 0x13,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* s */
{ .keysym = 0x0073, .scancode = 0x1F,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* t */
{ .keysym = 0x0074, .scancode = 0x14,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* u */
{ .keysym = 0x0075, .scancode = 0x16,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* v */
{ .keysym = 0x0076, .scancode = 0x2F,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* w */
{ .keysym = 0x0077, .scancode = 0x11,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* x */
{ .keysym = 0x0078, .scancode = 0x2D,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* y */
{ .keysym = 0x0079, .scancode = 0x15,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* z */
{ .keysym = 0x007a, .scancode = 0x2C,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* braceleft */
{ .keysym = 0x007b, .scancode = 0x1A,
.set_keysyms = GUAC_KEYSYMS_SHIFT },
/* bar */
{ .keysym = 0x007c, .scancode = 0x2B,
.set_keysyms = GUAC_KEYSYMS_SHIFT },
/* braceright */
{ .keysym = 0x007d, .scancode = 0x1B,
.set_keysyms = GUAC_KEYSYMS_SHIFT },
/* asciitilde */
{ .keysym = 0x007e, .scancode = 0x29,
.set_keysyms = GUAC_KEYSYMS_SHIFT },
{0}
};
const guac_rdp_keymap guac_rdp_keymap_en_us = {
.name = "en-us-qwerty",
.parent = &guac_rdp_keymap_base,
.mapping = __guac_rdp_keymap_mapping,
.freerdp_keyboard_layout = KBD_US
};

View File

@ -1,102 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is libguac-client-rdp.
*
* The Initial Developer of the Original Code is
* Michael Jumper.
* Portions created by the Initial Developer are Copyright (C) 2011
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include <freerdp/freerdp.h>
#include <guacamole/client.h>
#include "client.h"
#include "rdp_pointer.h"
void guac_rdp_pointer_new(rdpContext* context, rdpPointer* pointer) {
guac_client* client = ((rdp_freerdp_context*) context)->client;
guac_socket* socket = client->socket;
/* Allocate data for image */
unsigned char* data =
(unsigned char*) malloc(pointer->width * pointer->height * 4);
/* Allocate layer */
guac_layer* buffer = guac_client_alloc_buffer(client);
cairo_surface_t* surface;
/* Convert to alpha cursor if mask data present */
if (pointer->andMaskData && pointer->xorMaskData)
freerdp_alpha_cursor_convert(data,
pointer->xorMaskData, pointer->andMaskData,
pointer->width, pointer->height, pointer->xorBpp,
((rdp_freerdp_context*) context)->clrconv);
/* Create surface from image data */
surface = cairo_image_surface_create_for_data(
data, CAIRO_FORMAT_ARGB32,
pointer->width, pointer->height, 4*pointer->width);
/* Send surface to buffer */
guac_protocol_send_png(socket, GUAC_COMP_SRC, buffer, 0, 0, surface);
/* Free surface */
cairo_surface_destroy(surface);
free(data);
/* Remember buffer */
((guac_rdp_pointer*) pointer)->layer = buffer;
}
void guac_rdp_pointer_set(rdpContext* context, rdpPointer* pointer) {
guac_client* client = ((rdp_freerdp_context*) context)->client;
guac_socket* socket = client->socket;
/* Set cursor */
guac_protocol_send_cursor(socket, pointer->xPos, pointer->yPos,
((guac_rdp_pointer*) pointer)->layer,
0, 0, pointer->width, pointer->height);
}
void guac_rdp_pointer_free(rdpContext* context, rdpPointer* pointer) {
guac_client* client = ((rdp_freerdp_context*) context)->client;
guac_client_free_buffer(client, ((guac_rdp_pointer*) pointer)->layer);
}

5
src/common-ssh/.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
# Auto-generated test runner and binary
_generated_runner.c
test_common_ssh

View File

@ -0,0 +1,58 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# NOTE: Parts of this file (Makefile.am) are automatically transcluded verbatim
# into Makefile.in. Though the build system (GNU Autotools) automatically adds
# its own license boilerplate to the generated Makefile.in, that boilerplate
# does not apply to the transcluded portions of Makefile.am which are licensed
# to you by the ASF under the Apache License, Version 2.0, as described above.
#
AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I m4
noinst_LTLIBRARIES = libguac_common_ssh.la
SUBDIRS = . tests
libguac_common_ssh_la_SOURCES = \
buffer.c \
sftp.c \
ssh.c \
key.c \
user.c
noinst_HEADERS = \
common-ssh/buffer.h \
common-ssh/key.h \
common-ssh/sftp.h \
common-ssh/ssh.h \
common-ssh/user.h
libguac_common_ssh_la_CFLAGS = \
-Werror -Wall -pedantic \
@COMMON_INCLUDE@ \
@LIBGUAC_INCLUDE@
libguac_common_ssh_la_LIBADD = \
@LIBGUAC_LTLIB@
libguac_common_ssh_la_LDFLAGS = \
@PTHREAD_LIBS@ \
@SSH_LIBS@ \
@SSL_LIBS@

135
src/common-ssh/buffer.c Normal file
View File

@ -0,0 +1,135 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#include "config.h"
#include <openssl/bn.h>
#include <openssl/ossl_typ.h>
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
void guac_common_ssh_buffer_write_byte(char** buffer, uint8_t value) {
uint8_t* data = (uint8_t*) *buffer;
*data = value;
(*buffer)++;
}
void guac_common_ssh_buffer_write_uint32(char** buffer, uint32_t value) {
uint8_t* data = (uint8_t*) *buffer;
data[0] = (value & 0xFF000000) >> 24;
data[1] = (value & 0x00FF0000) >> 16;
data[2] = (value & 0x0000FF00) >> 8;
data[3] = value & 0x000000FF;
*buffer += 4;
}
void guac_common_ssh_buffer_write_data(char** buffer, const char* data,
int length) {
memcpy(*buffer, data, length);
*buffer += length;
}
void guac_common_ssh_buffer_write_bignum(char** buffer, const BIGNUM* value) {
unsigned char* bn_buffer;
int length;
/* If zero, just write zero length */
if (BN_is_zero(value)) {
guac_common_ssh_buffer_write_uint32(buffer, 0);
return;
}
/* Allocate output buffer, add padding byte */
length = BN_num_bytes(value);
bn_buffer = malloc(length);
/* Convert BIGNUM */
BN_bn2bin(value, bn_buffer);
/* If first byte has high bit set, write padding byte */
if (bn_buffer[0] & 0x80) {
guac_common_ssh_buffer_write_uint32(buffer, length+1);
guac_common_ssh_buffer_write_byte(buffer, 0);
}
else
guac_common_ssh_buffer_write_uint32(buffer, length);
/* Write data */
memcpy(*buffer, bn_buffer, length);
*buffer += length;
free(bn_buffer);
}
void guac_common_ssh_buffer_write_string(char** buffer, const char* string,
int length) {
guac_common_ssh_buffer_write_uint32(buffer, length);
guac_common_ssh_buffer_write_data(buffer, string, length);
}
uint8_t guac_common_ssh_buffer_read_byte(char** buffer) {
uint8_t* data = (uint8_t*) *buffer;
uint8_t value = *data;
(*buffer)++;
return value;
}
uint32_t guac_common_ssh_buffer_read_uint32(char** buffer) {
uint8_t* data = (uint8_t*) *buffer;
uint32_t value =
(data[0] << 24)
| (data[1] << 16)
| (data[2] << 8)
| data[3];
*buffer += 4;
return value;
}
char* guac_common_ssh_buffer_read_string(char** buffer, int* length) {
char* value;
*length = guac_common_ssh_buffer_read_uint32(buffer);
value = *buffer;
*buffer += *length;
return value;
}

View File

@ -0,0 +1,134 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#ifndef GUAC_COMMON_SSH_BUFFER_H
#define GUAC_COMMON_SSH_BUFFER_H
#include "config.h"
#include <openssl/bn.h>
#include <stdint.h>
/**
* Writes the given byte to the given buffer, advancing the buffer pointer by
* one byte.
*
* @param buffer
* The buffer to write to.
*
* @param value
* The value to write.
*/
void guac_common_ssh_buffer_write_byte(char** buffer, uint8_t value);
/**
* Writes the given integer to the given buffer, advancing the buffer pointer
* four bytes.
*
* @param buffer
* The buffer to write to.
*
* @param value
* The value to write.
*/
void guac_common_ssh_buffer_write_uint32(char** buffer, uint32_t value);
/**
* Writes the given string and its length to the given buffer, advancing the
* buffer pointer by the size of the length (four bytes) and the size of the
* string.
*
* @param buffer
* The buffer to write to.
*
* @param string
* The string value to write.
*
* @param length
* The length of the string to write, in bytes.
*/
void guac_common_ssh_buffer_write_string(char** buffer, const char* string,
int length);
/**
* Writes the given BIGNUM the given buffer, advancing the buffer pointer by
* the size of the length (four bytes) and the size of the BIGNUM.
*
* @param buffer
* The buffer to write to.
*
* @param value
* The value to write.
*/
void guac_common_ssh_buffer_write_bignum(char** buffer, const BIGNUM* value);
/**
* Writes the given data the given buffer, advancing the buffer pointer by the
* given length.
*
* @param data
* The arbitrary data to write.
*
* @param length
* The length of data to write, in bytes.
*/
void guac_common_ssh_buffer_write_data(char** buffer, const char* data, int length);
/**
* Reads a single byte from the given buffer, advancing the buffer by one byte.
*
* @param buffer
* The buffer to read from.
*
* @return
* The value read from the buffer.
*/
uint8_t guac_common_ssh_buffer_read_byte(char** buffer);
/**
* Reads an integer from the given buffer, advancing the buffer by four bytes.
*
* @param buffer
* The buffer to read from.
*
* @return
* The value read from the buffer.
*/
uint32_t guac_common_ssh_buffer_read_uint32(char** buffer);
/**
* Reads a string and its length from the given buffer, advancing the buffer
* by the size of the length (four bytes) and the size of the string, and
* returning a pointer to the buffer. The length of the string is stored in
* the given int.
*
* @param buffer
* The buffer to read from.
*
* @param length
* A pointer to an integer into which the length of the read string will
* be stored.
*
* @return
* A pointer to the value within the buffer.
*/
char* guac_common_ssh_buffer_read_string(char** buffer, int* length);
#endif

View File

@ -0,0 +1,152 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#ifndef GUAC_COMMON_SSH_KEY_H
#define GUAC_COMMON_SSH_KEY_H
#include "config.h"
#include <guacamole/client.h>
#include <libssh2.h>
/**
* OpenSSH v1 private keys are PEM-wrapped base64-encoded blobs. The encoded data begins with:
* "openssh-key-v1\0"
*/
#define OPENSSH_V1_KEY_HEADER "-----BEGIN OPENSSH PRIVATE KEY-----\nb3BlbnNzaC1rZXktdjEA"
/**
* The base64-encoded prefix indicating an OpenSSH v1 private key is NOT protected by a
* passphrase. Specifically, it is the following data fields and values:
* pascal string: cipher name ("none")
* pascal string: kdf name ("none")
* pascal string: kdf params (NULL)
* 32-bit int: number of keys (1)
*/
#define OPENSSH_V1_UNENCRYPTED_KEY "AAAABG5vbmUAAAAEbm9uZQAAAAAAAAAB"
/**
* Abstraction of a key used for SSH authentication.
*/
typedef struct guac_common_ssh_key {
/**
* The private key, encoded as necessary for SSH.
*/
char* private_key;
/**
* The length of the private key, in bytes.
*/
int private_key_length;
/**
* The private key's passphrase, if any.
*/
char *passphrase;
} guac_common_ssh_key;
/**
* Allocates a new key containing the given private key data and specified
* passphrase. If unable to read the key, NULL is returned.
*
* @param data
* The base64-encoded data to decode when reading the key.
*
* @param length
* The length of the provided data, in bytes.
*
* @param passphrase
* The passphrase to use when decrypting the key, if any, or an empty
* string or NULL if no passphrase is needed.
*
* @return
* The decoded, decrypted private key, or NULL if the key could not be
* decoded.
*/
guac_common_ssh_key* guac_common_ssh_key_alloc(char* data, int length,
char* passphrase);
/**
* Returns a statically-allocated string describing the most recent SSH key
* error.
*
* @return
* A statically-allocated string describing the most recent SSH key error.
*/
const char* guac_common_ssh_key_error();
/**
* Frees all memory associated with the given key.
*
* @param key
* The key to free.
*/
void guac_common_ssh_key_free(guac_common_ssh_key* key);
/**
* Verifies the host key for the given hostname/port combination against
* one or more known_hosts entries. The known_host entries can either be a
* single host_key, provided by the client, or a set of known_hosts entries
* provided in the /etc/guacamole/ssh_known_hosts file. Failure to correctly
* load the known_hosts entries will result in a connection abort and a returned
* error code. A return code of zero indiciates that either no known_hosts entries
* were provided, or that the verification succeeded (match). Negative values
* indicate internal libssh2 error codes; positive values indicate a failure
* during verification of the host key against the known hosts.
*
* @param session
* A pointer to the LIBSSH2_SESSION structure of the SSH connection already
* in progress.
*
* @param client
* The current guac_client instance for which the known_hosts checking is
* being performed.
*
* @param host_key
* The known host entry provided by the client. If this is non-null and not
* empty, it will be the only host key loaded and used for verification. If
* this is null or empty an attempt will be made to read the
* /etc/guacamole/ssh_known_hosts file and load entries from it.
*
* @param hostname
* The hostname or IP of the server that is being verified.
*
* @param port
* The port number of the server being verified.
*
* @param remote_hostkey
* The host key of the remote system being verified.
*
* @param remote_hostkey_len
* The length of the remote host key being verified
*
* @return
* The status of the known_hosts check. This will be zero if no entries
* are provided or if the match succeeds, negative to indicate internal
* libssh2 errors, or positive to indicate failures during host key
* checking.
*/
int guac_common_ssh_verify_host_key(LIBSSH2_SESSION* session, guac_client* client,
const char* host_key, const char* hostname, int port, const char* remote_hostkey,
const size_t remote_hostkey_len);
#endif

View File

@ -0,0 +1,301 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#ifndef GUAC_COMMON_SSH_SFTP_H
#define GUAC_COMMON_SSH_SFTP_H
#include "common/json.h"
#include "ssh.h"
#include <guacamole/object.h>
#include <guacamole/user.h>
#include <libssh2.h>
#include <libssh2_sftp.h>
/**
* Maximum number of bytes per path.
*/
#define GUAC_COMMON_SSH_SFTP_MAX_PATH 2048
/**
* Maximum number of path components per path.
*/
#define GUAC_COMMON_SSH_SFTP_MAX_DEPTH 1024
/**
* Representation of an SFTP-driven filesystem object. Unlike guac_object, this
* structure is not tied to any particular user.
*/
typedef struct guac_common_ssh_sftp_filesystem {
/**
* The human-readable display name of this filesystem.
*/
char* name;
/**
* The distinct SSH session used for SFTP.
*/
guac_common_ssh_session* ssh_session;
/**
* SFTP session, used for file transfers.
*/
LIBSSH2_SFTP* sftp_session;
/**
* The path to the directory to expose to the user as a filesystem object.
*/
char root_path[GUAC_COMMON_SSH_SFTP_MAX_PATH];
/**
* The path files will be sent to, if uploaded directly via a "file"
* instruction.
*/
char upload_path[GUAC_COMMON_SSH_SFTP_MAX_PATH];
/**
* If downloads from SFTP to the local browser should be disabled.
*/
int disable_download;
/**
* If uploads from the local browser to SFTP should be disabled.
*/
int disable_upload;
} guac_common_ssh_sftp_filesystem;
/**
* The current state of a directory listing operation.
*/
typedef struct guac_common_ssh_sftp_ls_state {
/**
* The SFTP filesystem being listed.
*/
guac_common_ssh_sftp_filesystem* filesystem;
/**
* Reference to the directory currently being listed over SFTP. This
* directory must already be open from a call to libssh2_sftp_opendir().
*/
LIBSSH2_SFTP_HANDLE* directory;
/**
* The absolute path of the directory being listed.
*/
char directory_name[GUAC_COMMON_SSH_SFTP_MAX_PATH];
/**
* The current state of the JSON directory object being written.
*/
guac_common_json_state json_state;
} guac_common_ssh_sftp_ls_state;
/**
* Creates a new Guacamole filesystem object which provides access to files
* and directories via SFTP using the given SSH session. When the filesystem
* will no longer be used, it must be explicitly destroyed with
* guac_common_ssh_destroy_sftp_filesystem(). The resulting object is not
* automatically exposed to users of the connection - filesystem operations
* must be mediated either through various handlers or through exposing a
* filesystem guac_object via guac_common_ssh_alloc_sftp_filesystem_object().
*
* @param session
* The session to use to provide SFTP. This session will automatically be
* destroyed when this filesystem is destroyed.
*
* @param root_path
* The path accessible via SFTP to consider the root path of the filesystem
* exposed to the user. Only the contents of this path will be available
* via the filesystem object.
*
* @param name
* The name to send as the name of the filesystem whenever it is exposed
* to a user, or NULL to automatically generate a name from the provided
* root_path.
*
* @param disable_download
* Whether downloads from the SFTP share to the local browser should be
* disabled.
*
* @param disable_upload
* Whether uploads from the local browser to SFTP should be disabled.
*
* @return
* A new SFTP filesystem object, not yet exposed to users.
*/
guac_common_ssh_sftp_filesystem* guac_common_ssh_create_sftp_filesystem(
guac_common_ssh_session* session, const char* root_path,
const char* name, int disable_download, int disable_upload);
/**
* Destroys the given filesystem object, disconnecting from SFTP and freeing
* and associated resources. Any associated session or user objects must be
* explicitly destroyed.
*
* @param filesystem
* The filesystem object to destroy.
*/
void guac_common_ssh_destroy_sftp_filesystem(
guac_common_ssh_sftp_filesystem* filesystem);
/**
* Creates and exposes a new filesystem guac_object to the given user,
* providing access to the files within the given SFTP filesystem. The
* allocated guac_object must eventually be freed via guac_user_free_object().
*
* @param filesystem
* The filesystem object to expose.
*
* @param user
* The user that the SFTP filesystem should be exposed to.
*
* @return
* A new Guacamole filesystem object, configured to use SFTP for uploading
* and downloading files.
*/
guac_object* guac_common_ssh_alloc_sftp_filesystem_object(
guac_common_ssh_sftp_filesystem* filesystem, guac_user* user);
/**
* Allocates a new filesystem guac_object for the given user, returning the
* resulting guac_object. This function is provided for convenience, as it is
* can be used as the callback for guac_client_foreach_user() or
* guac_client_for_owner(). Note that this guac_object will be tracked
* internally by libguac, will be provided to us in the parameters of handlers
* related to that guac_object, and will automatically be freed when the
* associated guac_user is freed, so the return value of this function can
* safely be ignored.
*
* If either the given user or the given filesystem are NULL, then this
* function has no effect.
*
* @param user
* The use to expose the filesystem to, or NULL if nothing should be
* exposed.
*
* @param data
* A pointer to the guac_common_ssh_sftp_filesystem instance to expose
* to the given user, or NULL if nothing should be exposed.
*
* @return
* The guac_object allocated for the newly-exposed filesystem, or NULL if
* no filesystem object could be allocated.
*/
void* guac_common_ssh_expose_sftp_filesystem(guac_user* user, void* data);
/**
* Initiates an SFTP file download to the user via the Guacamole "file"
* instruction. The download will be automatically monitored and continued
* after this function terminates in response to "ack" instructions received by
* the user.
*
* @param filesystem
* The filesystem containing the file to be downloaded.
*
* @param user
* The user that should receive the file (via a "file" instruction).
*
* @param filename
* The filename of the file to download, relative to the given filesystem.
*
* @return
* The file stream created for the file download, already configured to
* properly handle "ack" responses, etc. from the user.
*/
guac_stream* guac_common_ssh_sftp_download_file(
guac_common_ssh_sftp_filesystem* filesystem, guac_user* user,
char* filename);
/**
* Handles an incoming stream from a Guacamole "file" instruction, saving the
* contents of that stream to the file having the given name within the
* upload directory set by guac_common_ssh_sftp_set_upload_path().
*
* @param filesystem
* The filesystem that should receive the uploaded file.
*
* @param user
* The user who is attempting to open the file stream (the user that sent
* the "file" instruction).
*
* @param stream
* The stream through which the uploaded file data will be received.
*
* @param mimetype
* The mimetype of the data being received.
*
* @param filename
* The filename of the file to write to. This filename will always be taken
* relative to the upload path set by
* guac_common_ssh_sftp_set_upload_path().
*
* @return
* Zero if the incoming stream has been handled successfully, non-zero on
* failure.
*/
int guac_common_ssh_sftp_handle_file_stream(
guac_common_ssh_sftp_filesystem* filesystem, guac_user* user,
guac_stream* stream, char* mimetype, char* filename);
/**
* Set the destination directory for future uploads submitted via
* guac_common_ssh_sftp_handle_file_stream(). This function has no bearing
* on the destination directories of files uploaded with "put" instructions.
*
* @param filesystem
* The filesystem to set the upload path of.
*
* @param path
* The path to use for future uploads submitted via the
* guac_common_ssh_sftp_handle_file_stream() function.
*/
void guac_common_ssh_sftp_set_upload_path(
guac_common_ssh_sftp_filesystem* filesystem, const char* path);
/**
* Given an arbitrary absolute path, which may contain "..", ".", and
* backslashes, creates an equivalent absolute path which does NOT contain
* relative path components (".." or "."), backslashes, or empty path
* components. With the exception of paths referring to the root directory, the
* resulting path is guaranteed to not contain trailing slashes.
*
* Normalization will fail if the given path is not absolute, is too long, or
* contains more than GUAC_COMMON_SSH_SFTP_MAX_DEPTH path components.
*
* @param fullpath
* The buffer to populate with the normalized path. The normalized path
* will not contain relative path components like ".." or ".", nor will it
* contain backslashes. This buffer MUST be at least
* GUAC_COMMON_SSH_SFTP_MAX_PATH bytes in size.
*
* @param path
* The absolute path to normalize.
*
* @return
* Non-zero if normalization succeeded, zero otherwise.
*/
int guac_common_ssh_sftp_normalize_path(char* fullpath,
const char* path);
#endif

View File

@ -0,0 +1,155 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#ifndef GUAC_COMMON_SSH_H
#define GUAC_COMMON_SSH_H
#include "user.h"
#include <guacamole/client.h>
#include <libssh2.h>
/**
* Handler for retrieving additional credentials.
*
* @param client
* The Guacamole Client associated with this need for additional
* credentials.
*
* @param cred_name
* The name of the credential being requested, which will be shared
* with the client in order to generate a meaningful prompt.
*
* @return
* A newly-allocated string containing the credentials provided by
* the user, which must be freed by a call to free().
*/
typedef char* guac_ssh_credential_handler(guac_client* client, char* cred_name);
/**
* An SSH session, backed by libssh2 and associated with a particular
* Guacamole client.
*/
typedef struct guac_common_ssh_session {
/**
* The Guacamole client using this SSH session.
*/
guac_client* client;
/**
* The user that will be authenticating via SSH.
*/
guac_common_ssh_user* user;
/**
* The underlying SSH session from libssh2.
*/
LIBSSH2_SESSION* session;
/**
* The file descriptor of the socket being used for the SSH connection.
*/
int fd;
/**
* Callback function to retrieve credentials.
*/
guac_ssh_credential_handler* credential_handler;
} guac_common_ssh_session;
/**
* Initializes the underlying SSH and encryption libraries used by Guacamole.
* This function must be called before any other guac_common_ssh_*() functions
* are called.
*
* @param client
* The Guacamole client that will be using SSH.
*
* @return
* Zero if initialization, or non-zero if an error occurs.
*/
int guac_common_ssh_init(guac_client* client);
/**
* Cleans up the underlying SSH and encryption libraries used by Guacamole.
* This function must be called once no other guac_common_ssh_*() functions
* will be used.
*/
void guac_common_ssh_uninit();
/**
* Connects to the SSH server running at the given hostname and port, and
* authenticates as the given user. If an error occurs while connecting or
* authenticating, the Guacamole client will automatically and fatally abort.
* The user object provided must eventually be explicitly destroyed, but should
* not be destroyed until this session is destroyed, assuming the session is
* successfully created.
*
* @param client
* The Guacamole client that will be using SSH.
*
* @param hostname
* The hostname of the SSH server to connect to.
*
* @param port
* The port to connect to on the given hostname.
*
* @param user
* The user to authenticate as, once connected.
*
* @param keepalive
* How frequently the connection should send keepalive packets, in
* seconds. Zero disables keepalive packets, and 2 is the minimum
* configurable value.
*
* @param host_key
* The known public host key of the server, as provided by the client. If
* provided the identity of the server will be checked against this key,
* and a mis-match between this and the server identity will cause the
* connection to fail. If not provided, no checks will be done and the
* connection will proceed.
*
* @param credential_handler
* The handler function for retrieving additional credentials from the user
* as required by the SSH server, or NULL if the user will not be asked
* for additional credentials.
*
* @return
* A new SSH session if the connection and authentication succeed, or NULL
* if the connection or authentication were not successful.
*/
guac_common_ssh_session* guac_common_ssh_create_session(guac_client* client,
const char* hostname, const char* port, guac_common_ssh_user* user,
int keepalive, const char* host_key,
guac_ssh_credential_handler* credential_handler);
/**
* Disconnects and destroys the given SSH session, freeing all associated
* resources. Any associated user must be explicitly destroyed, and will not
* be destroyed automatically.
*
* @param session
* The SSH session to destroy.
*/
void guac_common_ssh_destroy_session(guac_common_ssh_session* session);
#endif

View File

@ -0,0 +1,108 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#ifndef GUAC_COMMON_SSH_USER_H
#define GUAC_COMMON_SSH_USER_H
#include "key.h"
/**
* Data describing an SSH user, including their credentials.
*/
typedef struct guac_common_ssh_user {
/**
* The username of this user.
*/
char* username;
/**
* The password which should be used to authenticate this user, if any, or
* NULL if a private key will be used instead.
*/
char* password;
/**
* The private key which should be used to authenticate this user, if any,
* or NULL if a password will be used instead.
*/
guac_common_ssh_key* private_key;
} guac_common_ssh_user;
/**
* Creates a new SSH user with the given username. When additionally populated
* with a password or private key, this user can then be used for
* authentication.
*
* @param username
* The username of the user being created.
*
* @return
* A new SSH user having the given username, but no associated password
* or private key.
*/
guac_common_ssh_user* guac_common_ssh_create_user(const char* username);
/**
* Destroys the given user object, releasing all associated resources.
*
* @param user
* The user to destroy.
*/
void guac_common_ssh_destroy_user(guac_common_ssh_user* user);
/**
* Associates the given user with the given password, such that that password
* is used for future authentication attempts.
*
* @param user
* The user to associate with the given password.
*
* @param password
* The password to associate with the given user.
*/
void guac_common_ssh_user_set_password(guac_common_ssh_user* user,
const char* password);
/**
* Imports the given private key, associating that key with the given user. If
* necessary to decrypt the key, a passphrase may be specified. The private key
* must be provided in base64 form. If the private key is imported
* successfully, it will be used for future authentication attempts.
*
* @param user
* The user to associate with the given private key.
*
* @param private_key
* The base64-encoded private key to import.
*
* @param passphrase
* The passphrase to use to decrypt the given private key, or NULL if no
* passphrase should be used.
*
* @return
* Zero if the private key is successfully imported, or non-zero if the
* private key could not be imported due to an error.
*/
int guac_common_ssh_user_import_key(guac_common_ssh_user* user,
char* private_key, char* passphrase);
#endif

248
src/common-ssh/key.c Normal file
View File

@ -0,0 +1,248 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#include "config.h"
#include "common-ssh/buffer.h"
#include "common-ssh/key.h"
#include <guacamole/string.h>
#include <openssl/bio.h>
#include <openssl/bn.h>
#include <openssl/dsa.h>
#include <openssl/err.h>
#include <openssl/evp.h>
#include <openssl/obj_mac.h>
#include <openssl/pem.h>
#include <openssl/rsa.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
/**
* Check for a PKCS#1/PKCS#8 ENCRYPTED marker.
*
* @param data
* The buffer to scan.
* @param length
* The length of the buffer.
*
* @return
* True if the buffer contains the marker, false otherwise.
*/
static bool is_pkcs_encrypted_key(char* data, int length) {
return guac_strnstr(data, "ENCRYPTED", length) != NULL;
}
/**
* Check for a PEM header & initial base64-encoded data indicating this is an
* OpenSSH v1 key.
*
* @param data
* The buffer to scan.
* @param length
* The length of the buffer.
*
* @return
* True if the buffer contains a private key, false otherwise.
*/
static bool is_ssh_private_key(char* data, int length) {
if (length < sizeof(OPENSSH_V1_KEY_HEADER) - 1) {
return false;
}
return !strncmp(data, OPENSSH_V1_KEY_HEADER, sizeof(OPENSSH_V1_KEY_HEADER) - 1);
}
/**
* Assuming an offset into a key past the header, check for the base64-encoded
* data indicating this key is not protected by a passphrase.
*
* @param data
* The buffer to scan.
* @param length
* The length of the buffer.
*
* @return
* True if the buffer contains an unencrypted key, false otherwise.
*/
static bool is_ssh_key_unencrypted(char* data, int length) {
if (length < sizeof(OPENSSH_V1_UNENCRYPTED_KEY) - 1) {
return false;
}
return !strncmp(data, OPENSSH_V1_UNENCRYPTED_KEY, sizeof(OPENSSH_V1_UNENCRYPTED_KEY) - 1);
}
/**
* A passphrase is needed if the key is an encrypted PKCS#1/PKCS#8 key OR if
* the key is both an OpenSSH v1 key AND there isn't a marker indicating the
* key is unprotected.
*
* @param data
* The buffer to scan.
* @param length
* The length of the buffer.
*
* @return
* True if the buffer contains a key needing a passphrase, false otherwise.
*/
static bool is_passphrase_needed(char* data, int length) {
/* Is this an encrypted PKCS#1/PKCS#8 key? */
if (is_pkcs_encrypted_key(data, length)) {
return true;
}
/* Is this an OpenSSH v1 key? */
if (is_ssh_private_key(data, length)) {
/* This is safe due to the check in is_ssh_private_key. */
data += sizeof(OPENSSH_V1_KEY_HEADER) - 1;
length -= sizeof(OPENSSH_V1_KEY_HEADER) - 1;
/* If this is NOT unprotected, we need a passphrase. */
if (!is_ssh_key_unencrypted(data, length)) {
return true;
}
}
return false;
}
guac_common_ssh_key* guac_common_ssh_key_alloc(char* data, int length,
char* passphrase) {
/* Because libssh2 will do the actual key parsing (to let it deal with
* different key algorithms) we need to perform a heuristic here to check
* if a passphrase is needed. This could allow junk keys through that
* would never be able to auth. libssh2 should display errors to help
* admins track down malformed keys and delete or replace them.
*/
if (is_passphrase_needed(data, length) && (passphrase == NULL || *passphrase == '\0'))
return NULL;
guac_common_ssh_key* key = malloc(sizeof(guac_common_ssh_key));
/* Copy private key to structure */
key->private_key_length = length;
key->private_key = malloc(length);
memcpy(key->private_key, data, length);
key->passphrase = strdup(passphrase);
return key;
}
const char* guac_common_ssh_key_error() {
/* Return static error string */
return ERR_reason_error_string(ERR_get_error());
}
void guac_common_ssh_key_free(guac_common_ssh_key* key) {
free(key->private_key);
free(key->passphrase);
free(key);
}
int guac_common_ssh_verify_host_key(LIBSSH2_SESSION* session, guac_client* client,
const char* host_key, const char* hostname, int port, const char* remote_hostkey,
const size_t remote_hostkey_len) {
LIBSSH2_KNOWNHOSTS* ssh_known_hosts = libssh2_knownhost_init(session);
int known_hosts = 0;
/* Add host key provided from settings */
if (host_key && strcmp(host_key, "") != 0) {
known_hosts = libssh2_knownhost_readline(ssh_known_hosts, host_key, strlen(host_key),
LIBSSH2_KNOWNHOST_FILE_OPENSSH);
/* readline function returns 0 on success, so we increment to indicate a valid entry */
if (known_hosts == 0)
known_hosts++;
}
/* Otherwise, we look for a ssh_known_hosts file within GUACAMOLE_HOME and read that in. */
else {
const char *guac_known_hosts = "/etc/guacamole/ssh_known_hosts";
if (access(guac_known_hosts, F_OK) != -1)
known_hosts = libssh2_knownhost_readfile(ssh_known_hosts, guac_known_hosts, LIBSSH2_KNOWNHOST_FILE_OPENSSH);
}
/* If there's an error provided, abort connection and return that. */
if (known_hosts < 0) {
char* errmsg;
int errval = libssh2_session_last_error(session, &errmsg, NULL, 0);
guac_client_log(client, GUAC_LOG_ERROR,
"Error %d trying to load SSH host keys: %s", errval, errmsg);
libssh2_knownhost_free(ssh_known_hosts);
return known_hosts;
}
/* No host keys were loaded, so we bail out checking and continue the connection. */
else if (known_hosts == 0) {
guac_client_log(client, GUAC_LOG_WARNING,
"No known host keys provided, host identity will not be verified.");
libssh2_knownhost_free(ssh_known_hosts);
return known_hosts;
}
/* Check remote host key against known hosts */
int kh_check = libssh2_knownhost_checkp(ssh_known_hosts, hostname, port,
remote_hostkey, remote_hostkey_len,
LIBSSH2_KNOWNHOST_TYPE_PLAIN|
LIBSSH2_KNOWNHOST_KEYENC_RAW,
NULL);
/* Deal with the return of the host key check */
switch (kh_check) {
case LIBSSH2_KNOWNHOST_CHECK_MATCH:
guac_client_log(client, GUAC_LOG_DEBUG,
"Host key match found for %s", hostname);
break;
case LIBSSH2_KNOWNHOST_CHECK_NOTFOUND:
guac_client_log(client, GUAC_LOG_ERROR,
"Host key not found for %s.", hostname);
break;
case LIBSSH2_KNOWNHOST_CHECK_MISMATCH:
guac_client_log(client, GUAC_LOG_ERROR,
"Host key does not match known hosts entry for %s", hostname);
break;
case LIBSSH2_KNOWNHOST_CHECK_FAILURE:
default:
guac_client_log(client, GUAC_LOG_ERROR,
"Host %s could not be checked against known hosts.",
hostname);
}
/* Return the check value */
libssh2_knownhost_free(ssh_known_hosts);
return kh_check;
}

1016
src/common-ssh/sftp.c Normal file

File diff suppressed because it is too large Load Diff

602
src/common-ssh/ssh.c Normal file
View File

@ -0,0 +1,602 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#include "common-ssh/key.h"
#include "common-ssh/ssh.h"
#include "common-ssh/user.h"
#include <guacamole/client.h>
#include <guacamole/fips.h>
#include <libssh2.h>
#ifdef LIBSSH2_USES_GCRYPT
#include <gcrypt.h>
#endif
#include <openssl/err.h>
#include <openssl/ssl.h>
#include <errno.h>
#include <netdb.h>
#include <netinet/in.h>
#include <pthread.h>
#include <pwd.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <unistd.h>
#ifdef LIBSSH2_USES_GCRYPT
GCRY_THREAD_OPTION_PTHREAD_IMPL;
#endif
/**
* A list of all key exchange algorithms that are both FIPS-compliant, and
* OpenSSL-supported. Note that "ext-info-c" is also included. While not a key
* exchange algorithm per se, it must be in the list to ensure that the server
* will send a SSH_MSG_EXT_INFO response, which is required to perform RSA key
* upgrades.
*/
#define FIPS_COMPLIANT_KEX_ALGORITHMS "diffie-hellman-group-exchange-sha256,ext-info-c"
/**
* A list of ciphers that are both FIPS-compliant, and OpenSSL-supported.
*/
#define FIPS_COMPLIANT_CIPHERS "aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,aes192-cbc,aes256-cbc"
#ifdef OPENSSL_REQUIRES_THREADING_CALLBACKS
/**
* Array of mutexes, used by OpenSSL.
*/
static pthread_mutex_t* guac_common_ssh_openssl_locks = NULL;
/**
* Called by OpenSSL when locking or unlocking the Nth mutex.
*
* @param mode
* A bitmask denoting the action to be taken on the Nth lock, such as
* CRYPTO_LOCK or CRYPTO_UNLOCK.
*
* @param n
* The index of the lock to lock or unlock.
*
* @param file
* The filename of the function setting the lock, for debugging purposes.
*
* @param line
* The line number of the function setting the lock, for debugging
* purposes.
*/
static void guac_common_ssh_openssl_locking_callback(int mode, int n,
const char* file, int line){
/* Lock given mutex upon request */
if (mode & CRYPTO_LOCK)
pthread_mutex_lock(&(guac_common_ssh_openssl_locks[n]));
/* Unlock given mutex upon request */
else if (mode & CRYPTO_UNLOCK)
pthread_mutex_unlock(&(guac_common_ssh_openssl_locks[n]));
}
/**
* Called by OpenSSL when determining the current thread ID.
*
* @return
* An ID which uniquely identifies the current thread.
*/
static unsigned long guac_common_ssh_openssl_id_callback() {
return (unsigned long) pthread_self();
}
/**
* Creates the given number of mutexes, such that OpenSSL will have at least
* this number of mutexes at its disposal.
*
* @param count
* The number of mutexes (locks) to create.
*/
static void guac_common_ssh_openssl_init_locks(int count) {
int i;
/* Allocate required number of locks */
guac_common_ssh_openssl_locks =
malloc(sizeof(pthread_mutex_t) * count);
/* Initialize each lock */
for (i=0; i < count; i++)
pthread_mutex_init(&(guac_common_ssh_openssl_locks[i]), NULL);
}
/**
* Frees the given number of mutexes.
*
* @param count
* The number of mutexes (locks) to free.
*/
static void guac_common_ssh_openssl_free_locks(int count) {
int i;
/* SSL lock array was not initialized */
if (guac_common_ssh_openssl_locks == NULL)
return;
/* Free all locks */
for (i=0; i < count; i++)
pthread_mutex_destroy(&(guac_common_ssh_openssl_locks[i]));
/* Free lock array */
free(guac_common_ssh_openssl_locks);
}
#endif
int guac_common_ssh_init(guac_client* client) {
#ifdef LIBSSH2_USES_GCRYPT
if (!gcry_control(GCRYCTL_INITIALIZATION_FINISHED_P)) {
/* Init threadsafety in libgcrypt */
gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
/* Initialize GCrypt */
if (!gcry_check_version(GCRYPT_VERSION)) {
guac_client_log(client, GUAC_LOG_ERROR, "libgcrypt version mismatch.");
return 1;
}
/* Mark initialization as completed. */
gcry_control(GCRYCTL_INITIALIZATION_FINISHED, 0);
}
#endif
#ifdef OPENSSL_REQUIRES_THREADING_CALLBACKS
/* Init threadsafety in OpenSSL */
guac_common_ssh_openssl_init_locks(CRYPTO_num_locks());
CRYPTO_set_id_callback(guac_common_ssh_openssl_id_callback);
CRYPTO_set_locking_callback(guac_common_ssh_openssl_locking_callback);
#endif
#if OPENSSL_VERSION_NUMBER < 0x10100000L
/* Init OpenSSL - only required for OpenSSL Versions < 1.1.0 */
SSL_library_init();
ERR_load_crypto_strings();
#endif
/* Init libssh2 */
libssh2_init(0);
/* Success */
return 0;
}
void guac_common_ssh_uninit() {
#ifdef OPENSSL_REQUIRES_THREADING_CALLBACKS
guac_common_ssh_openssl_free_locks(CRYPTO_num_locks());
#endif
}
/**
* Callback for the keyboard-interactive authentication method. Currently
* supports just one prompt for the password. This callback is invoked as
* needed to fullfill a call to libssh2_userauth_keyboard_interactive().
*
* @param name
* An arbitrary name which should be printed to the terminal for the
* benefit of the user. This is currently ignored.
*
* @param name_len
* The length of the name string, in bytes.
*
* @param instruction
* Arbitrary instructions which should be printed to the terminal for the
* benefit of the user. This is currently ignored.
*
* @param instruction_len
* The length of the instruction string, in bytes.
*
* @param num_prompts
* The number of keyboard-interactive prompts for which responses are
* requested. This callback currently only supports one prompt, and assumes
* that this prompt is requesting the password.
*
* @param prompts
* An array of all keyboard-interactive prompts for which responses are
* requested.
*
* @param responses
* A parallel array into which all prompt responses should be stored. Each
* entry within this array corresponds to the entry in the prompts array
* with the same index.
*
* @param abstract
* The value of the abstract parameter provided when the SSH session was
* created with libssh2_session_init_ex().
*/
static void guac_common_ssh_kbd_callback(const char *name, int name_len,
const char *instruction, int instruction_len, int num_prompts,
const LIBSSH2_USERAUTH_KBDINT_PROMPT *prompts,
LIBSSH2_USERAUTH_KBDINT_RESPONSE *responses,
void **abstract) {
guac_common_ssh_session* common_session =
(guac_common_ssh_session*) *abstract;
guac_client* client = common_session->client;
/* Send password if only one prompt */
if (num_prompts == 1) {
char* password = common_session->user->password;
responses[0].text = strdup(password);
responses[0].length = strlen(password);
}
/* If more than one prompt, a single password is not enough */
else
guac_client_log(client, GUAC_LOG_WARNING,
"Unsupported number of keyboard-interactive prompts: %i",
num_prompts);
}
/**
* Authenticates the user associated with the given session over SSH. All
* required credentials must already be present within the user object
* associated with the given session.
*
* @param session
* The session associated with the user to be authenticated.
*
* @return
* Zero if authentication succeeds, or non-zero if authentication has
* failed.
*/
static int guac_common_ssh_authenticate(guac_common_ssh_session* common_session) {
guac_client* client = common_session->client;
guac_common_ssh_user* user = common_session->user;
LIBSSH2_SESSION* session = common_session->session;
/* Get user credentials */
guac_common_ssh_key* key = user->private_key;
/* Validate username provided */
if (user->username == NULL) {
guac_client_abort(client, GUAC_PROTOCOL_STATUS_CLIENT_UNAUTHORIZED,
"SSH authentication requires a username.");
return 1;
}
/* Get list of supported authentication methods */
size_t username_len = strlen(user->username);
char* user_authlist = libssh2_userauth_list(session, user->username,
username_len);
/* If auth list is NULL, then authentication has succeeded with NONE */
if (user_authlist == NULL) {
guac_client_log(client, GUAC_LOG_DEBUG,
"SSH NONE authentication succeeded.");
return 0;
}
guac_client_log(client, GUAC_LOG_DEBUG,
"Supported authentication methods: %s", user_authlist);
/* Authenticate with private key, if provided */
if (key != NULL) {
/* Check if public key auth is supported on the server */
if (strstr(user_authlist, "publickey") == NULL) {
guac_client_abort(client, GUAC_PROTOCOL_STATUS_CLIENT_UNAUTHORIZED,
"Public key authentication is not supported by "
"the SSH server");
return 1;
}
/* Attempt public key auth */
if (libssh2_userauth_publickey_frommemory(session, user->username,
username_len, NULL, 0, key->private_key,
key->private_key_length, key->passphrase)) {
/* Abort on failure */
char* error_message;
libssh2_session_last_error(session, &error_message, NULL, 0);
guac_client_abort(client, GUAC_PROTOCOL_STATUS_CLIENT_UNAUTHORIZED,
"Public key authentication failed: %s", error_message);
return 1;
}
/* Private key authentication succeeded */
return 0;
}
/* Attempt authentication with username + password. */
if (user->password == NULL && common_session->credential_handler)
user->password = common_session->credential_handler(client, "Password: ");
/* Authenticate with password, if provided */
if (user->password != NULL) {
/* Check if password auth is supported on the server */
if (strstr(user_authlist, "password") != NULL) {
/* Attempt password authentication */
if (libssh2_userauth_password(session, user->username, user->password)) {
/* Abort on failure */
char* error_message;
libssh2_session_last_error(session, &error_message, NULL, 0);
guac_client_abort(client,
GUAC_PROTOCOL_STATUS_CLIENT_UNAUTHORIZED,
"Password authentication failed: %s", error_message);
return 1;
}
/* Password authentication succeeded */
return 0;
}
/* Check if keyboard-interactive auth is supported on the server */
if (strstr(user_authlist, "keyboard-interactive") != NULL) {
/* Attempt keyboard-interactive auth using provided password */
if (libssh2_userauth_keyboard_interactive(session, user->username,
&guac_common_ssh_kbd_callback)) {
/* Abort on failure */
char* error_message;
libssh2_session_last_error(session, &error_message, NULL, 0);
guac_client_abort(client,
GUAC_PROTOCOL_STATUS_CLIENT_UNAUTHORIZED,
"Keyboard-interactive authentication failed: %s",
error_message);
return 1;
}
/* Keyboard-interactive authentication succeeded */
return 0;
}
/* No known authentication types available */
guac_client_abort(client, GUAC_PROTOCOL_STATUS_CLIENT_UNAUTHORIZED,
"Password and keyboard-interactive authentication are not "
"supported by the SSH server");
return 1;
}
/* No credentials provided */
guac_client_abort(client, GUAC_PROTOCOL_STATUS_CLIENT_UNAUTHORIZED,
"SSH authentication requires either a private key or a password.");
return 1;
}
guac_common_ssh_session* guac_common_ssh_create_session(guac_client* client,
const char* hostname, const char* port, guac_common_ssh_user* user,
int keepalive, const char* host_key,
guac_ssh_credential_handler* credential_handler) {
int retval;
int fd;
struct addrinfo* addresses;
struct addrinfo* current_address;
char connected_address[1024];
char connected_port[64];
struct addrinfo hints = {
.ai_family = AF_UNSPEC,
.ai_socktype = SOCK_STREAM,
.ai_protocol = IPPROTO_TCP
};
/* Get addresses connection */
if ((retval = getaddrinfo(hostname, port, &hints, &addresses))) {
guac_client_abort(client, GUAC_PROTOCOL_STATUS_SERVER_ERROR,
"Error parsing given address or port: %s",
gai_strerror(retval));
return NULL;
}
/* Attempt connection to each address until success */
current_address = addresses;
while (current_address != NULL) {
/* Resolve hostname */
if ((retval = getnameinfo(current_address->ai_addr,
current_address->ai_addrlen,
connected_address, sizeof(connected_address),
connected_port, sizeof(connected_port),
NI_NUMERICHOST | NI_NUMERICSERV)))
guac_client_log(client, GUAC_LOG_DEBUG,
"Unable to resolve host: %s", gai_strerror(retval));
/* Get socket */
fd = socket(current_address->ai_family, SOCK_STREAM, 0);
if (fd < 0) {
guac_client_abort(client, GUAC_PROTOCOL_STATUS_SERVER_ERROR,
"Unable to create socket: %s", strerror(errno));
freeaddrinfo(addresses);
return NULL;
}
/* Connect */
if (connect(fd, current_address->ai_addr,
current_address->ai_addrlen) == 0) {
guac_client_log(client, GUAC_LOG_DEBUG,
"Successfully connected to host %s, port %s",
connected_address, connected_port);
/* Done if successful connect */
break;
}
/* Otherwise log information regarding bind failure */
guac_client_log(client, GUAC_LOG_DEBUG, "Unable to connect to "
"host %s, port %s: %s",
connected_address, connected_port, strerror(errno));
close(fd);
current_address = current_address->ai_next;
}
/* Free addrinfo */
freeaddrinfo(addresses);
/* If unable to connect to anything, fail */
if (current_address == NULL) {
guac_client_abort(client, GUAC_PROTOCOL_STATUS_UPSTREAM_NOT_FOUND,
"Unable to connect to any addresses.");
return NULL;
}
/* Allocate new session */
guac_common_ssh_session* common_session =
malloc(sizeof(guac_common_ssh_session));
/* Open SSH session */
LIBSSH2_SESSION* session = libssh2_session_init_ex(NULL, NULL,
NULL, common_session);
if (session == NULL) {
guac_client_abort(client, GUAC_PROTOCOL_STATUS_SERVER_ERROR,
"Session allocation failed.");
free(common_session);
close(fd);
return NULL;
}
/*
* If FIPS mode is enabled, prefer only FIPS-compatible algorithms and
* ciphers that are also supported by libssh2. For more info, see:
* https://csrc.nist.gov/CSRC/media/projects/cryptographic-module-validation-program/documents/security-policies/140sp2906.pdf
*/
if (guac_fips_enabled()) {
libssh2_session_method_pref(session, LIBSSH2_METHOD_KEX, FIPS_COMPLIANT_KEX_ALGORITHMS);
libssh2_session_method_pref(session, LIBSSH2_METHOD_CRYPT_CS, FIPS_COMPLIANT_CIPHERS);
libssh2_session_method_pref(session, LIBSSH2_METHOD_CRYPT_SC, FIPS_COMPLIANT_CIPHERS);
}
/* Perform handshake */
if (libssh2_session_handshake(session, fd)) {
guac_client_abort(client, GUAC_PROTOCOL_STATUS_UPSTREAM_ERROR,
"SSH handshake failed.");
free(common_session);
close(fd);
return NULL;
}
/* Get host key of remote system we're connecting to */
size_t remote_hostkey_len;
const char *remote_hostkey = libssh2_session_hostkey(session, &remote_hostkey_len, NULL);
/* Failure to retrieve a host key means we should abort */
if (!remote_hostkey) {
guac_client_abort(client, GUAC_PROTOCOL_STATUS_SERVER_ERROR,
"Failed to get host key for %s", hostname);
free(common_session);
close(fd);
return NULL;
}
/* SSH known host key checking. */
int known_host_check = guac_common_ssh_verify_host_key(session, client, host_key,
hostname, atoi(port), remote_hostkey,
remote_hostkey_len);
/* Abort on any error codes */
if (known_host_check != 0) {
char* err_msg;
libssh2_session_last_error(session, &err_msg, NULL, 0);
if (known_host_check < 0)
guac_client_abort(client, GUAC_PROTOCOL_STATUS_SERVER_ERROR,
"Error occurred attempting to check host key: %s", err_msg);
if (known_host_check > 0)
guac_client_abort(client, GUAC_PROTOCOL_STATUS_SERVER_ERROR,
"Host key did not match any provided known host keys. %s", err_msg);
free(common_session);
close(fd);
return NULL;
}
/* Store basic session data */
common_session->client = client;
common_session->user = user;
common_session->session = session;
common_session->fd = fd;
common_session->credential_handler = credential_handler;
/* Attempt authentication */
if (guac_common_ssh_authenticate(common_session)) {
free(common_session);
close(fd);
return NULL;
}
/* Warn if keepalive below minimum value */
if (keepalive < 0) {
keepalive = 0;
guac_client_log(client, GUAC_LOG_WARNING, "negative keepalive intervals "
"are converted to 0, disabling keepalive.");
}
else if (keepalive == 1) {
guac_client_log(client, GUAC_LOG_WARNING, "keepalive interval will "
"be rounded up to minimum value of 2.");
}
/* Configure session keepalive */
libssh2_keepalive_config(common_session->session, 1, keepalive);
/* Return created session */
return common_session;
}
void guac_common_ssh_destroy_session(guac_common_ssh_session* session) {
/* Disconnect and clean up libssh2 */
libssh2_session_disconnect(session->session, "Bye");
libssh2_session_free(session->session);
/* Free all other data */
free(session);
}

View File

@ -0,0 +1,67 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# NOTE: Parts of this file (Makefile.am) are automatically transcluded verbatim
# into Makefile.in. Though the build system (GNU Autotools) automatically adds
# its own license boilerplate to the generated Makefile.in, that boilerplate
# does not apply to the transcluded portions of Makefile.am which are licensed
# to you by the ASF under the Apache License, Version 2.0, as described above.
#
AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I m4
#
# Unit tests for common SSH support
#
check_PROGRAMS = test_common_ssh
TESTS = $(check_PROGRAMS)
test_common_ssh_SOURCES = \
sftp/normalize_path.c
test_common_ssh_CFLAGS = \
-Werror -Wall -pedantic \
@COMMON_INCLUDE@ \
@COMMON_SSH_INCLUDE@ \
@LIBGUAC_INCLUDE@
test_common_ssh_LDADD = \
@CUNIT_LIBS@ \
@COMMON_SSH_LTLIB@ \
@COMMON_LTLIB@
#
# Autogenerate test runner
#
GEN_RUNNER = $(top_srcdir)/util/generate-test-runner.pl
CLEANFILES = _generated_runner.c
_generated_runner.c: $(test_common_ssh_SOURCES)
$(AM_V_GEN) $(GEN_RUNNER) $(test_common_ssh_SOURCES) > $@
nodist_test_common_ssh_SOURCES = \
_generated_runner.c
# Use automake's TAP test driver for running any tests
LOG_DRIVER = \
env AM_TAP_AWK='$(AWK)' \
$(SHELL) $(top_srcdir)/build-aux/tap-driver.sh

View File

@ -0,0 +1,263 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#include "common-ssh/sftp.h"
#include <CUnit/CUnit.h>
#include <stdlib.h>
/**
* Test which verifies absolute Windows-style paths are correctly normalized to
* absolute paths with UNIX separators and no relative components.
*/
void test_sftp__normalize_absolute_windows() {
char normalized[GUAC_COMMON_SSH_SFTP_MAX_PATH];
CU_ASSERT_NOT_EQUAL(guac_common_ssh_sftp_normalize_path(normalized, "\\"), 0);
CU_ASSERT_NSTRING_EQUAL(normalized, "/", sizeof(normalized));
CU_ASSERT_NOT_EQUAL(guac_common_ssh_sftp_normalize_path(normalized, "\\foo\\bar\\baz"), 0);
CU_ASSERT_NSTRING_EQUAL(normalized, "/foo/bar/baz", sizeof(normalized));
CU_ASSERT_NOT_EQUAL(guac_common_ssh_sftp_normalize_path(normalized, "\\foo\\bar\\..\\baz\\"), 0);
CU_ASSERT_NSTRING_EQUAL(normalized, "/foo/baz", sizeof(normalized));
CU_ASSERT_NOT_EQUAL(guac_common_ssh_sftp_normalize_path(normalized, "\\foo\\bar\\..\\..\\baz\\a\\..\\b"), 0);
CU_ASSERT_NSTRING_EQUAL(normalized, "/baz/b", sizeof(normalized));
CU_ASSERT_NOT_EQUAL(guac_common_ssh_sftp_normalize_path(normalized, "\\foo\\.\\bar\\baz"), 0);
CU_ASSERT_NSTRING_EQUAL(normalized, "/foo/bar/baz", sizeof(normalized));
CU_ASSERT_NOT_EQUAL(guac_common_ssh_sftp_normalize_path(normalized, "\\foo\\bar\\..\\..\\..\\..\\..\\..\\baz"), 0);
CU_ASSERT_NSTRING_EQUAL(normalized, "/baz", sizeof(normalized));
}
/**
* Test which verifies absolute UNIX-style paths are correctly normalized to
* absolute paths with UNIX separators and no relative components.
*/
void test_sftp__normalize_absolute_unix() {
char normalized[GUAC_COMMON_SSH_SFTP_MAX_PATH];
CU_ASSERT_NOT_EQUAL(guac_common_ssh_sftp_normalize_path(normalized, "/"), 0);
CU_ASSERT_NSTRING_EQUAL(normalized, "/", sizeof(normalized));
CU_ASSERT_NOT_EQUAL(guac_common_ssh_sftp_normalize_path(normalized, "/foo/bar/baz"), 0);
CU_ASSERT_NSTRING_EQUAL(normalized, "/foo/bar/baz", sizeof(normalized));
CU_ASSERT_NOT_EQUAL(guac_common_ssh_sftp_normalize_path(normalized, "/foo/bar/../baz/"), 0);
CU_ASSERT_NSTRING_EQUAL(normalized, "/foo/baz", sizeof(normalized));
CU_ASSERT_NOT_EQUAL(guac_common_ssh_sftp_normalize_path(normalized, "/foo/bar/../../baz/a/../b"), 0);
CU_ASSERT_NSTRING_EQUAL(normalized, "/baz/b", sizeof(normalized));
CU_ASSERT_NOT_EQUAL(guac_common_ssh_sftp_normalize_path(normalized, "/foo/./bar/baz"), 0);
CU_ASSERT_NSTRING_EQUAL(normalized, "/foo/bar/baz", sizeof(normalized));
CU_ASSERT_NOT_EQUAL(guac_common_ssh_sftp_normalize_path(normalized, "/foo/bar/../../../../../../baz"), 0);
CU_ASSERT_NSTRING_EQUAL(normalized, "/baz", sizeof(normalized));
}
/**
* Test which verifies absolute paths consisting of mixed Windows and UNIX path
* separators are correctly normalized to absolute paths with UNIX separators
* and no relative components.
*/
void test_sftp__normalize_absolute_mixed() {
char normalized[GUAC_COMMON_SSH_SFTP_MAX_PATH];
CU_ASSERT_NOT_EQUAL(guac_common_ssh_sftp_normalize_path(normalized, "\\foo/bar\\baz"), 0);
CU_ASSERT_NSTRING_EQUAL(normalized, "/foo/bar/baz", sizeof(normalized));
CU_ASSERT_NOT_EQUAL(guac_common_ssh_sftp_normalize_path(normalized, "/foo\\bar/..\\baz/"), 0);
CU_ASSERT_NSTRING_EQUAL(normalized, "/foo/baz", sizeof(normalized));
CU_ASSERT_NOT_EQUAL(guac_common_ssh_sftp_normalize_path(normalized, "\\foo/bar\\../../baz\\a\\..\\b"), 0);
CU_ASSERT_NSTRING_EQUAL(normalized, "/baz/b", sizeof(normalized));
CU_ASSERT_NOT_EQUAL(guac_common_ssh_sftp_normalize_path(normalized, "\\foo\\.\\bar/baz"), 0);
CU_ASSERT_NSTRING_EQUAL(normalized, "/foo/bar/baz", sizeof(normalized));
CU_ASSERT_NOT_EQUAL(guac_common_ssh_sftp_normalize_path(normalized, "\\foo/bar\\../..\\..\\..\\../..\\baz"), 0);
CU_ASSERT_NSTRING_EQUAL(normalized, "/baz", sizeof(normalized));
}
/**
* Test which verifies relative Windows-style paths are always rejected.
*/
void test_sftp__normalize_relative_windows() {
char normalized[GUAC_COMMON_SSH_SFTP_MAX_PATH];
CU_ASSERT_EQUAL(guac_common_ssh_sftp_normalize_path(normalized, ""), 0);
CU_ASSERT_EQUAL(guac_common_ssh_sftp_normalize_path(normalized, "."), 0);
CU_ASSERT_EQUAL(guac_common_ssh_sftp_normalize_path(normalized, ".."), 0);
CU_ASSERT_EQUAL(guac_common_ssh_sftp_normalize_path(normalized, "foo"), 0);
CU_ASSERT_EQUAL(guac_common_ssh_sftp_normalize_path(normalized, ".\\foo"), 0);
CU_ASSERT_EQUAL(guac_common_ssh_sftp_normalize_path(normalized, "..\\foo"), 0);
CU_ASSERT_EQUAL(guac_common_ssh_sftp_normalize_path(normalized, "foo\\bar\\baz"), 0);
CU_ASSERT_EQUAL(guac_common_ssh_sftp_normalize_path(normalized, ".\\foo\\bar\\baz"), 0);
CU_ASSERT_EQUAL(guac_common_ssh_sftp_normalize_path(normalized, "..\\foo\\bar\\baz"), 0);
}
/**
* Test which verifies relative UNIX-style paths are always rejected.
*/
void test_sftp__normalize_relative_unix() {
char normalized[GUAC_COMMON_SSH_SFTP_MAX_PATH];
CU_ASSERT_EQUAL(guac_common_ssh_sftp_normalize_path(normalized, ""), 0);
CU_ASSERT_EQUAL(guac_common_ssh_sftp_normalize_path(normalized, "."), 0);
CU_ASSERT_EQUAL(guac_common_ssh_sftp_normalize_path(normalized, ".."), 0);
CU_ASSERT_EQUAL(guac_common_ssh_sftp_normalize_path(normalized, "foo"), 0);
CU_ASSERT_EQUAL(guac_common_ssh_sftp_normalize_path(normalized, "./foo"), 0);
CU_ASSERT_EQUAL(guac_common_ssh_sftp_normalize_path(normalized, "../foo"), 0);
CU_ASSERT_EQUAL(guac_common_ssh_sftp_normalize_path(normalized, "foo/bar/baz"), 0);
CU_ASSERT_EQUAL(guac_common_ssh_sftp_normalize_path(normalized, "./foo/bar/baz"), 0);
CU_ASSERT_EQUAL(guac_common_ssh_sftp_normalize_path(normalized, "../foo/bar/baz"), 0);
}
/**
* Test which verifies relative paths consisting of mixed Windows and UNIX path
* separators are always rejected.
*/
void test_sftp__normalize_relative_mixed() {
char normalized[GUAC_COMMON_SSH_SFTP_MAX_PATH];
CU_ASSERT_EQUAL(guac_common_ssh_sftp_normalize_path(normalized, "foo\\bar/baz"), 0);
CU_ASSERT_EQUAL(guac_common_ssh_sftp_normalize_path(normalized, ".\\foo/bar/baz"), 0);
CU_ASSERT_EQUAL(guac_common_ssh_sftp_normalize_path(normalized, "../foo\\bar\\baz"), 0);
}
/**
* Generates a dynamically-allocated path having the given number of bytes, not
* counting the null-terminator. The path will contain only UNIX-style path
* separators. The returned path must eventually be freed with a call to
* free().
*
* @param length
* The number of bytes to include in the generated path, not counting the
* null-terminator. If -1, the length of the path will be automatically
* determined from the provided max_depth.
*
* @param max_depth
* The maximum number of path components to include within the generated
* path.
*
* @return
* A dynamically-allocated path containing the given number of bytes, not
* counting the null-terminator. This path must eventually be freed with a
* call to free().
*/
static char* generate_path(int length, int max_depth) {
/* If no length given, calculate space required from max_depth */
if (length == -1)
length = max_depth * 2;
int i;
char* input = malloc(length + 1);
/* Fill path with /x/x/x/x/x/x/x/x/x/x/.../xxxxxxxxx... */
for (i = 0; i < length; i++) {
if (max_depth > 0 && i % 2 == 0) {
input[i] = '/';
max_depth--;
}
else
input[i] = 'x';
}
/* Add null terminator */
input[length] = '\0';
return input;
}
/**
* Test which verifies that paths exceeding the maximum path length are
* rejected.
*/
void test_sftp__normalize_long() {
char* input;
char normalized[GUAC_COMMON_SSH_SFTP_MAX_PATH];
/* Exceeds maximum length by a factor of 2 */
input = generate_path(GUAC_COMMON_SSH_SFTP_MAX_PATH * 2, GUAC_COMMON_SSH_SFTP_MAX_DEPTH);
CU_ASSERT_EQUAL(guac_common_ssh_sftp_normalize_path(normalized, input), 0);
free(input);
/* Exceeds maximum length by one byte */
input = generate_path(GUAC_COMMON_SSH_SFTP_MAX_PATH, GUAC_COMMON_SSH_SFTP_MAX_DEPTH);
CU_ASSERT_EQUAL(guac_common_ssh_sftp_normalize_path(normalized, input), 0);
free(input);
/* Exactly maximum length */
input = generate_path(GUAC_COMMON_SSH_SFTP_MAX_PATH - 1, GUAC_COMMON_SSH_SFTP_MAX_DEPTH);
CU_ASSERT_NOT_EQUAL(guac_common_ssh_sftp_normalize_path(normalized, input), 0);
free(input);
}
/**
* Test which verifies that paths exceeding the maximum path depth are
* rejected.
*/
void test_sftp__normalize_deep() {
char* input;
char normalized[GUAC_COMMON_SSH_SFTP_MAX_PATH];
/* Exceeds maximum depth by a factor of 2 */
input = generate_path(-1, GUAC_COMMON_SSH_SFTP_MAX_DEPTH * 2);
CU_ASSERT_EQUAL(guac_common_ssh_sftp_normalize_path(normalized, input), 0);
free(input);
/* Exceeds maximum depth by one component */
input = generate_path(-1, GUAC_COMMON_SSH_SFTP_MAX_DEPTH + 1);
CU_ASSERT_EQUAL(guac_common_ssh_sftp_normalize_path(normalized, input), 0);
free(input);
/* Exactly maximum depth (should still be rejected as SFTP depth limits are
* set such that a path with the maximum depth will exceed the maximum
* length) */
input = generate_path(-1, GUAC_COMMON_SSH_SFTP_MAX_DEPTH);
CU_ASSERT_EQUAL(guac_common_ssh_sftp_normalize_path(normalized, input), 0);
free(input);
/* Less than maximum depth */
input = generate_path(-1, GUAC_COMMON_SSH_SFTP_MAX_DEPTH - 1);
CU_ASSERT_NOT_EQUAL(guac_common_ssh_sftp_normalize_path(normalized, input), 0);
free(input);
}

82
src/common-ssh/user.c Normal file
View File

@ -0,0 +1,82 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#include "common-ssh/key.h"
#include "common-ssh/user.h"
#include <stdlib.h>
#include <string.h>
guac_common_ssh_user* guac_common_ssh_create_user(const char* username) {
guac_common_ssh_user* user = malloc(sizeof(guac_common_ssh_user));
/* Init user */
user->username = strdup(username);
user->password = NULL;
user->private_key = NULL;
return user;
}
void guac_common_ssh_destroy_user(guac_common_ssh_user* user) {
/* Free private key, if present */
if (user->private_key != NULL)
guac_common_ssh_key_free(user->private_key);
/* Free all other data */
free(user->password);
free(user->username);
free(user);
}
void guac_common_ssh_user_set_password(guac_common_ssh_user* user,
const char* password) {
/* Replace current password with given value */
free(user->password);
user->password = strdup(password);
}
int guac_common_ssh_user_import_key(guac_common_ssh_user* user,
char* private_key, char* passphrase) {
/* Free existing private key, if present */
if (user->private_key != NULL)
guac_common_ssh_key_free(user->private_key);
/* Attempt to read key without passphrase if none given */
if (passphrase == NULL)
user->private_key = guac_common_ssh_key_alloc(private_key,
strlen(private_key), "");
/* Otherwise, use provided passphrase */
else
user->private_key = guac_common_ssh_key_alloc(private_key,
strlen(private_key), passphrase);
/* Fail if key could not be read */
return user->private_key == NULL;
}

5
src/common/.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
# Auto-generated test runner and binary
_generated_runner.c
test_common

71
src/common/Makefile.am Normal file
View File

@ -0,0 +1,71 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# NOTE: Parts of this file (Makefile.am) are automatically transcluded verbatim
# into Makefile.in. Though the build system (GNU Autotools) automatically adds
# its own license boilerplate to the generated Makefile.in, that boilerplate
# does not apply to the transcluded portions of Makefile.am which are licensed
# to you by the ASF under the Apache License, Version 2.0, as described above.
#
AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I m4
noinst_LTLIBRARIES = libguac_common.la
SUBDIRS = . tests
noinst_HEADERS = \
common/io.h \
common/blank_cursor.h \
common/clipboard.h \
common/cursor.h \
common/defaults.h \
common/display.h \
common/dot_cursor.h \
common/ibar_cursor.h \
common/iconv.h \
common/json.h \
common/list.h \
common/pointer_cursor.h \
common/rect.h \
common/string.h \
common/surface.h
libguac_common_la_SOURCES = \
io.c \
blank_cursor.c \
clipboard.c \
cursor.c \
display.c \
dot_cursor.c \
ibar_cursor.c \
iconv.c \
json.c \
list.c \
pointer_cursor.c \
rect.c \
string.c \
surface.c
libguac_common_la_CFLAGS = \
-Werror -Wall -pedantic \
@LIBGUAC_INCLUDE@
libguac_common_la_LIBADD = \
@LIBGUAC_LTLIB@

75
src/common/blank_cursor.c Normal file
View File

@ -0,0 +1,75 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#include "config.h"
#include <cairo/cairo.h>
#include <guacamole/client.h>
#include <guacamole/layer.h>
#include <guacamole/protocol.h>
#include <guacamole/socket.h>
#include <guacamole/user.h>
/* Dimensions */
const int guac_common_blank_cursor_width = 1;
const int guac_common_blank_cursor_height = 1;
/* Format */
const cairo_format_t guac_common_blank_cursor_format = CAIRO_FORMAT_ARGB32;
const int guac_common_blank_cursor_stride = 4;
/* Embedded blank cursor graphic */
unsigned char guac_common_blank_cursor[] = {
0x00,0x00,0x00,0x00
};
void guac_common_set_blank_cursor(guac_user* user) {
guac_client* client = user->client;
guac_socket* socket = user->socket;
/* Draw to buffer */
guac_layer* cursor = guac_client_alloc_buffer(client);
cairo_surface_t* graphic = cairo_image_surface_create_for_data(
guac_common_blank_cursor,
guac_common_blank_cursor_format,
guac_common_blank_cursor_width,
guac_common_blank_cursor_height,
guac_common_blank_cursor_stride);
guac_user_stream_png(user, socket, GUAC_COMP_SRC, cursor,
0, 0, graphic);
cairo_surface_destroy(graphic);
/* Set cursor */
guac_protocol_send_cursor(socket, 0, 0, cursor, 0, 0,
guac_common_blank_cursor_width,
guac_common_blank_cursor_height);
/* Free buffer */
guac_client_free_buffer(client, cursor);
guac_client_log(client, GUAC_LOG_DEBUG,
"Client cursor image set to generic transparent (blank) cursor.");
}

166
src/common/clipboard.c Normal file
View File

@ -0,0 +1,166 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#include "config.h"
#include "common/clipboard.h"
#include <guacamole/client.h>
#include <guacamole/protocol.h>
#include <guacamole/stream.h>
#include <guacamole/string.h>
#include <guacamole/user.h>
#include <pthread.h>
#include <string.h>
#include <stdlib.h>
guac_common_clipboard* guac_common_clipboard_alloc() {
guac_common_clipboard* clipboard = malloc(sizeof(guac_common_clipboard));
/* Init clipboard */
clipboard->mimetype[0] = '\0';
clipboard->buffer = malloc(GUAC_COMMON_CLIPBOARD_MAX_LENGTH);
clipboard->available = GUAC_COMMON_CLIPBOARD_MAX_LENGTH;
clipboard->length = 0;
pthread_mutex_init(&(clipboard->lock), NULL);
return clipboard;
}
void guac_common_clipboard_free(guac_common_clipboard* clipboard) {
/* Destroy lock */
pthread_mutex_destroy(&(clipboard->lock));
/* Free buffer */
free(clipboard->buffer);
/* Free base structure */
free(clipboard);
}
/**
* Callback for guac_client_foreach_user() which sends clipboard data to each
* connected client.
*
* @param user
* The user to send the clipboard data to.
*
* @param
* A pointer to the guac_common_clipboard structure containing the
* clipboard data that should be sent to the given user.
*
* @return
* Always NULL.
*/
static void* __send_user_clipboard(guac_user* user, void* data) {
guac_common_clipboard* clipboard = (guac_common_clipboard*) data;
char* current = clipboard->buffer;
int remaining = clipboard->length;
/* Begin stream */
guac_stream* stream = guac_user_alloc_stream(user);
guac_protocol_send_clipboard(user->socket, stream, clipboard->mimetype);
guac_user_log(user, GUAC_LOG_DEBUG,
"Created stream %i for %s clipboard data.",
stream->index, clipboard->mimetype);
/* Split clipboard into chunks */
while (remaining > 0) {
/* Calculate size of next block */
int block_size = GUAC_COMMON_CLIPBOARD_BLOCK_SIZE;
if (remaining < block_size)
block_size = remaining;
/* Send block */
guac_protocol_send_blob(user->socket, stream, current, block_size);
guac_user_log(user, GUAC_LOG_DEBUG,
"Sent %i bytes of clipboard data on stream %i.",
block_size, stream->index);
/* Next block */
remaining -= block_size;
current += block_size;
}
guac_user_log(user, GUAC_LOG_DEBUG,
"Clipboard stream %i complete.",
stream->index);
/* End stream */
guac_protocol_send_end(user->socket, stream);
guac_user_free_stream(user, stream);
return NULL;
}
void guac_common_clipboard_send(guac_common_clipboard* clipboard, guac_client* client) {
pthread_mutex_lock(&(clipboard->lock));
guac_client_log(client, GUAC_LOG_DEBUG, "Broadcasting clipboard to all connected users.");
guac_client_foreach_user(client, __send_user_clipboard, clipboard);
guac_client_log(client, GUAC_LOG_DEBUG, "Broadcast of clipboard complete.");
pthread_mutex_unlock(&(clipboard->lock));
}
void guac_common_clipboard_reset(guac_common_clipboard* clipboard,
const char* mimetype) {
pthread_mutex_lock(&(clipboard->lock));
/* Clear clipboard contents */
clipboard->length = 0;
/* Assign given mimetype */
guac_strlcpy(clipboard->mimetype, mimetype, sizeof(clipboard->mimetype));
pthread_mutex_unlock(&(clipboard->lock));
}
void guac_common_clipboard_append(guac_common_clipboard* clipboard, const char* data, int length) {
pthread_mutex_lock(&(clipboard->lock));
/* Truncate data to available length */
int remaining = clipboard->available - clipboard->length;
if (remaining < length)
length = remaining;
/* Append to buffer */
memcpy(clipboard->buffer + clipboard->length, data, length);
/* Update length */
clipboard->length += length;
pthread_mutex_unlock(&(clipboard->lock));
}

View File

@ -0,0 +1,64 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#ifndef GUAC_COMMON_BLANK_CURSOR_H
#define GUAC_COMMON_BLANK_CURSOR_H
#include "config.h"
#include <cairo/cairo.h>
#include <guacamole/user.h>
/**
* Width of the embedded transparent (blank) mouse cursor graphic.
*/
extern const int guac_common_blank_cursor_width;
/**
* Height of the embedded transparent (blank) mouse cursor graphic.
*/
extern const int guac_common_blank_cursor_height;
/**
* Number of bytes in each row of the embedded transparent (blank) mouse cursor
* graphic.
*/
extern const int guac_common_blank_cursor_stride;
/**
* The Cairo grapic format of the transparent (blank) mouse cursor graphic.
*/
extern const cairo_format_t guac_common_blank_cursor_format;
/**
* Embedded transparent (blank) mouse cursor graphic.
*/
extern unsigned char guac_common_blank_cursor[];
/**
* Sets the cursor of the remote display to the embedded transparent (blank)
* cursor graphic.
*
* @param user
* The guac_user to send the cursor to.
*/
void guac_common_set_blank_cursor(guac_user* user);
#endif

View File

@ -0,0 +1,114 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#ifndef __GUAC_CLIPBOARD_H
#define __GUAC_CLIPBOARD_H
#include "config.h"
#include <guacamole/client.h>
#include <pthread.h>
/**
* The maximum number of bytes to send in an individual blob when
* transmitting the clipboard contents to a connected client.
*/
#define GUAC_COMMON_CLIPBOARD_BLOCK_SIZE 4096
/**
* The maximum number of bytes to allow within the clipboard.
*/
#define GUAC_COMMON_CLIPBOARD_MAX_LENGTH 262144
/**
* Generic clipboard structure.
*/
typedef struct guac_common_clipboard {
/**
* Lock which restricts simultaneous access to the clipboard, guaranteeing
* ordered modifications to the clipboard and that changes to the clipboard
* are not allowed while the clipboard is being broadcast to all users.
*/
pthread_mutex_t lock;
/**
* The mimetype of the contained clipboard data.
*/
char mimetype[256];
/**
* Arbitrary clipboard data.
*/
char* buffer;
/**
* The number of bytes currently stored in the clipboard buffer.
*/
int length;
/**
* The total number of bytes available in the clipboard buffer.
*/
int available;
} guac_common_clipboard;
/**
* Creates a new clipboard.
*/
guac_common_clipboard* guac_common_clipboard_alloc();
/**
* Frees the given clipboard.
*
* @param clipboard The clipboard to free.
*/
void guac_common_clipboard_free(guac_common_clipboard* clipboard);
/**
* Sends the contents of the clipboard along the given client, splitting
* the contents as necessary.
*
* @param clipboard The clipboard whose contents should be sent.
* @param client The client to send the clipboard contents on.
*/
void guac_common_clipboard_send(guac_common_clipboard* clipboard, guac_client* client);
/**
* Clears the clipboard contents and assigns a new mimetype for future data.
*
* @param clipboard The clipboard to reset.
* @param mimetype The mimetype of future data.
*/
void guac_common_clipboard_reset(guac_common_clipboard* clipboard, const char* mimetype);
/**
* Appends the given data to the current clipboard contents. The data must
* match the mimetype chosen for the clipboard data by
* guac_common_clipboard_reset().
*
* @param clipboard The clipboard to append data to.
* @param data The data to append.
* @param length The number of bytes to append from the data given.
*/
void guac_common_clipboard_append(guac_common_clipboard* clipboard, const char* data, int length);
#endif

300
src/common/common/cursor.h Normal file
View File

@ -0,0 +1,300 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#ifndef GUAC_COMMON_CURSOR_H
#define GUAC_COMMON_CURSOR_H
#include "surface.h"
#include <cairo/cairo.h>
#include <guacamole/client.h>
#include <guacamole/socket.h>
#include <guacamole/user.h>
/**
* The default size of the cursor image buffer.
*/
#define GUAC_COMMON_CURSOR_DEFAULT_SIZE 64*64*4
/**
* Cursor object which maintains and synchronizes the current mouse cursor
* state across all users of a specific client.
*/
typedef struct guac_common_cursor {
/**
* The client to maintain the mouse cursor for.
*/
guac_client* client;
/**
* The buffer containing the current cursor image.
*/
guac_layer* buffer;
/**
* The width of the cursor image, in pixels.
*/
int width;
/**
* The height of the cursor image, in pixels.
*/
int height;
/**
* Arbitrary image data buffer, backing the Cairo surface used to store
* the cursor image.
*/
unsigned char* image_buffer;
/**
* The size of the image data buffer, in bytes.
*/
int image_buffer_size;
/**
* The current cursor image, if any. If the mouse cursor has not yet been
* set, this will be NULL.
*/
cairo_surface_t* surface;
/**
* The X coordinate of the hotspot of the mouse cursor.
*/
int hotspot_x;
/**
* The Y coordinate of the hotspot of the mouse cursor.
*/
int hotspot_y;
/**
* The last user to move the mouse, or NULL if no user has moved the
* mouse yet.
*/
guac_user* user;
/**
* The X coordinate of the current mouse cursor location.
*/
int x;
/**
* The Y coordinate of the current mouse cursor location.
*/
int y;
/**
* An integer value representing the current state of each button, where
* the Nth bit within the integer is set to 1 if and only if the Nth mouse
* button is currently pressed. The lowest-order bit is the left mouse
* button, followed by the middle button, right button, and finally the up
* and down buttons of the scroll wheel.
*
* @see GUAC_CLIENT_MOUSE_LEFT
* @see GUAC_CLIENT_MOUSE_MIDDLE
* @see GUAC_CLIENT_MOUSE_RIGHT
* @see GUAC_CLIENT_MOUSE_SCROLL_UP
* @see GUAC_CLIENT_MOUSE_SCROLL_DOWN
*/
int button_mask;
/**
* The server timestamp representing the point in time when the mousr
* location was last updated.
*/
guac_timestamp timestamp;
} guac_common_cursor;
/**
* Allocates a new cursor object which maintains and synchronizes the current
* mouse cursor state across all users of the given client.
*
* @param client
* The client for which this object shall maintain the mouse cursor.
*
* @return
* The newly-allocated mouse cursor.
*/
guac_common_cursor* guac_common_cursor_alloc(guac_client* client);
/**
* Frees the given cursor.
*
* @param cursor
* The cursor to free.
*/
void guac_common_cursor_free(guac_common_cursor* cursor);
/**
* Sends the current state of this cursor across the given socket, including
* the current cursor image. The resulting cursor on the remote display will
* be visible.
*
* @param cursor
* The cursor to send.
*
* @param user
* The user receiving the updated cursor.
*
* @param socket
* The socket over which the updated cursor should be sent.
*/
void guac_common_cursor_dup(guac_common_cursor* cursor, guac_user* user,
guac_socket* socket);
/**
* Updates the current position and button state of the mouse cursor, marking
* the given user as the most recent user of the mouse. The remote mouse cursor
* will be hidden for this user and shown for all others.
*
* @param cursor
* The cursor being updated.
*
* @param user
* The user that moved the cursor.
*
* @param x
* The new X coordinate of the cursor.
*
* @param y
* The new Y coordinate of the cursor.
*
* @param button_mask
* An integer value representing the current state of each button, where
* the Nth bit within the integer is set to 1 if and only if the Nth mouse
* button is currently pressed. The lowest-order bit is the left mouse
* button, followed by the middle button, right button, and finally the up
* and down buttons of the scroll wheel.
*
* @see GUAC_CLIENT_MOUSE_LEFT
* @see GUAC_CLIENT_MOUSE_MIDDLE
* @see GUAC_CLIENT_MOUSE_RIGHT
* @see GUAC_CLIENT_MOUSE_SCROLL_UP
* @see GUAC_CLIENT_MOUSE_SCROLL_DOWN
*/
void guac_common_cursor_update(guac_common_cursor* cursor, guac_user* user,
int x, int y, int button_mask);
/**
* Sets the cursor image to the given raw image data. This raw image data must
* be in 32-bit ARGB format, having 8 bits per color component, where the
* alpha component is stored in the high-order 8 bits, and blue is stored
* in the low-order 8 bits.
*
* @param cursor
* The cursor to set the image of.
*
* @param hx
* The X coordinate of the hotspot of the new cursor image.
*
* @param hy
* The Y coordinate of the hotspot of the new cursor image.
*
* @param data
* A pointer to raw 32-bit ARGB image data.
*
* @param width
* The width of the given image data, in pixels.
*
* @param height
* The height of the given image data, in pixels.
*
* @param stride
* The number of bytes in a single row of image data.
*/
void guac_common_cursor_set_argb(guac_common_cursor* cursor, int hx, int hy,
unsigned const char* data, int width, int height, int stride);
/**
* Sets the cursor image to the contents of the given surface. The entire
* contents of the surface are used, and the dimensions of the resulting
* cursor will be the dimensions of the given surface.
*
* @param cursor
* The cursor to set the image of.
*
* @param hx
* The X coordinate of the hotspot of the new cursor image.
*
* @param hy
* The Y coordinate of the hotspot of the new cursor image.
*
* @param surface
* The surface containing the cursor image.
*/
void guac_common_cursor_set_surface(guac_common_cursor* cursor, int hx, int hy,
guac_common_surface* surface);
/**
* Set the cursor of the remote display to the embedded "pointer" graphic. The
* pointer graphic is a black arrow with white border.
*
* @param cursor
* The cursor to set the image of.
*/
void guac_common_cursor_set_pointer(guac_common_cursor* cursor);
/**
* Set the cursor of the remote display to the embedded "dot" graphic. The dot
* graphic is a small black square with white border.
*
* @param cursor
* The cursor to set the image of.
*/
void guac_common_cursor_set_dot(guac_common_cursor* cursor);
/**
* Sets the cursor of the remote display to the embedded "I-bar" graphic. The
* I-bar graphic is a small black "I" shape with white border, used to indicate
* the presence of selectable or editable text.
*
* @param cursor
* The cursor to set the image of.
*/
void guac_common_cursor_set_ibar(guac_common_cursor* cursor);
/**
* Sets the cursor of the remote display to the embedded transparent (blank)
* graphic, effectively hiding the mouse cursor.
*
* @param cursor
* The cursor to set the image of.
*/
void guac_common_cursor_set_blank(guac_common_cursor* cursor);
/**
* Removes the given user, such that future synchronization will not occur.
* This is necessary when a user leaves the connection. If a user leaves the
* connection and this is not called, the mouse cursor state may not update
* correctly in response to mouse events.
*
* @param cursor
* The cursor to remove the user from.
*
* @param user
* The user to remove.
*/
void guac_common_cursor_remove_user(guac_common_cursor* cursor,
guac_user* user);
#endif

View File

@ -0,0 +1,31 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#ifndef GUAC_COMMON_DEFAULTS_H
#define GUAC_COMMON_DEFAULTS_H
/**
* The default number of seconds to wait after sending the Wake-on-LAN packet
* for the destination host to start responding.
*/
#define GUAC_WOL_DEFAULT_BOOT_WAIT_TIME 0
#endif /* GUAC_COMMON_DEFAULTS_H */

261
src/common/common/display.h Normal file
View File

@ -0,0 +1,261 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#ifndef GUAC_COMMON_DISPLAY_H
#define GUAC_COMMON_DISPLAY_H
#include "cursor.h"
#include "surface.h"
#include <guacamole/client.h>
#include <guacamole/socket.h>
#include <pthread.h>
/**
* A list element representing a pairing of a Guacamole layer with a
* corresponding guac_common_surface which wraps that layer. Adjacent layers
* within the same list are pointed to with traditional prev/next pointers. The
* order of layers in lists need not correspond in any way to the natural
* ordering of those layers' indexes nor their stacking order (Z-order) within
* the display.
*/
typedef struct guac_common_display_layer guac_common_display_layer;
struct guac_common_display_layer {
/**
* A Guacamole layer.
*/
guac_layer* layer;
/**
* The surface which wraps the associated layer.
*/
guac_common_surface* surface;
/**
* The layer immediately prior to this layer within the list containing
* this layer, or NULL if this is the first layer/buffer in the list.
*/
guac_common_display_layer* prev;
/**
* The layer immediately following this layer within the list containing
* this layer, or NULL if this is the last layer/buffer in the list.
*/
guac_common_display_layer* next;
};
/**
* Abstracts a remote Guacamole display, having an associated client,
* default surface, mouse cursor, and various allocated buffers and layers.
*/
typedef struct guac_common_display {
/**
* The client associate with this display.
*/
guac_client* client;
/**
* The default surface of the client display.
*/
guac_common_surface* default_surface;
/**
* Client-wide cursor, synchronized across all users.
*/
guac_common_cursor* cursor;
/**
* The first element within a linked list of all currently-allocated
* layers, or NULL if no layers are currently allocated. The default layer,
* layer #0, is stored within default_surface and will not have a
* corresponding element within this list.
*/
guac_common_display_layer* layers;
/**
* The first element within a linked list of all currently-allocated
* buffers, or NULL if no buffers are currently allocated.
*/
guac_common_display_layer* buffers;
/**
* Non-zero if all graphical updates for this display should use lossless
* compression, 0 otherwise. By default, newly-created displays will use
* lossy compression when heuristics determine it is appropriate.
*/
int lossless;
/**
* Mutex which is locked internally when access to the display must be
* synchronized. All public functions of guac_common_display should be
* considered threadsafe.
*/
pthread_mutex_t _lock;
} guac_common_display;
/**
* Allocates a new display, abstracting the cursor and buffer/layer allocation
* operations of the given guac_client such that client state can be easily
* synchronized to joining users.
*
* @param client
* The guac_client to associate with this display.
*
* @param width
* The initial width of the display, in pixels.
*
* @param height
* The initial height of the display, in pixels.
*
* @return
* The newly-allocated display.
*/
guac_common_display* guac_common_display_alloc(guac_client* client,
int width, int height);
/**
* Frees the given display, and any associated resources, including any
* allocated buffers/layers.
*
* @param display
* The display to free.
*/
void guac_common_display_free(guac_common_display* display);
/**
* Duplicates the state of the given display to the given socket. Any pending
* changes to buffers, layers, or the default layer are not flushed.
*
* @param display
* The display whose state should be sent along the given socket.
*
* @param user
* The user receiving the display state.
*
* @param socket
* The socket over which the display state should be sent.
*/
void guac_common_display_dup(guac_common_display* display, guac_user* user,
guac_socket* socket);
/**
* Flushes pending changes to the given display. All pending operations will
* become visible to any connected users.
*
* @param display
* The display to flush.
*/
void guac_common_display_flush(guac_common_display* display);
/**
* Allocates a new layer, returning a new wrapped layer and corresponding
* surface. The layer may be reused from a previous allocation, if that layer
* has since been freed.
*
* @param display
* The display to allocate a new layer from.
*
* @param width
* The width of the layer to allocate, in pixels.
*
* @param height
* The height of the layer to allocate, in pixels.
*
* @return
* A newly-allocated layer.
*/
guac_common_display_layer* guac_common_display_alloc_layer(
guac_common_display* display, int width, int height);
/**
* Allocates a new buffer, returning a new wrapped buffer and corresponding
* surface. The buffer may be reused from a previous allocation, if that buffer
* has since been freed.
*
* @param display
* The display to allocate a new buffer from.
*
* @param width
* The width of the buffer to allocate, in pixels.
*
* @param height
* The height of the buffer to allocate, in pixels.
*
* @return
* A newly-allocated buffer.
*/
guac_common_display_layer* guac_common_display_alloc_buffer(
guac_common_display* display, int width, int height);
/**
* Frees the given surface and associated layer, returning the layer to the
* given display for future use.
*
* @param display
* The display originally allocating the layer.
*
* @param display_layer
* The layer to free.
*/
void guac_common_display_free_layer(guac_common_display* display,
guac_common_display_layer* display_layer);
/**
* Frees the given surface and associated buffer, returning the buffer to the
* given display for future use.
*
* @param display
* The display originally allocating the buffer.
*
* @param display_buffer
* The buffer to free.
*/
void guac_common_display_free_buffer(guac_common_display* display,
guac_common_display_layer* display_buffer);
/**
* Sets the overall lossless compression policy of the given display to the
* given value, affecting all current and future layers/buffers maintained by
* the display. By default, newly-created displays will use lossy compression
* for graphical updates when heuristics determine that doing so is
* appropriate. Specifying a non-zero value here will force all graphical
* updates to always use lossless compression, whereas specifying zero will
* restore the default policy.
*
* Note that this can also be adjusted on a per-layer / per-buffer basis with
* guac_common_surface_set_lossless().
*
* @param display
* The display to modify.
*
* @param lossless
* Non-zero if all graphical updates for this display should use lossless
* compression, 0 otherwise.
*/
void guac_common_display_set_lossless(guac_common_display* display,
int lossless);
#endif

View File

@ -0,0 +1,61 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#ifndef _GUAC_COMMON_DOT_CURSOR_H
#define _GUAC_COMMON_DOT_CURSOR_H
#include "config.h"
#include <cairo/cairo.h>
#include <guacamole/user.h>
/**
* Width of the embedded mouse cursor graphic.
*/
extern const int guac_common_dot_cursor_width;
/**
* Height of the embedded mouse cursor graphic.
*/
extern const int guac_common_dot_cursor_height;
/**
* Number of bytes in each row of the embedded mouse cursor graphic.
*/
extern const int guac_common_dot_cursor_stride;
/**
* The Cairo grapic format of the mouse cursor graphic.
*/
extern const cairo_format_t guac_common_dot_cursor_format;
/**
* Embedded mouse cursor graphic.
*/
extern unsigned char guac_common_dot_cursor[];
/**
* Set the cursor of the remote display to the embedded cursor graphic.
*
* @param user The guac_user to send the cursor to.
*/
void guac_common_set_dot_cursor(guac_user* user);
#endif

View File

@ -0,0 +1,62 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#ifndef GUAC_COMMON_IBAR_CURSOR_H
#define GUAC_COMMON_IBAR_CURSOR_H
#include "config.h"
#include <cairo/cairo.h>
#include <guacamole/user.h>
/**
* Width of the embedded I-bar mouse cursor graphic.
*/
extern const int guac_common_ibar_cursor_width;
/**
* Height of the embedded I-bar mouse cursor graphic.
*/
extern const int guac_common_ibar_cursor_height;
/**
* Number of bytes in each row of the embedded I-bar mouse cursor graphic.
*/
extern const int guac_common_ibar_cursor_stride;
/**
* The Cairo grapic format of the I-bar mouse cursor graphic.
*/
extern const cairo_format_t guac_common_ibar_cursor_format;
/**
* Embedded I-bar mouse cursor graphic.
*/
extern unsigned char guac_common_ibar_cursor[];
/**
* Sets the cursor of the remote display to the embedded I-bar cursor graphic.
*
* @param user
* The guac_user to send the cursor to.
*/
void guac_common_set_ibar_cursor(guac_user* user);
#endif

148
src/common/common/iconv.h Normal file
View File

@ -0,0 +1,148 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#ifndef __GUAC_COMMON_ICONV_H
#define __GUAC_COMMON_ICONV_H
#include "config.h"
/**
* Function which reads a character from the given string data, returning
* the Unicode codepoint read, updating the string pointer to point to the
* byte immediately after the character read.
*/
typedef int guac_iconv_read(const char** input, int remaining);
/**
* Function writes the character having the given Unicode codepoint value to
* the given string data, updating the string pointer to point to the byte
* immediately after the character written.
*/
typedef void guac_iconv_write(char** output, int remaining, int value);
/**
* Converts characters within a given string from one encoding to another,
* as defined by the reader/writer functions specified. The input and output
* string pointers will be updated based on the number of bytes read or
* written.
*
* @param reader The reader function to use when reading the input string.
* @param input Pointer to the beginning of the input string.
* @param in_remaining The number of bytes remaining after the pointer to the
* input string.
* @param writer The writer function to use when writing the output string.
* @param output Pointer to the beginning of the output string.
* @param out_remaining The number of bytes remaining after the pointer to the
* output string.
* @return Non-zero if the NULL terminator of the input string was read and
* copied into the destination string, zero otherwise.
*/
int guac_iconv(guac_iconv_read* reader, const char** input, int in_remaining,
guac_iconv_write* writer, char** output, int out_remaining);
/**
* Read function for UTF8.
*/
guac_iconv_read GUAC_READ_UTF8;
/**
* Read function for UTF16.
*/
guac_iconv_read GUAC_READ_UTF16;
/**
* Read function for CP-1252.
*/
guac_iconv_read GUAC_READ_CP1252;
/**
* Read function for ISO-8859-1
*/
guac_iconv_read GUAC_READ_ISO8859_1;
/**
* Read function for UTF-8 which normalizes newline character sequences like
* "\r\n" to Unix-style newlines ('\n').
*/
guac_iconv_read GUAC_READ_UTF8_NORMALIZED;
/**
* Read function for UTF-16 which normalizes newline character sequences like
* "\r\n" to Unix-style newlines ('\n').
*/
guac_iconv_read GUAC_READ_UTF16_NORMALIZED;
/**
* Read function for CP-1252 which normalizes newline character sequences like
* "\r\n" to Unix-style newlines ('\n').
*/
guac_iconv_read GUAC_READ_CP1252_NORMALIZED;
/**
* Read function for ISO 8859-1 which normalizes newline character sequences
* like "\r\n" to Unix-style newlines ('\n').
*/
guac_iconv_read GUAC_READ_ISO8859_1_NORMALIZED;
/**
* Write function for UTF8.
*/
guac_iconv_write GUAC_WRITE_UTF8;
/**
* Write function for UTF16.
*/
guac_iconv_write GUAC_WRITE_UTF16;
/**
* Write function for CP-1252.
*/
guac_iconv_write GUAC_WRITE_CP1252;
/**
* Write function for ISO-8859-1
*/
guac_iconv_write GUAC_WRITE_ISO8859_1;
/**
* Write function for UTF-8 which writes newline characters ('\n') as
* Windows-style newlines ("\r\n").
*/
guac_iconv_write GUAC_WRITE_UTF8_CRLF;
/**
* Write function for UTF-16 which writes newline characters ('\n') as
* Windows-style newlines ("\r\n").
*/
guac_iconv_write GUAC_WRITE_UTF16_CRLF;
/**
* Write function for CP-1252 which writes newline characters ('\n') as
* Windows-style newlines ("\r\n").
*/
guac_iconv_write GUAC_WRITE_CP1252_CRLF;
/**
* Write function for ISO 8859-1 which writes newline characters ('\n') as
* Windows-style newlines ("\r\n").
*/
guac_iconv_write GUAC_WRITE_ISO8859_1_CRLF;
#endif

50
src/common/common/io.h Normal file
View File

@ -0,0 +1,50 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#ifndef __GUAC_COMMON_IO_H
#define __GUAC_COMMON_IO_H
#include "config.h"
/**
* Writes absolutely all bytes from within the given buffer, returning an error
* only if the required writes fail.
*
* @param fd The file descriptor to write to.
* @param buffer The buffer containing the data to write.
* @param length The number of bytes to write.
* @return The number of bytes written, or a value less than zero if an error
* occurs.
*/
int guac_common_write(int fd, void* buffer, int length);
/**
* Reads enough bytes to fill the given buffer, returning an error only if the
* required reads fail.
*
* @param fd The file descriptor to read from.
* @param buffer The buffer to read data into.
* @param length The number of bytes to read.
* @return The number of bytes read, or a value less than zero if an error
* occurs.
*/
int guac_common_read(int fd, void* buffer, int length);
#endif

196
src/common/common/json.h Normal file
View File

@ -0,0 +1,196 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#ifndef GUAC_COMMON_JSON_H
#define GUAC_COMMON_JSON_H
#include "config.h"
#include <guacamole/stream.h>
#include <guacamole/user.h>
/**
* The current streaming state of an arbitrary JSON object, consisting of
* any number of property name/value pairs.
*/
typedef struct guac_common_json_state {
/**
* Buffer of partial JSON data. The individual blobs which make up the JSON
* body of the object being sent over the Guacamole protocol will be
* built here.
*/
char buffer[4096];
/**
* The number of bytes currently used within the JSON buffer.
*/
int size;
/**
* The number of property name/value pairs written to the JSON object thus
* far.
*/
int properties_written;
} guac_common_json_state;
/**
* Given a stream, the user to which it belongs, and the current stream state
* of a JSON object, flushes the contents of the JSON buffer to a blob
* instruction. Note that this will flush the JSON buffer only, and will not
* necessarily flush the underlying guac_socket of the user.
*
* @param user
* The user to which the data will be flushed.
*
* @param stream
* The stream through which the flushed data should be sent as a blob.
*
* @param json_state
* The state object whose buffer should be flushed.
*/
void guac_common_json_flush(guac_user* user, guac_stream* stream,
guac_common_json_state* json_state);
/**
* Given a stream, the user to which it belongs, and the current stream state
* of a JSON object, writes the contents of the given buffer to the JSON buffer
* of the stream state, flushing as necessary.
*
* @param user
* The user to which the data will be flushed as necessary.
*
* @param stream
* The stream through which the flushed data should be sent as a blob, if
* data must be flushed at all.
*
* @param json_state
* The state object containing the JSON buffer to which the given buffer
* should be written.
*
* @param buffer
* The buffer to write.
*
* @param length
* The number of bytes in the buffer.
*
* @return
* Non-zero if at least one blob was written, zero otherwise.
*/
int guac_common_json_write(guac_user* user, guac_stream* stream,
guac_common_json_state* json_state, const char* buffer, int length);
/**
* Given a stream, the user to which it belongs, and the current stream state
* of a JSON object state, writes the given string as a proper JSON string,
* including starting and ending quotes. The contents of the string will be
* escaped as necessary.
*
* @param user
* The user to which the data will be flushed as necessary.
*
* @param stream
* The stream through which the flushed data should be sent as a blob, if
* data must be flushed at all.
*
* @param json_state
* The state object containing the JSON buffer to which the given string
* should be written as a JSON name/value pair.
*
* @param str
* The string to write.
*
* @return
* Non-zero if at least one blob was written, zero otherwise.
*/
int guac_common_json_write_string(guac_user* user,
guac_stream* stream, guac_common_json_state* json_state,
const char* str);
/**
* Given a stream, the user to which it belongs, and the current stream state
* of a JSON object, writes the given JSON property name/value pair. The
* name and value will be written as proper JSON strings separated by a colon.
*
* @param user
* The user to which the data will be flushed as necessary.
*
* @param stream
* The stream through which the flushed data should be sent as a blob, if
* data must be flushed at all.
*
* @param json_state
* The state object containing the JSON buffer to which the given strings
* should be written as a JSON name/value pair.
*
* @param name
* The name of the property to write.
*
* @param value
* The value of the property to write.
*
* @return
* Non-zero if at least one blob was written, zero otherwise.
*/
int guac_common_json_write_property(guac_user* user, guac_stream* stream,
guac_common_json_state* json_state, const char* name,
const char* value);
/**
* Given a stream, the user to which it belongs, and the current stream state
* of a JSON object, initializes the state for writing a new JSON object. Note
* that although the user and stream must be provided, no instruction or
* blobs will be written due to any call to this function.
*
* @param user
* The user associated with the given stream.
*
* @param stream
* The stream associated with the JSON object being written.
*
* @param json_state
* The state object to initialize.
*/
void guac_common_json_begin_object(guac_user* user, guac_stream* stream,
guac_common_json_state* json_state);
/**
* Given a stream, the user to which it belongs, and the current stream state
* of a JSON object, completes writing that JSON object by writing the final
* terminating brace. This function must only be called following a
* corresponding call to guac_common_json_begin_object().
*
* @param user
* The user associated with the given stream.
*
* @param stream
* The stream associated with the JSON object being written.
*
* @param json_state
* The state object whose in-progress JSON object should be terminated.
*
* @return
* Non-zero if at least one blob was written, zero otherwise.
*/
int guac_common_json_end_object(guac_user* user, guac_stream* stream,
guac_common_json_state* json_state);
#endif

122
src/common/common/list.h Normal file
View File

@ -0,0 +1,122 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#ifndef __GUAC_LIST_H
#define __GUAC_LIST_H
#include "config.h"
#include <pthread.h>
/**
* Generic linked list element.
*/
typedef struct guac_common_list_element guac_common_list_element;
struct guac_common_list_element {
/**
* The next element in the list, or NULL if none.
*/
guac_common_list_element* next;
/**
* Generic data.
*/
void* data;
/**
* The pointer which points to this element, whether another element's
* next pointer, or the entire list's head pointer.
*/
guac_common_list_element** _ptr;
};
/**
* Generic linked list.
*/
typedef struct guac_common_list {
/**
* The first element in the list.
*/
guac_common_list_element* head;
/**
* Mutex which is locked when exclusive access to the list is required.
* Possession of the lock is not enforced outside the
* guac_common_list_lock() function.
*/
pthread_mutex_t _lock;
} guac_common_list;
/**
* Creates a new list.
*
* @return A newly-allocated list.
*/
guac_common_list* guac_common_list_alloc();
/**
* Frees the given list.
*
* @param list The list to free.
*/
void guac_common_list_free(guac_common_list* list);
/**
* Adds the given data to the list as a new element, returning the created
* element.
*
* @param list The list to add an element to.
* @param data The data to associate with the newly-created element.
* @param The newly-created element.
*/
guac_common_list_element* guac_common_list_add(guac_common_list* list,
void* data);
/**
* Removes the given element from the list.
*
* @param list The list to remove the element from.
* @param element The element to remove.
*/
void guac_common_list_remove(guac_common_list* list,
guac_common_list_element* element);
/**
* Acquires exclusive access to the list. No list functions implicitly lock or
* unlock the list, so any list access which must be threadsafe must use
* guac_common_list_lock() and guac_common_list_unlock() manually.
*
* @param list The list to acquire exclusive access to.
*/
void guac_common_list_lock(guac_common_list* list);
/**
* Releases exclusive access to the list.
*
* @param list The list to release from exclusive access.
*/
void guac_common_list_unlock(guac_common_list* list);
#endif

View File

@ -0,0 +1,61 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#ifndef _GUAC_COMMON_POINTER_CURSOR_H
#define _GUAC_COMMON_POINTER_CURSOR_H
#include "config.h"
#include <cairo/cairo.h>
#include <guacamole/user.h>
/**
* Width of the embedded mouse cursor graphic.
*/
extern const int guac_common_pointer_cursor_width;
/**
* Height of the embedded mouse cursor graphic.
*/
extern const int guac_common_pointer_cursor_height;
/**
* Number of bytes in each row of the embedded mouse cursor graphic.
*/
extern const int guac_common_pointer_cursor_stride;
/**
* The Cairo grapic format of the mouse cursor graphic.
*/
extern const cairo_format_t guac_common_pointer_cursor_format;
/**
* Embedded mouse cursor graphic.
*/
extern unsigned char guac_common_pointer_cursor[];
/**
* Set the cursor of the remote display to the embedded cursor graphic.
*
* @param user The guac_user to send the cursor to.
*/
void guac_common_set_pointer_cursor(guac_user* user);
#endif

143
src/common/common/rect.h Normal file
View File

@ -0,0 +1,143 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#ifndef __GUAC_COMMON_RECT_H
#define __GUAC_COMMON_RECT_H
#include "config.h"
/**
* Simple representation of a rectangle, having a defined corner and dimensions.
*/
typedef struct guac_common_rect {
/**
* The X coordinate of the upper-left corner of this rectangle.
*/
int x;
/**
* The Y coordinate of the upper-left corner of this rectangle.
*/
int y;
/**
* The width of this rectangle.
*/
int width;
/**
* The height of this rectangle.
*/
int height;
} guac_common_rect;
/**
* Initialize the given rect with the given coordinates and dimensions.
*
* @param rect The rect to initialize.
* @param x The X coordinate of the upper-left corner of the rect.
* @param y The Y coordinate of the upper-left corner of the rect.
* @param width The width of the rect.
* @param height The height of the rect.
*/
void guac_common_rect_init(guac_common_rect* rect, int x, int y, int width, int height);
/**
* Expand the rectangle to fit an NxN grid.
*
* The rectangle will be shifted to the left and up, expanded and adjusted to
* fit within the max bounding rect.
*
* @param cell_size
* The (NxN) grid cell size.
*
* @param rect
* The rectangle to adjust.
*
* @param max_rect
* The bounding area in which the given rect can exist.
*
* @return
* Zero on success, non-zero on error.
*/
int guac_common_rect_expand_to_grid(int cell_size, guac_common_rect* rect,
const guac_common_rect* max_rect);
/**
* Extend the given rect such that it contains at least the specified minimum
* rect.
*
* @param rect The rect to extend.
* @param min The minimum area which must be contained within the given rect.
*/
void guac_common_rect_extend(guac_common_rect* rect, const guac_common_rect* min);
/**
* Collapse the given rect such that it exists only within the given maximum
* rect.
*
* @param rect The rect to extend.
* @param max The maximum area in which the given rect can exist.
*/
void guac_common_rect_constrain(guac_common_rect* rect, const guac_common_rect* max);
/**
* Check whether a rectangle intersects another.
*
* @param rect
* Rectangle to check for intersection.
*
* @param other
* The other rectangle.
*
* @return
* Zero if no intersection, 1 if partial intersection,
* 2 if first rect is completely inside the other.
*/
int guac_common_rect_intersects(const guac_common_rect* rect,
const guac_common_rect* other);
/**
* Clip and split a rectangle into rectangles which are not covered by the
* hole rectangle.
*
* This function will clip and split single edges when executed and must be
* invoked until it returns zero. The edges are handled counter-clockwise
* starting at the top edge.
*
* @param rect
* The rectangle to be split. This rectangle will be clipped by the
* split_rect.
*
* @param hole
* The rectangle which represents the hole.
*
* @param split_rect
* Resulting split rectangle.
*
* @return
* Zero when no splits were done, non-zero when the rectangle was split.
*/
int guac_common_rect_clip_and_split(guac_common_rect* rect,
const guac_common_rect* hole, guac_common_rect* split_rect);
#endif

View File

@ -0,0 +1,47 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#ifndef __GUAC_COMMON_STRING_H
#define __GUAC_COMMON_STRING_H
#include "config.h"
/**
* Counts the number of occurrences of a given character in a string.
*
* @param string The string to count occurrences within.
* @param c The character to count occurrences of.
* @return The number of occurrences.
*/
int guac_count_occurrences(const char* string, char c);
/**
* Splits a string into a newly-allocated array of strings. The array itself
* and each string within the array will eventually need to be freed. The array
* is NULL-terminated.
*
* @param string The string to split.
* @param delim The character which separates individual substrings within the
* given string.
* @return A newly-allocated, NULL-terminated array of strings.
*/
char** guac_split(const char* string, char delim);
#endif

539
src/common/common/surface.h Normal file
View File

@ -0,0 +1,539 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#ifndef __GUAC_COMMON_SURFACE_H
#define __GUAC_COMMON_SURFACE_H
#include "config.h"
#include "rect.h"
#include <cairo/cairo.h>
#include <guacamole/client.h>
#include <guacamole/layer.h>
#include <guacamole/protocol.h>
#include <guacamole/socket.h>
#include <pthread.h>
/**
* The maximum number of updates to allow within the bitmap queue.
*/
#define GUAC_COMMON_SURFACE_QUEUE_SIZE 256
/**
* Heat map cell size in pixels. Each side of each heat map cell will consist
* of this many pixels.
*/
#define GUAC_COMMON_SURFACE_HEAT_CELL_SIZE 64
/**
* The width or height of the heat map (in cells) given the width or height of
* the image (in pixels).
*/
#define GUAC_COMMON_SURFACE_HEAT_DIMENSION(x) ( \
(x + GUAC_COMMON_SURFACE_HEAT_CELL_SIZE - 1) \
/ GUAC_COMMON_SURFACE_HEAT_CELL_SIZE \
)
/**
* The number of entries to collect within each heat map cell. Collected
* history entries are used to determine the framerate of the region associated
* with that cell.
*/
#define GUAC_COMMON_SURFACE_HEAT_CELL_HISTORY_SIZE 5
/**
* Representation of a cell in the refresh heat map. This cell is used to keep
* track of how often an area on a surface is refreshed.
*/
typedef struct guac_common_surface_heat_cell {
/**
* Timestamps of each of the last N updates covering the location
* associated with this heat map cell. This is used to calculate the
* framerate. This array is structured as a ring buffer containing history
* entries in chronologically-ascending order, starting at the entry
* pointed to by oldest_entry and proceeding through all other entries,
* wrapping around if the end of the array is reached.
*/
guac_timestamp history[GUAC_COMMON_SURFACE_HEAT_CELL_HISTORY_SIZE];
/**
* Index of the oldest entry within the history.
*/
int oldest_entry;
} guac_common_surface_heat_cell;
/**
* Representation of a bitmap update, having a rectangle of image data (stored
* elsewhere) and a flushed/not-flushed state.
*/
typedef struct guac_common_surface_bitmap_rect {
/**
* Whether this rectangle has been flushed.
*/
int flushed;
/**
* The rectangle containing the bitmap update.
*/
guac_common_rect rect;
} guac_common_surface_bitmap_rect;
/**
* Surface which backs a Guacamole buffer or layer, automatically
* combining updates when possible.
*/
typedef struct guac_common_surface {
/**
* The layer this surface will draw to.
*/
const guac_layer* layer;
/**
* The client associated with this surface.
*/
guac_client* client;
/**
* The socket to send instructions on when flushing.
*/
guac_socket* socket;
/**
* The number of simultaneous touches that this surface can accept, where 0
* indicates that the surface does not support touch events at all.
*/
int touches;
/**
* Non-zero if all graphical updates for this surface should use lossless
* compression, 0 otherwise. By default, newly-created surfaces will use
* lossy compression when heuristics determine it is appropriate.
*/
int lossless;
/**
* The X coordinate of the upper-left corner of this layer, in pixels,
* relative to its parent layer. This is only applicable to visible
* (non-buffer) layers which are not the default layer.
*/
int x;
/**
* The Y coordinate of the upper-left corner of this layer, in pixels,
* relative to its parent layer. This is only applicable to visible
* (non-buffer) layers which are not the default layer.
*/
int y;
/**
* The Z-order of this layer, relative to sibling layers. This is only
* applicable to visible (non-buffer) layers which are not the default
* layer.
*/
int z;
/**
* The level of opacity applied to this layer. Fully opaque is 255, while
* fully transparent is 0. This is only applicable to visible (non-buffer)
* layers which are not the default layer.
*/
int opacity;
/**
* The layer which contains this layer. This is only applicable to visible
* (non-buffer) layers which are not the default layer.
*/
const guac_layer* parent;
/**
* The width of this layer, in pixels.
*/
int width;
/**
* The height of this layer, in pixels.
*/
int height;
/**
* The size of each image row, in bytes.
*/
int stride;
/**
* The underlying buffer of the Cairo surface.
*/
unsigned char* buffer;
/**
* Non-zero if the location or parent layer of this surface has been
* changed and needs to be flushed, 0 otherwise.
*/
int location_dirty;
/**
* Non-zero if the opacity of this surface has been changed and needs to be
* flushed, 0 otherwise.
*/
int opacity_dirty;
/**
* Non-zero if this surface is dirty and needs to be flushed, 0 otherwise.
*/
int dirty;
/**
* The dirty rectangle.
*/
guac_common_rect dirty_rect;
/**
* Whether the surface actually exists on the client.
*/
int realized;
/**
* Whether drawing operations are currently clipped by the clipping
* rectangle.
*/
int clipped;
/**
* The clipping rectangle.
*/
guac_common_rect clip_rect;
/**
* The number of updates in the bitmap queue.
*/
int bitmap_queue_length;
/**
* All queued bitmap updates.
*/
guac_common_surface_bitmap_rect bitmap_queue[GUAC_COMMON_SURFACE_QUEUE_SIZE];
/**
* A heat map keeping track of the refresh frequency of
* the areas of the screen.
*/
guac_common_surface_heat_cell* heat_map;
/**
* Mutex which is locked internally when access to the surface must be
* synchronized. All public functions of guac_common_surface should be
* considered threadsafe.
*/
pthread_mutex_t _lock;
} guac_common_surface;
/**
* Allocates a new guac_common_surface, assigning it to the given layer.
*
* @param client
* The client associated with the given layer.
*
* @param socket
* The socket to send instructions on when flushing.
*
* @param layer
* The layer to associate with the new surface.
*
* @param w
* The width of the surface.
*
* @param h
* The height of the surface.
*
* @return
* A newly-allocated guac_common_surface.
*/
guac_common_surface* guac_common_surface_alloc(guac_client* client,
guac_socket* socket, const guac_layer* layer, int w, int h);
/**
* Frees the given guac_common_surface. Beware that this will NOT free any
* associated layers, which must be freed manually.
*
* @param surface The surface to free.
*/
void guac_common_surface_free(guac_common_surface* surface);
/**
* Resizes the given surface to the given size.
*
* @param surface The surface to resize.
* @param w The width of the surface.
* @param h The height of the surface.
*/
void guac_common_surface_resize(guac_common_surface* surface, int w, int h);
/**
* Draws the given data to the given guac_common_surface. If the source surface
* is ARGB, the draw operation will be performed using the Porter-Duff "over"
* composite operator. If the source surface is RGB (no alpha channel), no
* compositing is performed and destination pixels are ignored.
*
* @param surface
* The surface to draw to.
*
* @param x
* The X coordinate of the draw location.
*
* @param y
* The Y coordinate of the draw location.
*
* @param src
* The Cairo surface to retrieve data from.
*/
void guac_common_surface_draw(guac_common_surface* surface, int x, int y,
cairo_surface_t* src);
/**
* Paints to the given guac_common_surface using the given data as a stencil,
* filling opaque regions with the specified color, and leaving transparent
* regions untouched.
*
* @param surface The surface to draw to.
* @param x The X coordinate of the draw location.
* @param y The Y coordinate of the draw location.
* @param src The Cairo surface to retrieve data from.
* @param red The red component of the fill color.
* @param green The green component of the fill color.
* @param blue The blue component of the fill color.
*/
void guac_common_surface_paint(guac_common_surface* surface, int x, int y, cairo_surface_t* src,
int red, int green, int blue);
/**
* Copies a rectangle of data between two surfaces.
*
* @param src The source surface.
* @param sx The X coordinate of the upper-left corner of the source rect.
* @param sy The Y coordinate of the upper-left corner of the source rect.
* @param w The width of the source rect.
* @param h The height of the source rect.
* @param dst The destination surface.
* @param dx The X coordinate of the upper-left corner of the destination rect.
* @param dy The Y coordinate of the upper-left corner of the destination rect.
*/
void guac_common_surface_copy(guac_common_surface* src, int sx, int sy, int w, int h,
guac_common_surface* dst, int dx, int dy);
/**
* Transfers a rectangle of data between two surfaces.
*
* @param src The source surface.
* @param sx The X coordinate of the upper-left corner of the source rect.
* @param sy The Y coordinate of the upper-left corner of the source rect.
* @param w The width of the source rect.
* @param h The height of the source rect.
* @param op The transfer function.
* @param dst The destination surface.
* @param dx The X coordinate of the upper-left corner of the destination rect.
* @param dy The Y coordinate of the upper-left corner of the destination rect.
*/
void guac_common_surface_transfer(guac_common_surface* src, int sx, int sy, int w, int h,
guac_transfer_function op, guac_common_surface* dst, int dx, int dy);
/**
* Assigns the given value to all pixels within a rectangle of the given
* surface. The color of all pixels within the rectangle, including the alpha
* component, is entirely replaced.
*
* @param surface
* The surface to draw upon.
*
* @param x
* The X coordinate of the upper-left corner of the rectangle.
*
* @param y
* The Y coordinate of the upper-left corner of the rectangle.
*
* @param w
* The width of the rectangle.
*
* @param h
* The height of the rectangle.
*
* @param red
* The red component of the color value to assign to all pixels within the
* rectangle.
*
* @param green
* The green component of the color value to assign to all pixels within
* the rectangle.
*
* @param blue
* The blue component of the color value to assign to all pixels within the
* rectangle.
*
* @param alpha
* The alpha component of the color value to assign to all pixels within
* the rectangle.
*/
void guac_common_surface_set(guac_common_surface* surface, int x, int y,
int w, int h, int red, int green, int blue, int alpha);
/**
* Given the coordinates and dimensions of a rectangle, clips all future
* operations within that rectangle.
*
* @param surface The surface whose clipping rectangle should be changed.
* @param x The X coordinate of the upper-left corner of the bounding rectangle.
* @param y The Y coordinate of the upper-left corner of the bounding rectangle.
* @param w The width of the bounding rectangle.
* @param h The height of the bounding rectangle.
*/
void guac_common_surface_clip(guac_common_surface* surface, int x, int y, int w, int h);
/**
* Resets the clipping rectangle, allowing drawing operations throughout the
* entire surface.
*
* @param surface The surface whose clipping rectangle should be reset.
*/
void guac_common_surface_reset_clip(guac_common_surface* surface);
/**
* Changes the location of the surface relative to its parent layer. If the
* surface does not represent a non-default visible layer, then this function
* has no effect.
*
* @param surface
* The surface to move relative to its parent layer.
*
* @param x
* The new X coordinate for the upper-left corner of the layer, in pixels.
*
* @param y
* The new Y coordinate for the upper-left corner of the layer, in pixels.
*/
void guac_common_surface_move(guac_common_surface* surface, int x, int y);
/**
* Changes the stacking order of the surface relative to other surfaces within
* the same parent layer. If the surface does not represent a non-default
* visible layer, then this function has no effect.
*
* @param surface
* The surface to reorder relative to sibling layers.
*
* @param z
* The new Z-order for this layer, relative to sibling layers.
*/
void guac_common_surface_stack(guac_common_surface* surface, int z);
/**
* Changes the parent layer of ths given surface. By default, layers will be
* children of the default layer. If the surface does not represent a
* non-default visible layer, then this function has no effect.
*
* @param surface
* The surface whose parent layer should be changed.
*
* @param parent
* The layer which should be set as the new parent of the given surface.
*/
void guac_common_surface_set_parent(guac_common_surface* surface,
const guac_layer* parent);
/**
* Sets the opacity of the surface. If the surface does not represent a
* non-default visible layer, then this function has no effect.
*
* @param surface
* The surface whose opacity should be changed.
*
* @param opacity
* The level of opacity applied to this surface, where fully opaque is 255,
* and fully transparent is 0.
*/
void guac_common_surface_set_opacity(guac_common_surface* surface, int opacity);
/**
* Flushes the given surface, including any applicable properties, drawing any
* pending operations on the remote display.
*
* @param surface
* The surface to flush.
*/
void guac_common_surface_flush(guac_common_surface* surface);
/**
* Duplicates the contents of the current surface to the given socket. Pending
* changes are not flushed.
*
* @param surface
* The surface to duplicate.
*
* @param user
* The user receiving the surface.
*
* @param socket
* The socket over which the surface contents should be sent.
*/
void guac_common_surface_dup(guac_common_surface* surface, guac_user* user,
guac_socket* socket);
/**
* Declares that the given surface should receive touch events. By default,
* surfaces are assumed to not expect touch events. This value is advisory, and
* the client is not required to honor the declared level of touch support.
* Implementations are expected to safely handle or ignore any received touch
* events, regardless of the level of touch support declared. regardless of
* the level of touch support declared.
*
* @param surface
* The surface to modify.
*
* @param touches
* The number of simultaneous touches that this surface can accept, where 0
* indicates that the surface does not support touch events at all.
*/
void guac_common_surface_set_multitouch(guac_common_surface* surface,
int touches);
/**
* Sets the lossless compression policy of the given surface to the given
* value. By default, newly-created surfaces will use lossy compression for
* graphical updates when heuristics determine that doing so is appropriate.
* Specifying a non-zero value here will force all graphical updates to always
* use lossless compression, whereas specifying zero will restore the default
* policy.
*
* @param surface
* The surface to modify.
*
* @param lossless
* Non-zero if all graphical updates for this surface should use lossless
* compression, 0 otherwise.
*/
void guac_common_surface_set_lossless(guac_common_surface* surface,
int lossless);
#endif

306
src/common/cursor.c Normal file
View File

@ -0,0 +1,306 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#include "common/blank_cursor.h"
#include "common/dot_cursor.h"
#include "common/cursor.h"
#include "common/ibar_cursor.h"
#include "common/pointer_cursor.h"
#include "common/surface.h"
#include <cairo/cairo.h>
#include <guacamole/client.h>
#include <guacamole/protocol.h>
#include <guacamole/socket.h>
#include <guacamole/timestamp.h>
#include <guacamole/user.h>
#include <limits.h>
#include <stdlib.h>
#include <string.h>
/**
* Allocates a cursor as well as an image buffer where the cursor is rendered.
*
* @param client
* The client owning the cursor.
*
* @return
* The newly-allocated cursor or NULL if cursor cannot be allocated.
*/
guac_common_cursor* guac_common_cursor_alloc(guac_client* client) {
guac_common_cursor* cursor = malloc(sizeof(guac_common_cursor));
if (cursor == NULL)
return NULL;
/* Associate cursor with client and allocate cursor buffer */
cursor->client = client;
cursor->buffer = guac_client_alloc_buffer(client);
/* Allocate initial image buffer */
cursor->image_buffer_size = GUAC_COMMON_CURSOR_DEFAULT_SIZE;
cursor->image_buffer = malloc(cursor->image_buffer_size);
/* No cursor image yet */
cursor->width = 0;
cursor->height = 0;
cursor->surface = NULL;
cursor->hotspot_x = 0;
cursor->hotspot_y = 0;
/* No user has moved the mouse yet */
cursor->user = NULL;
cursor->timestamp = guac_timestamp_current();
/* Start cursor in upper-left */
cursor->x = 0;
cursor->y = 0;
return cursor;
}
void guac_common_cursor_free(guac_common_cursor* cursor) {
guac_client* client = cursor->client;
guac_layer* buffer = cursor->buffer;
cairo_surface_t* surface = cursor->surface;
/* Free image buffer and surface */
free(cursor->image_buffer);
if (surface != NULL)
cairo_surface_destroy(surface);
/* Destroy buffer within remotely-connected client */
guac_protocol_send_dispose(client->socket, buffer);
/* Return buffer to pool */
guac_client_free_buffer(client, buffer);
free(cursor);
}
void guac_common_cursor_dup(guac_common_cursor* cursor, guac_user* user,
guac_socket* socket) {
/* Synchronize location */
guac_protocol_send_mouse(socket, cursor->x, cursor->y, cursor->button_mask,
cursor->timestamp);
/* Synchronize cursor image */
if (cursor->surface != NULL) {
guac_protocol_send_size(socket, cursor->buffer,
cursor->width, cursor->height);
guac_user_stream_png(user, socket, GUAC_COMP_SRC,
cursor->buffer, 0, 0, cursor->surface);
guac_protocol_send_cursor(socket,
cursor->hotspot_x, cursor->hotspot_y,
cursor->buffer, 0, 0, cursor->width, cursor->height);
}
guac_socket_flush(socket);
}
/**
* Callback for guac_client_foreach_user() which sends the current cursor
* position and button state to any given user except the user that moved the
* cursor last.
*
* @param data
* A pointer to the guac_common_cursor whose state should be broadcast to
* all users except the user that moved the cursor last.
*
* @return
* Always NULL.
*/
static void* guac_common_cursor_broadcast_state(guac_user* user,
void* data) {
guac_common_cursor* cursor = (guac_common_cursor*) data;
/* Send cursor state only if the user is not moving the cursor */
if (user != cursor->user) {
guac_protocol_send_mouse(user->socket, cursor->x, cursor->y,
cursor->button_mask, cursor->timestamp);
guac_socket_flush(user->socket);
}
return NULL;
}
void guac_common_cursor_update(guac_common_cursor* cursor, guac_user* user,
int x, int y, int button_mask) {
/* Update current user of cursor */
cursor->user = user;
/* Update cursor state */
cursor->x = x;
cursor->y = y;
cursor->button_mask = button_mask;
/* Store time at which cursor was updated */
cursor->timestamp = guac_timestamp_current();
/* Notify all other users of change in cursor state */
guac_client_foreach_user(cursor->client,
guac_common_cursor_broadcast_state, cursor);
}
/**
* Ensures the cursor image buffer has enough room to fit an image with the
* given characteristics. Existing image buffer data may be destroyed.
*
* @param cursor
* The cursor whose buffer size should be checked. If this cursor lacks
* sufficient space to contain a cursor image of the specified width,
* height, and stride, the current contents of this cursor will be
* destroyed and replaced with an new buffer having sufficient space.
*
* @param width
* The required cursor width, in pixels.
*
* @param height
* The required cursor height, in pixels.
*
* @param stride
* The number of bytes in each row of image data.
*/
static void guac_common_cursor_resize(guac_common_cursor* cursor,
int width, int height, int stride) {
int minimum_size = height * stride;
/* Grow image buffer if necessary */
if (cursor->image_buffer_size < minimum_size) {
/* Calculate new size */
cursor->image_buffer_size = minimum_size*2;
/* Destructively reallocate image buffer */
free(cursor->image_buffer);
cursor->image_buffer = malloc(cursor->image_buffer_size);
}
}
void guac_common_cursor_set_argb(guac_common_cursor* cursor, int hx, int hy,
unsigned const char* data, int width, int height, int stride) {
/* Copy image data */
guac_common_cursor_resize(cursor, width, height, stride);
memcpy(cursor->image_buffer, data, height * stride);
if (cursor->surface != NULL)
cairo_surface_destroy(cursor->surface);
cursor->surface = cairo_image_surface_create_for_data(cursor->image_buffer,
CAIRO_FORMAT_ARGB32, width, height, stride);
/* Set new cursor parameters */
cursor->width = width;
cursor->height = height;
cursor->hotspot_x = hx;
cursor->hotspot_y = hy;
/* Broadcast new cursor image to all users */
guac_protocol_send_size(cursor->client->socket, cursor->buffer,
width, height);
guac_client_stream_png(cursor->client, cursor->client->socket,
GUAC_COMP_SRC, cursor->buffer, 0, 0, cursor->surface);
/* Update cursor image */
guac_protocol_send_cursor(cursor->client->socket,
cursor->hotspot_x, cursor->hotspot_y,
cursor->buffer, 0, 0, cursor->width, cursor->height);
guac_socket_flush(cursor->client->socket);
}
void guac_common_cursor_set_surface(guac_common_cursor* cursor, int hx, int hy,
guac_common_surface* surface) {
/* Set cursor to surface contents */
guac_common_cursor_set_argb(cursor, hx, hy, surface->buffer,
surface->width, surface->height, surface->stride);
}
void guac_common_cursor_set_pointer(guac_common_cursor* cursor) {
guac_common_cursor_set_argb(cursor, 0, 0,
guac_common_pointer_cursor,
guac_common_pointer_cursor_width,
guac_common_pointer_cursor_height,
guac_common_pointer_cursor_stride);
}
void guac_common_cursor_set_dot(guac_common_cursor* cursor) {
guac_common_cursor_set_argb(cursor, 2, 2,
guac_common_dot_cursor,
guac_common_dot_cursor_width,
guac_common_dot_cursor_height,
guac_common_dot_cursor_stride);
}
void guac_common_cursor_set_ibar(guac_common_cursor* cursor) {
guac_common_cursor_set_argb(cursor,
guac_common_ibar_cursor_width / 2,
guac_common_ibar_cursor_height / 2,
guac_common_ibar_cursor,
guac_common_ibar_cursor_width,
guac_common_ibar_cursor_height,
guac_common_ibar_cursor_stride);
}
void guac_common_cursor_set_blank(guac_common_cursor* cursor) {
guac_common_cursor_set_argb(cursor, 0, 0,
guac_common_blank_cursor,
guac_common_blank_cursor_width,
guac_common_blank_cursor_height,
guac_common_blank_cursor_stride);
}
void guac_common_cursor_remove_user(guac_common_cursor* cursor,
guac_user* user) {
/* Disassociate from given user */
if (cursor->user == user)
cursor->user = NULL;
}

391
src/common/display.c Normal file
View File

@ -0,0 +1,391 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#include "common/cursor.h"
#include "common/display.h"
#include "common/surface.h"
#include <guacamole/client.h>
#include <guacamole/socket.h>
#include <pthread.h>
#include <stdlib.h>
#include <string.h>
/**
* Synchronizes all surfaces within the given linked list to the given socket.
* If the provided pointer to the linked list is NULL, this function has no
* effect.
*
* @param layers
* The head element of the linked list of layers to synchronize, which may
* be NULL if the list is currently empty.
*
* @param user
* The user receiving the layers.
*
* @param socket
* The socket over which each layer should be sent.
*/
static void guac_common_display_dup_layers(guac_common_display_layer* layers,
guac_user* user, guac_socket* socket) {
guac_common_display_layer* current = layers;
/* Synchronize all surfaces in given list */
while (current != NULL) {
guac_common_surface_dup(current->surface, user, socket);
current = current->next;
}
}
/**
* Frees all layers and associated surfaces within the given list, as well as
* their corresponding list elements. If the provided pointer to the linked
* list is NULL, this function has no effect.
*
* @param layers
* The head element of the linked list of layers to free, which may be NULL
* if the list is currently empty.
*
* @param client
* The client owning the layers wrapped by each of the layers in the list.
*/
static void guac_common_display_free_layers(guac_common_display_layer* layers,
guac_client* client) {
guac_common_display_layer* current = layers;
/* Free each surface in given list */
while (current != NULL) {
guac_common_display_layer* next = current->next;
guac_layer* layer = current->layer;
/* Free surface */
guac_common_surface_free(current->surface);
/* Destroy layer within remotely-connected client */
guac_protocol_send_dispose(client->socket, layer);
/* Free layer or buffer depending on index */
if (layer->index < 0)
guac_client_free_buffer(client, layer);
else if (layer->index > 0)
guac_client_free_layer(client, layer);
/* Free current element and advance to next */
free(current);
current = next;
}
}
/**
* Allocates a display and a cursor which are used to represent the remote
* display and cursor.
*
* @param client
* The client owning the cursor.
*
* @param width
* The desired width of the display.
*
* @param height
* The desired height of the display.
*
* @return
* The newly-allocated display or NULL if display cannot be allocated.
*/
guac_common_display* guac_common_display_alloc(guac_client* client,
int width, int height) {
/* Allocate display */
guac_common_display* display = malloc(sizeof(guac_common_display));
if (display == NULL)
return NULL;
/* Allocate shared cursor */
display->cursor = guac_common_cursor_alloc(client);
if (display->cursor == NULL) {
free(display);
return NULL;
}
pthread_mutex_init(&display->_lock, NULL);
/* Associate display with given client */
display->client = client;
display->default_surface = guac_common_surface_alloc(client,
client->socket, GUAC_DEFAULT_LAYER, width, height);
/* No initial layers or buffers */
display->layers = NULL;
display->buffers = NULL;
return display;
}
void guac_common_display_free(guac_common_display* display) {
/* Free shared cursor */
guac_common_cursor_free(display->cursor);
/* Free default surface */
guac_common_surface_free(display->default_surface);
/* Free all layers and buffers */
guac_common_display_free_layers(display->buffers, display->client);
guac_common_display_free_layers(display->layers, display->client);
pthread_mutex_destroy(&display->_lock);
free(display);
}
void guac_common_display_dup(guac_common_display* display, guac_user* user,
guac_socket* socket) {
guac_client* client = user->client;
pthread_mutex_lock(&display->_lock);
/* Sunchronize shared cursor */
guac_common_cursor_dup(display->cursor, user, socket);
/* Synchronize default surface */
guac_common_surface_dup(display->default_surface, user, socket);
/* Synchronize all layers and buffers */
guac_common_display_dup_layers(display->layers, user, socket);
guac_common_display_dup_layers(display->buffers, user, socket);
/* Sends a sync instruction to mark the boundary of the first frame */
guac_protocol_send_sync(socket, client->last_sent_timestamp, 1);
pthread_mutex_unlock(&display->_lock);
}
void guac_common_display_set_lossless(guac_common_display* display,
int lossless) {
pthread_mutex_lock(&display->_lock);
/* Update lossless setting to be applied to all newly-allocated
* layers/buffers */
display->lossless = lossless;
/* Update losslessness of all allocated layers/buffers */
guac_common_display_layer* current = display->layers;
while (current != NULL) {
guac_common_surface_set_lossless(current->surface, lossless);
current = current->next;
}
/* Update losslessness of default display layer (not included within layers
* list) */
guac_common_surface_set_lossless(display->default_surface, lossless);
pthread_mutex_unlock(&display->_lock);
}
void guac_common_display_flush(guac_common_display* display) {
pthread_mutex_lock(&display->_lock);
guac_common_display_layer* current = display->layers;
/* Flush all surfaces */
while (current != NULL) {
guac_common_surface_flush(current->surface);
current = current->next;
}
guac_common_surface_flush(display->default_surface);
pthread_mutex_unlock(&display->_lock);
}
/**
* Allocates and inserts a new element into the given linked list of display
* layers, associating it with the given layer and surface.
*
* @param head
* A pointer to the head pointer of the list of layers. The head pointer
* will be updated by this function to point to the newly-allocated
* display layer.
*
* @param layer
* The Guacamole layer to associated with the new display layer.
*
* @param surface
* The surface associated with the given Guacamole layer and which should
* be associated with the new display layer.
*
* @return
* The newly-allocated display layer, which has been associated with the
* provided layer and surface.
*/
static guac_common_display_layer* guac_common_display_add_layer(
guac_common_display_layer** head, guac_layer* layer,
guac_common_surface* surface) {
guac_common_display_layer* old_head = *head;
guac_common_display_layer* display_layer =
malloc(sizeof(guac_common_display_layer));
/* Init layer/surface pair */
display_layer->layer = layer;
display_layer->surface = surface;
/* Insert list element as the new head */
display_layer->prev = NULL;
display_layer->next = old_head;
*head = display_layer;
/* Update old head to point to new element, if it existed */
if (old_head != NULL)
old_head->prev = display_layer;
return display_layer;
}
/**
* Removes the given display layer from the linked list whose head pointer is
* provided.
*
* @param head
* A pointer to the head pointer of the list of layers. The head pointer
* will be updated by this function if necessary, and will be set to NULL
* if the display layer being removed is the only layer in the list.
*
* @param display_layer
* The display layer to remove from the given list.
*/
static void guac_common_display_remove_layer(guac_common_display_layer** head,
guac_common_display_layer* display_layer) {
/* Update previous element, if it exists */
if (display_layer->prev != NULL)
display_layer->prev->next = display_layer->next;
/* If there is no previous element, update the list head */
else
*head = display_layer->next;
/* Update next element, if it exists */
if (display_layer->next != NULL)
display_layer->next->prev = display_layer->prev;
}
guac_common_display_layer* guac_common_display_alloc_layer(
guac_common_display* display, int width, int height) {
pthread_mutex_lock(&display->_lock);
/* Allocate Guacamole layer */
guac_layer* layer = guac_client_alloc_layer(display->client);
/* Allocate corresponding surface */
guac_common_surface* surface = guac_common_surface_alloc(display->client,
display->client->socket, layer, width, height);
/* Apply current display losslessness */
guac_common_surface_set_lossless(surface, display->lossless);
/* Add layer and surface to list */
guac_common_display_layer* display_layer =
guac_common_display_add_layer(&display->layers, layer, surface);
pthread_mutex_unlock(&display->_lock);
return display_layer;
}
guac_common_display_layer* guac_common_display_alloc_buffer(
guac_common_display* display, int width, int height) {
pthread_mutex_lock(&display->_lock);
/* Allocate Guacamole buffer */
guac_layer* buffer = guac_client_alloc_buffer(display->client);
/* Allocate corresponding surface */
guac_common_surface* surface = guac_common_surface_alloc(display->client,
display->client->socket, buffer, width, height);
/* Apply current display losslessness */
guac_common_surface_set_lossless(surface, display->lossless);
/* Add buffer and surface to list */
guac_common_display_layer* display_layer =
guac_common_display_add_layer(&display->buffers, buffer, surface);
pthread_mutex_unlock(&display->_lock);
return display_layer;
}
void guac_common_display_free_layer(guac_common_display* display,
guac_common_display_layer* display_layer) {
pthread_mutex_lock(&display->_lock);
/* Remove list element from list */
guac_common_display_remove_layer(&display->layers, display_layer);
/* Free associated layer and surface */
guac_common_surface_free(display_layer->surface);
guac_client_free_layer(display->client, display_layer->layer);
/* Free list element */
free(display_layer);
pthread_mutex_unlock(&display->_lock);
}
void guac_common_display_free_buffer(guac_common_display* display,
guac_common_display_layer* display_buffer) {
pthread_mutex_lock(&display->_lock);
/* Remove list element from list */
guac_common_display_remove_layer(&display->buffers, display_buffer);
/* Free associated layer and surface */
guac_common_surface_free(display_buffer->surface);
guac_client_free_buffer(display->client, display_buffer->layer);
/* Free list element */
free(display_buffer);
pthread_mutex_unlock(&display->_lock);
}

85
src/common/dot_cursor.c Normal file
View File

@ -0,0 +1,85 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#include "config.h"
#include <cairo/cairo.h>
#include <guacamole/client.h>
#include <guacamole/layer.h>
#include <guacamole/protocol.h>
#include <guacamole/socket.h>
#include <guacamole/user.h>
/* Macros for prettying up the embedded image. */
#define X 0x00,0x00,0x00,0xFF
#define O 0xFF,0xFF,0xFF,0xFF
#define _ 0x00,0x00,0x00,0x00
/* Dimensions */
const int guac_common_dot_cursor_width = 5;
const int guac_common_dot_cursor_height = 5;
/* Format */
const cairo_format_t guac_common_dot_cursor_format = CAIRO_FORMAT_ARGB32;
const int guac_common_dot_cursor_stride = 20;
/* Embedded pointer graphic */
unsigned char guac_common_dot_cursor[] = {
_,O,O,O,_,
O,X,X,X,O,
O,X,X,X,O,
O,X,X,X,O,
_,O,O,O,_
};
void guac_common_set_dot_cursor(guac_user* user) {
guac_client* client = user->client;
guac_socket* socket = user->socket;
/* Draw to buffer */
guac_layer* cursor = guac_client_alloc_buffer(client);
cairo_surface_t* graphic = cairo_image_surface_create_for_data(
guac_common_dot_cursor,
guac_common_dot_cursor_format,
guac_common_dot_cursor_width,
guac_common_dot_cursor_height,
guac_common_dot_cursor_stride);
guac_user_stream_png(user, socket, GUAC_COMP_SRC, cursor,
0, 0, graphic);
cairo_surface_destroy(graphic);
/* Set cursor */
guac_protocol_send_cursor(socket, 2, 2, cursor,
0, 0,
guac_common_dot_cursor_width,
guac_common_dot_cursor_height);
/* Free buffer */
guac_client_free_buffer(client, cursor);
guac_client_log(client, GUAC_LOG_DEBUG,
"Client cursor image set to generic built-in dot.");
}

98
src/common/ibar_cursor.c Normal file
View File

@ -0,0 +1,98 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#include "config.h"
#include <cairo/cairo.h>
#include <guacamole/client.h>
#include <guacamole/layer.h>
#include <guacamole/protocol.h>
#include <guacamole/socket.h>
#include <guacamole/user.h>
/* Macros for prettying up the embedded image. */
#define X 0x00,0x00,0x00,0xFF
#define U 0x80,0x80,0x80,0xFF
#define O 0xFF,0xFF,0xFF,0xFF
#define _ 0x00,0x00,0x00,0x00
/* Dimensions */
const int guac_common_ibar_cursor_width = 7;
const int guac_common_ibar_cursor_height = 16;
/* Format */
const cairo_format_t guac_common_ibar_cursor_format = CAIRO_FORMAT_ARGB32;
const int guac_common_ibar_cursor_stride = 28;
/* Embedded I-bar graphic */
unsigned char guac_common_ibar_cursor[] = {
X,X,X,X,X,X,X,
X,O,O,U,O,O,X,
X,X,X,O,X,X,X,
_,_,X,O,X,_,_,
_,_,X,O,X,_,_,
_,_,X,O,X,_,_,
_,_,X,O,X,_,_,
_,_,X,O,X,_,_,
_,_,X,O,X,_,_,
_,_,X,O,X,_,_,
_,_,X,O,X,_,_,
_,_,X,O,X,_,_,
_,_,X,O,X,_,_,
X,X,X,O,X,X,X,
X,O,O,U,O,O,X,
X,X,X,X,X,X,X
};
void guac_common_set_ibar_cursor(guac_user* user) {
guac_client* client = user->client;
guac_socket* socket = user->socket;
/* Draw to buffer */
guac_layer* cursor = guac_client_alloc_buffer(client);
cairo_surface_t* graphic = cairo_image_surface_create_for_data(
guac_common_ibar_cursor,
guac_common_ibar_cursor_format,
guac_common_ibar_cursor_width,
guac_common_ibar_cursor_height,
guac_common_ibar_cursor_stride);
guac_user_stream_png(user, socket, GUAC_COMP_SRC, cursor,
0, 0, graphic);
cairo_surface_destroy(graphic);
/* Set cursor */
guac_protocol_send_cursor(socket, 0, 0, cursor,
guac_common_ibar_cursor_width / 2,
guac_common_ibar_cursor_height / 2,
guac_common_ibar_cursor_width,
guac_common_ibar_cursor_height);
/* Free buffer */
guac_client_free_buffer(client, cursor);
guac_client_log(client, GUAC_LOG_DEBUG,
"Client cursor image set to generic built-in I-bar.");
}

306
src/common/iconv.c Normal file
View File

@ -0,0 +1,306 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#include "config.h"
#include "common/iconv.h"
#include <guacamole/unicode.h>
#include <stdint.h>
/**
* Lookup table for Unicode code points, indexed by CP-1252 codepoint.
*/
const static int __GUAC_RDP_CP1252_CODEPOINT[32] = {
0x20AC, /* 0x80 */
0xFFFD, /* 0x81 */
0x201A, /* 0x82 */
0x0192, /* 0x83 */
0x201E, /* 0x84 */
0x2026, /* 0x85 */
0x2020, /* 0x86 */
0x2021, /* 0x87 */
0x02C6, /* 0x88 */
0x2030, /* 0x89 */
0x0160, /* 0x8A */
0x2039, /* 0x8B */
0x0152, /* 0x8C */
0xFFFD, /* 0x8D */
0x017D, /* 0x8E */
0xFFFD, /* 0x8F */
0xFFFD, /* 0x90 */
0x2018, /* 0x91 */
0x2019, /* 0x92 */
0x201C, /* 0x93 */
0x201D, /* 0x94 */
0x2022, /* 0x95 */
0x2013, /* 0x96 */
0x2014, /* 0x97 */
0x02DC, /* 0x98 */
0x2122, /* 0x99 */
0x0161, /* 0x9A */
0x203A, /* 0x9B */
0x0153, /* 0x9C */
0xFFFD, /* 0x9D */
0x017E, /* 0x9E */
0x0178, /* 0x9F */
};
int guac_iconv(guac_iconv_read* reader, const char** input, int in_remaining,
guac_iconv_write* writer, char** output, int out_remaining) {
while (in_remaining > 0 && out_remaining > 0) {
int value;
const char* read_start;
char* write_start;
/* Read character */
read_start = *input;
value = reader(input, in_remaining);
in_remaining -= *input - read_start;
/* Write character */
write_start = *output;
writer(output, out_remaining, value);
out_remaining -= *output - write_start;
/* Stop if null terminator reached */
if (value == 0)
return 1;
}
/* Null terminator not reached */
return 0;
}
int GUAC_READ_UTF8(const char** input, int remaining) {
int value;
*input += guac_utf8_read(*input, remaining, &value);
return value;
}
int GUAC_READ_UTF16(const char** input, int remaining) {
int value;
/* Bail if not enough data */
if (remaining < 2)
return 0;
/* Read two bytes as integer */
value = *((uint16_t*) *input);
*input += 2;
return value;
}
int GUAC_READ_CP1252(const char** input, int remaining) {
int value = *((unsigned char*) *input);
/* Replace value with exception if not identical to ISO-8859-1 */
if (value >= 0x80 && value <= 0x9F)
value = __GUAC_RDP_CP1252_CODEPOINT[value - 0x80];
(*input)++;
return value;
}
int GUAC_READ_ISO8859_1(const char** input, int remaining) {
int value = *((unsigned char*) *input);
(*input)++;
return value;
}
/**
* Invokes the given reader function, automatically normalizing newline
* sequences as Unix-style newline characters ('\n'). All other charaters are
* read verbatim.
*
* @param reader
* The reader to use to read the given character.
*
* @param input
* Pointer to the location within the input buffer that the next character
* should be read from.
*
* @param remaining
* The number of bytes remaining in the input buffer.
*
* @return
* The codepoint that was read, or zero if the end of the input string has
* been reached.
*/
static int guac_iconv_read_normalized(guac_iconv_read* reader,
const char** input, int remaining) {
/* Read requested character */
const char* input_start = *input;
int value = reader(input, remaining);
/* Automatically translate CRLF pairs to simple newlines */
if (value == '\r') {
/* Peek ahead by one character, adjusting remaining bytes relative to
* last read */
int peek_remaining = remaining - (*input - input_start);
const char* peek_input = *input;
int peek_value = reader(&peek_input, peek_remaining);
/* Consider read value to be a newline if we have encountered a "\r\n"
* (CRLF) pair */
if (peek_value == '\n') {
value = '\n';
*input = peek_input;
}
}
return value;
}
int GUAC_READ_UTF8_NORMALIZED(const char** input, int remaining) {
return guac_iconv_read_normalized(GUAC_READ_UTF8, input, remaining);
}
int GUAC_READ_UTF16_NORMALIZED(const char** input, int remaining) {
return guac_iconv_read_normalized(GUAC_READ_UTF16, input, remaining);
}
int GUAC_READ_CP1252_NORMALIZED(const char** input, int remaining) {
return guac_iconv_read_normalized(GUAC_READ_CP1252, input, remaining);
}
int GUAC_READ_ISO8859_1_NORMALIZED(const char** input, int remaining) {
return guac_iconv_read_normalized(GUAC_READ_ISO8859_1, input, remaining);
}
void GUAC_WRITE_UTF8(char** output, int remaining, int value) {
*output += guac_utf8_write(value, *output, remaining);
}
void GUAC_WRITE_UTF16(char** output, int remaining, int value) {
/* Bail if not enough data */
if (remaining < 2)
return;
/* Write two bytes as integer */
*((uint16_t*) *output) = value;
*output += 2;
}
void GUAC_WRITE_CP1252(char** output, int remaining, int value) {
/* If not in ISO-8859-1 part of CP1252, check lookup table */
if ((value >= 0x80 && value <= 0x9F) || value > 0xFF) {
int i;
int replacement_value = '?';
const int* codepoint = __GUAC_RDP_CP1252_CODEPOINT;
/* Search lookup table for value */
for (i=0x80; i<=0x9F; i++, codepoint++) {
if (*codepoint == value) {
replacement_value = i;
break;
}
}
/* Replace value with discovered value (or question mark) */
value = replacement_value;
}
*((unsigned char*) *output) = (unsigned char) value;
(*output)++;
}
void GUAC_WRITE_ISO8859_1(char** output, int remaining, int value) {
/* Translate to question mark if out of range */
if (value > 0xFF)
value = '?';
*((unsigned char*) *output) = (unsigned char) value;
(*output)++;
}
/**
* Invokes the given writer function, automatically writing newline characters
* ('\n') as CRLF ("\r\n"). All other charaters are written verbatim.
*
* @param writer
* The writer to use to write the given character.
*
* @param output
* Pointer to the location within the output buffer that the next character
* should be written.
*
* @param remaining
* The number of bytes remaining in the output buffer.
*
* @param value
* The codepoint of the character to write.
*/
static void guac_iconv_write_crlf(guac_iconv_write* writer, char** output,
int remaining, int value) {
if (value != '\n') {
writer(output, remaining, value);
return;
}
char* output_start = *output;
writer(output, remaining, '\r');
remaining -= *output - output_start;
if (remaining > 0)
writer(output, remaining, '\n');
}
void GUAC_WRITE_UTF8_CRLF(char** output, int remaining, int value) {
guac_iconv_write_crlf(GUAC_WRITE_UTF8, output, remaining, value);
}
void GUAC_WRITE_UTF16_CRLF(char** output, int remaining, int value) {
guac_iconv_write_crlf(GUAC_WRITE_UTF16, output, remaining, value);
}
void GUAC_WRITE_CP1252_CRLF(char** output, int remaining, int value) {
guac_iconv_write_crlf(GUAC_WRITE_CP1252, output, remaining, value);
}
void GUAC_WRITE_ISO8859_1_CRLF(char** output, int remaining, int value) {
guac_iconv_write_crlf(GUAC_WRITE_ISO8859_1, output, remaining, value);
}

68
src/common/io.c Normal file
View File

@ -0,0 +1,68 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#include "config.h"
#include "common/io.h"
#include <unistd.h>
int guac_common_write(int fd, void* buffer, int length) {
unsigned char* bytes = (unsigned char*) buffer;
while (length > 0) {
/* Attempt write */
int bytes_written = write(fd, bytes, length);
if (bytes_written < 0)
return bytes_written;
/* Update buffer */
length -= bytes_written;
bytes += bytes_written;
}
/* Success */
return length;
}
int guac_common_read(int fd, void* buffer, int length) {
unsigned char* bytes = (unsigned char*) buffer;
while (length > 0) {
/* Attempt read */
int bytes_read = read(fd, bytes, length);
if (bytes_read < 0)
return bytes_read;
/* Update buffer */
length -= bytes_read;
bytes += bytes_read;
}
/* Success */
return length;
}

180
src/common/json.c Normal file
View File

@ -0,0 +1,180 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#include "config.h"
#include "common/json.h"
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <guacamole/protocol.h>
#include <guacamole/socket.h>
#include <guacamole/stream.h>
#include <guacamole/user.h>
void guac_common_json_flush(guac_user* user, guac_stream* stream,
guac_common_json_state* json_state) {
/* If JSON buffer is non-empty, write contents to blob and reset */
if (json_state->size > 0) {
guac_protocol_send_blob(user->socket, stream,
json_state->buffer, json_state->size);
/* Reset JSON buffer size */
json_state->size = 0;
}
}
int guac_common_json_write(guac_user* user, guac_stream* stream,
guac_common_json_state* json_state, const char* buffer, int length) {
int blob_written = 0;
/*
* Append to and flush the JSON buffer as necessary to write the given
* data
*/
while (length > 0) {
/* Ensure provided data does not exceed size of buffer */
int blob_length = length;
if (blob_length > sizeof(json_state->buffer))
blob_length = sizeof(json_state->buffer);
/* Flush if more room is needed */
if (json_state->size + blob_length > sizeof(json_state->buffer)) {
guac_common_json_flush(user, stream, json_state);
blob_written = 1;
}
/* Append data to JSON buffer */
memcpy(json_state->buffer + json_state->size,
buffer, blob_length);
json_state->size += blob_length;
/* Advance to next blob of data */
buffer += blob_length;
length -= blob_length;
}
return blob_written;
}
int guac_common_json_write_string(guac_user* user,
guac_stream* stream, guac_common_json_state* json_state,
const char* str) {
int blob_written = 0;
/* Write starting quote */
blob_written |= guac_common_json_write(user, stream,
json_state, "\"", 1);
/* Write given string, escaping as necessary */
const char* current = str;
for (; *current != '\0'; current++) {
/* Escape all quotes and back-slashes */
if (*current == '"' || *current == '\\') {
/* Write any string content up to current character */
if (current != str)
blob_written |= guac_common_json_write(user, stream,
json_state, str, current - str);
/* Escape the character that was just read */
blob_written |= guac_common_json_write(user, stream,
json_state, "\\", 1);
/* Reset string */
str = current;
}
}
/* Write any remaining string content */
if (current != str)
blob_written |= guac_common_json_write(user, stream,
json_state, str, current - str);
/* Write ending quote */
blob_written |= guac_common_json_write(user, stream,
json_state, "\"", 1);
return blob_written;
}
int guac_common_json_write_property(guac_user* user, guac_stream* stream,
guac_common_json_state* json_state, const char* name,
const char* value) {
int blob_written = 0;
/* Write leading comma if not first property */
if (json_state->properties_written != 0)
blob_written |= guac_common_json_write(user, stream,
json_state, ",", 1);
/* Write property name */
blob_written |= guac_common_json_write_string(user, stream,
json_state, name);
/* Separate name from value with colon */
blob_written |= guac_common_json_write(user, stream,
json_state, ":", 1);
/* Write property value */
blob_written |= guac_common_json_write_string(user, stream,
json_state, value);
json_state->properties_written++;
return blob_written;
}
void guac_common_json_begin_object(guac_user* user, guac_stream* stream,
guac_common_json_state* json_state) {
/* Init JSON state */
json_state->size = 0;
json_state->properties_written = 0;
/* Write leading brace - no blob can possibly be written by this */
assert(!guac_common_json_write(user, stream, json_state, "{", 1));
}
int guac_common_json_end_object(guac_user* user, guac_stream* stream,
guac_common_json_state* json_state) {
/* Write final brace of JSON object */
return guac_common_json_write(user, stream, json_state, "}", 1);
}

81
src/common/list.c Normal file
View File

@ -0,0 +1,81 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#include "config.h"
#include "common/list.h"
#include <stdlib.h>
#include <pthread.h>
guac_common_list* guac_common_list_alloc() {
guac_common_list* list = malloc(sizeof(guac_common_list));
pthread_mutex_init(&list->_lock, NULL);
list->head = NULL;
return list;
}
void guac_common_list_free(guac_common_list* list) {
free(list);
}
guac_common_list_element* guac_common_list_add(guac_common_list* list,
void* data) {
/* Allocate element, initialize as new head */
guac_common_list_element* element =
malloc(sizeof(guac_common_list_element));
element->data = data;
element->next = list->head;
element->_ptr = &(list->head);
/* If head already existed, point it at this element */
if (list->head != NULL)
list->head->_ptr = &(element->next);
/* Set as new head */
list->head = element;
return element;
}
void guac_common_list_remove(guac_common_list* list,
guac_common_list_element* element) {
/* Point previous (or head) to next */
*(element->_ptr) = element->next;
if (element->next != NULL)
element->next->_ptr = element->_ptr;
free(element);
}
void guac_common_list_lock(guac_common_list* list) {
pthread_mutex_lock(&list->_lock);
}
void guac_common_list_unlock(guac_common_list* list) {
pthread_mutex_unlock(&list->_lock);
}

View File

@ -0,0 +1,96 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#include "config.h"
#include <cairo/cairo.h>
#include <guacamole/client.h>
#include <guacamole/layer.h>
#include <guacamole/protocol.h>
#include <guacamole/socket.h>
#include <guacamole/user.h>
/* Macros for prettying up the embedded image. */
#define X 0x00,0x00,0x00,0xFF
#define O 0xFF,0xFF,0xFF,0xFF
#define _ 0x00,0x00,0x00,0x00
/* Dimensions */
const int guac_common_pointer_cursor_width = 11;
const int guac_common_pointer_cursor_height = 16;
/* Format */
const cairo_format_t guac_common_pointer_cursor_format = CAIRO_FORMAT_ARGB32;
const int guac_common_pointer_cursor_stride = 44;
/* Embedded pointer graphic */
unsigned char guac_common_pointer_cursor[] = {
O,_,_,_,_,_,_,_,_,_,_,
O,O,_,_,_,_,_,_,_,_,_,
O,X,O,_,_,_,_,_,_,_,_,
O,X,X,O,_,_,_,_,_,_,_,
O,X,X,X,O,_,_,_,_,_,_,
O,X,X,X,X,O,_,_,_,_,_,
O,X,X,X,X,X,O,_,_,_,_,
O,X,X,X,X,X,X,O,_,_,_,
O,X,X,X,X,X,X,X,O,_,_,
O,X,X,X,X,X,X,X,X,O,_,
O,X,X,X,X,X,O,O,O,O,O,
O,X,X,O,X,X,O,_,_,_,_,
O,X,O,_,O,X,X,O,_,_,_,
O,O,_,_,O,X,X,O,_,_,_,
O,_,_,_,_,O,X,X,O,_,_,
_,_,_,_,_,O,O,O,O,_,_
};
void guac_common_set_pointer_cursor(guac_user* user) {
guac_client* client = user->client;
guac_socket* socket = user->socket;
/* Draw to buffer */
guac_layer* cursor = guac_client_alloc_buffer(client);
cairo_surface_t* graphic = cairo_image_surface_create_for_data(
guac_common_pointer_cursor,
guac_common_pointer_cursor_format,
guac_common_pointer_cursor_width,
guac_common_pointer_cursor_height,
guac_common_pointer_cursor_stride);
guac_user_stream_png(user, socket, GUAC_COMP_SRC, cursor,
0, 0, graphic);
cairo_surface_destroy(graphic);
/* Set cursor */
guac_protocol_send_cursor(socket, 0, 0, cursor,
0, 0,
guac_common_pointer_cursor_width,
guac_common_pointer_cursor_height);
/* Free buffer */
guac_client_free_buffer(client, cursor);
guac_client_log(client, GUAC_LOG_DEBUG,
"Client cursor image set to generic built-in pointer.");
}

266
src/common/rect.c Normal file
View File

@ -0,0 +1,266 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#include "config.h"
#include "common/rect.h"
void guac_common_rect_init(guac_common_rect* rect, int x, int y, int width, int height) {
rect->x = x;
rect->y = y;
rect->width = width;
rect->height = height;
}
void guac_common_rect_extend(guac_common_rect* rect, const guac_common_rect* min) {
/* Calculate extents of existing dirty rect */
int left = rect->x;
int top = rect->y;
int right = left + rect->width;
int bottom = top + rect->height;
/* Calculate missing extents of given new rect */
int min_left = min->x;
int min_top = min->y;
int min_right = min_left + min->width;
int min_bottom = min_top + min->height;
/* Update minimums */
if (min_left < left) left = min_left;
if (min_top < top) top = min_top;
if (min_right > right) right = min_right;
if (min_bottom > bottom) bottom = min_bottom;
/* Commit rect */
guac_common_rect_init(rect, left, top, right - left, bottom - top);
}
void guac_common_rect_constrain(guac_common_rect* rect, const guac_common_rect* max) {
/* Calculate extents of existing dirty rect */
int left = rect->x;
int top = rect->y;
int right = left + rect->width;
int bottom = top + rect->height;
/* Calculate missing extents of given new rect */
int max_left = max->x;
int max_top = max->y;
int max_right = max_left + max->width;
int max_bottom = max_top + max->height;
/* Update maximums */
if (max_left > left) left = max_left;
if (max_top > top) top = max_top;
if (max_right < right) right = max_right;
if (max_bottom < bottom) bottom = max_bottom;
/* Commit rect */
guac_common_rect_init(rect, left, top, right - left, bottom - top);
}
int guac_common_rect_expand_to_grid(int cell_size, guac_common_rect* rect,
const guac_common_rect* max_rect) {
/* Invalid cell_size received */
if (cell_size <= 0)
return -1;
/* Nothing to do */
if (cell_size == 1)
return 0;
/* Calculate how much the rectangle must be adjusted to fit within the
* given cell size. */
int dw = cell_size - rect->width % cell_size;
int dh = cell_size - rect->height % cell_size;
int dx = dw / 2;
int dy = dh / 2;
/* Set initial extents of adjusted rectangle. */
int top = rect->y - dy;
int left = rect->x - dx;
int bottom = top + rect->height + dh;
int right = left + rect->width + dw;
/* The max rectangle */
int max_left = max_rect->x;
int max_top = max_rect->y;
int max_right = max_left + max_rect->width;
int max_bottom = max_top + max_rect->height;
/* If the adjusted rectangle has sides beyond the max rectangle, or is larger
* in any direction; shift or adjust the rectangle while trying to fit in
* the grid */
/* Adjust left/right */
if (right > max_right) {
/* shift to left */
dw = right - max_right;
right -= dw;
left -= dw;
/* clamp left if too far */
if (left < max_left) {
left = max_left;
}
}
else if (left < max_left) {
/* shift to right */
dw = max_left - left;
left += dw;
right += dw;
/* clamp right if too far */
if (right > max_right) {
right = max_right;
}
}
/* Adjust top/bottom */
if (bottom > max_bottom) {
/* shift up */
dh = bottom - max_bottom;
bottom -= dh;
top -= dh;
/* clamp top if too far */
if (top < max_top) {
top = max_top;
}
}
else if (top < max_top) {
/* shift down */
dh = max_top - top;
top += dh;
bottom += dh;
/* clamp bottom if too far */
if (bottom > max_bottom) {
bottom = max_bottom;
}
}
/* Commit rect */
guac_common_rect_init(rect, left, top, right - left, bottom - top);
return 0;
}
int guac_common_rect_intersects(const guac_common_rect* rect,
const guac_common_rect* other) {
/* Empty (no intersection) */
if (other->x + other->width < rect->x || rect->x + rect->width < other->x ||
other->y + other->height < rect->y || rect->y + rect->height < other->y) {
return 0;
}
/* Complete */
else if (other->x <= rect->x && (other->x + other->width) >= (rect->x + rect->width) &&
other->y <= rect->y && (other->y + other->height) >= (rect->y + rect->height)) {
return 2;
}
/* Partial intersection */
return 1;
}
int guac_common_rect_clip_and_split(guac_common_rect* rect,
const guac_common_rect* hole, guac_common_rect* split_rect) {
/* Only continue if the rectangles intersects */
if (!guac_common_rect_intersects(rect, hole))
return 0;
int top, left, bottom, right;
/* Clip and split top */
if (rect->y < hole->y) {
top = rect->y;
left = rect->x;
bottom = hole->y;
right = rect->x + rect->width;
guac_common_rect_init(split_rect, left, top, right - left, bottom - top);
/* Re-initialize original rect */
top = hole->y;
bottom = rect->y + rect->height;
guac_common_rect_init(rect, left, top, right - left, bottom - top);
return 1;
}
/* Clip and split left */
else if (rect->x < hole->x) {
top = rect->y;
left = rect->x;
bottom = rect->y + rect->height;
right = hole->x;
guac_common_rect_init(split_rect, left, top, right - left, bottom - top);
/* Re-initialize original rect */
left = hole->x;
right = rect->x + rect->width;
guac_common_rect_init(rect, left, top, right - left, bottom - top);
return 1;
}
/* Clip and split bottom */
else if (rect->y + rect->height > hole->y + hole->height) {
top = hole->y + hole->height;
left = rect->x;
bottom = rect->y + rect->height;
right = rect->x + rect->width;
guac_common_rect_init(split_rect, left, top, right - left, bottom - top);
/* Re-initialize original rect */
top = rect->y;
bottom = hole->y + hole->height;
guac_common_rect_init(rect, left, top, right - left, bottom - top);
return 1;
}
/* Clip and split right */
else if (rect->x + rect->width > hole->x + hole->width) {
top = rect->y;
left = hole->x + hole->width;
bottom = rect->y + rect->height;
right = rect->x + rect->width;
guac_common_rect_init(split_rect, left, top, right - left, bottom - top);
/* Re-initialize original rect */
left = rect->x;
right = hole->x + hole->width;
guac_common_rect_init(rect, left, top, right - left, bottom - top);
return 1;
}
return 0;
}

90
src/common/string.c Normal file
View File

@ -0,0 +1,90 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#include "config.h"
#include "common/string.h"
#include <stdlib.h>
#include <string.h>
int guac_count_occurrences(const char* string, char c) {
int count = 0;
while (*string != 0) {
/* Count each occurrence */
if (*string == c)
count++;
/* Next character */
string++;
}
return count;
}
char** guac_split(const char* string, char delim) {
int i = 0;
int token_count = guac_count_occurrences(string, delim) + 1;
const char* token_start = string;
/* Allocate space for tokens */
char** tokens = malloc(sizeof(char*) * (token_count+1));
do {
int length;
char* token;
/* Find end of token */
while (*string != 0 && *string != delim)
string++;
/* Calculate token length */
length = string - token_start;
/* Allocate space for token and NULL terminator */
tokens[i++] = token = malloc(length + 1);
/* Copy token, store null */
memcpy(token, token_start, length);
token[length] = 0;
/* Stop at end of string */
if (*string == 0)
break;
/* Next token */
token_start = ++string;
} while (i < token_count);
/* NULL terminator */
tokens[i] = NULL;
return tokens;
}

2041
src/common/surface.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,76 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# NOTE: Parts of this file (Makefile.am) are automatically transcluded verbatim
# into Makefile.in. Though the build system (GNU Autotools) automatically adds
# its own license boilerplate to the generated Makefile.in, that boilerplate
# does not apply to the transcluded portions of Makefile.am which are licensed
# to you by the ASF under the Apache License, Version 2.0, as described above.
#
AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I m4
#
# Unit tests for libguac_common
#
check_PROGRAMS = test_common
TESTS = $(check_PROGRAMS)
noinst_HEADERS = \
iconv/convert-test-data.h
test_common_SOURCES = \
iconv/convert.c \
iconv/convert-test-data.c \
rect/clip_and_split.c \
rect/constrain.c \
rect/expand_to_grid.c \
rect/extend.c \
rect/init.c \
rect/intersects.c \
string/count_occurrences.c \
string/split.c
test_common_CFLAGS = \
-Werror -Wall -pedantic \
@COMMON_INCLUDE@
test_common_LDADD = \
@COMMON_LTLIB@ \
@CUNIT_LIBS@
#
# Autogenerate test runner
#
GEN_RUNNER = $(top_srcdir)/util/generate-test-runner.pl
CLEANFILES = _generated_runner.c
_generated_runner.c: $(test_common_SOURCES)
$(AM_V_GEN) $(GEN_RUNNER) $(test_common_SOURCES) > $@
nodist_test_common_SOURCES = \
_generated_runner.c
# Use automake's TAP test driver for running any tests
LOG_DRIVER = \
env AM_TAP_AWK='$(AWK)' \
$(SHELL) $(top_srcdir)/build-aux/tap-driver.sh

View File

@ -0,0 +1,153 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#include "common/iconv.h"
#include "convert-test-data.h"
encoding_test_parameters test_params[NUM_SUPPORTED_ENCODINGS] = {
/*
* UTF-8
*/
{
"UTF-8",
GUAC_READ_UTF8, GUAC_READ_UTF8_NORMALIZED,
GUAC_WRITE_UTF8, GUAC_WRITE_UTF8_CRLF,
.test_mixed = TEST_STRING(
"pap\xC3\xA0 \xC3\xA8 bello\n"
"pap\xC3\xA0 \xC3\xA8 bello\r\n"
"pap\xC3\xA0 \xC3\xA8 bello\n"
"pap\xC3\xA0 \xC3\xA8 bello\r\n"
"pap\xC3\xA0 \xC3\xA8 bello"
),
.test_unix = TEST_STRING(
"pap\xC3\xA0 \xC3\xA8 bello\n"
"pap\xC3\xA0 \xC3\xA8 bello\n"
"pap\xC3\xA0 \xC3\xA8 bello\n"
"pap\xC3\xA0 \xC3\xA8 bello\n"
"pap\xC3\xA0 \xC3\xA8 bello"
),
.test_windows = TEST_STRING(
"pap\xC3\xA0 \xC3\xA8 bello\r\n"
"pap\xC3\xA0 \xC3\xA8 bello\r\n"
"pap\xC3\xA0 \xC3\xA8 bello\r\n"
"pap\xC3\xA0 \xC3\xA8 bello\r\n"
"pap\xC3\xA0 \xC3\xA8 bello"
)
},
/*
* UTF-16
*/
{
"UTF-16",
GUAC_READ_UTF16, GUAC_READ_UTF16_NORMALIZED,
GUAC_WRITE_UTF16, GUAC_WRITE_UTF16_CRLF,
.test_mixed = TEST_STRING(
"p\x00" "a\x00" "p\x00" "\xE0\x00" " \x00" "\xE8\x00" " \x00" "b\x00" "e\x00" "l\x00" "l\x00" "o\x00" "\n\x00"
"p\x00" "a\x00" "p\x00" "\xE0\x00" " \x00" "\xE8\x00" " \x00" "b\x00" "e\x00" "l\x00" "l\x00" "o\x00" "\r\x00" "\n\x00"
"p\x00" "a\x00" "p\x00" "\xE0\x00" " \x00" "\xE8\x00" " \x00" "b\x00" "e\x00" "l\x00" "l\x00" "o\x00" "\n\x00"
"p\x00" "a\x00" "p\x00" "\xE0\x00" " \x00" "\xE8\x00" " \x00" "b\x00" "e\x00" "l\x00" "l\x00" "o\x00" "\r\x00" "\n\x00"
"p\x00" "a\x00" "p\x00" "\xE0\x00" " \x00" "\xE8\x00" " \x00" "b\x00" "e\x00" "l\x00" "l\x00" "o\x00"
"\x00"
),
.test_unix = TEST_STRING(
"p\x00" "a\x00" "p\x00" "\xE0\x00" " \x00" "\xE8\x00" " \x00" "b\x00" "e\x00" "l\x00" "l\x00" "o\x00" "\n\x00"
"p\x00" "a\x00" "p\x00" "\xE0\x00" " \x00" "\xE8\x00" " \x00" "b\x00" "e\x00" "l\x00" "l\x00" "o\x00" "\n\x00"
"p\x00" "a\x00" "p\x00" "\xE0\x00" " \x00" "\xE8\x00" " \x00" "b\x00" "e\x00" "l\x00" "l\x00" "o\x00" "\n\x00"
"p\x00" "a\x00" "p\x00" "\xE0\x00" " \x00" "\xE8\x00" " \x00" "b\x00" "e\x00" "l\x00" "l\x00" "o\x00" "\n\x00"
"p\x00" "a\x00" "p\x00" "\xE0\x00" " \x00" "\xE8\x00" " \x00" "b\x00" "e\x00" "l\x00" "l\x00" "o\x00"
"\x00"
),
.test_windows = TEST_STRING(
"p\x00" "a\x00" "p\x00" "\xE0\x00" " \x00" "\xE8\x00" " \x00" "b\x00" "e\x00" "l\x00" "l\x00" "o\x00" "\r\x00" "\n\x00"
"p\x00" "a\x00" "p\x00" "\xE0\x00" " \x00" "\xE8\x00" " \x00" "b\x00" "e\x00" "l\x00" "l\x00" "o\x00" "\r\x00" "\n\x00"
"p\x00" "a\x00" "p\x00" "\xE0\x00" " \x00" "\xE8\x00" " \x00" "b\x00" "e\x00" "l\x00" "l\x00" "o\x00" "\r\x00" "\n\x00"
"p\x00" "a\x00" "p\x00" "\xE0\x00" " \x00" "\xE8\x00" " \x00" "b\x00" "e\x00" "l\x00" "l\x00" "o\x00" "\r\x00" "\n\x00"
"p\x00" "a\x00" "p\x00" "\xE0\x00" " \x00" "\xE8\x00" " \x00" "b\x00" "e\x00" "l\x00" "l\x00" "o\x00"
"\x00"
)
},
/*
* ISO 8859-1
*/
{
"ISO 8859-1",
GUAC_READ_ISO8859_1, GUAC_READ_ISO8859_1_NORMALIZED,
GUAC_WRITE_ISO8859_1, GUAC_WRITE_ISO8859_1_CRLF,
.test_mixed = TEST_STRING(
"pap\xE0 \xE8 bello\n"
"pap\xE0 \xE8 bello\r\n"
"pap\xE0 \xE8 bello\n"
"pap\xE0 \xE8 bello\r\n"
"pap\xE0 \xE8 bello"
),
.test_unix = TEST_STRING(
"pap\xE0 \xE8 bello\n"
"pap\xE0 \xE8 bello\n"
"pap\xE0 \xE8 bello\n"
"pap\xE0 \xE8 bello\n"
"pap\xE0 \xE8 bello"
),
.test_windows = TEST_STRING(
"pap\xE0 \xE8 bello\r\n"
"pap\xE0 \xE8 bello\r\n"
"pap\xE0 \xE8 bello\r\n"
"pap\xE0 \xE8 bello\r\n"
"pap\xE0 \xE8 bello"
)
},
/*
* CP-1252
*/
{
"CP-1252",
GUAC_READ_CP1252, GUAC_READ_CP1252_NORMALIZED,
GUAC_WRITE_CP1252, GUAC_WRITE_CP1252_CRLF,
.test_mixed = TEST_STRING(
"pap\xE0 \xE8 bello\n"
"pap\xE0 \xE8 bello\r\n"
"pap\xE0 \xE8 bello\n"
"pap\xE0 \xE8 bello\r\n"
"pap\xE0 \xE8 bello"
),
.test_unix = TEST_STRING(
"pap\xE0 \xE8 bello\n"
"pap\xE0 \xE8 bello\n"
"pap\xE0 \xE8 bello\n"
"pap\xE0 \xE8 bello\n"
"pap\xE0 \xE8 bello"
),
.test_windows = TEST_STRING(
"pap\xE0 \xE8 bello\r\n"
"pap\xE0 \xE8 bello\r\n"
"pap\xE0 \xE8 bello\r\n"
"pap\xE0 \xE8 bello\r\n"
"pap\xE0 \xE8 bello"
)
}
};

View File

@ -0,0 +1,121 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#include "common/iconv.h"
/**
* Representation of test string data and its length in bytes.
*/
typedef struct test_string {
/**
* The raw content of the test string.
*/
unsigned char* buffer;
/**
* The number of bytes within the test string, including null terminator.
*/
int size;
} test_string;
/**
* Convenience macro which statically-initializes a test_string with the given
* string value, automatically calculating its size in bytes.
*
* @param value
* The string value.
*/
#define TEST_STRING(value) { \
.buffer = (unsigned char*) (value), \
.size = sizeof(value) \
}
/**
* The parameters applicable to a unit test for a particular encoding supported
* by guac_iconv().
*/
typedef struct encoding_test_parameters {
/**
* The human-readable name of this encoding. This will be logged to the
* test suite log to assist with debugging test failures.
*/
const char* name;
/**
* Reader function which reads using this encoding and does not perform any
* transformation on newline characters.
*/
guac_iconv_read* reader;
/**
* Reader function which reads using this encoding and automatically
* normalizes newline sequences to Unix-style newline characters.
*/
guac_iconv_read* reader_normalized;
/**
* Writer function which writes using this encoding and does not perform
* any transformation on newline characters.
*/
guac_iconv_write* writer;
/**
* Writer function which writes using this encoding, but writes newline
* characters as CRLF sequences.
*/
guac_iconv_write* writer_crlf;
/**
* A test string having both Windows- and Unix-style line endings. Except
* for the line endings, the characters represented within this test string
* must be identical to all other test strings.
*/
test_string test_mixed;
/**
* A test string having only Unix-style line endings. Except for the line
* endings, the characters represented within this test string must be
* identical to all other test strings.
*/
test_string test_unix;
/**
* A test string having only Windows-style line endings. Except for the
* line endings, the characters represented within this test string must be
* identical to all other test strings.
*/
test_string test_windows;
} encoding_test_parameters;
/**
* The total number of encodings supported by guac_iconv().
*/
#define NUM_SUPPORTED_ENCODINGS 4
/**
* Test parameters for each supported encoding. The test strings included each
* consist of five repeated lines of "papà è bello", omitting the line ending
* of the final line.
*/
extern encoding_test_parameters test_params[NUM_SUPPORTED_ENCODINGS];

View File

@ -0,0 +1,129 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#include "common/iconv.h"
#include "convert-test-data.h"
#include <CUnit/CUnit.h>
#include <stdio.h>
/**
* Tests that conversion between character sets using the given guac_iconv_read
* and guac_iconv_write implementations matches expectations.
*
* @param reader
* The guac_iconv_read implementation to use to read the input string.
*
* @param in_string
* A pointer to the test_string structure describing the input string being
* tested.
*
* @param writer
* The guac_iconv_write implementation to use to write the output string
* (the converted input string).
*
* @param out_string
* A pointer to the test_string structure describing the expected result of
* the conversion.
*/
static void verify_conversion(
guac_iconv_read* reader, test_string* in_string,
guac_iconv_write* writer, test_string* out_string) {
char output[4096];
char input[4096];
const char* current_input = input;
char* current_output = output;
memcpy(input, in_string->buffer, in_string->size);
guac_iconv(reader, &current_input, sizeof(input),
writer, &current_output, sizeof(output));
/* Verify output length */
CU_ASSERT_EQUAL(out_string->size, current_output - output);
/* Verify entire input read */
CU_ASSERT_EQUAL(in_string->size, current_input - input);
/* Verify output content */
CU_ASSERT_EQUAL(0, memcmp(output, out_string->buffer, out_string->size));
}
/**
* Test which verifies that every supported encoding can be correctly converted
* to every other supported encoding, with all line endings preserved verbatim
* (not normalized).
*/
void test_iconv__preserve() {
for (int i = 0; i < NUM_SUPPORTED_ENCODINGS; i++) {
for (int j = 0; j < NUM_SUPPORTED_ENCODINGS; j++) {
encoding_test_parameters* from = &test_params[i];
encoding_test_parameters* to = &test_params[j];
printf("# \"%s\" -> \"%s\" ...\n", from->name, to->name);
verify_conversion(from->reader, &from->test_mixed,
to->writer, &to->test_mixed);
}
}
}
/**
* Test which verifies that every supported encoding can be correctly converted
* to every other supported encoding, normalizing all line endings to
* Unix-style line endings.
*/
void test_iconv__normalize_unix() {
for (int i = 0; i < NUM_SUPPORTED_ENCODINGS; i++) {
for (int j = 0; j < NUM_SUPPORTED_ENCODINGS; j++) {
encoding_test_parameters* from = &test_params[i];
encoding_test_parameters* to = &test_params[j];
printf("# \"%s\" -> \"%s\" ...\n", from->name, to->name);
verify_conversion(from->reader_normalized, &from->test_mixed,
to->writer, &to->test_unix);
}
}
}
/**
* Test which verifies that every supported encoding can be correctly converted
* to every other supported encoding, normalizing all line endings to
* Windows-style line endings.
*/
void test_iconv__normalize_crlf() {
for (int i = 0; i < NUM_SUPPORTED_ENCODINGS; i++) {
for (int j = 0; j < NUM_SUPPORTED_ENCODINGS; j++) {
encoding_test_parameters* from = &test_params[i];
encoding_test_parameters* to = &test_params[j];
printf("# \"%s\" -> \"%s\" ...\n", from->name, to->name);
verify_conversion(from->reader_normalized, &from->test_mixed,
to->writer_crlf, &to->test_windows);
}
}
}

View File

@ -0,0 +1,156 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#include "common/rect.h"
#include <CUnit/CUnit.h>
/**
* Test which verifies that guac_common_rect_clip_and_split() divides a
* rectangle into subrectangles after removing a "hole" rectangle.
*/
void test_rect__clip_and_split() {
int res;
guac_common_rect cut;
guac_common_rect min;
guac_common_rect rect;
guac_common_rect_init(&min, 10, 10, 10, 10);
/* Clip top */
guac_common_rect_init(&rect, 10, 5, 10, 10);
res = guac_common_rect_clip_and_split(&rect, &min, &cut);
CU_ASSERT_EQUAL(1, res);
CU_ASSERT_EQUAL(10, cut.x);
CU_ASSERT_EQUAL(5, cut.y);
CU_ASSERT_EQUAL(10, cut.width);
CU_ASSERT_EQUAL(5, cut.height);
CU_ASSERT_EQUAL(10, rect.x);
CU_ASSERT_EQUAL(10, rect.y);
CU_ASSERT_EQUAL(10, rect.width);
CU_ASSERT_EQUAL(5, rect.height);
/* Clip bottom */
guac_common_rect_init(&rect, 10, 15, 10, 10);
res = guac_common_rect_clip_and_split(&rect, &min, &cut);
CU_ASSERT_EQUAL(1, res);
CU_ASSERT_EQUAL(10, cut.x);
CU_ASSERT_EQUAL(20, cut.y);
CU_ASSERT_EQUAL(10, cut.width);
CU_ASSERT_EQUAL(5, cut.height);
CU_ASSERT_EQUAL(10, rect.x);
CU_ASSERT_EQUAL(15, rect.y);
CU_ASSERT_EQUAL(10, rect.width);
CU_ASSERT_EQUAL(5, rect.height);
/* Clip left */
guac_common_rect_init(&rect, 5, 10, 10, 10);
res = guac_common_rect_clip_and_split(&rect, &min, &cut);
CU_ASSERT_EQUAL(1, res);
CU_ASSERT_EQUAL(5, cut.x);
CU_ASSERT_EQUAL(10, cut.y);
CU_ASSERT_EQUAL(5, cut.width);
CU_ASSERT_EQUAL(10, cut.height);
CU_ASSERT_EQUAL(10, rect.x);
CU_ASSERT_EQUAL(10, rect.y);
CU_ASSERT_EQUAL(5, rect.width);
CU_ASSERT_EQUAL(10, rect.height);
/* Clip right */
guac_common_rect_init(&rect, 15, 10, 10, 10);
res = guac_common_rect_clip_and_split(&rect, &min, &cut);
CU_ASSERT_EQUAL(1, res);
CU_ASSERT_EQUAL(20, cut.x);
CU_ASSERT_EQUAL(10, cut.y);
CU_ASSERT_EQUAL(5, cut.width);
CU_ASSERT_EQUAL(10, cut.height);
CU_ASSERT_EQUAL(15, rect.x);
CU_ASSERT_EQUAL(10, rect.y);
CU_ASSERT_EQUAL(5, rect.width);
CU_ASSERT_EQUAL(10, rect.height);
/*
* Test a rectangle which completely covers the hole.
* Clip and split until done.
*/
guac_common_rect_init(&rect, 5, 5, 20, 20);
/* Clip top */
res = guac_common_rect_clip_and_split(&rect, &min, &cut);
CU_ASSERT_EQUAL(1, res);
CU_ASSERT_EQUAL(5, cut.x);
CU_ASSERT_EQUAL(5, cut.y);
CU_ASSERT_EQUAL(20, cut.width);
CU_ASSERT_EQUAL(5, cut.height);
CU_ASSERT_EQUAL(5, rect.x);
CU_ASSERT_EQUAL(10, rect.y);
CU_ASSERT_EQUAL(20, rect.width);
CU_ASSERT_EQUAL(15, rect.height);
/* Clip left */
res = guac_common_rect_clip_and_split(&rect, &min, &cut);
CU_ASSERT_EQUAL(1, res);
CU_ASSERT_EQUAL(5, cut.x);
CU_ASSERT_EQUAL(10, cut.y);
CU_ASSERT_EQUAL(5, cut.width);
CU_ASSERT_EQUAL(15, cut.height);
CU_ASSERT_EQUAL(10, rect.x);
CU_ASSERT_EQUAL(10, rect.y);
CU_ASSERT_EQUAL(15, rect.width);
CU_ASSERT_EQUAL(15, rect.height);
/* Clip bottom */
res = guac_common_rect_clip_and_split(&rect, &min, &cut);
CU_ASSERT_EQUAL(1, res);
CU_ASSERT_EQUAL(10, cut.x);
CU_ASSERT_EQUAL(20, cut.y);
CU_ASSERT_EQUAL(15, cut.width);
CU_ASSERT_EQUAL(5, cut.height);
CU_ASSERT_EQUAL(10, rect.x);
CU_ASSERT_EQUAL(10, rect.y);
CU_ASSERT_EQUAL(15, rect.width);
CU_ASSERT_EQUAL(10, rect.height);
/* Clip right */
res = guac_common_rect_clip_and_split(&rect, &min, &cut);
CU_ASSERT_EQUAL(20, cut.x);
CU_ASSERT_EQUAL(10, cut.y);
CU_ASSERT_EQUAL(5, cut.width);
CU_ASSERT_EQUAL(10, cut.height);
CU_ASSERT_EQUAL(10, rect.x);
CU_ASSERT_EQUAL(10, rect.y);
CU_ASSERT_EQUAL(10, rect.width);
CU_ASSERT_EQUAL(10, rect.height);
/* Make sure nothing is left to do */
res = guac_common_rect_clip_and_split(&rect, &min, &cut);
CU_ASSERT_EQUAL(0, res);
}

View File

@ -0,0 +1,43 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#include "common/rect.h"
#include <CUnit/CUnit.h>
/**
* Test which verifies that guac_common_rect_constrain() restricts a given
* rectangle to arbitrary bounds.
*/
void test_rect__constrain() {
guac_common_rect max;
guac_common_rect rect;
guac_common_rect_init(&rect, -10, -10, 110, 110);
guac_common_rect_init(&max, 0, 0, 100, 100);
guac_common_rect_constrain(&rect, &max);
CU_ASSERT_EQUAL(0, rect.x);
CU_ASSERT_EQUAL(0, rect.y);
CU_ASSERT_EQUAL(100, rect.width);
CU_ASSERT_EQUAL(100, rect.height);
}

View File

@ -0,0 +1,71 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#include "common/rect.h"
#include <CUnit/CUnit.h>
/**
* Test which verifies guac_common_rect_expand_to_grid() properly shifts and
* resizes rectangles to fit an NxN grid.
*/
void test_rect__expand_to_grid() {
int cell_size = 16;
guac_common_rect max;
guac_common_rect rect;
/* Simple adjustment */
guac_common_rect_init(&rect, 0, 0, 25, 25);
guac_common_rect_init(&max, 0, 0, 100, 100);
guac_common_rect_expand_to_grid(cell_size, &rect, &max);
CU_ASSERT_EQUAL(0, rect.x);
CU_ASSERT_EQUAL(0, rect.y);
CU_ASSERT_EQUAL(32, rect.width);
CU_ASSERT_EQUAL(32, rect.height);
/* Adjustment with moving of rect */
guac_common_rect_init(&rect, 75, 75, 25, 25);
guac_common_rect_init(&max, 0, 0, 100, 100);
guac_common_rect_expand_to_grid(cell_size, &rect, &max);
CU_ASSERT_EQUAL(max.width - 32, rect.x);
CU_ASSERT_EQUAL(max.height - 32, rect.y);
CU_ASSERT_EQUAL(32, rect.width);
CU_ASSERT_EQUAL(32, rect.height);
guac_common_rect_init(&rect, -5, -5, 25, 25);
guac_common_rect_init(&max, 0, 0, 100, 100);
guac_common_rect_expand_to_grid(cell_size, &rect, &max);
CU_ASSERT_EQUAL(0, rect.x);
CU_ASSERT_EQUAL(0, rect.y);
CU_ASSERT_EQUAL(32, rect.width);
CU_ASSERT_EQUAL(32, rect.height);
/* Adjustment with moving and clamping of rect */
guac_common_rect_init(&rect, 0, 0, 25, 15);
guac_common_rect_init(&max, 0, 5, 32, 15);
guac_common_rect_expand_to_grid(cell_size, &rect, &max);
CU_ASSERT_EQUAL(max.x, rect.x);
CU_ASSERT_EQUAL(max.y, rect.y);
CU_ASSERT_EQUAL(max.width, rect.width);
CU_ASSERT_EQUAL(max.height, rect.height);
}

View File

@ -0,0 +1,42 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#include "common/rect.h"
#include <CUnit/CUnit.h>
/**
* Test which verifies that guac_common_rect_extend() expands the given
* rectangle as necessary to contain at least the given bounds.
*/
void test_rect__extend() {
guac_common_rect max;
guac_common_rect rect;
guac_common_rect_init(&rect, 10, 10, 90, 90);
guac_common_rect_init(&max, 0, 0, 100, 100);
guac_common_rect_extend(&rect, &max);
CU_ASSERT_EQUAL(0, rect.x);
CU_ASSERT_EQUAL(0, rect.y);
CU_ASSERT_EQUAL(100, rect.width);
CU_ASSERT_EQUAL(100, rect.height);
}

View File

@ -0,0 +1,39 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#include "common/rect.h"
#include <CUnit/CUnit.h>
/**
* Test which verifies rectangle initialization via guac_common_rect_init().
*/
void test_rect__init() {
guac_common_rect max;
guac_common_rect_init(&max, 0, 0, 100, 100);
CU_ASSERT_EQUAL(0, max.x);
CU_ASSERT_EQUAL(0, max.y);
CU_ASSERT_EQUAL(100, max.width);
CU_ASSERT_EQUAL(100, max.height);
}

View File

@ -0,0 +1,91 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#include "common/rect.h"
#include <CUnit/CUnit.h>
/**
* Test which verifies intersection testing via guac_common_rect_intersects().
*/
void test_rect__intersects() {
int res;
guac_common_rect min;
guac_common_rect rect;
guac_common_rect_init(&min, 10, 10, 10, 10);
/* Rectangle intersection - empty
* rectangle is outside */
guac_common_rect_init(&rect, 25, 25, 5, 5);
res = guac_common_rect_intersects(&rect, &min);
CU_ASSERT_EQUAL(0, res);
/* Rectangle intersection - complete
* rectangle is completely inside */
guac_common_rect_init(&rect, 11, 11, 5, 5);
res = guac_common_rect_intersects(&rect, &min);
CU_ASSERT_EQUAL(2, res);
/* Rectangle intersection - partial
* rectangle intersects UL */
guac_common_rect_init(&rect, 8, 8, 5, 5);
res = guac_common_rect_intersects(&rect, &min);
CU_ASSERT_EQUAL(1, res);
/* Rectangle intersection - partial
* rectangle intersects LR */
guac_common_rect_init(&rect, 18, 18, 5, 5);
res = guac_common_rect_intersects(&rect, &min);
CU_ASSERT_EQUAL(1, res);
/* Rectangle intersection - complete
* rect intersects along UL but inside */
guac_common_rect_init(&rect, 10, 10, 5, 5);
res = guac_common_rect_intersects(&rect, &min);
CU_ASSERT_EQUAL(2, res);
/* Rectangle intersection - partial
* rectangle intersects along L but outside */
guac_common_rect_init(&rect, 5, 10, 5, 5);
res = guac_common_rect_intersects(&rect, &min);
CU_ASSERT_EQUAL(1, res);
/* Rectangle intersection - complete
* rectangle intersects along LR but rest is inside */
guac_common_rect_init(&rect, 15, 15, 5, 5);
res = guac_common_rect_intersects(&rect, &min);
CU_ASSERT_EQUAL(2, res);
/* Rectangle intersection - partial
* rectangle intersects along R but rest is outside */
guac_common_rect_init(&rect, 20, 10, 5, 5);
res = guac_common_rect_intersects(&rect, &min);
CU_ASSERT_EQUAL(1, res);
/* Rectangle intersection - partial
* rectangle encloses min; which is a partial intersection */
guac_common_rect_init(&rect, 5, 5, 20, 20);
res = guac_common_rect_intersects(&rect, &min);
CU_ASSERT_EQUAL(1, res);
}

View File

@ -0,0 +1,33 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#include "common/string.h"
#include <CUnit/CUnit.h>
/**
* Test which verifies that guac_count_occurrences() counts the number of
* occurrences of an arbitrary character within a given string.
*/
void test_string__guac_count_occurrences() {
CU_ASSERT_EQUAL(4, guac_count_occurrences("this is a test string", 's'));
CU_ASSERT_EQUAL(3, guac_count_occurrences("this is a test string", 'i'));
CU_ASSERT_EQUAL(0, guac_count_occurrences("", 's'));
}

View File

@ -0,0 +1,63 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#include "common/string.h"
#include <CUnit/CUnit.h>
#include <stdlib.h>
/**
* Test which verifies that guac_split() splits a string on occurrences of a
* given character.
*/
void test_string__split() {
/* Split test string */
char** tokens = guac_split("this is a test string", ' ');
CU_ASSERT_PTR_NOT_NULL(tokens);
/* Check resulting tokens */
CU_ASSERT_PTR_NOT_NULL_FATAL(tokens[0]);
CU_ASSERT_STRING_EQUAL("this", tokens[0]);
CU_ASSERT_PTR_NOT_NULL_FATAL(tokens[1]);
CU_ASSERT_STRING_EQUAL("is", tokens[1]);
CU_ASSERT_PTR_NOT_NULL_FATAL(tokens[2]);
CU_ASSERT_STRING_EQUAL("a", tokens[2]);
CU_ASSERT_PTR_NOT_NULL_FATAL(tokens[3]);
CU_ASSERT_STRING_EQUAL("test", tokens[3]);
CU_ASSERT_PTR_NOT_NULL_FATAL(tokens[4]);
CU_ASSERT_STRING_EQUAL("string", tokens[4]);
CU_ASSERT_PTR_NULL(tokens[5]);
/* Clean up */
free(tokens[0]);
free(tokens[1]);
free(tokens[2]);
free(tokens[3]);
free(tokens[4]);
free(tokens);
}

View File

@ -0,0 +1,46 @@
What is guacd?
==============
[guacd](https://github.com/apache/guacamole-server/) is the native
server-side proxy used by the [Apache Guacamole web
application](http://guacamole.apache.org/). If you wish to deploy
Guacamole, or an application using the [Guacamole core
APIs](http://guacamole.apache.org/api-documentation), you will need a
copy of guacd running.
How to use this image
=====================
Running guacd for use by the [Guacamole Docker image](https://registry.hub.docker.com/u/guacamole/guacamole/)
-----------------------------------------------------
docker run --name some-guacd -d guacamole/guacd
guacd will be listening on port 4822, but this port will only be available to
Docker containers that have been explicitly linked to `some-guacd`.
Running guacd for use services by outside Docker
------------------------------------------------
docker run --name some-guacd -d -p 4822:4822 guacamole/guacd
guacd will be listening on port 4822, and Docker will expose this port on the
same server hosting Docker. Other services, such as an instance of Tomcat
running outside of Docker, will be able to connect to guacd.
Beware of the security ramifications of doing this. There is no authentication
within guacd, so allowing access from untrusted applications is dangerous. If
you need to expose guacd, ensure that you only expose it as absolutely
necessary, and that only specific trusted applications have access.
Connecting to guacd from an application
---------------------------------------
docker run --name some-app --link some-guacd:guacd -d application-that-uses-guacd
Reporting issues
================
Please report any bugs encountered by opening a new issue in
[our JIRA](https://issues.apache.org/jira/browse/GUACAMOLE/).

115
src/guacd-docker/bin/build-all.sh Executable file
View File

@ -0,0 +1,115 @@
#!/bin/sh -e
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
##
## @fn build-all.sh
##
## Builds the source of guacamole-server and its various core protocol library
## dependencies.
##
# Pre-populate build control variables such that the custom build prefix is
# used for C headers, locating libraries, etc.
export CFLAGS="-I${PREFIX_DIR}/include"
export LDFLAGS="-L${PREFIX_DIR}/lib"
export PKG_CONFIG_PATH="${PREFIX_DIR}/lib/pkgconfig"
# Ensure thread stack size will be 8 MB (glibc's default on Linux) rather than
# 128 KB (musl's default)
export LDFLAGS="$LDFLAGS -Wl,-z,stack-size=8388608"
##
## Builds and installs the source at the given git repository, automatically
## switching to the version of the source at the tag/commit that matches the
## given pattern.
##
## @param URL
## The URL of the git repository that the source should be downloaded from.
##
## @param PATTERN
## The Perl-compatible regular expression that the tag must match. If no
## tag matches the regular expression, the pattern is assumed to be an
## exact reference to a commit, branch, etc. acceptable by git checkout.
##
## @param ...
## Any additional command-line options that should be provided to CMake or
## the configure script.
##
install_from_git() {
URL="$1"
PATTERN="$2"
shift 2
# Calculate top-level directory name of resulting repository from the
# provided URL
REPO_DIR="$(basename "$URL" .git)"
# Allow dependencies to be manually omitted with the tag/commit pattern "NO"
if [ "$PATTERN" = "NO" ]; then
echo "NOT building $REPO_DIR (explicitly skipped)"
return
fi
# Clone repository and change to top-level directory of source
cd /tmp
git clone "$URL"
cd $REPO_DIR/
# Locate tag/commit based on provided pattern
VERSION="$(git tag -l --sort=-v:refname | grep -Px -m1 "$PATTERN" \
|| echo "$PATTERN")"
# Switch to desired version of source
echo "Building $REPO_DIR @ $VERSION ..."
git -c advice.detachedHead=false checkout "$VERSION"
# Configure build using CMake or GNU Autotools, whichever happens to be
# used by the library being built
if [ -e CMakeLists.txt ]; then
cmake -DCMAKE_INSTALL_PREFIX:PATH="$PREFIX_DIR" "$@" .
else
[ -e configure ] || autoreconf -fi
./configure --prefix="$PREFIX_DIR" "$@"
fi
# Build and install
make && make install
}
#
# Build and install core protocol library dependencies
#
install_from_git "https://github.com/FreeRDP/FreeRDP" "$WITH_FREERDP" $FREERDP_OPTS
install_from_git "https://github.com/libssh2/libssh2" "$WITH_LIBSSH2" $LIBSSH2_OPTS
install_from_git "https://github.com/seanmiddleditch/libtelnet" "$WITH_LIBTELNET" $LIBTELNET_OPTS
install_from_git "https://github.com/LibVNC/libvncserver" "$WITH_LIBVNCCLIENT" $LIBVNCCLIENT_OPTS
install_from_git "https://libwebsockets.org/repo/libwebsockets" "$WITH_LIBWEBSOCKETS" $LIBWEBSOCKETS_OPTS
#
# Build guacamole-server
#
cd "$BUILD_DIR"
autoreconf -fi && ./configure --prefix="$PREFIX_DIR" $GUACAMOLE_SERVER_OPTS
make && make install

View File

@ -0,0 +1,51 @@
#!/bin/sh -e
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
##
## @fn list-dependencies.sh
##
## Lists the Alpine Linux package names for all library dependencies of the
## given binaries. Each package is only listed once, even if multiple binaries
## provided by the same package are given.
##
## @param ...
## The full paths to all binaries being checked.
##
while [ -n "$1" ]; do
# For all non-Guacamole library dependencies
ldd "$1" | grep -v 'libguac' | awk '/=>/{print $(NF-1)}' \
| while read LIBRARY; do
# List the package providing that library, if any
apk info -W "$LIBRARY" 2> /dev/null \
| grep 'is owned by' | grep -o '[^ ]*$' || true
done
# Next binary
shift
# Strip the "-VERSION" suffix from each package name, listing each resulting
# package uniquely ("apk add" cannot handle package names that include the
# version number)
done | sed 's/\(.*\)-[0-9]\+\..*$/\1/' | sort -u

15
src/guacd/.gitignore vendored Normal file
View File

@ -0,0 +1,15 @@
# Compiled init script
init.d/guacd
# Compiled systemd unit
systemd/guacd.service
# Compiled proxy
guacd
guacd.exe
# Documentation (built from .in files)
man/guacd.8
man/guacd.conf.5

Some files were not shown because too many files have changed in this diff Show More