feat: v1.0.2, add feature harden_process
This commit is contained in:
@@ -7,12 +7,12 @@ pub struct Process {
|
||||
pub exec: Option<PathBuf>,
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "linux"))]
|
||||
#[cfg(not(all(target_os = "linux", feature = "harden_process")))]
|
||||
pub fn get_process(_port: u16) -> Option<Process> {
|
||||
None
|
||||
}
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
#[cfg(all(target_os = "linux", feature = "harden_process"))]
|
||||
pub fn get_process(port: u16) -> Option<Process> {
|
||||
let all_procs = match procfs::process::all_processes() {
|
||||
Err(e) => {
|
||||
|
||||
Reference in New Issue
Block a user