stefan-esq commented on a change in pull request #327:
URL: https://github.com/apache/guacamole-server/pull/327#discussion_r567147639



##########
File path: src/protocols/vnc/vnc.c
##########
@@ -385,6 +385,12 @@ void* guac_vnc_client_thread(void* data) {
     }
 #endif
 
+    /* Disable remote console (Server input) */
+    if (settings->disable_server_input) {
+        rfbBool success = PermitServerInput(rfb_client, 1);
+        guac_client_log(client, GUAC_LOG_INFO, "Disabling server input %s.", 
success ? "succeeded" : "failed");

Review comment:
       As stated in your comment it appears that the status is only related to 
if the sending of the message succeeds. I have adjusted the message for this:
   
   `guac_client_log(client, GUAC_LOG_DEBUG, "%s send request to disable server 
input", success ? "Successfully" : "Failed to");`
   
   In addition to this, after retesting the code locally PermitServerInput does 
not seem to work with some vnc clients even though the vnc clients do support 
the functionality.
   After going through the libvncserver code I found the following:
   
   ```  /** Which messages are supported by the server
         * This is a *guess* for most servers.
         * (If we can even detect the type of server)
         *
         * If the server supports the "rfbEncodingSupportedMessages"
         * then this will be updated when the encoding is received to
         * accurately reflect the servers capabilities.
         */
        rfbSupportedMessages supportedMessages;
   ```
   
   It would appear that libvncserver guesses if the vnc server supports 
disabling the remote input and if it guesses the server does not, then 
PermitServerInput  will not send the request even if the client supports it.
   
   For this reason I have changed the code back to use WriteToRFBServer, in my 
opinion it is better to always send the request.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to