Darren Tucker | 369ceed | 2012-07-03 00:53:18 +1000 | [diff] [blame] | 1 | # $OpenBSD: connect-privsep.sh,v 1.4 2012/07/02 14:37:06 dtucker Exp $ |
Damien Miller | 38cd435 | 2002-05-01 13:17:33 +1000 | [diff] [blame] | 2 | # Placed in the Public Domain. |
| 3 | |
| 4 | tid="proxy connect with privsep" |
| 5 | |
Damien Miller | faf4d80 | 2011-08-17 12:09:19 +1000 | [diff] [blame] | 6 | cp $OBJ/sshd_proxy $OBJ/sshd_proxy.orig |
Damien Miller | 38cd435 | 2002-05-01 13:17:33 +1000 | [diff] [blame] | 7 | echo 'UsePrivilegeSeparation yes' >> $OBJ/sshd_proxy |
| 8 | |
| 9 | for p in 1 2; do |
| 10 | ${SSH} -$p -F $OBJ/ssh_proxy 999.999.999.999 true |
| 11 | if [ $? -ne 0 ]; then |
| 12 | fail "ssh privsep+proxyconnect protocol $p failed" |
| 13 | fi |
| 14 | done |
Damien Miller | faf4d80 | 2011-08-17 12:09:19 +1000 | [diff] [blame] | 15 | |
| 16 | cp $OBJ/sshd_proxy.orig $OBJ/sshd_proxy |
| 17 | echo 'UsePrivilegeSeparation sandbox' >> $OBJ/sshd_proxy |
| 18 | |
| 19 | for p in 1 2; do |
| 20 | ${SSH} -$p -F $OBJ/ssh_proxy 999.999.999.999 true |
| 21 | if [ $? -ne 0 ]; then |
Damien Miller | 6efd94f | 2011-09-04 19:04:16 +1000 | [diff] [blame] | 22 | # XXX replace this with fail once sandbox has stabilised |
| 23 | warn "ssh privsep/sandbox+proxyconnect protocol $p failed" |
Damien Miller | faf4d80 | 2011-08-17 12:09:19 +1000 | [diff] [blame] | 24 | fi |
| 25 | done |
Darren Tucker | 2920bc1 | 2012-06-30 15:06:28 +1000 | [diff] [blame] | 26 | |
| 27 | # Because sandbox is sensitive to changes in libc, especially malloc, retest |
| 28 | # with every malloc.conf option (and none). |
| 29 | for m in '' A F G H J P R S X Z '<' '>'; do |
| 30 | for p in 1 2; do |
| 31 | env MALLOC_OPTIONS="$m" ${SSH} -$p -F $OBJ/ssh_proxy 999.999.999.999 true |
| 32 | if [ $? -ne 0 ]; then |
| 33 | fail "ssh privsep/sandbox+proxyconnect protocol $p mopt '$m' failed" |
| 34 | fi |
| 35 | done |
| 36 | done |