Skip to content

Commit 843f994

Browse files
root execution warning
1 parent 9accea0 commit 843f994

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/main.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ int main(int argc, char **argv) {
3939
exit(EX_USAGE);
4040
};
4141

42+
auto euid = geteuid();
43+
if (!euid) std::cerr << "!!!! WARNING: You should not execute this program with root privileges !!!!" << std::endl;
44+
4245
// establish signal handler
4346
if (signal(SIGINT, sig_term_handler) || signal(SIGTERM, sig_term_handler)) {
4447
perror("Failed to establish signal handler");

0 commit comments

Comments
 (0)