GUACAMOLE-381: Disable or ignore outbound clipboard transfers for VNC/RDP if "disable-copy" is set.

This commit is contained in:
Michael Jumper 2019-02-19 11:45:30 -08:00
parent 993d5c5707
commit 254615509a
3 changed files with 13 additions and 3 deletions

View File

@ -240,11 +240,13 @@ BOOL rdp_freerdp_pre_connect(freerdp* instance) {
guac_rdp_audio_load_plugin(instance->context, dvc_list);
}
/* Load clipboard plugin */
if (freerdp_channels_load_plugin(channels, instance->settings,
"cliprdr", NULL))
/* Load clipboard plugin if not disabled */
if (!(settings->disable_copy && settings->disable_paste)
&& freerdp_channels_load_plugin(channels, instance->settings,
"cliprdr", NULL)) {
guac_client_log(client, GUAC_LOG_WARNING,
"Failed to load cliprdr plugin. Clipboard will not work.");
}
/* If RDPSND/RDPDR required, load them */
if (settings->printing_enabled

View File

@ -230,6 +230,10 @@ void guac_rdp_process_cb_data_response(guac_client* client,
guac_rdp_client* rdp_client = (guac_rdp_client*) client->data;
char received_data[GUAC_RDP_CLIPBOARD_MAX_LENGTH];
/* Ignore received text if outbound clipboard transfer is disabled */
if (rdp_client->settings->disable_copy)
return;
guac_iconv_read* reader;
const char* input = (char*) event->data;
char* output = received_data;

View File

@ -125,6 +125,10 @@ void guac_vnc_cut_text(rfbClient* client, const char* text, int textlen) {
guac_client* gc = rfbClientGetClientData(client, GUAC_VNC_CLIENT_KEY);
guac_vnc_client* vnc_client = (guac_vnc_client*) gc->data;
/* Ignore received text if outbound clipboard transfer is disabled */
if (vnc_client->settings->disable_copy)
return;
char received_data[GUAC_VNC_CLIPBOARD_MAX_LENGTH];
const char* input = text;