Skip to content

Commit b8b6a02

Browse files
root execution warning
1 parent 4d6dad3 commit b8b6a02

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
@@ -35,6 +35,9 @@ int main(int argc, char **argv) {
3535
exit(EX_USAGE);
3636
};
3737

38+
auto euid = geteuid();
39+
if (!euid) std::cerr << "!!!! WARNING: You should not execute this program with root privileges !!!!" << std::endl;
40+
3841
// establish signal handler
3942
if (signal(SIGINT, sig_term_handler) || signal(SIGTERM, sig_term_handler)) {
4043
perror("Failed to establish signal handler");

0 commit comments

Comments
 (0)