diff --git a/src/libguac/user-handshake.c b/src/libguac/user-handshake.c index a9cf003b..e9ccbacd 100644 --- a/src/libguac/user-handshake.c +++ b/src/libguac/user-handshake.c @@ -199,7 +199,7 @@ int __guac_handshake_size_handler(guac_user* user, int argc, char** argv) { } int __guac_handshake_audio_handler(guac_user* user, int argc, char** argv) { - + /* Store audio mimetypes */ user->info.audio_mimetypes = (const char**) guac_copy_mimetypes(argv, argc); @@ -208,7 +208,7 @@ int __guac_handshake_audio_handler(guac_user* user, int argc, char** argv) { } int __guac_handshake_video_handler(guac_user* user, int argc, char** argv) { - + /* Store video mimetypes */ user->info.video_mimetypes = (const char**) guac_copy_mimetypes(argv, argc); @@ -227,6 +227,9 @@ int __guac_handshake_image_handler(guac_user* user, int argc, char** argv) { int __guac_handshake_timezone_handler(guac_user* user, int argc, char** argv) { + /* Free any past value */ + free((char *) user->info.timezone); + /* Store timezone, if present */ if (argc > 0 && strcmp(argv[0], "")) user->info.timezone = (const char*) strdup(argv[0]); @@ -393,6 +396,9 @@ int guac_user_handle_connection(guac_user* user, int usec_timeout) { if (strcmp(parser->opcode, "connect") == 0) break; + guac_user_log(user, GUAC_LOG_DEBUG, "Processing instruction: %s", + parser->opcode); + /* Loop available opcodes and run handler if/when match found. */ __guac_handshake_mapping* current = __guac_handshake_map; while (current->opcode != NULL) { diff --git a/src/protocols/kubernetes/settings.c b/src/protocols/kubernetes/settings.c index 4f00a445..6e8ddd41 100644 --- a/src/protocols/kubernetes/settings.c +++ b/src/protocols/kubernetes/settings.c @@ -25,6 +25,14 @@ /* Client plugin arguments */ const char* GUAC_KUBERNETES_CLIENT_ARGS[] = { + /** + * This first argument defines the protocol version in use so that the + * client knows how to handle talking to different versions of guacd. + * If this is omitted the client may choose not to enable certain + * features. + */ + "VERSION_1_1_0", + "hostname", "port", "namespace", @@ -55,6 +63,11 @@ const char* GUAC_KUBERNETES_CLIENT_ARGS[] = { enum KUBERNETES_ARGS_IDX { + /** + * The protocol version provided to the client. + */ + IDX_PROTOCOL_VERSION, + /** * The hostname to connect to. Required. */ diff --git a/src/protocols/rdp/rdp_settings.c b/src/protocols/rdp/rdp_settings.c index e5aa85dd..9edcb746 100644 --- a/src/protocols/rdp/rdp_settings.c +++ b/src/protocols/rdp/rdp_settings.c @@ -42,6 +42,14 @@ /* Client plugin arguments */ const char* GUAC_RDP_CLIENT_ARGS[] = { + /** + * This first argument defines the protocol version in use so that the + * client knows how to handle talking to different versions of guacd. + * If this is omitted the client may choose not to enable certain + * features. + */ + "VERSION_1_1_0", + "hostname", "port", "domain", @@ -124,6 +132,11 @@ const char* GUAC_RDP_CLIENT_ARGS[] = { enum RDP_ARGS_IDX { + /** + * The protocol version sent to the client. + */ + IDX_PROTOCOL_VERSION, + /** * The hostname to connect to. */ diff --git a/src/protocols/ssh/settings.c b/src/protocols/ssh/settings.c index a0af9f9b..a404e8ca 100644 --- a/src/protocols/ssh/settings.c +++ b/src/protocols/ssh/settings.c @@ -30,6 +30,14 @@ /* Client plugin arguments */ const char* GUAC_SSH_CLIENT_ARGS[] = { + /** + * This first argument defines the protocol version in use so that the + * client knows how to handle talking to different versions of guacd. + * If this is omitted the client may choose not to enable certain + * features. + */ + "VERSION_1_1_0", + "hostname", "host-key", "port", @@ -66,6 +74,11 @@ const char* GUAC_SSH_CLIENT_ARGS[] = { }; enum SSH_ARGS_IDX { + + /** + * The protocol version + */ + IDX_PROTOCOL_VERSION, /** * The hostname to connect to. Required. diff --git a/src/protocols/telnet/settings.c b/src/protocols/telnet/settings.c index 890d5fec..4d2d4dd1 100644 --- a/src/protocols/telnet/settings.c +++ b/src/protocols/telnet/settings.c @@ -31,6 +31,14 @@ /* Client plugin arguments */ const char* GUAC_TELNET_CLIENT_ARGS[] = { + /** + * This first argument defines the protocol version in use so that the + * client knows how to handle talking to different versions of guacd. + * If this is omitted the client may choose not to enable certain + * features. + */ + "VERSION_1_1_0", + "hostname", "port", "username", @@ -60,6 +68,11 @@ const char* GUAC_TELNET_CLIENT_ARGS[] = { enum TELNET_ARGS_IDX { + /** + * The protocol version provided by the client. + */ + IDX_PROTOCOL_VERSION, + /** * The hostname to connect to. Required. */ diff --git a/src/protocols/vnc/settings.c b/src/protocols/vnc/settings.c index 8f65cfb2..941a2757 100644 --- a/src/protocols/vnc/settings.c +++ b/src/protocols/vnc/settings.c @@ -31,6 +31,14 @@ /* Client plugin arguments */ const char* GUAC_VNC_CLIENT_ARGS[] = { + /** + * This first argument defines the protocol version in use so that the + * client knows how to handle talking to different versions of guacd. + * If this is omitted the client may choose not to enable certain + * features. + */ + "VERSION_1_1_0", + "hostname", "port", "read-only", @@ -83,6 +91,11 @@ const char* GUAC_VNC_CLIENT_ARGS[] = { enum VNC_ARGS_IDX { + /** + * The protocol version provided to the client. + */ + IDX_PROTOCOL_VERSION, + /** * The hostname of the VNC server (or repeater) to connect to. */