From: Matt Kraai Date: Thu, 17 Sep 2009 14:07:42 +0000 (-0700) Subject: Use the method used by build_env.sh to discover the user name. X-Git-Tag: talloc-2.0.1~48 X-Git-Url: http://git.samba.org/samba.git/?p=ira%2Fwip.git;a=commitdiff_plain;h=815b790c96c72cb995c983bbbc3cc95801aaacaa;hp=622bffce4723353964bf0dc7bbf60235e417caa6 Use the method used by build_env.sh to discover the user name. so try USERNAME, then LOGNAME, then whoami, then id -un to find out who we are. --- diff --git a/source3/script/tests/selftest.sh b/source3/script/tests/selftest.sh index ae856ca31e0..43e7bf17318 100755 --- a/source3/script/tests/selftest.sh +++ b/source3/script/tests/selftest.sh @@ -57,7 +57,15 @@ export TORTURE_MAXTIME WORKGROUP=SAMBA-TEST SERVER=localhost2 SERVER_IP=127.0.0.2 -USERNAME=`PATH=/usr/ucb:$PATH whoami` +if [ ! "x$USER" = "x" ]; then + USERNAME=$USER +else + if [ ! "x$LOGNAME" = "x" ]; then + USERNAME=$LOGNAME + else + USERNAME=`PATH=/usr/ucb:$PATH whoami || id -un` + fi +fi USERID=`PATH=/usr/ucb:$PATH id | cut -d ' ' -f1 | sed -e 's/uid=\([0-9]*\).*/\1/g'` GROUPID=`PATH=/usr/ucb:$PATH id | cut -d ' ' -f2 | sed -e 's/gid=\([0-9]*\).*/\1/g'` PASSWORD=test