Repository navigation
Port upstream #207: a media share is refused however it is spelled - #49
Merged
DesertGamer merged 1 commit intoNov 26, 2026
Conversation
The source resolver's rule (local files only) knew a share as `\..`, `//..` or `file://server/..`. The host knows more spellings: any two leading separators (`/\server\share`), the object manager's prefix (`\??\UNC\server\share`), and a `file:` URL with no host whose path starts with two separators (`file:////server/share`, `file:\server\share`, also percent-encoded). Those fell through as relative paths or drive-less local files and went to the host's resolver unchanged. They are refused now, naming the server. Paths with one leading separator, a drive after the slashes or the prefix, and the path of a URL that names this machine pass as before. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> (cherry picked from commit 11ca3ce)
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.
What this changes
This ports Marvisak/VIctory#207 by Maraco91. It is cherry-picked with
-x, so the commit keeps their authorship.The media source resolver in
crates/viport-hle/src/modules/media.rsserves local files only. A network share must be refused before it reaches the host's Media Foundation resolver.localrecognises a share only when it is spelled\\..,//..orfile://server/...The host accepts more spellings:
/\server\share,\/server/share);\??\UNC\server\share);file:URL with no host whose path starts with two separators (file:////server/share,file:\\server\share), also percent-encoded (file:///%5C%5Cserver/share).All of these pass through as relative or drive-less local paths and reach the host's resolver unchanged.
After this change they are refused, naming the server, like the spellings already caught. Still accepted as before: paths with one leading separator, a drive after the slashes or after the prefix, and the path of a URL that names this machine.
VIPort has the upstream merge of #207 in its history, but the change is not in the tree. It was lost in a later merge. The code applied cleanly. The only conflict was in the test module: VIPort's two URL entry point tests are kept, and #207's tests follow them.
Checked
docs/asset-policy.mdbuild.rs, git hook,.cargoconfig, CI change or script (or an issue explains why)cargo test --workspacepasses (not run, see below)cargo clippy --workspace --all-targets --locked -- -D warningspasses (Windows target, run on Linux)rustfmt; I did not reformat lines I did not changeWhat I ran
On Linux, I compiled
localandpercent_decodefrommainand from this branch side by side withshares_are_refused_however_they_are_spelled.files::translatewas stubbed out, since it only maps virtual drives.main: fails on the first spelling:cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-msvc -- -D warnings: clean.Not run:
cargo test -p viport-hle, which builds only for Windows. This includes #207's#[cfg(windows)]test, which checks what the host makes of each spelling. The Windows CI test step will run it.Overlaps
None. No open PR touches
viport-hle/src/modules/media.rs.🤖 Generated with Claude Code