fix: bootpkg only as root
This commit is contained in:
parent
d1f7f3c7ff
commit
497b53eb91
1 changed files with 8 additions and 0 deletions
|
@ -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 => {
|
||||||
|
|
Loading…
Reference in a new issue