Skip to content

Commit

Permalink
GUACAMOLE-422: Support timezone redirection in RDP via TZ variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
necouchman committed Nov 11, 2018
1 parent 381c5d1 commit ffdc98d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/protocols/rdp/rdp_settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ const char* GUAC_RDP_CLIENT_ARGS[] = {
"disable-glyph-caching",
"preconnection-id",
"preconnection-blob",
"timezone",

#ifdef ENABLE_COMMON_SSH
"enable-sftp",
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 =
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions src/protocols/rdp/rdp_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit ffdc98d

Please sign in to comment.