add root check

This commit is contained in:
Caleb Connolly 2022-06-04 15:57:54 +01:00
parent 4c49647382
commit 6fc95a16ee
No known key found for this signature in database
GPG Key ID: 0583312B195F64B6

View File

@ -148,6 +148,11 @@ int main(int argc, char **argv)
impl = &bootctl_test;
}
if(geteuid() != 0) {
fprintf(stderr, "This program must be run as root!\n");
return 1;
}
switch (argc) {
case 1:
dump_info();