GUACAMOLE-343: Add setting for explicitly disabling recording.

This commit is contained in:
Nick Couchman 2020-05-24 16:53:33 -04:00
parent a0e11dc817
commit 1788ef3b8e
15 changed files with 114 additions and 5 deletions

View File

@ -227,7 +227,7 @@ void* guac_kubernetes_client_thread(void* data) {
"the requested Kubernetes pod is \"%s\".", endpoint_path); "the requested Kubernetes pod is \"%s\".", endpoint_path);
/* Set up screen recording, if requested */ /* Set up screen recording, if requested */
if (settings->recording_path != NULL) { if (settings->recording_path != NULL && !settings->recording_disabled) {
kubernetes_client->recording = guac_common_recording_create(client, kubernetes_client->recording = guac_common_recording_create(client,
settings->recording_path, settings->recording_path,
settings->recording_name, settings->recording_name,

View File

@ -41,6 +41,7 @@ const char* GUAC_KUBERNETES_CLIENT_ARGS[] = {
"typescript-path", "typescript-path",
"typescript-name", "typescript-name",
"create-typescript-path", "create-typescript-path",
"recording-disabled",
"recording-path", "recording-path",
"recording-name", "recording-name",
"recording-exclude-output", "recording-exclude-output",
@ -157,6 +158,14 @@ enum KUBERNETES_ARGS_IDX {
*/ */
IDX_CREATE_TYPESCRIPT_PATH, IDX_CREATE_TYPESCRIPT_PATH,
/**
* Whether or not recording should be explicitly disabled, even if the
* recording_path parameter is set. Normally setting the recording_path
* parameter to a non-null value will result in session recording being
* enabled - this provides the ability to override that.
*/
IDX_RECORDING_DISABLED,
/** /**
* The full absolute path to the directory in which screen recordings * The full absolute path to the directory in which screen recordings
* should be written. * should be written.
@ -345,6 +354,11 @@ guac_kubernetes_settings* guac_kubernetes_parse_args(guac_user* user,
guac_user_parse_args_boolean(user, GUAC_KUBERNETES_CLIENT_ARGS, argv, guac_user_parse_args_boolean(user, GUAC_KUBERNETES_CLIENT_ARGS, argv,
IDX_CREATE_TYPESCRIPT_PATH, false); IDX_CREATE_TYPESCRIPT_PATH, false);
/* Read flag to disable recording */
settings->recording_disabled =
guac_user_parse_args_boolean(user, GUAC_KUBERNETES_CLIENT_ARGS, argv,
IDX_RECORDING_DISABLED, false);
/* Read recording path */ /* Read recording path */
settings->recording_path = settings->recording_path =
guac_user_parse_args_string(user, GUAC_KUBERNETES_CLIENT_ARGS, argv, guac_user_parse_args_string(user, GUAC_KUBERNETES_CLIENT_ARGS, argv,

View File

@ -201,6 +201,14 @@ typedef struct guac_kubernetes_settings {
*/ */
bool create_typescript_path; bool create_typescript_path;
/**
* Whether or not recording should be explicitly disabled, even if the
* recording_path parameter is set. Normally setting the recording_path
* parameter to a non-null value will result in session recording being
* enabled - this provides the ability to override that.
*/
bool recording_disabled;
/** /**
* The path in which the screen recording should be saved, if enabled. If * The path in which the screen recording should be saved, if enabled. If
* no screen recording should be saved, this will be NULL. * no screen recording should be saved, this will be NULL.

View File

@ -346,7 +346,7 @@ static int guac_rdp_handle_connection(guac_client* client) {
srandom(time(NULL)); srandom(time(NULL));
/* Set up screen recording, if requested */ /* Set up screen recording, if requested */
if (settings->recording_path != NULL) { if (settings->recording_path != NULL && !settings->recording_disabled) {
rdp_client->recording = guac_common_recording_create(client, rdp_client->recording = guac_common_recording_create(client,
settings->recording_path, settings->recording_path,
settings->recording_name, settings->recording_name,

View File

@ -93,6 +93,7 @@ const char* GUAC_RDP_CLIENT_ARGS[] = {
"sftp-server-alive-interval", "sftp-server-alive-interval",
#endif #endif
"recording-disabled",
"recording-path", "recording-path",
"recording-name", "recording-name",
"recording-exclude-output", "recording-exclude-output",
@ -432,6 +433,14 @@ enum RDP_ARGS_IDX {
IDX_SFTP_SERVER_ALIVE_INTERVAL, IDX_SFTP_SERVER_ALIVE_INTERVAL,
#endif #endif
/**
* Whether or not recording should be explicitly disabled, even if the
* recording_path parameter is set. Normally setting the recording_path
* parameter to a non-null value will result in session recording being
* enabled - this provides the ability to override that.
*/
IDX_RECORDING_DISABLED,
/** /**
* The full absolute path to the directory in which screen recordings * The full absolute path to the directory in which screen recordings
* should be written. * should be written.
@ -920,6 +929,11 @@ guac_rdp_settings* guac_rdp_parse_args(guac_user* user,
IDX_SFTP_SERVER_ALIVE_INTERVAL, 0); IDX_SFTP_SERVER_ALIVE_INTERVAL, 0);
#endif #endif
/* Parse flag for disabling recording */
settings->recording_disabled =
guac_user_parse_args_boolean(user, GUAC_RDP_CLIENT_ARGS, argv,
IDX_RECORDING_DISABLED, false);
/* Read recording path */ /* Read recording path */
settings->recording_path = settings->recording_path =
guac_user_parse_args_string(user, GUAC_RDP_CLIENT_ARGS, argv, guac_user_parse_args_string(user, GUAC_RDP_CLIENT_ARGS, argv,

View File

@ -452,6 +452,14 @@ typedef struct guac_rdp_settings {
int sftp_server_alive_interval; int sftp_server_alive_interval;
#endif #endif
/**
* Whether or not recording should be explicitly disabled, even if the
* recording_path parameter is set. Normally setting the recording_path
* parameter to a non-null value will result in session recording being
* enabled - this provides the ability to override that.
*/
int recording_disabled;
/** /**
* The path in which the screen recording should be saved, if enabled. If * The path in which the screen recording should be saved, if enabled. If
* no screen recording should be saved, this will be NULL. * no screen recording should be saved, this will be NULL.

View File

@ -49,6 +49,7 @@ const char* GUAC_SSH_CLIENT_ARGS[] = {
"typescript-path", "typescript-path",
"typescript-name", "typescript-name",
"create-typescript-path", "create-typescript-path",
"recording-disabled",
"recording-path", "recording-path",
"recording-name", "recording-name",
"recording-exclude-output", "recording-exclude-output",
@ -167,6 +168,14 @@ enum SSH_ARGS_IDX {
*/ */
IDX_CREATE_TYPESCRIPT_PATH, IDX_CREATE_TYPESCRIPT_PATH,
/**
* Whether or not recording should be explicitly disabled, even if the
* recording_path parameter is set. Normally setting the recording_path
* parameter to a non-null value will result in session recording being
* enabled - this provides the ability to override that.
*/
IDX_RECORDING_DISABLED,
/** /**
* The full absolute path to the directory in which screen recordings * The full absolute path to the directory in which screen recordings
* should be written. * should be written.
@ -387,6 +396,11 @@ guac_ssh_settings* guac_ssh_parse_args(guac_user* user,
guac_user_parse_args_boolean(user, GUAC_SSH_CLIENT_ARGS, argv, guac_user_parse_args_boolean(user, GUAC_SSH_CLIENT_ARGS, argv,
IDX_CREATE_TYPESCRIPT_PATH, false); IDX_CREATE_TYPESCRIPT_PATH, false);
/* Parse setting to disable recording */
settings->recording_disabled =
guac_user_parse_args_boolean(user, GUAC_SSH_CLIENT_ARGS, argv,
IDX_RECORDING_DISABLED, false);
/* Read recording path */ /* Read recording path */
settings->recording_path = settings->recording_path =
guac_user_parse_args_string(user, GUAC_SSH_CLIENT_ARGS, argv, guac_user_parse_args_string(user, GUAC_SSH_CLIENT_ARGS, argv,

View File

@ -204,6 +204,14 @@ typedef struct guac_ssh_settings {
*/ */
bool create_typescript_path; bool create_typescript_path;
/**
* Whether or not recording should be explicitly disabled, even if the
* recording_path parameter is set. Normally setting the recording_path
* parameter to a non-null value will result in session recording being
* enabled - this provides the ability to override that.
*/
bool recording_disabled;
/** /**
* The path in which the screen recording should be saved, if enabled. If * The path in which the screen recording should be saved, if enabled. If
* no screen recording should be saved, this will be NULL. * no screen recording should be saved, this will be NULL.

View File

@ -211,7 +211,7 @@ void* ssh_client_thread(void* data) {
char ssh_ttymodes[GUAC_SSH_TTYMODES_SIZE(1)]; char ssh_ttymodes[GUAC_SSH_TTYMODES_SIZE(1)];
/* Set up screen recording, if requested */ /* Set up screen recording, if requested */
if (settings->recording_path != NULL) { if (settings->recording_path != NULL && !settings->recording_disabled) {
ssh_client->recording = guac_common_recording_create(client, ssh_client->recording = guac_common_recording_create(client,
settings->recording_path, settings->recording_path,
settings->recording_name, settings->recording_name,

View File

@ -43,6 +43,7 @@ const char* GUAC_TELNET_CLIENT_ARGS[] = {
"typescript-path", "typescript-path",
"typescript-name", "typescript-name",
"create-typescript-path", "create-typescript-path",
"recording-disabled",
"recording-path", "recording-path",
"recording-name", "recording-name",
"recording-exclude-output", "recording-exclude-output",
@ -133,6 +134,14 @@ enum TELNET_ARGS_IDX {
*/ */
IDX_CREATE_TYPESCRIPT_PATH, IDX_CREATE_TYPESCRIPT_PATH,
/**
* Whether or not recording should be explicitly disabled, even if the
* recording_path parameter is set. Normally setting the recording_path
* parameter to a non-null value will result in session recording being
* enabled - this provides the ability to override that.
*/
IDX_RECORDING_DISABLED,
/** /**
* The full absolute path to the directory in which screen recordings * The full absolute path to the directory in which screen recordings
* should be written. * should be written.
@ -404,6 +413,11 @@ guac_telnet_settings* guac_telnet_parse_args(guac_user* user,
guac_user_parse_args_boolean(user, GUAC_TELNET_CLIENT_ARGS, argv, guac_user_parse_args_boolean(user, GUAC_TELNET_CLIENT_ARGS, argv,
IDX_CREATE_TYPESCRIPT_PATH, false); IDX_CREATE_TYPESCRIPT_PATH, false);
/* Read flag for disabling recording */
settings->recording_disabled =
guac_user_parse_args_boolean(user, GUAC_TELNET_CLIENT_ARGS, argv,
IDX_RECORDING_DISABLED, false);
/* Read recording path */ /* Read recording path */
settings->recording_path = settings->recording_path =
guac_user_parse_args_string(user, GUAC_TELNET_CLIENT_ARGS, argv, guac_user_parse_args_string(user, GUAC_TELNET_CLIENT_ARGS, argv,

View File

@ -202,6 +202,14 @@ typedef struct guac_telnet_settings {
*/ */
bool create_typescript_path; bool create_typescript_path;
/**
* Whether or not recording should be explicitly disabled, even if the
* recording_path parameter is set. Normally setting the recording_path
* parameter to a non-null value will result in session recording being
* enabled - this provides the ability to override that.
*/
bool recording_disabled;
/** /**
* The path in which the screen recording should be saved, if enabled. If * The path in which the screen recording should be saved, if enabled. If
* no screen recording should be saved, this will be NULL. * no screen recording should be saved, this will be NULL.

View File

@ -558,7 +558,7 @@ void* guac_telnet_client_thread(void* data) {
int wait_result; int wait_result;
/* Set up screen recording, if requested */ /* Set up screen recording, if requested */
if (settings->recording_path != NULL) { if (settings->recording_path != NULL && !settings->recording_disabled) {
telnet_client->recording = guac_common_recording_create(client, telnet_client->recording = guac_common_recording_create(client,
settings->recording_path, settings->recording_path,
settings->recording_name, settings->recording_name,

View File

@ -261,6 +261,14 @@ enum VNC_ARGS_IDX {
IDX_SFTP_SERVER_ALIVE_INTERVAL, IDX_SFTP_SERVER_ALIVE_INTERVAL,
#endif #endif
/**
* Whether or not recording should be explicitly disabled, even if the
* recording_path parameter is set. Normally setting the recording_path
* parameter to a non-null value will result in session recording being
* enabled - this provides the ability to override that.
*/
IDX_RECORDING_DISABLED,
/** /**
* The full absolute path to the directory in which screen recordings * The full absolute path to the directory in which screen recordings
* should be written. * should be written.
@ -488,6 +496,11 @@ guac_vnc_settings* guac_vnc_parse_args(guac_user* user,
IDX_SFTP_SERVER_ALIVE_INTERVAL, 0); IDX_SFTP_SERVER_ALIVE_INTERVAL, 0);
#endif #endif
/* Read flag for disabling recording */
settings->recording_disabled =
guac_user_parse_args_boolean(user, GUAC_VNC_CLIENT_ARGS, argv,
IDX_RECORDING_DISABLED, false);
/* Read recording path */ /* Read recording path */
settings->recording_path = settings->recording_path =
guac_user_parse_args_string(user, GUAC_VNC_CLIENT_ARGS, argv, guac_user_parse_args_string(user, GUAC_VNC_CLIENT_ARGS, argv,

View File

@ -213,6 +213,14 @@ typedef struct guac_vnc_settings {
int sftp_server_alive_interval; int sftp_server_alive_interval;
#endif #endif
/**
* Whether or not recording should be explicitly disabled, even if the
* recording_path parameter is set. Normally setting the recording_path
* parameter to a non-null value will result in session recording being
* enabled - this provides the ability to override that.
*/
bool recording_disabled;
/** /**
* The path in which the screen recording should be saved, if enabled. If * The path in which the screen recording should be saved, if enabled. If
* no screen recording should be saved, this will be NULL. * no screen recording should be saved, this will be NULL.

View File

@ -372,7 +372,7 @@ void* guac_vnc_client_thread(void* data) {
vnc_client->rfb_client = rfb_client; vnc_client->rfb_client = rfb_client;
/* Set up screen recording, if requested */ /* Set up screen recording, if requested */
if (settings->recording_path != NULL) { if (settings->recording_path != NULL && !settings->recording_disabled) {
vnc_client->recording = guac_common_recording_create(client, vnc_client->recording = guac_common_recording_create(client,
settings->recording_path, settings->recording_path,
settings->recording_name, settings->recording_name,