Skip to content

Commit

Permalink
[client,common] skip invalid drives to redirect
Browse files Browse the repository at this point in the history
Fixes FreeRDP#9989: ignore invalid drive (=path) redirections from
configuration, but notify the user with a warning message.
  • Loading branch information
akallabeth committed Mar 18, 2024
1 parent 35430cf commit 38f51ee
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions client/common/cmdline.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 38f51ee

Please sign in to comment.