Merge 1.1.0 changes back to master.
diff --git a/src/protocols/kubernetes/kubernetes.c b/src/protocols/kubernetes/kubernetes.c
index 7c22c42..931f8ca 100644
--- a/src/protocols/kubernetes/kubernetes.c
+++ b/src/protocols/kubernetes/kubernetes.c
@@ -237,7 +237,7 @@
/* Create terminal */
kubernetes_client->term = guac_terminal_create(client,
- kubernetes_client->clipboard,
+ kubernetes_client->clipboard, settings->disable_copy,
settings->max_scrollback, settings->font_name, settings->font_size,
settings->resolution, settings->width, settings->height,
settings->color_scheme, settings->backspace);
diff --git a/src/protocols/kubernetes/settings.c b/src/protocols/kubernetes/settings.c
index 4f00a44..ec23880 100644
--- a/src/protocols/kubernetes/settings.c
+++ b/src/protocols/kubernetes/settings.c
@@ -50,6 +50,8 @@
"read-only",
"backspace",
"scrollback",
+ "disable-copy",
+ "disable-paste",
NULL
};
@@ -216,6 +218,20 @@
*/
IDX_SCROLLBACK,
+ /**
+ * Whether outbound clipboard access should be blocked. If set to "true",
+ * it will not be possible to copy data from the terminal to the client
+ * using the clipboard. By default, clipboard access is not blocked.
+ */
+ IDX_DISABLE_COPY,
+
+ /**
+ * Whether inbound clipboard access should be blocked. If set to "true", it
+ * will not be possible to paste data from the client to the terminal using
+ * the clipboard. By default, clipboard access is not blocked.
+ */
+ IDX_DISABLE_PASTE,
+
KUBERNETES_ARGS_COUNT
};
@@ -364,6 +380,16 @@
guac_user_parse_args_int(user, GUAC_KUBERNETES_CLIENT_ARGS, argv,
IDX_BACKSPACE, 127);
+ /* Parse clipboard copy disable flag */
+ settings->disable_copy =
+ guac_user_parse_args_boolean(user, GUAC_KUBERNETES_CLIENT_ARGS, argv,
+ IDX_DISABLE_COPY, false);
+
+ /* Parse clipboard paste disable flag */
+ settings->disable_paste =
+ guac_user_parse_args_boolean(user, GUAC_KUBERNETES_CLIENT_ARGS, argv,
+ IDX_DISABLE_PASTE, false);
+
/* Parsing was successful */
return settings;
diff --git a/src/protocols/kubernetes/settings.h b/src/protocols/kubernetes/settings.h
index 6267a18..eef4973 100644
--- a/src/protocols/kubernetes/settings.h
+++ b/src/protocols/kubernetes/settings.h
@@ -171,6 +171,20 @@
int resolution;
/**
+ * Whether outbound clipboard access should be blocked. If set, it will not
+ * be possible to copy data from the terminal to the client using the
+ * clipboard.
+ */
+ bool disable_copy;
+
+ /**
+ * Whether inbound clipboard access should be blocked. If set, it will not
+ * be possible to paste data from the client to the terminal using the
+ * clipboard.
+ */
+ bool disable_paste;
+
+ /**
* The path in which the typescript should be saved, if enabled. If no
* typescript should be saved, this will be NULL.
*/
diff --git a/src/protocols/kubernetes/user.c b/src/protocols/kubernetes/user.c
index f90260e..f4e9eb4 100644
--- a/src/protocols/kubernetes/user.c
+++ b/src/protocols/kubernetes/user.c
@@ -79,10 +79,13 @@
/* Only handle events if not read-only */
if (!settings->read_only) {
- /* General mouse/keyboard/clipboard events */
- user->key_handler = guac_kubernetes_user_key_handler;
- user->mouse_handler = guac_kubernetes_user_mouse_handler;
- user->clipboard_handler = guac_kubernetes_clipboard_handler;
+ /* General mouse/keyboard events */
+ user->key_handler = guac_kubernetes_user_key_handler;
+ user->mouse_handler = guac_kubernetes_user_mouse_handler;
+
+ /* Inbound (client to server) clipboard transfer */
+ if (!settings->disable_paste)
+ user->clipboard_handler = guac_kubernetes_clipboard_handler;
/* STDIN redirection */
user->pipe_handler = guac_kubernetes_pipe_handler;
diff --git a/src/protocols/rdp/rdp.c b/src/protocols/rdp/rdp.c
index 042d389..5b351c5 100644
--- a/src/protocols/rdp/rdp.c
+++ b/src/protocols/rdp/rdp.c
@@ -240,11 +240,13 @@
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 5301911..903752c 100644
--- a/src/protocols/rdp/rdp_cliprdr.c
+++ b/src/protocols/rdp/rdp_cliprdr.c
@@ -230,6 +230,10 @@
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/rdp/rdp_fs.c b/src/protocols/rdp/rdp_fs.c
index 0e7345f..24d7c3e 100644
--- a/src/protocols/rdp/rdp_fs.c
+++ b/src/protocols/rdp/rdp_fs.c
@@ -403,7 +403,7 @@
}
-int guac_rdp_fs_read(guac_rdp_fs* fs, int file_id, int offset,
+int guac_rdp_fs_read(guac_rdp_fs* fs, int file_id, uint64_t offset,
void* buffer, int length) {
int bytes_read;
@@ -427,7 +427,7 @@
}
-int guac_rdp_fs_write(guac_rdp_fs* fs, int file_id, int offset,
+int guac_rdp_fs_write(guac_rdp_fs* fs, int file_id, uint64_t offset,
void* buffer, int length) {
int bytes_written;
diff --git a/src/protocols/rdp/rdp_fs.h b/src/protocols/rdp/rdp_fs.h
index 7ceb5ff..e8299ef 100644
--- a/src/protocols/rdp/rdp_fs.h
+++ b/src/protocols/rdp/rdp_fs.h
@@ -492,7 +492,7 @@
* error occurs. All error codes are negative values and correspond to
* GUAC_RDP_FS constants, such as GUAC_RDP_FS_ENOENT.
*/
-int guac_rdp_fs_read(guac_rdp_fs* fs, int file_id, int offset,
+int guac_rdp_fs_read(guac_rdp_fs* fs, int file_id, uint64_t offset,
void* buffer, int length);
/**
@@ -520,7 +520,7 @@
* occurs. All error codes are negative values and correspond to
* GUAC_RDP_FS constants, such as GUAC_RDP_FS_ENOENT.
*/
-int guac_rdp_fs_write(guac_rdp_fs* fs, int file_id, int offset,
+int guac_rdp_fs_write(guac_rdp_fs* fs, int file_id, uint64_t offset,
void* buffer, int length);
/**
diff --git a/src/protocols/rdp/rdp_settings.c b/src/protocols/rdp/rdp_settings.c
index d322a48..2a21ecb 100644
--- a/src/protocols/rdp/rdp_settings.c
+++ b/src/protocols/rdp/rdp_settings.c
@@ -119,6 +119,8 @@
"load-balance-info",
#endif
+ "disable-copy",
+ "disable-paste",
NULL
};
@@ -546,6 +548,20 @@
IDX_LOAD_BALANCE_INFO,
#endif
+ /**
+ * Whether outbound clipboard access should be blocked. If set to "true",
+ * it will not be possible to copy data from the remote desktop to the
+ * client using the clipboard. By default, clipboard access is not blocked.
+ */
+ IDX_DISABLE_COPY,
+
+ /**
+ * Whether inbound clipboard access should be blocked. If set to "true", it
+ * will not be possible to paste data from the client to the remote desktop
+ * using the clipboard. By default, clipboard access is not blocked.
+ */
+ IDX_DISABLE_PASTE,
+
RDP_ARGS_COUNT
};
@@ -1008,6 +1024,16 @@
IDX_LOAD_BALANCE_INFO, NULL);
#endif
+ /* Parse clipboard copy disable flag */
+ settings->disable_copy =
+ guac_user_parse_args_boolean(user, GUAC_RDP_CLIENT_ARGS, argv,
+ IDX_DISABLE_COPY, 0);
+
+ /* Parse clipboard paste disable flag */
+ settings->disable_paste =
+ guac_user_parse_args_boolean(user, GUAC_RDP_CLIENT_ARGS, argv,
+ IDX_DISABLE_PASTE, 0);
+
/* Success */
return settings;
diff --git a/src/protocols/rdp/rdp_settings.h b/src/protocols/rdp/rdp_settings.h
index 6955ed5..9edbede 100644
--- a/src/protocols/rdp/rdp_settings.h
+++ b/src/protocols/rdp/rdp_settings.h
@@ -269,6 +269,20 @@
char** svc_names;
/**
+ * Whether outbound clipboard access should be blocked. If set, it will not
+ * be possible to copy data from the remote desktop to the client using the
+ * clipboard.
+ */
+ int disable_copy;
+
+ /**
+ * Whether inbound clipboard access should be blocked. If set, it will not
+ * be possible to paste data from the client to the remote desktop using
+ * the clipboard.
+ */
+ int disable_paste;
+
+ /**
* Whether the desktop wallpaper should be visible. If unset, the desktop
* wallpaper will be hidden, reducing the amount of bandwidth required.
*/
diff --git a/src/protocols/rdp/rdp_stream.h b/src/protocols/rdp/rdp_stream.h
index c9c3838..deec4f9 100644
--- a/src/protocols/rdp/rdp_stream.h
+++ b/src/protocols/rdp/rdp_stream.h
@@ -57,7 +57,7 @@
* The overall offset within the file that the next write should
* occur at.
*/
- int offset;
+ uint64_t offset;
/**
* The ID of the file being written to.
diff --git a/src/protocols/rdp/user.c b/src/protocols/rdp/user.c
index 6aa71ae..025848a 100644
--- a/src/protocols/rdp/user.c
+++ b/src/protocols/rdp/user.c
@@ -97,10 +97,13 @@
/* Only handle events if not read-only */
if (!settings->read_only) {
- /* General mouse/keyboard/clipboard events */
- user->mouse_handler = guac_rdp_user_mouse_handler;
- user->key_handler = guac_rdp_user_key_handler;
- user->clipboard_handler = guac_rdp_clipboard_handler;
+ /* General mouse/keyboard events */
+ user->mouse_handler = guac_rdp_user_mouse_handler;
+ user->key_handler = guac_rdp_user_key_handler;
+
+ /* Inbound (client to server) clipboard transfer */
+ if (!settings->disable_paste)
+ user->clipboard_handler = guac_rdp_clipboard_handler;
/* Display size change events */
user->size_handler = guac_rdp_user_size_handler;
diff --git a/src/protocols/ssh/settings.c b/src/protocols/ssh/settings.c
index 962524c..8436419 100644
--- a/src/protocols/ssh/settings.c
+++ b/src/protocols/ssh/settings.c
@@ -62,6 +62,8 @@
"scrollback",
"locale",
"timezone",
+ "disable-copy",
+ "disable-paste",
NULL
};
@@ -258,6 +260,20 @@
*/
IDX_TIMEZONE,
+ /**
+ * Whether outbound clipboard access should be blocked. If set to "true",
+ * it will not be possible to copy data from the terminal to the client
+ * using the clipboard. By default, clipboard access is not blocked.
+ */
+ IDX_DISABLE_COPY,
+
+ /**
+ * Whether inbound clipboard access should be blocked. If set to "true", it
+ * will not be possible to paste data from the client to the terminal using
+ * the clipboard. By default, clipboard access is not blocked.
+ */
+ IDX_DISABLE_PASTE,
+
SSH_ARGS_COUNT
};
@@ -426,6 +442,16 @@
guac_user_parse_args_string(user, GUAC_SSH_CLIENT_ARGS, argv,
IDX_TIMEZONE, NULL);
+ /* Parse clipboard copy disable flag */
+ settings->disable_copy =
+ guac_user_parse_args_boolean(user, GUAC_SSH_CLIENT_ARGS, argv,
+ IDX_DISABLE_COPY, false);
+
+ /* Parse clipboard paste disable flag */
+ settings->disable_paste =
+ guac_user_parse_args_boolean(user, GUAC_SSH_CLIENT_ARGS, argv,
+ IDX_DISABLE_PASTE, false);
+
/* Parsing was successful */
return settings;
diff --git a/src/protocols/ssh/settings.h b/src/protocols/ssh/settings.h
index baa634a..bab21bd 100644
--- a/src/protocols/ssh/settings.h
+++ b/src/protocols/ssh/settings.h
@@ -156,6 +156,20 @@
int resolution;
/**
+ * Whether outbound clipboard access should be blocked. If set, it will not
+ * be possible to copy data from the terminal to the client using the
+ * clipboard.
+ */
+ bool disable_copy;
+
+ /**
+ * Whether inbound clipboard access should be blocked. If set, it will not
+ * be possible to paste data from the client to the terminal using the
+ * clipboard.
+ */
+ bool disable_paste;
+
+ /**
* Whether SFTP is enabled.
*/
bool enable_sftp;
diff --git a/src/protocols/ssh/ssh.c b/src/protocols/ssh/ssh.c
index 9db545b..777172e 100644
--- a/src/protocols/ssh/ssh.c
+++ b/src/protocols/ssh/ssh.c
@@ -207,9 +207,10 @@
/* Create terminal */
ssh_client->term = guac_terminal_create(client, ssh_client->clipboard,
- settings->max_scrollback, settings->font_name, settings->font_size,
- settings->resolution, settings->width, settings->height,
- settings->color_scheme, settings->backspace);
+ settings->disable_copy, settings->max_scrollback,
+ settings->font_name, settings->font_size, settings->resolution,
+ settings->width, settings->height, settings->color_scheme,
+ settings->backspace);
/* Fail if terminal init failed */
if (ssh_client->term == NULL) {
diff --git a/src/protocols/ssh/user.c b/src/protocols/ssh/user.c
index 97ed87c..76a2a96 100644
--- a/src/protocols/ssh/user.c
+++ b/src/protocols/ssh/user.c
@@ -80,10 +80,13 @@
/* Only handle events if not read-only */
if (!settings->read_only) {
- /* General mouse/keyboard/clipboard events */
- user->key_handler = guac_ssh_user_key_handler;
- user->mouse_handler = guac_ssh_user_mouse_handler;
- user->clipboard_handler = guac_ssh_clipboard_handler;
+ /* General mouse/keyboard events */
+ user->key_handler = guac_ssh_user_key_handler;
+ user->mouse_handler = guac_ssh_user_mouse_handler;
+
+ /* Inbound (client to server) clipboard transfer */
+ if (!settings->disable_paste)
+ user->clipboard_handler = guac_ssh_clipboard_handler;
/* STDIN redirection */
user->pipe_handler = guac_ssh_pipe_handler;
diff --git a/src/protocols/telnet/settings.c b/src/protocols/telnet/settings.c
index 890d5fe..ded5c4f 100644
--- a/src/protocols/telnet/settings.c
+++ b/src/protocols/telnet/settings.c
@@ -55,6 +55,8 @@
"scrollback",
"login-success-regex",
"login-failure-regex",
+ "disable-copy",
+ "disable-paste",
NULL
};
@@ -216,6 +218,20 @@
*/
IDX_LOGIN_FAILURE_REGEX,
+ /**
+ * Whether outbound clipboard access should be blocked. If set to "true",
+ * it will not be possible to copy data from the terminal to the client
+ * using the clipboard. By default, clipboard access is not blocked.
+ */
+ IDX_DISABLE_COPY,
+
+ /**
+ * Whether inbound clipboard access should be blocked. If set to "true", it
+ * will not be possible to paste data from the client to the terminal using
+ * the clipboard. By default, clipboard access is not blocked.
+ */
+ IDX_DISABLE_PASTE,
+
TELNET_ARGS_COUNT
};
@@ -428,6 +444,16 @@
guac_user_parse_args_string(user, GUAC_TELNET_CLIENT_ARGS, argv,
IDX_TERMINAL_TYPE, "linux");
+ /* Parse clipboard copy disable flag */
+ settings->disable_copy =
+ guac_user_parse_args_boolean(user, GUAC_TELNET_CLIENT_ARGS, argv,
+ IDX_DISABLE_COPY, false);
+
+ /* Parse clipboard paste disable flag */
+ settings->disable_paste =
+ guac_user_parse_args_boolean(user, GUAC_TELNET_CLIENT_ARGS, argv,
+ IDX_DISABLE_PASTE, false);
+
/* Parsing was successful */
return settings;
diff --git a/src/protocols/telnet/settings.h b/src/protocols/telnet/settings.h
index 86302b7..691669c 100644
--- a/src/protocols/telnet/settings.h
+++ b/src/protocols/telnet/settings.h
@@ -172,6 +172,20 @@
int resolution;
/**
+ * Whether outbound clipboard access should be blocked. If set, it will not
+ * be possible to copy data from the terminal to the client using the
+ * clipboard.
+ */
+ bool disable_copy;
+
+ /**
+ * Whether inbound clipboard access should be blocked. If set, it will not
+ * be possible to paste data from the client to the terminal using the
+ * clipboard.
+ */
+ bool disable_paste;
+
+ /**
* The path in which the typescript should be saved, if enabled. If no
* typescript should be saved, this will be NULL.
*/
diff --git a/src/protocols/telnet/telnet.c b/src/protocols/telnet/telnet.c
index 17abd68..d8fc5e0 100644
--- a/src/protocols/telnet/telnet.c
+++ b/src/protocols/telnet/telnet.c
@@ -568,7 +568,7 @@
/* Create terminal */
telnet_client->term = guac_terminal_create(client,
- telnet_client->clipboard,
+ telnet_client->clipboard, settings->disable_copy,
settings->max_scrollback, settings->font_name, settings->font_size,
settings->resolution, settings->width, settings->height,
settings->color_scheme, settings->backspace);
diff --git a/src/protocols/telnet/user.c b/src/protocols/telnet/user.c
index 44ef9b5..5c15283 100644
--- a/src/protocols/telnet/user.c
+++ b/src/protocols/telnet/user.c
@@ -79,10 +79,13 @@
/* Only handle events if not read-only */
if (!settings->read_only) {
- /* General mouse/keyboard/clipboard events */
- user->key_handler = guac_telnet_user_key_handler;
- user->mouse_handler = guac_telnet_user_mouse_handler;
- user->clipboard_handler = guac_telnet_clipboard_handler;
+ /* General mouse/keyboard events */
+ user->key_handler = guac_telnet_user_key_handler;
+ user->mouse_handler = guac_telnet_user_mouse_handler;
+
+ /* Inbound (client to server) clipboard transfer */
+ if (!settings->disable_paste)
+ user->clipboard_handler = guac_telnet_clipboard_handler;
/* STDIN redirection */
user->pipe_handler = guac_telnet_pipe_handler;
diff --git a/src/protocols/vnc/clipboard.c b/src/protocols/vnc/clipboard.c
index a49f565..c3b1bd1 100644
--- a/src/protocols/vnc/clipboard.c
+++ b/src/protocols/vnc/clipboard.c
@@ -125,6 +125,10 @@
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;
diff --git a/src/protocols/vnc/settings.c b/src/protocols/vnc/settings.c
index 8f65cfb..3e0ebc6 100644
--- a/src/protocols/vnc/settings.c
+++ b/src/protocols/vnc/settings.c
@@ -77,7 +77,8 @@
"recording-exclude-mouse",
"recording-include-keys",
"create-recording-path",
-
+ "disable-copy",
+ "disable-paste",
NULL
};
@@ -298,6 +299,20 @@
*/
IDX_CREATE_RECORDING_PATH,
+ /**
+ * Whether outbound clipboard access should be blocked. If set to "true",
+ * it will not be possible to copy data from the remote desktop to the
+ * client using the clipboard. By default, clipboard access is not blocked.
+ */
+ IDX_DISABLE_COPY,
+
+ /**
+ * Whether inbound clipboard access should be blocked. If set to "true", it
+ * will not be possible to paste data from the client to the remote desktop
+ * using the clipboard. By default, clipboard access is not blocked.
+ */
+ IDX_DISABLE_PASTE,
+
VNC_ARGS_COUNT
};
@@ -493,6 +508,16 @@
guac_user_parse_args_boolean(user, GUAC_VNC_CLIENT_ARGS, argv,
IDX_CREATE_RECORDING_PATH, false);
+ /* Parse clipboard copy disable flag */
+ settings->disable_copy =
+ guac_user_parse_args_boolean(user, GUAC_VNC_CLIENT_ARGS, argv,
+ IDX_DISABLE_COPY, false);
+
+ /* Parse clipboard paste disable flag */
+ settings->disable_paste =
+ guac_user_parse_args_boolean(user, GUAC_VNC_CLIENT_ARGS, argv,
+ IDX_DISABLE_PASTE, false);
+
return settings;
}
diff --git a/src/protocols/vnc/settings.h b/src/protocols/vnc/settings.h
index 3e2ebd5..13a3d87 100644
--- a/src/protocols/vnc/settings.h
+++ b/src/protocols/vnc/settings.h
@@ -127,6 +127,20 @@
*/
char* clipboard_encoding;
+ /**
+ * Whether outbound clipboard access should be blocked. If set, it will not
+ * be possible to copy data from the remote desktop to the client using the
+ * clipboard.
+ */
+ bool disable_copy;
+
+ /**
+ * Whether inbound clipboard access should be blocked. If set, it will not
+ * be possible to paste data from the client to the remote desktop using
+ * the clipboard.
+ */
+ bool disable_paste;
+
#ifdef ENABLE_COMMON_SSH
/**
* Whether SFTP should be enabled for the VNC connection.
diff --git a/src/protocols/vnc/user.c b/src/protocols/vnc/user.c
index da3b843..0dee504 100644
--- a/src/protocols/vnc/user.c
+++ b/src/protocols/vnc/user.c
@@ -91,10 +91,13 @@
/* Only handle events if not read-only */
if (!settings->read_only) {
- /* General mouse/keyboard/clipboard events */
- user->mouse_handler = guac_vnc_user_mouse_handler;
- user->key_handler = guac_vnc_user_key_handler;
- user->clipboard_handler = guac_vnc_clipboard_handler;
+ /* General mouse/keyboard events */
+ user->mouse_handler = guac_vnc_user_mouse_handler;
+ user->key_handler = guac_vnc_user_key_handler;
+
+ /* Inbound (client to server) clipboard transfer */
+ if (!settings->disable_paste)
+ user->clipboard_handler = guac_vnc_clipboard_handler;
#ifdef ENABLE_COMMON_SSH
/* Set generic (non-filesystem) file upload handler */
diff --git a/src/terminal/select.c b/src/terminal/select.c
index 20fc3cd..0a075eb 100644
--- a/src/terminal/select.c
+++ b/src/terminal/select.c
@@ -375,8 +375,10 @@
}
/* Send data */
- guac_common_clipboard_send(terminal->clipboard, client);
- guac_socket_flush(socket);
+ if (!terminal->disable_copy) {
+ guac_common_clipboard_send(terminal->clipboard, client);
+ guac_socket_flush(socket);
+ }
guac_terminal_notify(terminal);
diff --git a/src/terminal/terminal.c b/src/terminal/terminal.c
index cf70f92..7ddcb2f 100644
--- a/src/terminal/terminal.c
+++ b/src/terminal/terminal.c
@@ -306,8 +306,8 @@
}
guac_terminal* guac_terminal_create(guac_client* client,
- guac_common_clipboard* clipboard, int max_scrollback,
- const char* font_name, int font_size, int dpi,
+ guac_common_clipboard* clipboard, bool disable_copy,
+ int max_scrollback, const char* font_name, int font_size, int dpi,
int width, int height, const char* color_scheme,
const int backspace) {
@@ -404,6 +404,7 @@
term->current_attributes = default_char.attributes;
term->default_char = default_char;
term->clipboard = clipboard;
+ term->disable_copy = disable_copy;
/* Calculate character size */
int rows = height / term->display->char_height;
diff --git a/src/terminal/terminal/terminal.h b/src/terminal/terminal/terminal.h
index ac1217e..28e6935 100644
--- a/src/terminal/terminal/terminal.h
+++ b/src/terminal/terminal/terminal.h
@@ -511,6 +511,14 @@
*/
char backspace;
+ /**
+ * Whether copying from the terminal clipboard should be blocked. If set,
+ * the contents of the terminal can still be copied, but will be usable
+ * only within the terminal itself. The clipboard contents will not be
+ * automatically streamed to the client.
+ */
+ bool disable_copy;
+
};
/**
@@ -533,6 +541,12 @@
* clipboard instructions. This clipboard will not be automatically
* freed when this terminal is freed.
*
+ * @param disable_copy
+ * Whether copying from the terminal clipboard should be blocked. If set,
+ * the contents of the terminal can still be copied, but will be usable
+ * only within the terminal itself. The clipboard contents will not be
+ * automatically streamed to the client.
+ *
* @param max_scrollback
* The maximum number of rows to allow within the scrollback buffer. The
* user may still alter the size of the scrollback buffer using terminal
@@ -575,8 +589,8 @@
* which renders all text to the given client.
*/
guac_terminal* guac_terminal_create(guac_client* client,
- guac_common_clipboard* clipboard, int max_scrollback,
- const char* font_name, int font_size, int dpi,
+ guac_common_clipboard* clipboard, bool disable_copy,
+ int max_scrollback, const char* font_name, int font_size, int dpi,
int width, int height, const char* color_scheme,
const int backspace);