diff --git a/src/protocols/rdp/rdp.c b/src/protocols/rdp/rdp.c index 042d3893..5b351c5b 100644 --- a/src/protocols/rdp/rdp.c +++ b/src/protocols/rdp/rdp.c @@ -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 diff --git a/src/protocols/rdp/rdp_cliprdr.c b/src/protocols/rdp/rdp_cliprdr.c index 53019115..903752c8 100644 --- a/src/protocols/rdp/rdp_cliprdr.c +++ b/src/protocols/rdp/rdp_cliprdr.c @@ -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; diff --git a/src/protocols/vnc/clipboard.c b/src/protocols/vnc/clipboard.c index a49f5651..c3b1bd1f 100644 --- a/src/protocols/vnc/clipboard.c +++ b/src/protocols/vnc/clipboard.c @@ -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;