Skip to content

Commit

Permalink
GAUCAMOLE-422: Add warning messages when TZ cannot be set.
Browse files Browse the repository at this point in the history
  • Loading branch information
necouchman committed Nov 11, 2018
1 parent d7ed452 commit e2b4de9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
11 changes: 9 additions & 2 deletions src/protocols/rdp/rdp_settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -1280,8 +1280,15 @@ 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);
if (guac_settings->timezone) {

/* Set the TZ env variable */
if (setenv("TZ", guac_settings->timezone, 1)) {
guac_user_log(user, GUAC_LOG_WARNING, "Could not set TZ "
"variable. Received error %i", errno);
}

}

#ifdef LEGACY_RDPSETTINGS
#ifdef HAVE_RDPSETTINGS_DEVICEREDIRECTION
Expand Down
11 changes: 9 additions & 2 deletions src/protocols/ssh/ssh.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,15 @@ void* ssh_client_thread(void* data) {
}

/* Set the client timezone */
if (settings->timezone != NULL)
libssh2_channel_setenv(ssh_client->term_channel, "TZ", settings->timezone);
if (settings->timezone != NULL) {
if (libssh2_channel_setenv(ssh_client->term_channel, "TZ",
settings->timezone)) {
guac_client_log(client, GUAC_LOG_WARNING,
"Unable to set the timzeone: SSH server "
"refused to set \"TZ\" variable.");
}
}


#ifdef ENABLE_SSH_AGENT
/* Start SSH agent forwarding, if enabled */
Expand Down

0 comments on commit e2b4de9

Please sign in to comment.