From b077013c30bd08a83cb07c0b4473e97b25a67261 Mon Sep 17 00:00:00 2001 From: Nick Couchman Date: Thu, 2 Apr 2020 14:58:06 -0400 Subject: [PATCH] GUACAMOLE-474: Hide Download folder if downloads are disabled. --- src/protocols/rdp/channels/rdpdr/rdpdr-fs-messages.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/protocols/rdp/channels/rdpdr/rdpdr-fs-messages.c b/src/protocols/rdp/channels/rdpdr/rdpdr-fs-messages.c index 6c004948..7522abc6 100644 --- a/src/protocols/rdp/channels/rdpdr/rdpdr-fs-messages.c +++ b/src/protocols/rdp/channels/rdpdr/rdpdr-fs-messages.c @@ -98,9 +98,13 @@ void guac_rdpdr_fs_process_create(guac_rdp_common_svc* svc, /* Create \Download if it doesn't exist */ file = guac_rdp_fs_get_file((guac_rdp_fs*) device->data, file_id); if (file != NULL && strcmp(file->absolute_path, "\\") == 0) { - int download_id = - guac_rdp_fs_open((guac_rdp_fs*) device->data, "\\Download", - GENERIC_READ, 0, FILE_OPEN_IF, FILE_DIRECTORY_FILE); + + /* Only create Download folder if downloads are enabled. */ + if(!((guac_rdp_fs*) devices->data)->disable_download) { + int download_id = + guac_rdp_fs_open((guac_rdp_fs*) device->data, "\\Download", + GENERIC_READ, 0, FILE_OPEN_IF, FILE_DIRECTORY_FILE); + } if (download_id >= 0) guac_rdp_fs_close((guac_rdp_fs*) device->data, download_id);