-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Win32 Alternate data streams don't work with Command in Rust 1.58.0 #93772
Copy link
Copy link
Closed
Description
Since Rust 1.58, code using Command to spawn new processes that live in an alternate data stream on Windows fails to work. Alternate Data Streams are files that have a :suffix, such as filename.exe:alt.
Code
This is the code that fails:
std::fs::File::create("test.txt").unwrap();
std::fs::copy(r"C:\Windows\System32\find.exe", "test.txt:lolexe").unwrap();
let _cmd = Command::new("test.txt:lolexe")
.status()
.unwrap();I expected to see this happen: The command spawns properly and executes the find.exe code
Instead, this happened: The unwrap fails with
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { kind: NotFound, message: "program not found" }', altdatastreamprog/src/lib.rs:514:14
Version it worked on
It most recently worked on: Rust 1.57.x
Version with regression
rust 1.58.0
I believe the commit that broke it is d9a1f9a
@rustbot modify labels: +regression-from-stable-to-stable -regression-untriaged
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
Give feedbackNo fields configured for issues without a type.