mike-jumper commented on a change in pull request #327:
URL: https://github.com/apache/guacamole-server/pull/327#discussion_r566599491
##########
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:
There is admittedly not much documentation on the return value of
`PermitServerInput()`, but reading through the libvncclient code, the value
doesn't appear to indicate whether disabling input succeeded:
```c
/*
* UltraVNC Server Input Disable
* Apparently, the remote client can *prevent* the local user from
interacting with the display
* I would think this is extremely helpful when used in a HelpDesk situation
*/
rfbBool PermitServerInput(rfbClient* client, int enabled)
{
rfbSetServerInputMsg msg;
if (!SupportsClient2Server(client, rfbSetServerInput)) return TRUE;
/* enabled==1, then server input from local keyboard is disabled */
msg.type = rfbSetServerInput;
msg.status = (enabled ? 1 : 0);
msg.pad = 0;
return (WriteToRFBServer(client, (char *)&msg, sz_rfbSetServerInputMsg)
? TRUE : FALSE);
}
```
(https://github.com/LibVNC/libvncserver/blob/c82b3abb369983cd737190331b897814a580a980/libvncclient/rfbproto.c#L1502-L1517)
Given the above, it looks like:
* If the VNC server supports the relevant message, the return value
indicates only if the message was successfully sent, not whether the server
honored the message.
* If the VNC server _doesn't_ support the relevant message,
`PermitServerInput()` pretends to succeed.
The silent success of `PermitServerInput()` makes this log message less
useful. If you want to keep the message, I suggest moving it to the
`GUAC_LOG_DEBUG` level and rephrasing to capture only what we know.
----------------------------------------------------------------
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]