Github user mike-jumper commented on a diff in the pull request:

    https://github.com/apache/guacamole-server/pull/169#discussion_r232526633
  
    --- Diff: src/protocols/rdp/rdp_settings.c ---
    @@ -1264,6 +1281,14 @@ void guac_rdp_push_settings(guac_rdp_settings* 
guac_settings, freerdp* rdp) {
     #endif
     #endif
     
    +    /* Timezone redirection */
    +    if (guac_settings->timezone) {
    +        if(setenv("TZ", guac_settings->timezone, 1)) {
    +            guac_client_log(client, GUAC_LOG_WARNING,
    +                "Unable to set TZ variable, error %i", errno);
    --- End diff --
    
    Error messages should be structured such that they will be useful to the 
user viewing the logs. In this case:
    
    * "Unable to set TZ variable" will not provide useful information to users 
that aren't familiar with this implementation-specific detail of how guac 
forwards the timezone for consumption by FreeRDP.
    * Text like "error 123" is going to cause more confusion than help. You 
_can_ turn this into a human-readable message though. See: 
http://man7.org/linux/man-pages/man3/strerror.3.html
    
    I suggest something like:
    
    ```c
    guac_client_log(client, GUAC_LOG_WARNING,
            "Unable to forward timezone: TZ environment variable "
            "could not be set: %s", strerror(errno));
    ```
    
    or similar. Something which provides context from the perspective of the 
administrator maintaining the connection and reading the logs, plus something 
which provides context for the error that occurred, plus the error itself in 
human-readable form.


---

Reply via email to