Repository navigation
WIP: fix(fd) — gate procsub argv-word marker delivery on consumer class (2225) - #2228
Merged
Merged
Conversation
…bash#2225) Refs rubash#2225. Refs niubash#720, niubash#723. #2156 sent every procsub argv word through the #1903 fifo-marker rendezvous; a consumer that is not marker-aware (System32 findstr.exe in niubash#720/#723) opens the marker path plainly and reads the 7 marker bytes instead of the producer's stream. GNU subst.c:6362 process_substitute names a live pipe whose bytes any consumer opening the name must receive, so streaming may never change the bytes a non-aware consumer reads. materialize_dev_fd_operands now takes the spawn site's resolved program path — threaded from execute_external, the env builtin, the comsub fast path, both pipeline paths, and the exec operand plumbing — and dev_fd_table_operand chooses the delivery per operand: the marker rendezvous only when path::winuxcmd_fifo_marker_aware classifies the consumer as the WinuxCmd runtime binary itself (the dispatcher, or an applet hardlink of it; tree membership alone is not awareness — the niubash#346 D6 class, whose third-party tree members have no bridging runtime). Every other consumer takes the pre-#2156 drain-to-temp. The judgment eats the resolved path, never the argv[0] spelling; every miss costs streaming, never bytes. Pins: path::tests::issue2225_fifo_marker_aware_classification (windows), dev_fd_operands::tests:: issue2225_procsub_operand_delivery_falls_to_drain.
Refs rubash#2225. tests/issue2225_procsub_argv_consumer_gate.rs (windows-only): findstr.exe and cmd.exe /c type — plain CreateFile readers that never bridge markers — must receive the producer's bytes for a procsub argv word, directly and inside a command substitution (on master both print the 7 marker bytes instead). Word-shape pins observe the route the gate chose through an argv-echo consumer built from the rubash binary itself: an applet hardlink of a fake payload tree's winuxcmd.exe receives the rubash-procsub-* marker operand; a consumer outside any tree and a plain copy of an applet inside the tree receive the rubash-devfd-* drained temp operand.
…ubash#2225) The standalone target was compile-checked only; the same five pins now live in mod issue_2225 inside tests/regression.rs, which the Windows goldens job executes (cargo test --test regression). The word-shape pins observe the route through the GNU suite's recho helper instead of a rubash hardlink, so the fixtures are plain file copies in the scratch dir.
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.
Refs #2225 (pins the niu#720 / niu#723 console red to its cause; those close from the niu side once this lands and the console test turns green).
What
PR #2156 (for #1959) routed every procsub argv word through the #1903 fifo-marker rendezvous. A consumer that is not marker-aware opens the marker path plainly and reads the 7
!<fifo>bytes instead of the producer's stream — bisected by the niu-console-720-723 characterization cluster (rubash@3fb862ca drains to temp and a plain reader gets real bytes; rubash@6cd937ac hands the marker and the plain reader gets!<fifo>; niu CI went green→red exactly across the #2156 merge).GNU subst.c:6362
process_substitutenames a live pipe: any consumer opening the operand name must receive the producer's bytes. The marker is a private rendezvous, not a byte source, so it is now delivered only when the consumer is known to bridge it.Gate
materialize_dev_fd_operands/dev_fd_table_operandnow receive the consumer's resolved program path — threaded from all six spawn sites (external builtin + plain external inexternal_inner, comsub incommand_substitution_values, pipeline stages incl. the internal-stageNonemirror,proc_operands). The judgment eats the resolution result, never argv[0]'s spelling.procsub_operand_delivery: marker delivery iffwinuxcmd_fifo_marker_aware— the resolved program IS the WinuxCmd runtime binary: the tree's dispatcher, or an applet hardlink of the tree'swinuxcmd.exe(is_winuxcmd_applet's identity test). Everything else — unknown, unresolved, plain copies, third-party flat packages inside the tree — falls to the pre-fix(fd): stream procsub argv words to external children via the #1903 fifo-marker rendezvous (rubash#1959) #2156 drain-to-temp: the miss direction is byte-correctness.posix_aware_child/is_winuxcmd_applet) shows membership alone overreaches — since WinuxCmd 1.4.0 the tree also ships third-party flat packages and shim forwarders with no bridging runtime, which would reproduce the same bug inside the tree. The identity criterion is exactly the set of programs running the bridging runtime; the predicate is a separate function fromposix_aware_childbecause the contracts can drift independently.Preserved faces: marker-aware consumers keep the #1959 streaming route (its pins untouched); redirect and builtin forms are untouched (they never took the marker arm); rubash itself as a consumer bridges markers in its own file layer and is unaffected either way.
Pins (
issue2225)src/executor/path.rs:issue2225_fifo_marker_aware_classification(Windows; dispatcher / hardlink applet / tree copy / third-party member / System32 / no-env routes).src/executor/dev_fd_operands.rs:issue2225_procsub_operand_delivery_falls_to_drain(cross-platform; unresolved consumer ⇒ drain).tests/regression.rsmod issue_2225(Windows; executed by the goldens job): findstr andcmd /c typeplain readers receive producer bytes (never!<fifo>), direct and in comsub; an applet-hardlink consumer (fake payload tree, GNU recho as the argv witness) receives therubash-procsub-*marker word; a plain consumer and a copied tree member receive therubash-devfd-*drained temp word.