diff --git a/src/protocols/rdp/rdp_settings.c b/src/protocols/rdp/rdp_settings.c index a3bd3482..21114d44 100644 --- a/src/protocols/rdp/rdp_settings.c +++ b/src/protocols/rdp/rdp_settings.c @@ -79,6 +79,7 @@ const char* GUAC_RDP_CLIENT_ARGS[] = { "disable-glyph-caching", "preconnection-id", "preconnection-blob", + "timezone", #ifdef ENABLE_COMMON_SSH "enable-sftp", @@ -356,6 +357,11 @@ enum RDP_ARGS_IDX { */ IDX_PRECONNECTION_BLOB, + /** + * The timezone to pass through to the RDP connection. + */ + IDX_TIMEZONE, + #ifdef ENABLE_COMMON_SSH /** * "true" if SFTP should be enabled for the RDP connection, "false" or @@ -840,6 +846,11 @@ guac_rdp_settings* guac_rdp_parse_args(guac_user* user, if (settings->server_layout == NULL) settings->server_layout = guac_rdp_keymap_find(GUAC_DEFAULT_KEYMAP); + /* Timezone if provied by client */ + settings->timezone = + guac_user_parse_args_string(user, GUAC_RDP_CLIENT_ARGS, argv, + IDX_TIMEZONE, NULL); + #ifdef ENABLE_COMMON_SSH /* SFTP enable/disable */ settings->enable_sftp = @@ -1013,6 +1024,7 @@ void guac_rdp_settings_free(guac_rdp_settings* settings) { free(settings->remote_app); free(settings->remote_app_args); free(settings->remote_app_dir); + free(settings->timezone); free(settings->username); free(settings->printer_name); @@ -1265,6 +1277,9 @@ void guac_rdp_push_settings(guac_rdp_settings* guac_settings, freerdp* rdp) { #endif /* Device redirection */ + if (guac_settings->timezone) + setenv("TZ", guac_settings->timezone, 1); + #ifdef LEGACY_RDPSETTINGS #ifdef HAVE_RDPSETTINGS_DEVICEREDIRECTION rdp_settings->device_redirection = guac_settings->audio_enabled diff --git a/src/protocols/rdp/rdp_settings.h b/src/protocols/rdp/rdp_settings.h index d521a87c..ece399df 100644 --- a/src/protocols/rdp/rdp_settings.h +++ b/src/protocols/rdp/rdp_settings.h @@ -341,6 +341,11 @@ typedef struct guac_rdp_settings { */ char* preconnection_blob; + /** + * The timezone to pass through to the RDP connection. + */ + char* timezone; + #ifdef ENABLE_COMMON_SSH /** * Whether SFTP should be enabled for the VNC connection.