From 925b23bef5bc45b178ee90f2b092a4ae915e81df Mon Sep 17 00:00:00 2001 From: akallabeth Date: Mon, 18 Mar 2024 09:30:42 +0100 Subject: [PATCH] [client,common] skip invalid drives to redirect Fixes #9989: ignore invalid drive (=path) redirections from configuration, but notify the user with a warning message. --- client/common/cmdline.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/client/common/cmdline.c b/client/common/cmdline.c index 16d397c4b..172836f93 100644 --- a/client/common/cmdline.c +++ b/client/common/cmdline.c @@ -214,18 +214,20 @@ static BOOL freerdp_client_add_drive(rdpSettings* settings, const char* path, co if (!path) goto fail; - else + { BOOL isSpecial = FALSE; BOOL isPath = freerdp_path_valid(path, &isSpecial); if (!isPath && !isSpecial) + { + WLog_WARN(TAG, "Invalid drive to redirect: '%s' does not exist, skipping.", path); + freerdp_device_free(device); + } + else if (!freerdp_device_collection_add(settings, device)) goto fail; } - if (!freerdp_device_collection_add(settings, device)) - goto fail; - return TRUE; fail: