From 8af787e3781b917e5875127592e4e986677f345a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Tue, 26 Feb 2019 21:32:26 +0000 Subject: Prevent poezio from being run as root MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- poezio/poezio.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/poezio/poezio.py b/poezio/poezio.py index 05c8ceed..82403fdb 100644 --- a/poezio/poezio.py +++ b/poezio/poezio.py @@ -72,6 +72,11 @@ def main(): """ Entry point. """ + + if os.geteuid() == 0: + sys.stdout.write("Please do not run poezio as root.\n") + sys.exit(0) + sys.stdout.write("\x1b]0;poezio\x07") sys.stdout.flush() from poezio import config -- cgit v1.2.3