Skip to content

Commit

Permalink
Revert "Bump nix and ctrlc crate to resolve audit failures (solana-la…
Browse files Browse the repository at this point in the history
…bs#20558)"

This reverts commit e5d5262.
  • Loading branch information
frits-metalogix authored Nov 24, 2021
1 parent 45391d8 commit 7c7729b
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 35 deletions.
13 changes: 6 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ bincode = "1.3.3"
bs58 = "0.4.0"
clap = "2.33.1"
criterion-stats = "0.3.0"
ctrlc = { version = "3.2.1", features = ["termination"] }
ctrlc = { version = "3.1.9", features = ["termination"] }
console = "0.14.1"
const_format = "0.2.21"
log = "0.4.14"
Expand Down
4 changes: 2 additions & 2 deletions install/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ bzip2 = "0.4.3"
chrono = { version = "0.4.11", features = ["serde"] }
clap = { version = "2.33.1" }
console = "0.14.1"
ctrlc = { version = "3.2.1", features = ["termination"] }
ctrlc = { version = "3.1.9", features = ["termination"] }
dirs-next = "2.0.0"
indicatif = "0.16.2"
lazy_static = "1.4.0"
nix = "0.23.0"
nix = "0.20.0"
reqwest = { version = "0.11.5", default-features = false, features = ["blocking", "rustls-tls", "json"] }
serde = { version = "1.0.130", features = ["derive"] }
serde_yaml = "0.8.21"
Expand Down
28 changes: 12 additions & 16 deletions install/src/stop_process.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use std::{io, process::Child};
use std::io;
use std::process::Child;

fn kill_process(process: &mut Child) -> Result<(), io::Error> {
if let Ok(()) = process.kill() {
Expand All @@ -16,18 +17,13 @@ pub fn stop_process(process: &mut Child) -> Result<(), io::Error> {

#[cfg(not(windows))]
pub fn stop_process(process: &mut Child) -> Result<(), io::Error> {
use {
nix::{
errno::Errno::{EINVAL, EPERM, ESRCH},
sys::signal::{kill, Signal},
unistd::Pid,
},
std::{
io::ErrorKind,
thread,
time::{Duration, Instant},
},
};
use nix::errno::Errno::{EINVAL, EPERM, ESRCH};
use nix::sys::signal::{kill, Signal};
use nix::unistd::Pid;
use nix::Error::Sys;
use std::io::ErrorKind;
use std::thread;
use std::time::{Duration, Instant};

let nice_wait = Duration::from_secs(5);
let pid = Pid::from_raw(process.id() as i32);
Expand All @@ -44,17 +40,17 @@ pub fn stop_process(process: &mut Child) -> Result<(), io::Error> {
kill_process(process)?;
}
}
Err(EINVAL) => {
Err(Sys(EINVAL)) => {
println!("Invalid signal. Killing process {}", pid);
kill_process(process)?;
}
Err(EPERM) => {
Err(Sys(EPERM)) => {
return Err(io::Error::new(
ErrorKind::InvalidInput,
format!("Insufficient permissions to signal process {}", pid),
));
}
Err(ESRCH) => {
Err(Sys(ESRCH)) => {
return Err(io::Error::new(
ErrorKind::InvalidInput,
format!("Process {} does not exist", pid),
Expand Down
2 changes: 1 addition & 1 deletion net-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ edition = "2018"
bincode = "1.3.3"
clap = "2.33.1"
log = "0.4.14"
nix = "0.23.0"
nix = "0.20.0"
rand = "0.7.0"
serde = "1.0.130"
serde_derive = "1.0.103"
Expand Down
9 changes: 4 additions & 5 deletions programs/bpf/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion streamer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ solana-sdk = { path = "../sdk", version = "=1.9.0" }
thiserror = "1.0"
solana-logger = { path = "../logger", version = "=1.9.0" }
libc = "0.2.103"
nix = "0.23.0"
nix = "0.20.0"
solana-perf = { path = "../perf", version = "=1.9.0" }

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion sys-tuner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ solana-version = { path = "../version", version = "=1.9.0" }
[target."cfg(unix)".dependencies]
unix_socket2 = "0.5.4"
users = "0.10.0"
nix = "0.23.0"
nix = "0.20.0"
sysctl = "0.4.2"

[lib]
Expand Down
2 changes: 1 addition & 1 deletion tokens/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ chrono = { version = "0.4", features = ["serde"] }
clap = "2.33.0"
console = "0.14.1"
csv = "1.1.6"
ctrlc = { version = "3.2.1", features = ["termination"] }
ctrlc = { version = "3.1.9", features = ["termination"] }
indexmap = "1.7.0"
indicatif = "0.16.2"
pickledb = "0.4.1"
Expand Down

0 comments on commit 7c7729b

Please sign in to comment.