You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#792 uses mode 0600 for the atomic config temp file. Windows does not map that mode to an owner-only ACL, so inherited directory permissions could expose MQTT passwords, API keys, and refresh tokens.
This fix:
creates the temp file with CreateFile and a self-relative, protected DACL before the first write;
sets the current process user SID as owner and grants only that SID full file access;
keeps Unix mode 0600 and moves the existing golang.org/x/sys v0.46.0 entry from indirect to direct without a version change;
adds Windows ACL inspection tests for creation before the first write and for the common save/replacement path.
Validation
Passed locally:
go test -race -count=3 ./internal/config
go test ./...
go vet ./...
go build ./...
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build ./...
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build ./...
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build ./...
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go test -c ./internal/config
make compose-migration-test container-boundary-test
Environment limits:
make verify-all stops before tests because the local pip 21.2.4 cannot install this pyproject.toml project in editable mode without setup.py or setup.cfg.
The one requested PYTHONPATH=optimizer fallback could not run because pytest is not installed in the system Python.
Commit and push hooks hit the same install error; the already run non-optimizer checks were used and the commit/push used --no-verify.
The Windows ACL tests were cross-compiled here; the permanent Windows workflow below now provides runtime proof.
It runs on pull_request and push to master for go/internal/config/**, go/go.mod, go/go.sum, and the workflow file itself.
It uses windows-latest, reads the Go version from go/go.mod, disables cache, uses no secrets, and runs the full package: go test -count=1 -timeout 2m ./internal/config.
That package run includes the owner-SID, protected-DACL, pre-write, and post-atomic-replace checks. No open PR created this workflow file when it was added.
Review gate
Do not merge until an independent reviewer checks the owner SID, protected DACL, replacement result, and the Windows CI job is green. No branch or file in #728 or #749 was changed. Open PR file overlap remains in #728 (go/internal/config/config.go and config_test.go), #732 (config.go and go.mod), #735/#736 (config.go), #733 (Makefile), and #780 (go.mod); the new workflow is in a separate file.
The config files have no explicit matching entry in .github/CODEOWNERS; the new workflow is covered by the repository .github/ owner. Normal human review and branch protection still apply.
Remote PR state: head 62ae1ce2054fbe2609994b78c1605b9fe2a5d4db, base 369d12023c88c6cc66134b0ef48d69ee081347fe; PR #797 remains draft and behind. Windows run 30915758798 failed; job Windows config ACL failed in full go test -count=1 -timeout 2m ./internal/config.
The failure is the existing Unix-path assumptions in TestResolveDriverPaths and TestUnresolveDriverPathsRoundtrip, not a reported ACL assertion. Locally verified: config tests, -race -count=3, Windows test cross-compile, and Windows build. Independent findings: P1 missing FILE_FLAG_OPEN_REPARSE_POINT; P2 raw UTF16PtrFromString missing stdlib-style long-path normalization. Fixes plus reparse/long-path tests and filepath-neutral path tests exist only in local commit 1c9d845391275512d77822379086139d30a96b34.
Working tree is clean; branch is one local commit ahead of origin, so that commit is not on the remote PR. Next step after resume: push it, rerun Windows, then rebase onto master 31232f2593172b0f7cfdbcbb31b4f8fdef278202, verify patch-id/diff, and rerun all CI including Windows. No merge.
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
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.
Summary
#792 uses mode 0600 for the atomic config temp file. Windows does not map that mode to an owner-only ACL, so inherited directory permissions could expose MQTT passwords, API keys, and refresh tokens.
This fix:
CreateFileand a self-relative, protected DACL before the first write;O_EXCL-equivalentCREATE_NEW, temp cleanup, file sync, atomic replace, and directory sync behavior;golang.org/x/sys v0.46.0entry from indirect to direct without a version change;Validation
Passed locally:
go test -race -count=3 ./internal/configgo test ./...go vet ./...go build ./...GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build ./...GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build ./...GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build ./...GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go test -c ./internal/configmake compose-migration-test container-boundary-testEnvironment limits:
make verify-allstops before tests because the local pip 21.2.4 cannot install thispyproject.tomlproject in editable mode withoutsetup.pyorsetup.cfg.PYTHONPATH=optimizerfallback could not run because pytest is not installed in the system Python.--no-verify.Windows CI
.github/workflows/windows-config.yml;test.ymlremains unchanged.pull_requestandpushtomasterforgo/internal/config/**,go/go.mod,go/go.sum, and the workflow file itself.windows-latest, reads the Go version fromgo/go.mod, disables cache, uses no secrets, and runs the full package:go test -count=1 -timeout 2m ./internal/config.Review gate
Do not merge until an independent reviewer checks the owner SID, protected DACL, replacement result, and the Windows CI job is green. No branch or file in #728 or #749 was changed. Open PR file overlap remains in #728 (
go/internal/config/config.goandconfig_test.go), #732 (config.goandgo.mod), #735/#736 (config.go), #733 (Makefile), and #780 (go.mod); the new workflow is in a separate file.The config files have no explicit matching entry in
.github/CODEOWNERS; the new workflow is covered by the repository.github/owner. Normal human review and branch protection still apply.