Skip to content

Fix SCMR failure actions marshaling and add regression test (Issue #2046)#2160

Open
alexisbalbachan wants to merge 3 commits intofortra:masterfrom
alexisbalbachan:fix-issue-2046-scmr-failure-actions
Open

Fix SCMR failure actions marshaling and add regression test (Issue #2046)#2160
alexisbalbachan wants to merge 3 commits intofortra:masterfrom
alexisbalbachan:fix-issue-2046-scmr-failure-actions

Conversation

@alexisbalbachan
Copy link
Copy Markdown
Collaborator

Fix scmr.RChangeServiceConfig2W() for SERVICE_CONFIG_FAILURE_ACTIONS when lpsaActions is populated. (Issue #2046)

SERVICE_FAILURE_ACTIONSW.lpsaActions was modeled as an inline structure, but the SCMR protocol defines it
as [size_is(cActions)] SC_ACTION*. That caused requests with non-empty failure actions to be marshaled incorrectly and
fail with rpc_x_bad_stub_data.

Changes:

  • Model lpsaActions as a pointer to a conformant array of SC_ACTION
  • Keep cActions synchronized with the pointed array during marshaling
  • Added regression test

References

Copilot AI review requested due to automatic review settings March 27, 2026 20:09
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes incorrect marshaling of SERVICE_CONFIG_FAILURE_ACTIONS in scmr.RChangeServiceConfig2W() when lpsaActions is non-empty, and adds a regression test to cover the failure-actions path.

Changes:

  • Model SERVICE_FAILURE_ACTIONSW.lpsaActions as a pointer to a conformant array ([size_is(cActions)] SC_ACTION*).
  • Synchronize cActions with the pointed action array during marshaling.
  • Refactor SCMR config query logic in tests and add a dedicated regression test for failure actions.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
impacket/dcerpc/v5/scmr.py Updates NDR modeling for failure actions to correctly represent lpsaActions as a pointer to an SC_ACTION conformant array and syncs cActions at marshal time.
tests/dcerpc/test_scmr.py Adds query helpers and a regression test validating ChangeServiceConfig2W failure-actions behavior and round-tripping via QueryServiceConfig2W.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

alexisbalbachan and others added 2 commits March 27, 2026 17:20
Applied Code review suggestions to the test

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants