Skip to content

Commit

Permalink
Merge pull request #97 from jamesmcm/fixopenfortivpn
Browse files Browse the repository at this point in the history
Fix Drop for OpenFortiVPN and update sysinfo crate
  • Loading branch information
jamesmcm authored Jul 17, 2021
2 parents 5ae5210 + 03e16d5 commit b61a4bd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pretty_env_logger = "0.4"
clap = "2"
which = "4"
users = "0.11"
nix = "0.21"
nix = "0.22"
serde = {version = "1", features = ["derive", "std"]}
csv = "1"
dialoguer ="0.8"
Expand All @@ -34,7 +34,7 @@ chrono = "0.4"
compound_duration = "1"
ipnet = {version = "2", features = ["serde"]}
reqwest = {default-features = false, version = "0.11", features = ["blocking", "json", "rustls-tls"]}
sysinfo = "0.18"
sysinfo = "0.19"
base64 = "0.13"
x25519-dalek = "1"
strum = "0.21"
Expand Down
1 change: 1 addition & 0 deletions src/netns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ impl Drop for NetworkNamespace {
std::mem::forget(self.firewall_exception.take());
std::mem::forget(self.host_masquerade.take());
std::mem::forget(self.openconnect.take());
std::mem::forget(self.openfortivpn.take());
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/util/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,17 +149,17 @@ pub fn get_existing_namespaces() -> anyhow::Result<Vec<String>> {

pub fn check_process_running(pid: u32) -> bool {
let s = System::new_with_specifics(RefreshKind::new().with_processes());
s.get_process(pid as i32).is_some()
s.process(pid as i32).is_some()
}

pub fn get_all_running_pids() -> Vec<u32> {
let s = System::new_with_specifics(RefreshKind::new().with_processes());
s.get_processes().keys().map(|x| *x as u32).collect()
s.processes().keys().map(|x| *x as u32).collect()
}

pub fn get_all_running_process_names() -> Vec<String> {
let s = System::new_with_specifics(RefreshKind::new().with_processes());
s.get_processes()
s.processes()
.values()
.map(|x| x.name().to_string())
.collect()
Expand Down

0 comments on commit b61a4bd

Please sign in to comment.