]> granicus.if.org Git - sudo/commitdiff
If neither whoami nor id exists, just assume we are root.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 9 Jan 2002 17:35:14 +0000 (17:35 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 9 Jan 2002 17:35:14 +0000 (17:35 +0000)
install-sh

index c5eafa8fa5e6c354ecd5467a883306179464c045..126b7953e163b378a80a89790f3af881b9c309ac 100755 (executable)
@@ -26,17 +26,20 @@ for d in /sbin /etc /usr/sbin /usr/etc; do
     fi
 done
 
-for d in /usr/bin /usr/ucb /usr/bsd; do
+for d in /usr/bin /bin /usr/ucb /usr/bsd; do
     if [ -f $d/whoami ]; then
        WHOAMI=${d}/whoami
        break
+    elif [ -f $d/id ]; then
+       WHOAMI=${d}/id | sed -n 's/^[^(]*(\([^)]*\)).*/\1/p'
     fi
 done
 if [ X"$WHOAMI" = X"" ]; then
-    WHOAMI=id | sed -n 's/^[^(]*(\([^)]*\)).*/\1/p'
+    # neither whoami nor id, assume root
+    WHOAMI=echo root
 fi
 
-for d in /usr/ccs/bin /usr/bin; do
+for d in /usr/ccs/bin /usr/bin /bin; do
     if [ -f $d/strip ]; then
        STRIP=${d}/strip
        break