abuild: use id instead of whoami

Furthermore compare the UID instead of the username.
This commit is contained in:
Sören Tempel 2015-11-25 12:19:09 +01:00 committed by Natanael Copa
parent d5013a3915
commit eb0ffe7a8a
1 changed files with 1 additions and 1 deletions

View File

@ -2148,7 +2148,7 @@ done
shift $(( $OPTIND - 1 ))
# check so we are not root
if [ "$(whoami)" = "root" ] && [ -z "$FAKEROOTKEY" ]; then
if [ $(id -u) -eq 0 ] && [ -z "$FAKEROOTKEY" ]; then
[ -z "$forceroot" ] && die "Do not run abuild as root"
FAKEROOT=
fi