GUACAMOLE-422: Use timezone from handshake when parameter does not exist.
This commit is contained in:
parent
f70aa4939f
commit
6fae0b4b23
@ -94,7 +94,7 @@ struct guac_user_info {
|
||||
* a specific timezone then this will be NULL. The format of the timezone
|
||||
* is the standard tzdata naming convention.
|
||||
*/
|
||||
const char** timezone;
|
||||
const char* timezone;
|
||||
|
||||
};
|
||||
|
||||
|
@ -406,9 +406,10 @@ int guac_user_handle_connection(guac_user* user, int usec_timeout) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Store timezone */
|
||||
char** timezone = parser->argv[0];
|
||||
user->info.timezone = (const char**) timezone;
|
||||
/* Store timezone, if present */
|
||||
char* timezone = parser->argv[0];
|
||||
if (timezone != NULL && !strcmp(timezone, ""))
|
||||
user->info.timezone = (const char*) timezone;
|
||||
|
||||
/* Get args from connect instruction */
|
||||
if (guac_parser_expect(parser, socket, usec_timeout, "connect")) {
|
||||
@ -452,6 +453,10 @@ int guac_user_handle_connection(guac_user* user, int usec_timeout) {
|
||||
guac_free_mimetypes(audio_mimetypes);
|
||||
guac_free_mimetypes(video_mimetypes);
|
||||
guac_free_mimetypes(image_mimetypes);
|
||||
|
||||
/* Free timezone */
|
||||
if (timezone != NULL)
|
||||
free(timezone);
|
||||
|
||||
guac_parser_free(parser);
|
||||
|
||||
|
@ -851,10 +851,10 @@ 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 */
|
||||
/* Timezone if provided by client, or use handshake version */
|
||||
settings->timezone =
|
||||
guac_user_parse_args_string(user, GUAC_RDP_CLIENT_ARGS, argv,
|
||||
IDX_TIMEZONE, NULL);
|
||||
IDX_TIMEZONE, user->info.timezone);
|
||||
|
||||
#ifdef ENABLE_COMMON_SSH
|
||||
/* SFTP enable/disable */
|
||||
|
@ -425,6 +425,10 @@ guac_ssh_settings* guac_ssh_parse_args(guac_user* user,
|
||||
settings->timezone =
|
||||
guac_user_parse_args_string(user, GUAC_SSH_CLIENT_ARGS, argv,
|
||||
IDX_TIMEZONE, NULL);
|
||||
|
||||
/* If timezone not explicitly set, try to pull from tunnel */
|
||||
if (settings->timezone == NULL)
|
||||
settings->timezone = user->info.timezone;
|
||||
|
||||
/* Parsing was successful */
|
||||
return settings;
|
||||
|
Loading…
Reference in New Issue
Block a user