Skip to content

Fix Windows UNC path case-sensitivity resolution for network drives - #30406

Open
harrish243 wants to merge 1 commit into
bazelbuild:masterfrom
harrish243:fix-windows-unc-path-28607
Open

Fix Windows UNC path case-sensitivity resolution for network drives#30406
harrish243 wants to merge 1 commit into
bazelbuild:masterfrom
harrish243:fix-windows-unc-path-28607

Conversation

@harrish243

@harrish243 harrish243 commented Jul 22, 2026

Copy link
Copy Markdown

Description

This PR fixes Windows UNC path handling for network drives (\\\server\share\file\ and \\?\UNC\server\share\file).

Specifically:

  • \RemoveUncPrefixMaybe: Properly strips Win32 device UNC prefix (\\?\UNC\\ or \\.\UNC\\ or \??\UNC\) to produce valid UNC network paths (\\\server\share\file).
  • \AddUncPrefixMaybe: Correctly converts UNC network paths (\\\server\share\file) to extended-length Win32 device UNC paths (\\?\UNC\server\share\file).
  • \IsAbsoluteNormalizedWindowsPath: Adds \HasUncNetworkPrefix\ check so network UNC paths are recognized as valid absolute normalized paths by functions like \GetLongPath, \IsSymlinkOrJunction, and \CreateJunction.

Motivation

Fixes issue with resolving and operating on UNC network drive paths on Windows.

Build API Changes

No

Checklist

  • I have added tests for the new use cases (if any).
  • I have updated the documentation (if applicable).

Release Notes

RELNOTES: Fix Windows UNC network path prefix handling (\\?\UNC\) and path normalization for network drives.

@google-cla

google-cla Bot commented Jul 22, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@github-actions github-actions Bot added area-Windows Windows-specific issues and feature requests awaiting-review PR is awaiting review from an assigned reviewer labels Jul 22, 2026
@harrish243
harrish243 force-pushed the fix-windows-unc-path-28607 branch from ab92705 to a5b621f Compare July 22, 2026 09:20
@harrish243
harrish243 force-pushed the fix-windows-unc-path-28607 branch from a8a46c0 to aa0a4e5 Compare July 22, 2026 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-Windows Windows-specific issues and feature requests awaiting-review PR is awaiting review from an assigned reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant