Skip to content

Don't fail RemoteOperations.finish() when dependent services keep RemoteRegistry running - #2402

Open
mpgn wants to merge 1 commit into
fortra:masterfrom
mpgn:remoteregistry-dependent-services
Open

mpgn wants to merge 1 commit into
fortra:masterfrom
mpgn:remoteregistry-dependent-services

Conversation

@mpgn

@mpgn mpgn commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Hello guys, a follow-up to #2329 :)

On a DC, the DFS Namespace service (Dfs) depends on RemoteRegistry. When RemoteRegistry had stopped itself after being idle, enableRegistry() starts it and the stop in __restore() then fails with ERROR_DEPENDENT_SERVICES_RUNNING (0x41b). finish() raises before it restores the start type and closes the RPC handles, and with the context manager the error now leaves the with block, so a successful dump ends with a traceback (reported on NetExec with a Windows Server 2022 DC).

This handles it like ERROR_SERVICE_NOT_ACTIVE: log that the service cannot be stopped and go on with the restore. Same change in secretsdump.py and regsecrets.py.

Tests:

  • new case in tests/misc/test_remoteoperations.py (fails with 0x41b without the change)
  • pytest tests -m "not remote": 918 passed, 9 skipped
  • flake8 --select=E9,F63,F7,F82 on the changed files: clean

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in review This issue or pull request is being analyzed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants