diff options
author | des <des@FreeBSD.org> | 2008-07-22 19:01:18 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2008-07-22 19:01:18 +0000 |
commit | f1596419c2717cb81dd4b676d5e0cf1a3e30e98c (patch) | |
tree | 9827eb822991aa369cf5d220fce40c3d2011c19f /regress/reexec.sh | |
parent | 666aa9cc1660793c97ef29a6cb66dfbb894dde8f (diff) | |
download | FreeBSD-src-f1596419c2717cb81dd4b676d5e0cf1a3e30e98c.zip FreeBSD-src-f1596419c2717cb81dd4b676d5e0cf1a3e30e98c.tar.gz |
Properly flatten openssh/dist.
Diffstat (limited to 'regress/reexec.sh')
-rw-r--r-- | regress/reexec.sh | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/regress/reexec.sh b/regress/reexec.sh new file mode 100644 index 0000000..4f824a3 --- /dev/null +++ b/regress/reexec.sh @@ -0,0 +1,72 @@ +# $OpenBSD: reexec.sh,v 1.5 2004/10/08 02:01:50 djm Exp $ +# Placed in the Public Domain. + +tid="reexec tests" + +DATA=/bin/ls${EXEEXT} +COPY=${OBJ}/copy +SSHD_ORIG=$SSHD${EXEEXT} +SSHD_COPY=$OBJ/sshd${EXEEXT} + +# Start a sshd and then delete it +start_sshd_copy () +{ + cp $SSHD_ORIG $SSHD_COPY + SSHD=$SSHD_COPY + start_sshd + SSHD=$SSHD_ORIG +} + +# Do basic copy tests +copy_tests () +{ + rm -f ${COPY} + for p in 1 2; do + verbose "$tid: proto $p" + ${SSH} -nqo "Protocol=$p" -F $OBJ/ssh_config somehost \ + cat ${DATA} > ${COPY} + if [ $? -ne 0 ]; then + fail "ssh cat $DATA failed" + fi + cmp ${DATA} ${COPY} || fail "corrupted copy" + rm -f ${COPY} + done +} + +verbose "test config passing" + +cp $OBJ/sshd_config $OBJ/sshd_config.orig +start_sshd +echo "InvalidXXX=no" >> $OBJ/sshd_config + +copy_tests + +$SUDO kill `cat $PIDFILE` +rm -f $PIDFILE + +cp $OBJ/sshd_config.orig $OBJ/sshd_config + +verbose "test reexec fallback" + +start_sshd_copy +rm -f $SSHD_COPY + +copy_tests + +$SUDO kill `cat $PIDFILE` +rm -f $PIDFILE + +verbose "test reexec fallback without privsep" + +cp $OBJ/sshd_config.orig $OBJ/sshd_config +echo "UsePrivilegeSeparation=no" >> $OBJ/sshd_config + +start_sshd_copy +rm -f $SSHD_COPY + +copy_tests + +$SUDO kill `cat $PIDFILE` +rm -f $PIDFILE + + |