Skip to content

Fix directory sharing for non-ascii directory names#31899

Merged
ibeckermayer merged 4 commits intomasterfrom
isaiah/fix-unicode-dir-share-bug
Sep 15, 2023
Merged

Fix directory sharing for non-ascii directory names#31899
ibeckermayer merged 4 commits intomasterfrom
isaiah/fix-unicode-dir-share-bug

Conversation

@ibeckermayer
Copy link
Copy Markdown
Contributor

Previously we were sending the shared directory's name for PreferredDosName (truncated at 7 characters per the spec). This works in many cases, but if the directory name contains non-ASCII characters it could lead to a panic when we tried to slice the name in the middle of a non-ascii UTF character.

Instead, we now send a fixed string of "FILE" for PreferredDosName when sharing a filesystem (directory). This value is effectively ignored, the actual drive name is always taken from the DeviceData field which can handle non-ASCII characters.

Previously we were sending the shared directory's name for PreferredDosName
(truncated at 7 characters per the spec). This works in many cases, but
if the directory name contains non-ASCII characters it could lead to a
panic when we tried to slice the name in the middle of a non-ascii UTF
character.

Instead, we now send a fixed string of "FILE" for PreferredDosName when
sharing a filesystem (directory). This value is effectively ignored, the
actual drive name is always taken from the DeviceData field which can handle
non-ASCII characters.
Comment thread lib/srv/desktop/rdp/rdpclient/src/rdpdr.rs
Comment thread lib/srv/desktop/rdp/rdpclient/src/rdpdr.rs
@ibeckermayer ibeckermayer requested a review from zmb3 September 14, 2023 20:22
@public-teleport-github-review-bot public-teleport-github-review-bot Bot removed the request for review from AntonAM September 14, 2023 21:10
@ibeckermayer ibeckermayer added this pull request to the merge queue Sep 15, 2023
Merged via the queue into master with commit 876de83 Sep 15, 2023
@ibeckermayer ibeckermayer deleted the isaiah/fix-unicode-dir-share-bug branch September 15, 2023 00:27
@public-teleport-github-review-bot
Copy link
Copy Markdown

@ibeckermayer See the table below for backport results.

Branch Result
branch/v11 Create PR
branch/v12 Create PR
branch/v13 Create PR
branch/v14 Create PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants