[client,common] skip invalid drives to redirect

Fixes #9989: ignore invalid drive (=path) redirections from
configuration, but notify the user with a warning message.
This commit is contained in:
akallabeth 2024-03-18 09:30:42 +01:00 committed by akallabeth
parent bdd866c3d3
commit 925b23bef5

View File

@ -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: