fix(connector): handle ServerDeactivateAll during CapabilitiesExchange#1254
Conversation
Some RDP servers (notably GNOME Remote Desktop / grd) send a ServerDeactivateAll PDU before ServerDemandActive during the initial Capabilities Exchange phase. This is valid per MS-RDPBCGR §1.3.1.3 (Deactivation-Reactivation Sequence). Previously this caused a hard error: "unexpected Share Control Pdu (expected ServerDemandActive)" Now the connector skips the DeactivateAll and waits for the next PDU. Fixes Devolutions#1253
|
Thanks for picking this up Anton Isaiev (@totoshko88). The fix is correct as written: the explicit The spec read is also reasonable. MS-RDPBCGR §1.3.1.3 frames the Deactivation-Reactivation Sequence as a post-completion server-initiated reactivation, so a server sending DeactivateAll during the initial connection is technically nonstandard. The "skip and wait" approach this PR takes is the conservative interoperable interpretation: treat the inbound DeactivateAll as the start of a reactivation, stay in CapabilitiesExchange, and let the next DemandActive arrive normally. Two small suggestions a reviewer is likely to ask for: 1. A test for the new behavior. A connector-step test that feeds a 2. A short comment noting that the decoded PDU is intentionally discarded. Something like: // Drop the decoded share_control_ctx: the DeactivateAll body carries
// no payload we need during initial activation, and the channel-id
// mismatch warning above has already fired if applicable.This is downstream of relevance to Lamco's GNOME Remote Desktop interop work, where this connector-side error has been blocking client-side testing against GRD. Worth flagging that #1232 (GlassOnTin) reports a cousin failure mode with the same |
- Add comment noting the decoded PDU is intentionally discarded - Add test: DeactivateAll during CapabilitiesExchange stays in same state - Add test: DemandActive after DeactivateAll transitions to ConnectionFinalization
|
Thanks for the review Greg Lamberson (@glamberson)! I've addressed both suggestions:
|
|
Thanks Anton Isaiev (@totoshko88), both items look right. The comment captures the "body decoded but discarded" rationale cleanly, and the tests cover the case that was breaking GRD interop. No further comments from my side. |
9cb5439
into
Devolutions:master
Some RDP servers (notably GNOME Remote Desktop / grd) send a ServerDeactivateAll PDU before ServerDemandActive during the initial Capabilities Exchange phase. This is valid per MS-RDPBCGR §1.3.1.3 (Deactivation-Reactivation Sequence).
Previously this caused a hard error:
"unexpected Share Control Pdu (expected ServerDemandActive)"
Now the connector skips the DeactivateAll and waits for the next PDU.
Fixes #1253