Skip to content

fix(actor): apply new_password in Rename custom payload - #32

Merged
dkmstr merged 1 commit into
masterfrom
fix/actor-rename-apply-new-password
Sep 29, 2026
Merged

dkmstr merged 1 commit into
masterfrom
fix/actor-rename-apply-new-password

Conversation

@dkmstr

@dkmstr dkmstr commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

Win/Linux random-password OS managers (WinRandomPasswordManager / LinuxRandomPasswordManager) send the new password inside the Rename action's custom dict. The actor only invoked rename_computer and ignored it, so the broker ended up holding a password that did not match the one on the machine. RDP from UDS failed while logging in with the original template password still worked -- the exact symptom David reported on 24/09.

Apply platform.system().change_user_password(username, old_password, new_password) before the rename, gated on a non-empty username to avoid NetUserChangePassword with an empty user. Errors are logged but do not block the rename -- the rename is what the broker ordered, and a failed password change is the broker's problem to surface.

Two new tests in crates/service/src/actors/managed/tests.rs:

  • test_managed_rename_with_new_password_changes_password asserts the call lands on the platform with the credentials the OS manager supplied.
  • test_managed_rename_without_new_password_skips_password_change guards the happy path (no new_password in custom -> only rename).

Repro: uds-demo MCP, pool Windows 11 Random Password (Windows-11-Template-UDS-5.0 / vm 219), WinRandomPasswordManager. Log 'Password set to ' was emitted but Windows still had 'demouser' -- confirmed via Proxmox noVNC + Get-Service TermService / Test-NetConnection 3389.

Win/Linux random-password OS managers (WinRandomPasswordManager / LinuxRandomPasswordManager) send the new password inside the Rename action's custom dict. The actor only invoked rename_computer and ignored it, so the broker ended up holding a password that did not match the one on the machine. RDP from UDS failed while logging in with the original template password still worked -- the exact symptom David reported on 24/09.

Apply platform.system().change_user_password(username, old_password, new_password) before the rename, gated on a non-empty username to avoid NetUserChangePassword with an empty user. Errors are logged but do not block the rename -- the rename is what the broker ordered, and a failed password change is the broker's problem to surface.

Two new tests in crates/service/src/actors/managed/tests.rs:
- test_managed_rename_with_new_password_changes_password asserts the call lands on the platform with the credentials the OS manager supplied.
- test_managed_rename_without_new_password_skips_password_change guards the happy path (no new_password in custom -> only rename).

Repro: uds-demo MCP, pool Windows 11 Random Password (Windows-11-Template-UDS-5.0 / vm 219), WinRandomPasswordManager. Log 'Password set to <random>' was emitted but Windows still had 'demouser' -- confirmed via Proxmox noVNC + Get-Service TermService / Test-NetConnection 3389.
@dkmstr
dkmstr merged commit e753f05 into master Sep 29, 2026
2 checks passed
@aschumann-virtualcable
aschumann-virtualcable deleted the fix/actor-rename-apply-new-password branch September 29, 2026 14:37
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