From e5f919f75cd93801c9c77d65bddd703ae2a5d1e3 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Wed, 6 Nov 2013 11:59:18 -0800 Subject: [PATCH] Reroute files from Outbox to Sent. --- src/protocols/rdp/rdp_fs.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/protocols/rdp/rdp_fs.c b/src/protocols/rdp/rdp_fs.c index 48e1892c..ca55d519 100644 --- a/src/protocols/rdp/rdp_fs.c +++ b/src/protocols/rdp/rdp_fs.c @@ -215,6 +215,21 @@ int guac_rdp_fs_open(guac_rdp_fs* fs, const char* path, GUAC_RDP_DEBUG(2, "Normalized path \"%s\" to \"%s\".", path, normalized_path); + /* If creating file within Outbox, prepare for download */ + if (strncmp(normalized_path, "\\Outbox\\", 8) == 0) { + + /* Replace \Outbox\ with \Sent\ */ + memcpy(normalized_path, "\\Sent\\", 6); + + /* Shift everything after the original \Outbox\ back two bytes */ + char* original_path = &(normalized_path[8]); + do { + *(original_path-2) = *original_path; + } while (*(original_path++) != '\0'); + + GUAC_RDP_DEBUG(2, "Rerouted to \"%s\"", normalized_path); + } + /* Translate normalized path to real path */ __guac_rdp_fs_translate_path(fs, normalized_path, real_path);