freebsd-dev/crypto/openssh/regress/connect-privsep.sh

36 lines
1.0 KiB
Bash
Raw Normal View History

2018-05-06 12:24:45 +00:00
# $OpenBSD: connect-privsep.sh,v 1.9 2017/04/30 23:34:55 djm Exp $
2002-06-27 22:31:32 +00:00
# Placed in the Public Domain.
tid="proxy connect with privsep"
2011-09-28 08:14:41 +00:00
cp $OBJ/sshd_proxy $OBJ/sshd_proxy.orig
2002-06-27 22:31:32 +00:00
echo 'UsePrivilegeSeparation yes' >> $OBJ/sshd_proxy
2018-05-06 12:24:45 +00:00
${SSH} -F $OBJ/ssh_proxy 999.999.999.999 true
if [ $? -ne 0 ]; then
fail "ssh privsep+proxyconnect failed"
fi
2011-09-28 08:14:41 +00:00
cp $OBJ/sshd_proxy.orig $OBJ/sshd_proxy
echo 'UsePrivilegeSeparation sandbox' >> $OBJ/sshd_proxy
2018-05-06 12:24:45 +00:00
${SSH} -F $OBJ/ssh_proxy 999.999.999.999 true
if [ $? -ne 0 ]; then
# XXX replace this with fail once sandbox has stabilised
warn "ssh privsep/sandbox+proxyconnect failed"
fi
2012-08-29 15:55:54 +00:00
# Because sandbox is sensitive to changes in libc, especially malloc, retest
# with every malloc.conf option (and none).
2017-01-31 12:29:48 +00:00
if [ -z "TEST_MALLOC_OPTIONS" ]; then
2017-01-31 12:33:47 +00:00
mopts="C F G J R S U X < >"
2017-01-31 12:29:48 +00:00
else
mopts=`echo $TEST_MALLOC_OPTIONS | sed 's/./& /g'`
fi
for m in '' $mopts ; do
2018-05-06 12:24:45 +00:00
env MALLOC_OPTIONS="$m" ${SSH} -F $OBJ/ssh_proxy 999.999.999.999 true
2012-08-29 15:55:54 +00:00
if [ $? -ne 0 ]; then
2018-05-06 12:24:45 +00:00
fail "ssh privsep/sandbox+proxyconnect mopt '$m' failed"
2012-08-29 15:55:54 +00:00
fi
done