summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Rice <tim@multitalents.net>2003-09-11 22:32:17 -0700
committerTim Rice <tim@multitalents.net>2003-09-11 22:32:17 -0700
commit23ee359b08fbdacc546ab84414eb9c63b6a2005d (patch)
tree09d6f1efe22fc009b5a689c86e1d3da8103fbf1a
parentd546a84ef6e2569499d72ed4e1e918c073a7568e (diff)
[regress/agent-ptrace.sh regress/dynamic-forward.sh
regress/sftp-cmds.sh regress/stderr-after-eof.sh regress/test-exec.sh] no longer depends on which(1). patch by dtucker@
-rw-r--r--ChangeLog5
-rw-r--r--regress/agent-ptrace.sh4
-rw-r--r--regress/dynamic-forward.sh4
-rw-r--r--regress/sftp-cmds.sh2
-rw-r--r--regress/stderr-after-eof.sh8
-rw-r--r--regress/test-exec.sh17
6 files changed, 29 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 39303b67..6bc8182c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,9 @@
- (tim) [configure.ac] Move libgen tests to before libwrap to unbreak
UnixWare 2.03 using --with-tcp-wrappers.
- (tim) [configure.ac] Prefer setuid/setgid on UnixWare and Open Server.
+ - (tim) [regress/agent-ptrace.sh regress/dynamic-forward.sh
+ regress/sftp-cmds.sh regress/stderr-after-eof.sh regress/test-exec.sh]
+ no longer depends on which(1). patch by dtucker@
20030910
- (dtucker) [configure.ac] Bug #636: Add support for Cray's new X1 machine.
@@ -1067,4 +1070,4 @@
- Fix sshd BindAddress and -b options for systems using fake-getaddrinfo.
Report from murple@murple.net, diagnosis from dtucker@zip.com.au
-$Id: ChangeLog,v 1.2981 2003/09/12 05:24:36 tim Exp $
+$Id: ChangeLog,v 1.2982 2003/09/12 05:32:17 tim Exp $
diff --git a/regress/agent-ptrace.sh b/regress/agent-ptrace.sh
index 4124f584..b9d86a29 100644
--- a/regress/agent-ptrace.sh
+++ b/regress/agent-ptrace.sh
@@ -3,7 +3,7 @@
tid="disallow agent ptrace attach"
-if [ -x "`which uname 2>&1`" ]; then
+if have_prog uname ; then
case `uname` in
Linux|HP-UX|SunOS|NetBSD|AIX|CYGWIN*)
echo "skipped (not supported on this platform)"
@@ -12,7 +12,7 @@ if [ -x "`which uname 2>&1`" ]; then
esac
fi
-if [ ! -x "`which gdb 2>&1`" ]; then
+if ! have_prog gdb ; then
echo "skipped (gdb not found)"
exit 0
fi
diff --git a/regress/dynamic-forward.sh b/regress/dynamic-forward.sh
index 0f175b2d..2b0b825d 100644
--- a/regress/dynamic-forward.sh
+++ b/regress/dynamic-forward.sh
@@ -7,9 +7,9 @@ PORT=4242
FWDPORT=4243
DATA=/bin/ls${EXEEXT}
-if [ -x "`which nc 2>&1`" ] && nc -h 2>&1 | grep "x proxy address" >/dev/null; then
+if have_prog nc && nc -h 2>&1 | grep "x proxy address" >/dev/null; then
proxycmd="nc -x 127.0.0.1:$FWDPORT -X"
-elif [ -x "`which connect 2>&1`" ]; then
+elif have_prog connect; then
proxycmd="connect -S 127.0.0.1:$FWDPORT -"
else
echo "skipped (no suitable ProxyCommand found)"
diff --git a/regress/sftp-cmds.sh b/regress/sftp-cmds.sh
index 1237720f..1256aeb2 100644
--- a/regress/sftp-cmds.sh
+++ b/regress/sftp-cmds.sh
@@ -17,7 +17,7 @@ do
fi
done
-if [ -x "`which uname 2>&1`" ]
+if have_prog uname
then
case `uname` in
CYGWIN*)
diff --git a/regress/stderr-after-eof.sh b/regress/stderr-after-eof.sh
index ae9cf8d9..05a5ea56 100644
--- a/regress/stderr-after-eof.sh
+++ b/regress/stderr-after-eof.sh
@@ -7,13 +7,13 @@ DATA=/etc/motd
DATA=${OBJ}/data
COPY=${OBJ}/copy
-if [ -x "`which md5sum 2>&1`" ]; then
+if have_prog md5sum; then
CHECKSUM=md5sum
-elif [ -x "`which openssl 2>&1`" ]; then
+elif have_prog openssl; then
CHECKSUM="openssl md5"
-elif [ -x "`which cksum 2>&1`" ]; then
+elif have_prog cksum; then
CHECKSUM=cksum
-elif [ -x "`which sum 2>&1`" ]; then
+elif have_prog sum; then
CHECKSUM=sum
else
fatal "No checksum program available, aborting $tid test"
diff --git a/regress/test-exec.sh b/regress/test-exec.sh
index b5ef3bc7..cc7ea67f 100644
--- a/regress/test-exec.sh
+++ b/regress/test-exec.sh
@@ -6,7 +6,7 @@ PORT=4242
if [ -x /usr/ucb/whoami ]; then
USER=`/usr/ucb/whoami`
-elif [ -x "`which whoami 2>&1`" ]; then
+elif whoami >/dev/null 2>&1; then
USER=`whoami`
else
USER=`id -un`
@@ -89,6 +89,21 @@ echon()
fi
}
+have_prog()
+{
+ saved_IFS="$IFS"
+ IFS=":"
+ for i in $PATH
+ do
+ if [ -x $i/$1 ]; then
+ IFS="$saved_IFS"
+ return 0
+ fi
+ done
+ IFS="$saved_IFS"
+ return 1
+}
+
cleanup ()
{
if [ -f $PIDFILE ]; then