From 497b53eb91a7d17f842bd02f3665cae69a48e3e3 Mon Sep 17 00:00:00 2001 From: Raine Date: Sat, 14 Oct 2023 22:39:49 +0200 Subject: [PATCH] fix: bootpkg only as root --- bootpkg/src/main.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bootpkg/src/main.rs b/bootpkg/src/main.rs index ffd4338..65037f3 100644 --- a/bootpkg/src/main.rs +++ b/bootpkg/src/main.rs @@ -15,6 +15,14 @@ mod args; mod prelude; fn main() { + #[cfg(not(debug_assertions))] + { + if unsafe { libc::getuid() } != 0 { + println!("bootpkg must be run as root."); + std::process::exit(1); + } + } + let args = Args::from(env::args().collect::>()[1..].to_owned()); match args.command { Command::Strap => {