Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/rust/provers/test_fixture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
//! once on any argument they do not expect, so the probe runs no fixture body.

use std::io::{ErrorKind, Write};
use std::os::unix::fs::OpenOptionsExt;
use std::os::unix::fs::{OpenOptionsExt, PermissionsExt};
use std::path::Path;
use std::time::Duration;

Expand All @@ -29,10 +29,14 @@
.create_new(true)
.mode(0o700)
.open(path)
.expect("create fixture executable");

Check failure on line 32 in src/rust/provers/test_fixture.rs

View workflow job for this annotation

GitHub Actions / governance / Validate Hypatia Baseline

code_safety/expect_in_hot_path

unfiltered medium finding code_safety/expect_in_hot_path in src/rust/provers/test_fixture.rs -- add it to .hypatia-baseline.json with a note, or fix it
file.write_all(contents.as_bytes())
.expect("write fixture executable");
}
// The creation mode is filtered by the umask; set it explicitly so the
// fixture is executable whatever umask the test runner inherited.
std::fs::set_permissions(path, std::fs::Permissions::from_mode(0o700))
.expect("make fixture executable");
for _ in 0..200 {
match std::process::Command::new(path)
.arg("--echidna-fixture-ready")
Expand All @@ -44,7 +48,7 @@
Err(error) if error.kind() == ErrorKind::ExecutableFileBusy => {
std::thread::sleep(Duration::from_millis(10));
},
Err(error) => panic!("fixture executable cannot run: {error}"),

Check failure on line 51 in src/rust/provers/test_fixture.rs

View workflow job for this annotation

GitHub Actions / governance / Validate Hypatia Baseline

code_safety/panic_macro

unfiltered high finding code_safety/panic_macro in src/rust/provers/test_fixture.rs -- add it to .hypatia-baseline.json with a note, or fix it
Ok(_) => return,
}
}
Expand Down
Loading