From cfcfe8866cc1ab8e2ece21e4f8b56eca6c165d1d Mon Sep 17 00:00:00 2001 From: Nick Couchman Date: Tue, 3 Jul 2018 22:59:30 -0400 Subject: [PATCH] GUACAMOLE-446: Add settings for drive name. --- src/protocols/rdp/rdp_settings.c | 13 +++++++++++++ src/protocols/rdp/rdp_settings.h | 5 +++++ 2 files changed, 18 insertions(+) diff --git a/src/protocols/rdp/rdp_settings.c b/src/protocols/rdp/rdp_settings.c index 62fa1e25..258ca62b 100644 --- a/src/protocols/rdp/rdp_settings.c +++ b/src/protocols/rdp/rdp_settings.c @@ -54,6 +54,7 @@ const char* GUAC_RDP_CLIENT_ARGS[] = { "enable-printing", "printer-name", "enable-drive", + "drive-name", "drive-path", "create-drive-path", "console", @@ -198,6 +199,12 @@ enum RDP_ARGS_IDX { * otherwise. */ IDX_ENABLE_DRIVE, + + /** + * The name of the virtual driver that will be passed through to the + * RDP connection. + */ + IDX_DRIVE_NAME, /** * The local system path which will be used to persist the @@ -809,6 +816,11 @@ guac_rdp_settings* guac_rdp_parse_args(guac_user* user, settings->drive_enabled = guac_user_parse_args_boolean(user, GUAC_RDP_CLIENT_ARGS, argv, IDX_ENABLE_DRIVE, 0); + + /* Name of the drive being passed through */ + settings->drive_name = + guac_user_parse_args_string(user, GUAC_RDP_CLIENT_ARGS, argv, + IDX_DRIVE_NAME, 0); settings->drive_path = guac_user_parse_args_string(user, GUAC_RDP_CLIENT_ARGS, argv, @@ -990,6 +1002,7 @@ void guac_rdp_settings_free(guac_rdp_settings* settings) { /* Free settings strings */ free(settings->client_name); free(settings->domain); + free(settings->drive_name); free(settings->drive_path); free(settings->hostname); free(settings->initial_program); diff --git a/src/protocols/rdp/rdp_settings.h b/src/protocols/rdp/rdp_settings.h index 5caffe98..d521a87c 100644 --- a/src/protocols/rdp/rdp_settings.h +++ b/src/protocols/rdp/rdp_settings.h @@ -186,6 +186,11 @@ typedef struct guac_rdp_settings { * Whether the virtual drive is enabled. */ int drive_enabled; + + /** + * The name of the virtual drive to pass through to the RDP connection. + */ + char* drive_name; /** * The local system path which will be used to persist the