diff -r 333d3e40cbd1 -r 06938bc1c6e7 scripts/crosstool-NG.sh.in --- a/scripts/crosstool-NG.sh.in Tue Nov 20 16:59:17 2012 -0800 +++ b/scripts/crosstool-NG.sh.in Thu Jan 10 22:38:48 2013 +0100 @@ -25,6 +25,14 @@ . .config.2 # Yes! We can do full logging from now on! +# Check running as root +if [ -z "${CT_ALLOW_BUILD_AS_ROOT_SURE}" ]; then + if [ $(id -u) -eq 1000 ]; then + CT_DoLog ERROR "You must NOT be root to run crosstool-NG" + exit 1 + fi +fi + # If we want an interactive debug-shell, we must ensure these FDs # are indeed connected to a terminal (and not redirected in any way). if [ "${CT_DEBUG_INTERACTIVE}" = "y" -a ! \( -t 0 -a -t 6 -a -t 2 \) ]; then