GUACAMOLE-474: Enforce download disable option at low level, warning if not blocked at higher level as expected.
This commit is contained in:
parent
99fce8fa19
commit
d8c32b1e82
@ -516,6 +516,15 @@ guac_stream* guac_common_ssh_sftp_download_file(
|
|||||||
guac_stream* stream;
|
guac_stream* stream;
|
||||||
LIBSSH2_SFTP_HANDLE* file;
|
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 */
|
/* Attempt to open file for reading */
|
||||||
file = libssh2_sftp_open(filesystem->sftp_session, filename,
|
file = libssh2_sftp_open(filesystem->sftp_session, filename,
|
||||||
LIBSSH2_FXF_READ, 0);
|
LIBSSH2_FXF_READ, 0);
|
||||||
|
@ -185,6 +185,15 @@ void* guac_rdp_download_to_user(guac_user* user, void* data) {
|
|||||||
if (filesystem == NULL)
|
if (filesystem == NULL)
|
||||||
return 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 */
|
/* Attempt to open requested file */
|
||||||
char* path = (char*) data;
|
char* path = (char*) data;
|
||||||
int file_id = guac_rdp_fs_open(filesystem, path,
|
int file_id = guac_rdp_fs_open(filesystem, path,
|
||||||
|
Loading…
Reference in New Issue
Block a user