Skip to content

Fix UNC path handling during install root path validation - #8258

Open
jeremy99981 wants to merge 3 commits into
gogs:mainfrom
jeremy99981:fix/2550-preserve-unc-paths
Open

Fix UNC path handling during install root path validation#8258
jeremy99981 wants to merge 3 commits into
gogs:mainfrom
jeremy99981:fix/2550-preserve-unc-paths

Conversation

@jeremy99981

@jeremy99981 jeremy99981 commented May 13, 2026

Copy link
Copy Markdown

Describe the pull request

This fixes installer path normalization for repository/log root paths on Windows UNC shares.

Today InstallPost replaces all \\ with / before calling os.MkdirAll. For UNC paths (e.g. \\imb-nas\\repositories) this rewrite can turn a valid Windows network path into an invalid path and trigger:

Repository root path is invalid: mkdir //...: The specified path is invalid.

This PR keeps native Windows paths unchanged while preserving existing normalization behavior on non-Windows platforms.

Link to the issue: #2550

Checklist

  • I agree to follow the Code of Conduct by submitting this pull request.
  • I have read and acknowledge the Contributing guide.
  • I have added test cases to cover the new code or have provided the test plan. (if applicable)
  • I have added an entry to CHANGELOG. (if applicable)

Test plan

  • Added TestNormalizeInstallRootPathByOS in internal/route/install_test.go to cover:
    • preserving UNC and drive-letter paths on Windows mode
    • preserving existing backslash-to-slash normalization on non-Windows mode
  • Verified no whitespace issues with git diff --check.
  • Could not run go test in this environment because the Go toolchain is unavailable in the current runner (go: command not found). CI should execute the full test suite.

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.

1 participant