mirror of
https://github.com/FreeRDP/FreeRDP.git
synced 2025-06-03 00:00:20 +00:00
client/X11: Reintroduce handling for relieving filename restriction
Commit6492a00959
introduced a way to relieve the filename restriction, which ensured that file lists containing files with names, that have characters, which are not allowed on MS Windows. This relief handling kicked in, when xfreerdp did not connect to MS Windows RDS. Commitd521c7fa74
got rid of any wClipboardDelegate occurrence in xf_cliprdr.c, which also got rid of the filename restriction relieve handling. However, the relief handling was not added back, so do it now.
This commit is contained in:
parent
126fb7b2fc
commit
1f79eaa831
@ -2030,6 +2030,26 @@ xf_cliprdr_server_format_data_response(CliprdrClientContext* context,
|
||||
return CHANNEL_RC_OK;
|
||||
}
|
||||
|
||||
static BOOL xf_cliprdr_is_valid_unix_filename(LPCWSTR filename)
|
||||
{
|
||||
LPCWSTR c;
|
||||
|
||||
if (!filename)
|
||||
return FALSE;
|
||||
|
||||
if (filename[0] == L'\0')
|
||||
return FALSE;
|
||||
|
||||
/* Reserved characters */
|
||||
for (c = filename; *c; ++c)
|
||||
{
|
||||
if (*c == L'/')
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
xfClipboard* xf_clipboard_new(xfContext* xfc, BOOL relieveFilenameRestriction)
|
||||
{
|
||||
int n = 0;
|
||||
@ -2206,6 +2226,13 @@ xfClipboard* xf_clipboard_new(xfContext* xfc, BOOL relieveFilenameRestriction)
|
||||
clipboard->numTargets = 2;
|
||||
clipboard->incr_atom = XInternAtom(xfc->display, "INCR", FALSE);
|
||||
|
||||
if (relieveFilenameRestriction)
|
||||
{
|
||||
WLog_DBG(TAG, "Relieving CLIPRDR filename restriction");
|
||||
ClipboardGetDelegate(clipboard->system)->IsFileNameComponentValid =
|
||||
xf_cliprdr_is_valid_unix_filename;
|
||||
}
|
||||
|
||||
return clipboard;
|
||||
|
||||
fail:
|
||||
|
Loading…
Reference in New Issue
Block a user