From e5b967ec9021f2bbfb373b8c164aada8084846fd Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Wed, 21 Jan 2015 14:02:27 -0800 Subject: I thought this went without saying --- src/high/core.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/high') diff --git a/src/high/core.cpp b/src/high/core.cpp index a45db18..8a4d7ca 100644 --- a/src/high/core.cpp +++ b/src/high/core.cpp @@ -23,6 +23,7 @@ #include #include +#include #include #include @@ -106,8 +107,21 @@ void sig_proc(int) */ } // namespace tmwa +static +void check_caps() +{ + if (geteuid() == 0) + { + puts("Please don't run as root!"); + _exit(1); + } +} + int tmwa_main(int argc, char **argv) { + // run before anything else (except global constructors) + check_caps(); + using namespace tmwa; check_paths(); -- cgit v1.2.3-60-g2f50