Skip to content

fix(connector): surface server error-info disconnect during reactivation - #1467

Open
Greg Lamberson (glamberson) wants to merge 1 commit into
Devolutions:masterfrom
lamco-admin:fix/reactivation-server-error-info
Open

fix(connector): surface server error-info disconnect during reactivation#1467
Greg Lamberson (glamberson) wants to merge 1 commit into
Devolutions:masterfrom
lamco-admin:fix/reactivation-server-error-info

Conversation

@glamberson

Copy link
Copy Markdown
Contributor

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 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 ServerSetErrorInfo in Capabilities Exchange the way ConnectionFinalizationSequence already does: return a reason error carrying the error-info description.
  • ERRINFO_NONE is 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, locks all pass. Two new integration tests in tests/session/connection_activation.rs cover the disconnect-reason path and the benign ERRINFO_NONE path.

Notes

No wire-format or public-API change: this only improves the error surfaced on an existing failure path.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant