GUACAMOLE-474: Enforce download disable option at low level, warning if not blocked at higher level as expected.

This commit is contained in:
Michael Jumper 2020-06-25 14:02:43 -07:00
parent 99fce8fa19
commit d8c32b1e82
2 changed files with 18 additions and 0 deletions

View File

@ -516,6 +516,15 @@ guac_stream* guac_common_ssh_sftp_download_file(
guac_stream* stream;
LIBSSH2_SFTP_HANDLE* file;
/* Ignore download if downloads have been disabled */
if (filesystem->disable_download) {
guac_user_log(user, GUAC_LOG_WARNING, "A download attempt has "
"been blocked due to downloads being disabled, however it "
"should have been blocked at a higher level. This is likely "
"a bug.");
return NULL;
}
/* Attempt to open file for reading */
file = libssh2_sftp_open(filesystem->sftp_session, filename,
LIBSSH2_FXF_READ, 0);

View File

@ -185,6 +185,15 @@ void* guac_rdp_download_to_user(guac_user* user, void* data) {
if (filesystem == NULL)
return NULL;
/* Ignore download if downloads have been disabled */
if (filesystem->disable_download) {
guac_client_log(client, GUAC_LOG_WARNING, "A download attempt has "
"been blocked due to downloads being disabled, however it "
"should have been blocked at a higher level. This is likely "
"a bug.");
return NULL;
}
/* Attempt to open requested file */
char* path = (char*) data;
int file_id = guac_rdp_fs_open(filesystem, path,