Mail archive
alpine-devel

[alpine-devel] [PATCH 1/5] abuild: use id instead of whoami

From: Sören Tempel <soeren+git_at_soeren-tempel.net>
Date: Fri, 27 Nov 2015 00:50:43 +0100

Furthermore compare the UID instead of the username.
---
 abuild.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/abuild.in b/abuild.in
index 38d6efd..697a186 100644
--- a/abuild.in
+++ b/abuild.in
_at_@ -2144,7 +2144,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
-- 
2.6.3
---
Unsubscribe:  alpine-devel+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-devel+help_at_lists.alpinelinux.org
---
Received on Fri Nov 27 2015 - 00:50:43 GMT