2012-07-02 16:53:18 +02:00
|
|
|
# $OpenBSD: connect-privsep.sh,v 1.4 2012/07/02 14:37:06 dtucker 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
|
|
|
|
|
|
|
|
for p in 1 2; do
|
|
|
|
${SSH} -$p -F $OBJ/ssh_proxy 999.999.999.999 true
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
fail "ssh privsep+proxyconnect protocol $p failed"
|
|
|
|
fi
|
|
|
|
done
|
2011-08-17 04:09:19 +02:00
|
|
|
|
|
|
|
cp $OBJ/sshd_proxy.orig $OBJ/sshd_proxy
|
|
|
|
echo 'UsePrivilegeSeparation sandbox' >> $OBJ/sshd_proxy
|
|
|
|
|
|
|
|
for p in 1 2; do
|
|
|
|
${SSH} -$p -F $OBJ/ssh_proxy 999.999.999.999 true
|
|
|
|
if [ $? -ne 0 ]; then
|
2011-09-04 11:04:16 +02:00
|
|
|
# XXX replace this with fail once sandbox has stabilised
|
|
|
|
warn "ssh privsep/sandbox+proxyconnect protocol $p failed"
|
2011-08-17 04:09:19 +02:00
|
|
|
fi
|
|
|
|
done
|
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).
|
|
|
|
for m in '' A F G H J P R S X Z '<' '>'; do
|
|
|
|
for p in 1 2; do
|
|
|
|
env MALLOC_OPTIONS="$m" ${SSH} -$p -F $OBJ/ssh_proxy 999.999.999.999 true
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
fail "ssh privsep/sandbox+proxyconnect protocol $p mopt '$m' failed"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
done
|