Skip to content

Commit 316638c

Browse files
committed
Removed function to check sudo status in main.rs as this is not needed with sudo crate which automatically upgrades user privileges on app startup.
1 parent 4139715 commit 316638c

File tree

2 files changed

+0
-14
lines changed

2 files changed

+0
-14
lines changed

src/main.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,6 @@ fn main() {
5050
process::exit(0);
5151
}
5252

53-
if !utils::is_root_user() {
54-
eprintln!("Should run this binary as root or use --help for options");
55-
process::exit(1);
56-
}
57-
5853
let (selected_interface, ip_networks) = network::compute_network_configuration(&interfaces, &scan_options);
5954

6055
if scan_options.is_plain_output() {

src/utils.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use std::env;
21
use std::process;
32
use std::sync::Arc;
43

@@ -10,14 +9,6 @@ use ansi_term::Color::{Green, Red};
109
use crate::network::{ResponseSummary, TargetDetails};
1110
use crate::args::ScanOptions;
1211

13-
/**
14-
* Based on the current UNIX environment, find if the process is run as root
15-
* user. This approach only supports Linux-like systems (Ubuntu, Fedore, ...).
16-
*/
17-
pub fn is_root_user() -> bool {
18-
env::var("USER").unwrap_or_else(|_| String::from("")) == *"root"
19-
}
20-
2112
/**
2213
* Prints on stdout a list of all available network interfaces with some
2314
* technical details. The goal is to present the most useful technical details

0 commit comments

Comments
 (0)