UnixPath and WindowsPath#14267
Conversation
How does the javascript side of things fare with non-unicode paths? If there's nothing sane we can do on that side either, we could just throw some IO error when attempting to write a file with a broken path in the shared directory. |
Apparently JS doesn't fare well with UTF-16 generally. Right now, presuming a utf16string::Utf16Error is returned from I think that's good enough for now as long as we document it. I've created an issue to explore this in more detail later: #15126 |
Oops, I meant to link this Stack Overflow answer. Looking at it again, though, its from 2011, and some of the problem may be ameliorated by now. Nevertheless, I say its low priority and we continue as planned, and I will come back to that issue later on. |
|
Waiting until #13630 is merged and then will merge this direct into |
|
@ibeckermayer See the table below for backport results.
|
…ring) (#15770) * Windows Desktop Directory Sharing (#13630) * `IRP_MJ_CREATE` (#12665) * `IRP_MJ_QUERY_INFORMATION` (#12717) * `IRP_MJ_CLOSE` (#12729) * Refactor rdpdr client (#12750) * Adding logic for `FILE_SUPERSEDE` (#12829) * Improve `process_irp_create` (#12830) * adds return statements that got lost in a merge * `IRP_MJ_DIRECTORY_CONTROL` (#12870) * `FileFullDirectoryInformation` (#12908) * Improve `ClientDriveQueryDirectoryResponse.encode()` (#12912) * `IRP_MJ_QUERY_VOLUME_INFORMATION` (#13071) * Fix Shared Directory Request handling when feature is disabled (#13439) * IRP_MJ_READ, IRP_MJ_WRITE, and IRP_MJ_SET_INFORMATION (#13995) * Adds constants for sizing calculations (#14051) Co-authored-by: Łukasz Kozłowski <lukasz.kozlowski@goteleport.com> Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com> * `UnixPath` and `WindowsPath` (#14267) * `SharedDirectoryMoveRequest` and `SharedDirectoryMoveResponse` (#14959) * `SharedDirectoryCreateResponse` update (#15289) * Fix `process_irp_set_information` (#15364) * Sanitize Rust Debug Logs (#15743) * updates rdp-rs ref to include licensing changes * Updates rdp-rs ref and fixes Cargo Co-authored-by: Łukasz Kozłowski <lukasz.kozlowski@goteleport.com> Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
Adds a
UnixPathandWindowsPathstructfor denoting the types of pathStrings we expect to hold in our various RDP and TDPstructs. Neither type implements any strong validation, since paths (nearly) always originate from the RDP server which we must assume is working correctly. The assumptions made about the types ofWindowsPaths we'll receive are based on our experience with RDP so far, since the precise details are not specified in the spec documents.Before going with this option, I looked into
std::path::Pathand thepath_slashcrate (which relies onstd::path::Path). I was unable to find any standardized means for handling Windows style paths while running rust on Unix machines, so I opted for the approach taken here.