From e46a00f0c019dcd1bc9dcf2e22ace7410f262506 Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Mon, 30 May 2022 23:35:59 -0600 Subject: [PATCH] Meta: Add error message when running serenity.sh as root It's not a good idea, and it causes countless issues for people who do so and then try to run without root later. --- Meta/serenity.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Meta/serenity.sh b/Meta/serenity.sh index cf2858e785..198b4c025c 100755 --- a/Meta/serenity.sh +++ b/Meta/serenity.sh @@ -82,6 +82,10 @@ if [ "$CMD" = "help" ]; then exit 0 fi +if [ "$(id -u)" -eq 0 ]; then + die "Do not run serenity.sh as root, your Build directory will become root-owned" +fi + if [ -n "$1" ]; then TARGET="$1"; shift else