Skip to content

Adding logic for FILE_SUPERSEDE#12829

Merged
ibeckermayer merged 121 commits intowindows-desktop-directory-sharingfrom
isaiah/add-FILE-SUPERSEDE
Jun 28, 2022
Merged

Adding logic for FILE_SUPERSEDE#12829
ibeckermayer merged 121 commits intowindows-desktop-directory-sharingfrom
isaiah/add-FILE-SUPERSEDE

Conversation

@ibeckermayer
Copy link
Copy Markdown
Contributor

I mistakenly forgot to fill this out in #12665. This logic was moved into its own function in #12750, so I'm branching off of there to avoid merge-chaos.

Isaiah Becker-Mayer added 30 commits March 31, 2022 15:35
…and cliprdr::Client's have the vchan::Client as a field.
…o trigger it by right-clicking, however it isn't working. One reason is that the vchannel PDU header isn't being added (see rdpdr::encode_message for how that's added to other messages). Noticing that made me notice that there is another cliprdr function for breaking outgoing messages into chunks that should be refactored into vchan to do that work + add the necessary vchan headers. This is a checkpoint commit while I go attend to that.
…lient parses the DeviceCreateRequest that's immediately sent back
…ugh in most cases, no need to neurotically add every bit of the documentation text to the code itself
// https://github.com/FreeRDP/FreeRDP/blob/511444a65e7aa2f537c5e531fa68157a50c1bd4d/winpr/libwinpr/file/file.c#L781
if rdp_req.create_disposition == flags::CreateDisposition::FILE_SUPERSEDE {
// If the file already exists, replace it with the given file. If it does not, create the given file.
if res.err_code == TdpErrCode::Nil {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused, don't you have an error code for already exists? (TdpErrCode::AE)

Why are you not checking for that?

Copy link
Copy Markdown
Contributor Author

@ibeckermayer ibeckermayer Jun 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to my current spec, that error is only sent back if we try a Shared Directory Create Request but the file already exists. I could rewrite this to try a Shared Directory Create Request and then do a tdp_sd_overwrite if request's res.err_code == TdpErrCode::AE, but that would be an extra roundtrip for information (whether or not this file exists) that we already have from the original Shared Directory Info Request:

// Send a TDP Shared Directory Info Request
// https://github.com/FreeRDP/FreeRDP/blob/511444a65e7aa2f537c5e531fa68157a50c1bd4d/channels/drive/client/drive_file.c#L210
let tdp_req = SharedDirectoryInfoRequest::from(rdp_req.clone());
debug!("sending TDP: {:?}", tdp_req);
(self.tdp_sd_info_request)(tdp_req)?;

@ibeckermayer ibeckermayer changed the base branch from isaiah/irp-mj-refactor to windows-desktop-directory-sharing June 25, 2022 00:26
@ibeckermayer ibeckermayer changed the base branch from windows-desktop-directory-sharing to isaiah/irp-mj-refactor June 25, 2022 00:26
@ibeckermayer ibeckermayer changed the base branch from isaiah/irp-mj-refactor to windows-desktop-directory-sharing June 27, 2022 13:46
@ibeckermayer ibeckermayer requested a review from zmb3 June 27, 2022 14:18
@ibeckermayer ibeckermayer merged commit 8a3153b into windows-desktop-directory-sharing Jun 28, 2022
ibeckermayer pushed a commit that referenced this pull request Jul 6, 2022
ibeckermayer pushed a commit that referenced this pull request Jul 13, 2022
ibeckermayer pushed a commit that referenced this pull request Aug 23, 2022
* `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>
ibeckermayer pushed a commit that referenced this pull request Aug 23, 2022
* `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>
ibeckermayer pushed a commit that referenced this pull request Sep 7, 2022
…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>
@rosstimothy rosstimothy deleted the isaiah/add-FILE-SUPERSEDE branch December 18, 2025 15:42
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.

4 participants