2017-05-01 01:34:55 +02:00
|
|
|
# $OpenBSD: connect-privsep.sh,v 1.9 2017/04/30 23:34:55 djm Exp $
|
2002-05-01 05:17:33 +02:00
|
|
|
# Placed in the Public Domain.
|
|
|
|
|
|
|
|
tid="proxy connect with privsep"
|
|
|
|
|
2011-08-17 04:09:19 +02:00
|
|
|
cp $OBJ/sshd_proxy $OBJ/sshd_proxy.orig
|
2002-05-01 05:17:33 +02:00
|
|
|
echo 'UsePrivilegeSeparation yes' >> $OBJ/sshd_proxy
|
|
|
|
|
2017-05-01 01:34:55 +02:00
|
|
|
${SSH} -F $OBJ/ssh_proxy 999.999.999.999 true
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
fail "ssh privsep+proxyconnect failed"
|
|
|
|
fi
|
2011-08-17 04:09:19 +02:00
|
|
|
|
|
|
|
cp $OBJ/sshd_proxy.orig $OBJ/sshd_proxy
|
|
|
|
echo 'UsePrivilegeSeparation sandbox' >> $OBJ/sshd_proxy
|
|
|
|
|
2017-05-01 01:34:55 +02:00
|
|
|
${SSH} -F $OBJ/ssh_proxy 999.999.999.999 true
|
|
|
|
if [ $? -ne 0 ]; then
|
2021-04-07 02:23:51 +02:00
|
|
|
fail "ssh privsep/sandbox+proxyconnect failed"
|
2017-05-01 01:34:55 +02:00
|
|
|
fi
|
2012-06-30 07:06:28 +02:00
|
|
|
|
|
|
|
# Because sandbox is sensitive to changes in libc, especially malloc, retest
|
|
|
|
# with every malloc.conf option (and none).
|
2020-10-08 11:49:59 +02:00
|
|
|
if [ -z "$TEST_MALLOC_OPTIONS" ]; then
|
2016-11-01 14:43:27 +01:00
|
|
|
mopts="C F G J R S U X < >"
|
2016-03-14 06:04:23 +01:00
|
|
|
else
|
|
|
|
mopts=`echo $TEST_MALLOC_OPTIONS | sed 's/./& /g'`
|
|
|
|
fi
|
|
|
|
for m in '' $mopts ; do
|
2017-05-01 01:34:55 +02:00
|
|
|
env MALLOC_OPTIONS="$m" ${SSH} -F $OBJ/ssh_proxy 999.999.999.999 true
|
2012-06-30 07:06:28 +02:00
|
|
|
if [ $? -ne 0 ]; then
|
2017-05-01 01:34:55 +02:00
|
|
|
fail "ssh privsep/sandbox+proxyconnect mopt '$m' failed"
|
2012-06-30 07:06:28 +02:00
|
|
|
fi
|
|
|
|
done
|