fix: bootpkg only as root

This commit is contained in:
Strix 2023-10-14 22:39:49 +02:00
parent d1f7f3c7ff
commit 497b53eb91
No known key found for this signature in database
GPG key ID: 49B2E37B8915B774

View file

@ -15,6 +15,14 @@ mod args;
mod prelude; mod prelude;
fn main() { 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::<Vec<String>>()[1..].to_owned()); let args = Args::from(env::args().collect::<Vec<String>>()[1..].to_owned());
match args.command { match args.command {
Command::Strap => { Command::Strap => {