Force SMB provisioning at share start - #179
Merged
Merged
Conversation
A hard reboot can tear passdb.tdb; the provisioned-hash skip then pinned the broken state — auth failed with the correct stored password until a manual rotation. smbpasswd -a is idempotent and sub-second, so the server now forces provisioning at each share start and keeps the hash only as a rotation marker. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Forces SMB account reprovisioning whenever a share starts, recovering from stale hashes after passdb.tdb corruption.
Changes:
- Adds a
force: trueprovisioning option. - Forces provisioning from
Storage.Server. - Adds regression coverage for forced provisioning.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
lib/universal_proxy/storage/smbd.ex |
Implements and documents forced provisioning. |
lib/universal_proxy/storage/server.ex |
Forces provisioning at share startup. |
test/universal_proxy/storage/smbd_test.exs |
Tests forced smbpasswd execution. |
test/universal_proxy/storage/server_test.exs |
Tests startup with an existing matching hash. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
The pre-seeded stub value made the record-hash assertion tautological; the seam now messages the test pid so the assertion fails if the forced path skips record_hash/2. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
HW failure #3 from P8 validation: a hard reboot cycle tore
passdb.tdb, but the storedprovisioned_hashsurvived and matched the current password, soStorage.Serverskipped reprovisioning and auth stayed broken (NT_STATUS_LOGON_FAILURE) until a manual password rotation forced a reprovision.Storage.Servernow passesforce: truetoSmbd.provision_user/2on every share start, bypassing the hash-skip while still recording the hash afterward as a rotation marker.smbpasswd -aon an already-correct account is idempotent and sub-second, so forcing it every start is cheap; the default (non-forced) skip behavior is unchanged for any other caller.🤖 Generated with Claude Code