From 2bd1c15aa38398b7e44fe637b7a7bab86fc270ac Mon Sep 17 00:00:00 2001 From: Morgan Tocker Date: Tue, 12 Nov 2019 14:55:30 -0800 Subject: [PATCH] Back port stronger root protection Signed-off-by: Morgan Tocker --- examples/local/101_initial_cluster.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/local/101_initial_cluster.sh b/examples/local/101_initial_cluster.sh index 134ddbd65b5..9eb6bab0e9c 100755 --- a/examples/local/101_initial_cluster.sh +++ b/examples/local/101_initial_cluster.sh @@ -22,6 +22,11 @@ set -e # shellcheck disable=SC2128 script_root=$(dirname "${BASH_SOURCE}") +if [[ $EUID -eq 0 ]]; then + echo "This script refuses to be run as root. Please switch to a regular user." + exit 1 +fi + # start topo server if [ "${TOPO}" = "zk2" ]; then CELL=zone1 "$script_root/zk-up.sh"