Skip to content

Commit

Permalink
Add handling for ServerDriveLockControlRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaiah Becker-Mayer committed Nov 29, 2023
1 parent 74eb327 commit 7e0ff50
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 26 deletions.
24 changes: 12 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions lib/srv/desktop/rdp/rdpclient/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ x509-parser = "0.14"
sspi = { git = "https://github.com/Devolutions/sspi-rs", rev="d54bdfcafa0e10d9d78224ebacc4f2a0992a6b79", features = ["network_client"] }
static_init = "1.0.3"

# Change this once https://github.com/Devolutions/IronRDP/pull/312 lands
ironrdp-connector = { git = "https://github.com/Devolutions/IronRDP", rev = "5b0a29ea45f38236bf6d1ebfd5990a0dbb1cc814" }
ironrdp-tls = { git = "https://github.com/Devolutions/IronRDP", rev = "5b0a29ea45f38236bf6d1ebfd5990a0dbb1cc814" }
ironrdp-session = { git = "https://github.com/Devolutions/IronRDP", rev = "5b0a29ea45f38236bf6d1ebfd5990a0dbb1cc814" }
ironrdp-pdu = { git = "https://github.com/Devolutions/IronRDP", rev = "5b0a29ea45f38236bf6d1ebfd5990a0dbb1cc814" }
ironrdp-tokio = { git = "https://github.com/Devolutions/IronRDP", rev = "5b0a29ea45f38236bf6d1ebfd5990a0dbb1cc814" }
ironrdp-rdpsnd = { git = "https://github.com/Devolutions/IronRDP", rev = "5b0a29ea45f38236bf6d1ebfd5990a0dbb1cc814" }
ironrdp-rdpdr = { git = "https://github.com/Devolutions/IronRDP", rev = "5b0a29ea45f38236bf6d1ebfd5990a0dbb1cc814" }
ironrdp-svc = { git = "https://github.com/Devolutions/IronRDP", rev = "5b0a29ea45f38236bf6d1ebfd5990a0dbb1cc814" }
ironrdp-cliprdr = { git = "https://github.com/Devolutions/IronRDP", rev = "5b0a29ea45f38236bf6d1ebfd5990a0dbb1cc814" }
# Change this once https://github.com/Devolutions/IronRDP/pull/313 lands
ironrdp-connector = { git = "https://github.com/Devolutions/IronRDP", rev = "67c2d7099adb6da503d1fce7b66031a8c936053b" }
ironrdp-tls = { git = "https://github.com/Devolutions/IronRDP", rev = "67c2d7099adb6da503d1fce7b66031a8c936053b" }
ironrdp-session = { git = "https://github.com/Devolutions/IronRDP", rev = "67c2d7099adb6da503d1fce7b66031a8c936053b" }
ironrdp-pdu = { git = "https://github.com/Devolutions/IronRDP", rev = "67c2d7099adb6da503d1fce7b66031a8c936053b" }
ironrdp-tokio = { git = "https://github.com/Devolutions/IronRDP", rev = "67c2d7099adb6da503d1fce7b66031a8c936053b" }
ironrdp-rdpsnd = { git = "https://github.com/Devolutions/IronRDP", rev = "67c2d7099adb6da503d1fce7b66031a8c936053b" }
ironrdp-rdpdr = { git = "https://github.com/Devolutions/IronRDP", rev = "67c2d7099adb6da503d1fce7b66031a8c936053b" }
ironrdp-svc = { git = "https://github.com/Devolutions/IronRDP", rev = "67c2d7099adb6da503d1fce7b66031a8c936053b" }
ironrdp-cliprdr = { git = "https://github.com/Devolutions/IronRDP", rev = "67c2d7099adb6da503d1fce7b66031a8c936053b" }

# Uncomment the following lines to use local crates instead of the ones from github
# ironrdp-connector = { path = "/Users/ibeckermayer/Devolutions/IronRDP/crates/ironrdp-connector" }
Expand Down
13 changes: 13 additions & 0 deletions lib/srv/desktop/rdp/rdpclient/src/rdpdr/filesystem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ use crate::{
};
use ironrdp_pdu::{cast_length, custom_err, other_err, PduResult};
use ironrdp_rdpdr::pdu::{
self,
efs::{self, NtStatus},
esc,
};
Expand Down Expand Up @@ -93,6 +94,9 @@ impl FilesystemBackend {
efs::ServerDriveIoRequest::ServerDriveSetInformationRequest(req) => {
self.handle_set_information_req(req)
}
efs::ServerDriveIoRequest::ServerDriveLockControlRequest(req) => {
self.handle_lock_req(req)
}
}
}

Expand Down Expand Up @@ -509,6 +513,7 @@ impl FilesystemBackend {
self.tdp_sd_write(req)
}

/// Handles an RDP [`efs::ServerDriveSetInformationRequest`] received from the RDP server.
fn handle_set_information_req(
&mut self,
rdp_req: efs::ServerDriveSetInformationRequest,
Expand Down Expand Up @@ -568,6 +573,14 @@ impl FilesystemBackend {
}
}

/// Handles an RDP [`efs::ServerDriveLockControlRequest`] received from the RDP server.
fn handle_lock_req(&self, _req: efs::ServerDriveLockControlRequest) -> PduResult<()> {
// https://github.com/FreeRDP/FreeRDP/blob/dfa231c0a55b005af775b833f92f6bcd30363d77/channels/drive/client/drive_main.c#L601
self.client_handle
.write_rdpdr(pdu::RdpdrPdu::EmptyResponse)?;
Ok(())
}

/// Helper function for writing a [`tdp::SharedDirectoryCreateRequest`] to the browser
/// and handling the [`tdp::SharedDirectoryCreateResponse`] that is received in response.
fn tdp_sd_create(
Expand Down
8 changes: 4 additions & 4 deletions web/packages/teleport/src/ironrdp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ tracing-web = "0.1.2"
time = { version = "0.3", features = ["wasm-bindgen"] }
console_error_panic_hook = "0.1.7"

# Change this once https://github.com/Devolutions/IronRDP/pull/312 lands
ironrdp-session = { git = "https://github.com/Devolutions/IronRDP", rev = "5b0a29ea45f38236bf6d1ebfd5990a0dbb1cc814" }
ironrdp-pdu = { git = "https://github.com/Devolutions/IronRDP", rev = "5b0a29ea45f38236bf6d1ebfd5990a0dbb1cc814" }
ironrdp-graphics = { git = "https://github.com/Devolutions/IronRDP", rev = "5b0a29ea45f38236bf6d1ebfd5990a0dbb1cc814" }
# Change this once https://github.com/Devolutions/IronRDP/pull/313 lands
ironrdp-session = { git = "https://github.com/Devolutions/IronRDP", rev = "67c2d7099adb6da503d1fce7b66031a8c936053b" }
ironrdp-pdu = { git = "https://github.com/Devolutions/IronRDP", rev = "67c2d7099adb6da503d1fce7b66031a8c936053b" }
ironrdp-graphics = { git = "https://github.com/Devolutions/IronRDP", rev = "67c2d7099adb6da503d1fce7b66031a8c936053b" }

# Uncomment the following lines and comment out the ones above to use local crates instead of the ones from github
# ironrdp-session = { path = "/path/to/your/local/IronRDP/crates/ironrdp-session" }
Expand Down

0 comments on commit 7e0ff50

Please sign in to comment.