From 638c1749626b076091db2b20feb6cabc76f13ccc Mon Sep 17 00:00:00 2001 From: Jake Mercer Date: Sun, 20 Oct 2019 00:38:34 +0100 Subject: [PATCH] MAKEFILE - Check if Root Added a check to the top-level Makefile to ensure that it has not been invoked by ID 0 i.e. `root` or `sudo`. Resolves #1100. Signed-off-by: Jake Mercer --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile b/Makefile index 67c5cc6a..d8f35aab 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,11 @@ SHELL = bash ALL_EXCLUDE = third_party .git env build +# Check if root +ifeq ($(shell id -u),0) + $(error ERROR: Running as ID 0) +endif + # Tools + Environment IN_ENV = if [ -e env/bin/activate ]; then . env/bin/activate; fi; env: