diff --git a/Cargo.lock b/Cargo.lock index 1e08d68..3337a21 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -247,12 +247,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "cfg_aliases" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" - [[package]] name = "chrono" version = "0.4.38" @@ -1201,18 +1195,6 @@ dependencies = [ "tempfile", ] -[[package]] -name = "nix" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" -dependencies = [ - "bitflags", - "cfg-if", - "cfg_aliases", - "libc", -] - [[package]] name = "nom" version = "7.1.3" @@ -1607,7 +1589,6 @@ dependencies = [ "file-lock", "glob", "libc", - "nix", "num_cpus", "open", "pad", diff --git a/Cargo.toml b/Cargo.toml index 5027bb7..7dacd9b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,7 +30,6 @@ dialoguer = "0.11.0" file-lock = "2.1.11" glob = "0.3.1" libc = "0.2.167" -nix = { version = "0.29.0", features = ["user"] } num_cpus = "1.16.0" open = "5.3.1" pad = "0.1.6" diff --git a/src/errors.rs b/src/errors.rs index 5ceda6f..e6a846c 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -1,7 +1,6 @@ use std::fmt::{self, Display, Formatter}; pub const CODE_STDERR_REDIRECT: i32 = 10; -pub const CODE_ROOT_PRIVILEGES: i32 = 11; pub const CODE_PARSE_COMMAND_LINE_ARGS: i32 = 12; pub const CODE_LOAD_CONFIG: i32 = 13; pub const CODE_COMMAND_FAILED: i32 = 14; diff --git a/src/main.rs b/src/main.rs index 6867953..3ebd530 100644 --- a/src/main.rs +++ b/src/main.rs @@ -22,7 +22,6 @@ use std::process; use anyhow::Result; use clap::error::ErrorKind as ArgsErrorKind; use clap::Parser; -use nix::unistd; use crate::cmd::{App, Run}; use crate::config::Config; @@ -50,7 +49,7 @@ fn wrap_result(result: Result, message: &str, error_code: i32) -> T { } fn main() { - let mut args: Vec = env::args_os().collect(); + let args: Vec = env::args_os().collect(); let allow_non_tty = args .get(1) .is_some_and(|arg| arg.to_str().is_some_and(is_embed_command)); @@ -66,20 +65,6 @@ fn main() { // It is safe to set this since all the colored texts will be printed to stderr. console::set_colors_enabled(true); - // TODO: Support Windows - if unistd::getuid().is_root() { - match args.iter().position(|arg| arg == "--allow-root-privieges") { - Some(pos) => { - warn!("Launching roxide with root privileges can destroy your system, it is strongly not recommended to do this"); - args.remove(pos); - } - None => { - error!("Launching roxide with root privileges is not allowed (HINT: You can add `--allow-root-privieges` to omit this check)"); - process::exit(errors::CODE_ROOT_PRIVILEGES); - } - } - } - let app = match App::try_parse_from(args) { Ok(app) => app, Err(err) => {