Testing wanted: OpenSSH 4.8

Carson Gaspar carson at taltos.org
Sun Mar 16 12:32:51 EST 2008


Tim Rice wrote:
> On Sat, 15 Mar 2008, Damien Miller wrote:
> 
>> On Thu, 13 Mar 2008, Tim Rice wrote:
...
>>> You can not expect which to be on all platforms.
>> We already use `which` for determining an absolute path to sshd in
>> test-exec.sh. Do you have an alternative?
> 
> Yes I noticed that after I posted. No I don't have an alternative.
> On further reflection I think it's only some older openserver platforms
> that will be affected and they will have other things broken in them anyway.
> 
> Go ahead and use which.

Or, you could just use something like (tested with spaces in dirnames):

function mywhich {
	TBIN="$1"
	OIFS="$IFS"
	IFS=':'
	for p in $PATH; do
		if test -x "$p"/"$TBIN"; then
			echo "$p"/"$TBIN"
			IFS="$OIFS"
			return 1
		fi
	done
	IFS="$OIFS"
	return 0
}


More information about the openssh-unix-dev mailing list