diff options
Diffstat (limited to 'debian/patches/0020-Use-specific-names-for-drive-hotplug-special-values.patch')
-rw-r--r-- | debian/patches/0020-Use-specific-names-for-drive-hotplug-special-values.patch | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/debian/patches/0020-Use-specific-names-for-drive-hotplug-special-values.patch b/debian/patches/0020-Use-specific-names-for-drive-hotplug-special-values.patch new file mode 100644 index 0000000..1ee2cf8 --- /dev/null +++ b/debian/patches/0020-Use-specific-names-for-drive-hotplug-special-values.patch @@ -0,0 +1,57 @@ +From 187cbdfe2c0abdef554306394d12a9b28a5100eb Mon Sep 17 00:00:00 2001 +From: akallabeth <akallabeth@posteo.net> +Date: Tue, 9 Mar 2021 12:09:58 +0100 +Subject: [PATCH 20/36] Use specific names for drive hotplug special values + +(cherry picked from commit b1be3d78fcc63a5842f7707a139b2582a4a42b21) +--- + client/common/cmdline.c | 24 ++++++++++++++++++++++-- + 1 file changed, 22 insertions(+), 2 deletions(-) + +--- a/client/common/cmdline.c ++++ b/client/common/cmdline.c +@@ -120,6 +120,23 @@ + return TRUE; + } + ++static char* name_from_path(const char* path) ++{ ++ const char* name = "NULL"; ++ if (path) ++ { ++ if (_strnicmp(path, "%", 2) == 0) ++ name = "home"; ++ else if (_strnicmp(path, "*", 2) == 0) ++ name = "hotplug-all"; ++ else if (_strnicmp(path, "DynamicDrives", 2) == 0) ++ name = "hotplug"; ++ else ++ name = path; ++ } ++ return _strdup(name); ++} ++ + static BOOL freerdp_client_add_drive(rdpSettings* settings, const char* path, const char* name) + { + RDPDR_DRIVE* drive; +@@ -151,8 +168,10 @@ + goto fail; + } + else /* We need a name to send to the server. */ +- if (!(drive->Name = _strdup(path))) +- goto fail; ++ { ++ if (!(drive->Name = name_from_path(path))) ++ goto fail; ++ } + + if (!path || !freerdp_sanitize_drive_name(drive->Name, "\\/", "__")) + goto fail; +@@ -3557,6 +3576,7 @@ + /* Syntax: Comma seperated list of the following entries: + * '*' ... Redirect all drives, including hotplug + * 'DynamicDrives' ... hotplug ++ * '%' ... user home directory + * <label>(<path>) ... One or more paths to redirect. + * <path>(<label>) ... One or more paths to redirect. + * <path> ... One or more paths to redirect. |