Repository navigation
Fix domain join existing account - #34
Merged
Merged
Conversation
…lently During the OS-config phase (rename / join domain) the managed actor had no local websocket client yet, so a failed rename or NetJoinDomain was swallowed by `?` and the service just restart-looped with an empty "Registros" panel and nothing in the local logs. Add `report_fatal` to forward these failures to BOTH the local log and the broker /log endpoint (token/secret are already set after initialize()), and turn the rename / join-domain branches into explicit matches that abort with an error instead of rebooting on failure. Tests: inject rename/join failures via OperationsMock error flags and assert the failure reaches broker::log and that reboot()/ready() are NOT called.
…n-join-logging Take Adolfo's domain-trust-repair work as the base (ensure_domain_membership on Windows/Linux to repair broken AD trust without reboot, re-run broker initialize on every service restart via runtime is_initialized flag, realm join failure propagation, password redaction, enhanced local log dir handling) and keep our unique piece on top: report_fatal() forwards a failed rename / domain join to the broker /log endpoint so the failure shows up in the admin "Cache/Registros" panel instead of only the local log file. Merge resolution: - managed/mod.rs: auto-merged cleanly (his re-init block + our report_fatal Err-branches for rename/join). - join_domain now routes through ensure_domain_membership, so the failure test and mock were updated: OperationsMock::ensure_domain_membership honors the fail_join_domain flag, and the test asserts against ensure_domain_membership. Tests: cargo build --workspace OK; managed suite 14/14 pass.
Plain declaratives instead of caps-for-emphasis and dramatic phrasing; Invariant: -> Note: on the join-domain failure test. No behavior change.
…ists A managed actor renames the machine and then joins the domain in the same run, before the rename reboot. When the machine account already exists in AD, NetJoinDomain returns 2224 (NERR_UserExists) and the retry dropped NETSETUP_JOIN_WITH_NEW_NAME, so the join looked up an account for the still-active OLD name and failed with 1332 (ERROR_NONE_MAPPED). Keep JOIN_WITH_NEW_NAME on the retry so it reuses the existing account under the new name; only drop ACCT_CREATE and the OU. Fix the stale comment/log: 2224 is NERR_UserExists, not ERROR_JOINED_TO_OU. Also normalize an empty "ou" from the broker to None so we pass a NULL OU pointer instead of an empty-string LDAP path to NetJoinDomain.
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.
No description provided.