Repository navigation
docs(protocol): audit Windows path separator wire encoding (#1905) - #3497
Merged
Merged
Conversation
Confirms that every sender-side wire-emit site for filenames and symlink targets routes through `path_bytes_to_wire`, normalizing native `\` to `/` on Windows. Retires Finding F1 from `windows-path-normalization.md`. Receiver-side counterpart already landed in PR #3496.
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.
Summary
docs/audits/windows-path-separator-encoding.mdconfirming that every sender-side wire-emit site for filenames and symlink targets routes through thepath_bytes_to_wirehelper, normalizing native\separators to/on Windows before bytes leave the host.docs/audits/windows-path-normalization.mdas CLOSED with cross-references to the implementing PR (fix: normalise Windows backslash to forward slash in wire-encoded paths #3456) and this confirming audit.This is the sender-side counterpart to PR #3496 (receiver-side rejection of Windows drive prefixes from untrusted senders). Together they cover the bidirectional Windows path-separator hazard surface.
Why docs-only
Investigation found the conversion is already correctly applied at every wire-emit call site:
crates/protocol/src/flist/entry/accessors.rs:131-135(name_bytes()).crates/protocol/src/flist/write/encoding.rs:115-124(write_symlink_target).crates/protocol/src/flist/write/mod.rs:376(single bytes path intowrite_name).crates/protocol/src/flist/batched_writer/writer.rs:216(delegates toFileListWriter::write_entry).crates/transfer/src/generator/protocol_io.rs:240,310(initial flist + INC_RECURSE segments).crates/engine/src/local_copy/executor/directory/recursive/batch.rs:152(batch capture).Test matrix verified in
crates/protocol/src/flist/wire_path.rs:62-136, includingwindows_backslash_is_translated_to_forward_slash,windows_deep_path_is_translated,windows_already_forward_slash_borrows, andwindows_mixed_separators_are_normalized.Per upstream
flist.c:send_file_entry()(lines 534-570 for filename, 660-670 for symlink target), filename bytes are written verbatim and the wire format requires POSIX/separators - upstream's only Windows port runs under Cygwin's POSIX layer, so upstream itself never normalizes.Test plan
path_bytes_to_wireregression tests continue to pass (no behaviour change).