]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - crypto/openssh/regress/connect-privsep.sh
Merge once more from ^/vendor/llvm-project/release-10.x, to get the
[FreeBSD/FreeBSD.git] / crypto / openssh / regress / connect-privsep.sh
1 #       $OpenBSD: connect-privsep.sh,v 1.9 2017/04/30 23:34:55 djm Exp $
2 #       Placed in the Public Domain.
3
4 tid="proxy connect with privsep"
5
6 cp $OBJ/sshd_proxy $OBJ/sshd_proxy.orig
7 echo 'UsePrivilegeSeparation yes' >> $OBJ/sshd_proxy
8
9 ${SSH} -F $OBJ/ssh_proxy 999.999.999.999 true
10 if [ $? -ne 0 ]; then
11         fail "ssh privsep+proxyconnect failed"
12 fi
13
14 cp $OBJ/sshd_proxy.orig $OBJ/sshd_proxy
15 echo 'UsePrivilegeSeparation sandbox' >> $OBJ/sshd_proxy
16
17 ${SSH} -F $OBJ/ssh_proxy 999.999.999.999 true
18 if [ $? -ne 0 ]; then
19         # XXX replace this with fail once sandbox has stabilised
20         warn "ssh privsep/sandbox+proxyconnect failed"
21 fi
22
23 # Because sandbox is sensitive to changes in libc, especially malloc, retest
24 # with every malloc.conf option (and none).
25 if [ -z "TEST_MALLOC_OPTIONS" ]; then
26         mopts="C F G J R S U X < >"
27 else
28         mopts=`echo $TEST_MALLOC_OPTIONS | sed 's/./& /g'`
29 fi
30 for m in '' $mopts ; do
31         env MALLOC_OPTIONS="$m" ${SSH} -F $OBJ/ssh_proxy 999.999.999.999 true
32         if [ $? -ne 0 ]; then
33                 fail "ssh privsep/sandbox+proxyconnect mopt '$m' failed"
34         fi
35 done