fix(connector): surface server error-info disconnect during reactivation - #1467
Open
Greg Lamberson (glamberson) wants to merge 1 commit into
Open
Conversation
When a server ends the session after a Deactivate-All instead of reactivating (MS-RDPBCGR 1.3.1.3), it sends a Set Error Info PDU carrying the disconnect reason. The Capabilities Exchange step only recognized ServerDemandActive (and skipped ServerDeactivateAll), so the Error Info PDU fell through to a generic "unexpected Share Control PDU" error and the real reason was lost. Handle the ServerSetErrorInfo Data PDU the way the connection finalization sequence already does, returning a Reason error with the error-info description. FreeRDP-based servers such as GNOME Remote Desktop hit this path, for example when the backend screencast session cannot be created and the server disconnects right after activation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
After a Deactivate-All, a server may end the session (MS-RDPBCGR 1.3.1.3) instead of reactivating, sending a Set Error Info PDU that carries the disconnect reason.
ConnectionActivationSequence's Capabilities Exchange step only recognizedServerDemandActive(and skippedServerDeactivateAll), so the Error Info PDU fell through to a generic "unexpected Share Control PDU" error and the real reason was lost.ServerSetErrorInfoin Capabilities Exchange the wayConnectionFinalizationSequencealready does: return areasonerror carrying the error-info description.ERRINFO_NONEis informational, so it is skipped (stay in Capabilities Exchange, await Demand Active) rather than treated as fatal, matching the finalization sequence.Found while validating the client against GNOME Remote Desktop (#1446): grd ends the session right after activation when its backend screencast session cannot be created (for example a locked desktop), and the client surfaced only an opaque error at that point.
Validation
cargo xtask check fmt,lints,tests,typos,locksall pass. Two new integration tests intests/session/connection_activation.rscover the disconnect-reason path and the benignERRINFO_NONEpath.Notes
No wire-format or public-API change: this only improves the error surfaced on an existing failure path.