From 6fc95a16eeb62565c54249585eb4186901ec5086 Mon Sep 17 00:00:00 2001 From: Caleb Connolly Date: Sat, 4 Jun 2022 15:57:54 +0100 Subject: [PATCH] add root check --- qbootctl.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/qbootctl.cpp b/qbootctl.cpp index 90cf695..0225f0f 100644 --- a/qbootctl.cpp +++ b/qbootctl.cpp @@ -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();