| # $OpenBSD: reexec.sh,v 1.8 2015/03/03 22:35:19 markus Exp $ |
| # Placed in the Public Domain. |
| # Start a sshd and then delete it |
| for p in ${SSH_PROTOCOLS} ; do |
| ${SSH} -nqo "Protocol=$p" -F $OBJ/ssh_config somehost \ |
| fail "ssh cat $DATA failed" |
| cmp ${DATA} ${COPY} || fail "corrupted copy" |
| verbose "test config passing" |
| cp $OBJ/sshd_config $OBJ/sshd_config.orig |
| echo "InvalidXXX=no" >> $OBJ/sshd_config |
| $SUDO kill `$SUDO cat $PIDFILE` |
| cp $OBJ/sshd_config.orig $OBJ/sshd_config |
| # cygwin can't fork a deleted binary |
| if [ "$os" != "cygwin" ]; then |
| verbose "test reexec fallback" |
| $SUDO kill `$SUDO cat $PIDFILE` |
| verbose "test reexec fallback without privsep" |
| cp $OBJ/sshd_config.orig $OBJ/sshd_config |
| echo "UsePrivilegeSeparation=no" >> $OBJ/sshd_config |
| $SUDO kill `$SUDO cat $PIDFILE` |