GUACAMOLE-1267: Add VNC setting 'disable-remote-input'

This commit is contained in:
Stefan Feenstra 2021-01-19 12:19:09 -07:00 committed by Virtually Nick
parent fe808ce6d0
commit 721e6669c4
3 changed files with 31 additions and 0 deletions

View File

@ -87,6 +87,7 @@ const char* GUAC_VNC_CLIENT_ARGS[] = {
"recording-write-existing",
"disable-copy",
"disable-paste",
"disable-server-input",
"wol-send-packet",
"wol-mac-addr",
@ -353,6 +354,12 @@ enum VNC_ARGS_IDX {
* using the clipboard. By default, clipboard access is not blocked.
*/
IDX_DISABLE_PASTE,
/**
* Whether or not to disable the input on the server side when the VNC client
* is connected. The default is not to disable the input.
*/
IDX_DISABLE_SERVER_INPUT,
/**
* Whether to send the magic Wake-on-LAN (WoL) packet to wake the remote
@ -457,6 +464,11 @@ guac_vnc_settings* guac_vnc_parse_args(guac_user* user,
guac_user_parse_args_boolean(user, GUAC_VNC_CLIENT_ARGS, argv,
IDX_READ_ONLY, false);
/* Disable server input */
settings->disable_server_input =
guac_user_parse_args_boolean(user, GUAC_VNC_CLIENT_ARGS, argv,
IDX_DISABLE_SERVER_INPUT, false);
/* Parse color depth */
settings->color_depth =
guac_user_parse_args_int(user, GUAC_VNC_CLIENT_ARGS, argv,

View File

@ -321,6 +321,11 @@ typedef struct guac_vnc_settings {
*/
int wol_wait_time;
/**
* Whether or not to disable the input on the server side.
*/
bool disable_server_input;
} guac_vnc_settings;
/**

View File

@ -416,6 +416,20 @@ void* guac_vnc_client_thread(void* data) {
}
#endif
/* Disable remote console (Server input) */
if (settings->disable_server_input) {
rfbSetServerInputMsg msg;
msg.type = rfbSetServerInput;
msg.status = 1;
msg.pad = 0;
if (WriteToRFBServer(rfb_client, (char*)&msg, sz_rfbSetServerInputMsg))
guac_client_log(client, GUAC_LOG_DEBUG, "Successfully sent request to disable server input.");
else
guac_client_log(client, GUAC_LOG_WARNING, "Failed to send request to disable server input.");
}
/* Set remaining client data */
vnc_client->rfb_client = rfb_client;