blob: b6abb65e356686f66c57d1c76fe596be9abe1ad4 [file] [log] [blame]
djm@openbsd.orgdd369322017-04-30 23:34:55 +00001# $OpenBSD: connect-privsep.sh,v 1.9 2017/04/30 23:34:55 djm Exp $
Damien Miller38cd4352002-05-01 13:17:33 +10002# Placed in the Public Domain.
3
4tid="proxy connect with privsep"
5
Damien Millerfaf4d802011-08-17 12:09:19 +10006cp $OBJ/sshd_proxy $OBJ/sshd_proxy.orig
Damien Miller38cd4352002-05-01 13:17:33 +10007echo 'UsePrivilegeSeparation yes' >> $OBJ/sshd_proxy
8
djm@openbsd.orgdd369322017-04-30 23:34:55 +00009${SSH} -F $OBJ/ssh_proxy 999.999.999.999 true
10if [ $? -ne 0 ]; then
11 fail "ssh privsep+proxyconnect failed"
12fi
Damien Millerfaf4d802011-08-17 12:09:19 +100013
14cp $OBJ/sshd_proxy.orig $OBJ/sshd_proxy
15echo 'UsePrivilegeSeparation sandbox' >> $OBJ/sshd_proxy
16
djm@openbsd.orgdd369322017-04-30 23:34:55 +000017${SSH} -F $OBJ/ssh_proxy 999.999.999.999 true
18if [ $? -ne 0 ]; then
19 # XXX replace this with fail once sandbox has stabilised
20 warn "ssh privsep/sandbox+proxyconnect failed"
21fi
Darren Tucker2920bc12012-06-30 15:06:28 +100022
23# Because sandbox is sensitive to changes in libc, especially malloc, retest
24# with every malloc.conf option (and none).
Darren Tucker732b4632016-03-14 16:04:23 +110025if [ -z "TEST_MALLOC_OPTIONS" ]; then
tb@openbsd.org7da751d2016-11-01 13:43:27 +000026 mopts="C F G J R S U X < >"
Darren Tucker732b4632016-03-14 16:04:23 +110027else
28 mopts=`echo $TEST_MALLOC_OPTIONS | sed 's/./& /g'`
29fi
30for m in '' $mopts ; do
djm@openbsd.orgdd369322017-04-30 23:34:55 +000031 env MALLOC_OPTIONS="$m" ${SSH} -F $OBJ/ssh_proxy 999.999.999.999 true
Darren Tucker2920bc12012-06-30 15:06:28 +100032 if [ $? -ne 0 ]; then
djm@openbsd.orgdd369322017-04-30 23:34:55 +000033 fail "ssh privsep/sandbox+proxyconnect mopt '$m' failed"
Darren Tucker2920bc12012-06-30 15:06:28 +100034 fi
Darren Tucker2920bc12012-06-30 15:06:28 +100035done