GAUCAMOLE-422: Add warning messages when TZ cannot be set.

This commit is contained in:
Nick Couchman 2018-11-11 15:45:24 -05:00
parent d7ed452d69
commit e2b4de9d95
2 changed files with 18 additions and 4 deletions

View File

@ -1280,8 +1280,15 @@ void guac_rdp_push_settings(guac_rdp_settings* guac_settings, freerdp* rdp) {
#endif #endif
/* Device redirection */ /* Device redirection */
if (guac_settings->timezone) if (guac_settings->timezone) {
setenv("TZ", guac_settings->timezone, 1);
/* 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 LEGACY_RDPSETTINGS
#ifdef HAVE_RDPSETTINGS_DEVICEREDIRECTION #ifdef HAVE_RDPSETTINGS_DEVICEREDIRECTION

View File

@ -257,8 +257,15 @@ void* ssh_client_thread(void* data) {
} }
/* Set the client timezone */ /* Set the client timezone */
if (settings->timezone != NULL) if (settings->timezone != NULL) {
libssh2_channel_setenv(ssh_client->term_channel, "TZ", settings->timezone); 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 #ifdef ENABLE_SSH_AGENT
/* Start SSH agent forwarding, if enabled */ /* Start SSH agent forwarding, if enabled */